Hashing uniform integer boxes by modular matrices #
Reduction modulo q is injective on [-r,r]^m when 2r < q. For prime q, the existing
finite-field matrix universality and leftover-hash theorem therefore bound the joint law of the
public matrix and the image of an actual uniform box sample. The distance is half the L1 distance.
Main results #
intCast_injective_intBox: reduction of bounded integer vectors is injective.dist_intBox_mulVec_le: an explicit joint leftover-hash bound for the box source.
These original finite-probability applications assume ideal uniform matrix and box sampling. They do not assert an efficient sampler or a bound for every fixed public matrix.
Integer vectors in a box of width at most q have distinct reductions modulo q.
theorem Cslib.Probability.dist_intBox_mulVec_le (n m q r : ℕ) [Fact (Nat.Prime q)] (hr : 2 * r < q) :
dist
((PMF.uniformOfFintype (Matrix (Fin n) (Fin m) (ZMod q))).bind fun (A : Matrix (Fin n) (Fin m) (ZMod q)) =>
PMF.map (fun (y : Fin m → ℤ) => (A, A.mulVec (Int.cast ∘ y))) (PMF.uniformOfFinset (intBox (Fin m) r) ⋯))
((PMF.uniformOfFintype (Matrix (Fin n) (Fin m) (ZMod q))).bind fun (A : Matrix (Fin n) (Fin m) (ZMod q)) =>
PMF.map (fun (x : Fin n → ZMod q) => (A, x)) (PMF.uniformOfFintype (Fin n → ZMod q))) ≤ √(↑q ^ n / ↑(2 * r + 1) ^ m) / 2
The public matrix is retained in the box-image leftover-hash bound. The bound averages over the ideal uniform matrix; it need not hold after conditioning on a particular matrix.