Documentation

CslibFrontier.Probability.HashFamily.Transport

Changing the digest group of a Δ-universal hash family #

An injective additive map f : Y →+ Z applied to every digest preserves ε-Δ-universality: the difference of two digests is d' exactly when the difference of their images is f d', and a difference outside the range of f never occurs. A hash proved Δ-universal over a field therefore stays Δ-universal when its digests are written as bit strings by an additive encoding, where the difference is XOR.

Reinterpreting canonical residues modulo a larger modulus also preserves the bound when each target difference comes from at most one integer difference of source representatives. For a smaller modulus, a union bound counts the possible source differences.

Main results #

theorem Cslib.Probability.IsDeltaUniversalHash.postcompose {ι : Type u_1} {X : Type u_2} {Y : Type u_3} {Z : Type u_4} [AddGroup Y] [AddGroup Z] {seed : PMF ι} {hash : ι → X → Y} {ε : ENNReal} (hh : IsDeltaUniversalHash seed hash ε) (f : Y →+ Z) (hf : Function.Injective ⇑f) :
IsDeltaUniversalHash seed (fun (i : ι) (x : X) => f (hash i x)) ε

An injective additive map on digests preserves ε-Δ-universality.

theorem Cslib.Probability.IsDeltaUniversalHash.zmod_cast {ι : Type u_1} {X : Type u_2} {seed : PMF ι} {ε : ENNReal} {p N : ℕ} [NeZero p] {hash : ι → X → ZMod p} (hh : IsDeltaUniversalHash seed hash ε) (hN : 2 * (p - 1) < N) :
IsDeltaUniversalHash seed (fun (i : ι) (x : X) => (hash i x).cast) ε

Transferring canonical residues from ZMod p to ZMod N preserves the difference bound when N is greater than twice the largest source representative. This gives Exercise 7.22(a) of [BS23], v0.6, printed p. 283, under the slightly weaker condition 2 * (p - 1) < N and for an arbitrary seed law.

theorem Cslib.Probability.IsDeltaUniversalHash.zmod_cast_bound {ι : Type u_1} {X : Type u_2} {seed : PMF ι} {ε : ENNReal} {p N : ℕ} [NeZero p] [NeZero N] {hash : ι → X → ZMod p} (hh : IsDeltaUniversalHash seed hash ε) :
IsDeltaUniversalHash seed (fun (i : ι) (x : X) => (hash i x).cast) (2 * (↑p / ↑N + 1) * ε)

Reducing canonical residues modulo N scales the difference bound by at most 2 * (p / N + 1). This is the first bound of Exercise 7.22(b) ([BS23], v0.6, printed p. 283). The proof allows any positive moduli and any seed law.

theorem Cslib.Probability.IsDeltaUniversalHash.zmod_cast_div {ι : Type u_1} {X : Type u_2} {seed : PMF ι} {p N : ℕ} [NeZero p] [NeZero N] {hash : ι → X → ZMod p} {α : ENNReal} (hh : IsDeltaUniversalHash seed hash (α / ↑p)) (hNp : N ≤ p) :
IsDeltaUniversalHash seed (fun (i : ι) (x : X) => (hash i x).cast) (4 * α / ↑N)

A difference bound α / p becomes 4 * α / N when reducing to N ≤ p ([BS23], v0.6, Exercise 7.22(b), printed p. 283).