Documentation

CslibFrontier.Crypto.Computational.SIS.MR07Core

Finite distributional core of the Micciancio–Regev IncGDD to ℓ₂-SIS reduction #

This module formalizes the non-asymptotic, single-call distributional core of the reduction from incremental guaranteed distance decoding (IncGDD) to the Euclidean short integer solution problem (ℓ₂-SIS) from [MR07a] (§5.2, pp. 20–24), formulated on the fine discrete grid G_q = (1 / q) ℤⁿ with ideal discrete-grid and quotient samplers and an explicit dual-mass premise.

Strict-PPT sampler realization, independent amplification, iterative basis shortening, and the asymptotic worst-case-to-average-case theorems (Theorem 5.9, Corollary 5.13, Theorem 5.16) are not formalized here; they are tracked separately in #6861.

Main definitions #

Main results #

References #

Part 1: Integer lattice bases, fine grid, parallelepiped representatives, dual bounds #

def Cslib.Crypto.SIS.MR07.intCol {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (j : Fin n) :

Column j of an integer matrix B viewed in EuclideanSpace ℝ (Fin n).

Integer lattice L(B) ⊂ ℝⁿ spanned by the columns of B.

Fine discrete grid lattice G_q = (1 / q) ℤⁿ ⊂ ℝⁿ. [MR07a] §2 (p. 8) remarks in prose on fine-grid discretization; setting G_q = (1 / q) ℤⁿ at the SIS modulus q is this module's representation choice.

@[reducible, inline]
abbrev Cslib.Crypto.SIS.MR07.matR {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) :
Matrix (Fin n) (Fin n) ℝ

Real matrix cast of an integer matrix.

theorem Cslib.Crypto.SIS.MR07.isUnit_matR_det {n : ℕ} {B : Matrix (Fin n) (Fin n) ℤ} (hB : B.det ≠ 0) :

The real cast of an integer matrix with nonzero determinant has unit determinant.

theorem Cslib.Crypto.SIS.MR07.matR_mul_inv {n : ℕ} {B : Matrix (Fin n) (Fin n) ℤ} (hB : B.det ≠ 0) :
matR B * (matR B)⁻¹ = 1

Right-inverse identity matR B * (matR B)⁻¹ = 1 for B.det ≠ 0.

theorem Cslib.Crypto.SIS.MR07.matR_inv_mul {n : ℕ} {B : Matrix (Fin n) (Fin n) ℤ} (hB : B.det ≠ 0) :
(matR B)⁻¹ * matR B = 1

Left-inverse identity (matR B)⁻¹ * matR B = 1 for B.det ≠ 0.

Every integer lattice intLattice B is discrete in EuclideanSpace ℝ (Fin n).

Full-rank integer lattices are full-rank ℤ-lattices in EuclideanSpace ℝ (Fin n).

Rank of a full-rank integer lattice equals the ambient dimension n.

noncomputable def Cslib.Crypto.SIS.MR07.intColCast {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) :

Transport the columns of S across finrank_intLattice hB to match Fin (finrank ℤ L).

theorem Cslib.Crypto.SIS.MR07.norm_intColCast {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) :

Transporting intCol S across finrank_intLattice preserves its Pi supremum norm.

The fine grid G_q = (1 / q) ℤⁿ is discrete for every q : ℕ.

The fine grid G_q = (1 / q) ℤⁿ is a full-rank ℤ-lattice for q > 0.

theorem Cslib.Crypto.SIS.MR07.mem_intLattice_iff {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (x : EuclideanSpace ℝ (Fin n)) :
x ∈ intLattice B ↔ ∃ (k : Fin n → ℤ), x = WithLp.toLp 2 fun (i : Fin n) => ↑(B.mulVec k i)

Characterization of membership in intLattice B.

theorem Cslib.Crypto.SIS.MR07.mem_gridLattice_iff {n q : ℕ} (x : EuclideanSpace ℝ (Fin n)) :
x ∈ gridLattice n q ↔ ∃ (u : Fin n → ℤ), x = (↑q)⁻¹ • WithLp.toLp 2 fun (i : Fin n) => ↑(u i)

Characterization of membership in gridLattice n q.

Every integer lattice is contained in the fine grid G_q for q > 0.

Dual-mass monotonicity from intLattice B to the fine grid gridLattice n q.

Parallelepiped representative x mod P(B) = B * frac(B⁻¹ x) for invertible B.

Reducing modulo the fundamental parallelepiped P(B) is idempotent for B.det ≠ 0.

theorem Cslib.Crypto.SIS.MR07.modParallelepiped_mem_of_le {n : ℕ} {B : Matrix (Fin n) (Fin n) ℤ} (hB : B.det ≠ 0) {L : Submodule ℤ (EuclideanSpace ℝ (Fin n))} (hBL : intLattice B ≤ L) {x : EuclideanSpace ℝ (Fin n)} (hx : x ∈ L) :

Reducing modulo P(B) preserves membership in any superlattice L ≥ intLattice B.

theorem Cslib.Crypto.SIS.MR07.modParallelepiped_abs_le {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (x : EuclideanSpace ℝ (Fin n)) (i : Fin n) :
|(modParallelepiped B x).ofLp i| ≤ ∑ j : Fin n, |↑(B i j)|

Coordinatewise bound |(modParallelepiped B x) i| ≤ ∑ j, |B i j| on P(B).

def Cslib.Crypto.SIS.MR07.GridRep {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (q : ℕ) :

Canonical finite set of representatives G_q ∩ P(B).

Instances For
    noncomputable def Cslib.Crypto.SIS.MR07.GridRep.toVec {n : ℕ} {B : Matrix (Fin n) (Fin n) ℤ} {q : ℕ} (c : GridRep B q) :

    Embed a GridRep B q element into EuclideanSpace ℝ (Fin n).

    GridRep B q is always nonempty (0 is a representative).

    @[instance_reducible]
    noncomputable instance Cslib.Crypto.SIS.MR07.instFintypeGridRep {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (q : ℕ) :

    GridRep B q is finite (explicit coordinate box).

    theorem Cslib.Crypto.SIS.MR07.card_gridRep {n : ℕ} {B : Matrix (Fin n) (Fin n) ℤ} (hB : B.det ≠ 0) {q : ℕ} (hq : 0 < q) :

    Exact cardinality Fintype.card (GridRep B q) = q^n * |det B|.

    Part 2: Discrete-Grid Sampling Lemma (Finite MR07 Lemma 5.7, p. 20) #

    noncomputable def Cslib.Crypto.SIS.MR07.idealGridSample {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (q : ℕ) (hq : 0 < q) (s : ℝ) (hs : 0 < s) (t : EuclideanSpace ℝ (Fin n)) :
    PMF (GridRep B q × ↥(intLattice B))

    Ideal discrete-grid sampler S_q(B, t, s) (finite MR07 Lemma 5.7, p. 20).

    theorem Cslib.Crypto.SIS.MR07.idealGridSample_eq_map {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (q : ℕ) (hq : 0 < q) (s : ℝ) (hs : 0 < s) (t : EuclideanSpace ℝ (Fin n)) (f : ↥(gridLattice n q) → GridRep B q × ↥(intLattice B)) (hf_fst : ∀ (r : ↥(gridLattice n q)), (f r).1.toVec = modParallelepiped B (-↑r)) (hf_snd : ∀ (r : ↥(gridLattice n q)), ↑(f r).2 = ↑r + (f r).1.toVec) :

    Characterization of idealGridSample as pushing the discrete Gaussian on G_q through any splitting map r ↦ (c, y) satisfying c = (-r) mod P(B) and y = r + c.

    theorem Cslib.Crypto.SIS.MR07.idealGridSample_eq_bind_discreteGaussian {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (q : ℕ) (hq : 0 < q) (s : ℝ) (hs : 0 < s) (t : EuclideanSpace ℝ (Fin n)) :
    idealGridSample B hB q hq s hs t = (PMF.map Prod.fst (idealGridSample B hB q hq s hs t)).bind fun (c : GridRep B q) => PMF.map (fun (y : ↥(intLattice B)) => (c, y)) (ZLattice.discreteGaussian (intLattice B) s hs (t + c.toVec))

    Exact conditional law y | c ~ D_{L(B), s, t + c} (MR07 Lemma 5.7, item 2).

    theorem Cslib.Crypto.SIS.MR07.idealGridSample_fst_closeTo_uniform {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (q : ℕ) (hq : 0 < q) {s ε : ℝ} (hs : 0 < s) (hε0 : 0 ≤ ε) (hε1 : ε < 1) (hdual : ZLattice.gaussianMass (LinearMap.BilinForm.dualSubmodule (innerₗ (EuclideanSpace ℝ (Fin n))) (intLattice B)) (1 / s) 0 - 1 ≤ ε) (t : EuclideanSpace ℝ (Fin n)) :

    Marginal closeness of c to uniform on GridRep B q (finite MR07 Lemma 5.7, p. 20).

    Part 3: Sublattice Quotient & Discrete-Grid Combining Procedure (Finite MR07 Lemma 5.8) #

    noncomputable def Cslib.Crypto.SIS.MR07.sublatticeMat {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (hSB : intLattice S ≤ intLattice B) :
    Matrix (Fin n) (Fin n) ℤ

    For L(S) ≤ L(B), construct the integer transition matrix U satisfying B * U = S.

    theorem Cslib.Crypto.SIS.MR07.mul_sublatticeMat {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (hSB : intLattice S ≤ intLattice B) :
    B * sublatticeMat B S hSB = S

    The integer transition matrix sublatticeMat B S hSB satisfies B * sublatticeMat B S hSB = S.

    theorem Cslib.Crypto.SIS.MR07.det_sublatticeMat {n : ℕ} {B S : Matrix (Fin n) (Fin n) ℤ} (hB : B.det ≠ 0) (hSB : intLattice S ≤ intLattice B) :
    (sublatticeMat B S hSB).det = S.det / B.det

    For invertible B and L(S) ≤ L(B), (sublatticeMat B S hSB).det = S.det / B.det.

    theorem Cslib.Crypto.SIS.MR07.det_sublatticeMat_ne_zero {n : ℕ} {B S : Matrix (Fin n) (Fin n) ℤ} (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) :
    (sublatticeMat B S hSB).det ≠ 0

    For invertible S and L(S) ≤ L(B), sublatticeMat B S hSB has nonzero determinant.

    Canonical finite set of quotient representatives L(B) ∩ P(S) (cardinality |det(B⁻¹ S)|).

    Instances For
      noncomputable def Cslib.Crypto.SIS.MR07.SublatticeQuot.toVec {n : ℕ} {B S : Matrix (Fin n) (Fin n) ℤ} (v : SublatticeQuot B S) :

      Embed a SublatticeQuot B S representative into EuclideanSpace ℝ (Fin n).

      The zero representative 0 ∈ L(B) ∩ P(S).

      @[simp]
      theorem Cslib.Crypto.SIS.MR07.SublatticeQuot.zero_val {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) :
      ↑(zero B S) = 0

      The coordinate vector of SublatticeQuot.zero B S is 0.

      SublatticeQuot B S is always nonempty (0 is a representative).

      @[instance_reducible]
      noncomputable instance Cslib.Crypto.SIS.MR07.instFintypeSublatticeQuot {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) :

      SublatticeQuot B S is finite via the explicit coordinate box [-∑_j |S i j|, ∑_j |S i j|].

      theorem Cslib.Crypto.SIS.MR07.card_sublatticeQuot {n : ℕ} {B S : Matrix (Fin n) (Fin n) ℤ} (hB : B.det ≠ 0) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) :

      Exact cardinality Fintype.card (SublatticeQuot B S) = |det(B⁻¹ S)|.

      noncomputable def Cslib.Crypto.SIS.MR07.quotientHom {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) (x : Fin n → ZMod (S.det / B.det).natAbs) :

      HNF-free quotient surjection (ZMod D)^n → SublatticeQuot B S with D = |det(B⁻¹ S)|.

      theorem Cslib.Crypto.SIS.MR07.quotientHom_toVec {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) (x : Fin n → ZMod (S.det / B.det).natAbs) :
      (quotientHom B S hS hSB x).toVec = modParallelepiped S (WithLp.toLp 2 fun (i : Fin n) => ↑(B.mulVec (fun (j : Fin n) => ↑(x j).val) i))

      Explicit parallelepiped characterization of quotientHom.

      HNF-free exact uniform sampling on SublatticeQuot B S via (ZMod D)^n ↠ SublatticeQuot B S with D = |det(B⁻¹ S)| (Cramer's rule Matrix.mul_adjugate).

      noncomputable def Cslib.Crypto.SIS.MR07.combineColumn {n : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (q : ℕ) (v : SublatticeQuot B S) (c : GridRep B q) :
      GridRep S q × (Fin n → ZMod q)

      Single-column combining map (v, c) ↦ (w, a) where w = (v + c) mod P(S) and a = ⌊q S⁻¹ w⌋ mod q (MR07 Lemma 5.8, p. 21).

      theorem Cslib.Crypto.SIS.MR07.combineColumn_fst_toVec {n : ℕ} {B S : Matrix (Fin n) (Fin n) ℤ} (hS : S.det ≠ 0) {q : ℕ} (hq : 0 < q) (v : SublatticeQuot B S) (c : GridRep B q) :

      The first component of combineColumn B S q v c represents (v + c) mod P(S).

      theorem Cslib.Crypto.SIS.MR07.combineColumn_snd_val {n : ℕ} {B S : Matrix (Fin n) (Fin n) ℤ} (hS : S.det ≠ 0) {q : ℕ} (hq : 0 < q) (v : SublatticeQuot B S) (c : GridRep B q) (k : Fin n) :
      ↑((combineColumn B S q v c).2 k).val = ⌊↑q * (S.map Int.cast)⁻¹.mulVec (combineColumn B S q v c).1.toVec.ofLp k⌋

      Canonical residue value of the second component of combineColumn: ((combineColumn B S q v c).2 k).val = ⌊q · (S⁻¹ w)_k⌋, where w = (combineColumn B S q v c).1.

      noncomputable def Cslib.Crypto.SIS.MR07.combineMatrix {n m : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (q : ℕ) (V : Fin m → SublatticeQuot B S) (C : Fin m → GridRep B q) :
      Matrix (Fin n) (Fin m) (ZMod q)

      Query matrix A ∈ ZMod q^{n×m} produced by the combining procedure from (V, C).

      noncomputable def Cslib.Crypto.SIS.MR07.combineOutput {n m : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (q : ℕ) (V : Fin m → SublatticeQuot B S) (C : Fin m → GridRep B q) (z : Fin m → ℤ) :

      Output vector x = ∑_j z_j (c_j - w_j) + S * ((A_int *ᵥ z) / q) of the combining procedure. Using integer Euclidean division ((A_int *ᵥ z) k) / q ensures combineOutput ∈ L(B) holds unconditionally for every z : Fin m → ℤ, and coincides with S * (A_int *ᵥ z / q) whenever A *ᵥ z ≡ 0 (mod q).

      theorem Cslib.Crypto.SIS.MR07.combineOutput_mem_intLattice {n m : ℕ} (B S : Matrix (Fin n) (Fin n) ℤ) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) (q : ℕ) (hq : 0 < q) (V : Fin m → SublatticeQuot B S) (C : Fin m → GridRep B q) (z : Fin m → ℤ) :

      Unconditional lattice membership of combineOutput for every z : Fin m → ℤ.

      theorem Cslib.Crypto.SIS.MR07.idealCombine_matrix_eq_uniform {n m q : ℕ} [NeZero q] (B S : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) :

      Exact uniformity of the combining query matrix A ∈ ZMod q^{n×m} when C and V are uniformly random (MR07 Lemma 5.8, item 1, pp. 20–21).

      theorem Cslib.Crypto.SIS.MR07.combineOutput_mem_intLattice_and_norm_sub_le {n m q : ℕ} (hq : 0 < q) (B S : Matrix (Fin n) (Fin n) ℤ) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) (V : Fin m → SublatticeQuot B S) (C : Fin m → GridRep B q) (z : Fin m → ℤ) (hker : InKernelLattice (combineMatrix B S q V C) z) :
      combineOutput B S q V C z ∈ intLattice B ∧ ‖combineOutput B S q V C z - ∑ j : Fin m, z j • (C j).toVec‖ ≤ √↑m * ↑n * ‖intCol S‖ * ‖WithLp.toLp 2 fun (j : Fin m) => ↑(z j)‖ / ↑q

      Combining procedure output membership and distance bound ([MR07a], Lemma 5.8, items 2–3, p. 21): whenever InKernelLattice (combineMatrix B S q V C) z, combineOutput B S q V C z ∈ intLattice B and ‖combineOutput B S q V C z - ∑ j, z j • (C j).toVec‖ ≤ √m · n · ‖intCol S‖ · ‖z‖₂ / q.

      Part 4: Finite Single-Call IncGDD Reduction Step (Finite MR07 Theorem 5.9 Step) #

      noncomputable def Cslib.Crypto.SIS.MR07.idealIncGDDStep {n m q : ℕ} [NeZero q] (B S : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (β r : ℝ) (hβ : 1 ≤ β) (hr : 0 < r) (t : EuclideanSpace ℝ (Fin n)) (F : Matrix (Fin n) (Fin m) (ZMod q) → ProbComp (Fin m → ℤ)) :

      Single-call finite reduction step from IncGDD to ℓ₂-SIS using ideal discrete-grid samplers. This is the finite distributional core step toward [MR07a], Theorem 5.9 (pp. 22–24); strict-PPT realization and amplification are not formalized here and are tracked in #6861.

      theorem Cslib.Crypto.SIS.MR07.idealIncGDDStep_support_mem_intLattice {n m q : ℕ} [NeZero q] (B S : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) (β r : ℝ) (hβ : 1 ≤ β) (hr : 0 < r) (t : EuclideanSpace ℝ (Fin n)) (F : Matrix (Fin n) (Fin m) (ZMod q) → ProbComp (Fin m → ℤ)) {v : EuclideanSpace ℝ (Fin n)} (hv : v ∈ (idealIncGDDStep B S hB β r hβ hr t F).support) :

      Unconditional lattice membership on 100% of the support of idealIncGDDStep (including when the SIS solver F fails or returns an invalid vector).

      theorem Cslib.Crypto.SIS.MR07.idealIncGDDStep_succProb_of_sisEll2 {n m q : ℕ} [NeZero q] (hn : 1 ≤ n) (hm : 1 ≤ m) (B S : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) {β g r ε : ℝ} (hβ : 1 ≤ β) (hg : 0 < g) (hr : 0 < r) (hε0 : 0 ≤ ε) (hε : ε ≤ 1 / (400 * max 1 √↑m)) (hq : g * ↑n * √↑m * β ≤ ↑q) (hdual : ZLattice.gaussianMass (LinearMap.BilinForm.dualSubmodule (innerₗ (EuclideanSpace ℝ (Fin n))) (intLattice B)) (2 / (2 * r / (β * √↑n))) 0 - 1 ≤ ε) (t : EuclideanSpace ℝ (Fin n)) (F : Matrix (Fin n) (Fin m) (ZMod q) → ProbComp (Fin m → ℤ)) :
      1 / 3 * (↑(sisEll2Advantage q β F) / (2 * ↑⌊β⌋₊ * ↑m) - ↑m * ε / (2 * (1 - ε))) ≤ ((idealIncGDDStep B S hB β r hβ hr t F).toOuterMeasure {v : EuclideanSpace ℝ (Fin n) | IncGDD.IsSolution g (intLattice B) (intColCast B S hB) t r v}).toReal

      Non-asymptotic single-call success lower bound for idealIncGDDStep (finite distributional step toward [MR07a], Theorem 5.9, §5.2, pp. 22–24). Uses ideal discrete-grid samplers on G_q = (1 / q) ℤⁿ and the dual-mass premise ρ_{2/s}(L(B)* \ {0}) ≤ ε; strict-PPT realization and amplification are not formalized here and are tracked in #6861.

      theorem Cslib.Crypto.SIS.MR07.incGDD_succProb_of_closeTo_idealIncGDDStep {n m q : ℕ} [NeZero q] (hn : 1 ≤ n) (hm : 1 ≤ m) (B S : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (hS : S.det ≠ 0) (hSB : intLattice S ≤ intLattice B) {β g r ε η : ℝ} (hβ : 1 ≤ β) (hg : 0 < g) (hr : 0 < r) (hε0 : 0 ≤ ε) (hε : ε ≤ 1 / (400 * max 1 √↑m)) (hη : 0 ≤ η) (hq : g * ↑n * √↑m * β ≤ ↑q) (hdual : ZLattice.gaussianMass (LinearMap.BilinForm.dualSubmodule (innerₗ (EuclideanSpace ℝ (Fin n))) (intLattice B)) (2 / (2 * r / (β * √↑n))) 0 - 1 ≤ ε) (t : EuclideanSpace ℝ (Fin n)) (F : Matrix (Fin n) (Fin m) (ZMod q) → ProbComp (Fin m → ℤ)) (μ : PMF (EuclideanSpace ℝ (Fin n))) (hclose : Probability.CloseTo μ (idealIncGDDStep B S hB β r hβ hr t F) (ENNReal.ofReal η)) :
      1 / 3 * (↑(sisEll2Advantage q β F) / (2 * ↑⌊β⌋₊ * ↑m) - ↑m * ε / (2 * (1 - ε))) - η ≤ (μ.toOuterMeasure {v : EuclideanSpace ℝ (Fin n) | IncGDD.IsSolution g (intLattice B) (intColCast B S hB) t r v}).toReal

      Transfer of idealIncGDDStep_succProb_of_sisEll2 to any approximate sampler μ within CloseTo statistical distance η of idealIncGDDStep.