Documentation

CslibFrontier.Crypto.Computational.SIS.MR07Reduction.Shorten

Strict-PPT Basis Shortening Helpers for the Micciancio–Regev Reduction #

Executable polynomial-time implementations on row-major IntTables of the deterministic basis shortening primitives in CslibFrontier.Crypto.Computational.Lattice.MR07Shorten (supporting the finite-parameter reduction step toward [MicciancioRegev2007] Lemma 5.10, p. 24):

1. Row-major IntTable column helpers and RowTable.ofMatrix bridge #

A well-formed n × n IntTable equals RowTable.ofMatrix of its entry matrix.

Column j of a row-major IntTable, matching MR07.intCol T.toMatrix.

Exact squared Euclidean norm of column j of T (as ℕ).

Maximum squared column norm across all columns j < T.numCols (as ℕ).

Column index iStar < T.numCols maximizing squared Euclidean column norm.

intTableColSqNorm T j equals the sum of squared natAbs entries in column j.

Every column squared norm j < T.numCols is at most intTableMaxColSqNorm T.

intTableMaxColSqNorm T is at most B whenever every column squared norm is at most B.

For any nonempty-column table T, intTableMaxSqNormIdx T < T.numCols.

theorem Cslib.Crypto.SIS.MR07.intTableColSqNorm_cast_eq_norm_sq {n : ℕ} (T : LinearAlgebra.IntTable) (hr : T.numRows = n) (j : Fin n) :
↑(intTableColSqNorm T ↑j) = ‖intCol (Matrix.of fun (i k : Fin n) => RowTable.entry T ↑i ↑k) j‖ ^ 2

Exact real cast equality between intTableColSqNorm T j and ‖intCol TMat j‖².

Exact equality between executable intTableMaxSqNormIdx T and MR07Shorten.maxSqNormIndex.

2. Strict-PPT ratOrthoTargetIntTable matching MR07Shorten.ratOrthoTarget #

Executable strict-PPT rational orthogonal target t : List ℚ for row-major IntTable T, matching MR07Shorten.ratOrthoTarget entry-by-entry.

theorem Cslib.Crypto.SIS.MR07.ratOrthoTargetIntTable_spec {m : ℕ} (T : LinearAlgebra.IntTable) (hr : T.numRows = m + 1) (hc : T.numCols = m + 1) (hli : LinearIndependent ℝ (intCol (Matrix.of fun (i j : Fin (m + 1)) => RowTable.entry T ↑i ↑j))) :
have TMat := Matrix.of fun (i j : Fin (m + 1)) => RowTable.entry T ↑i ↑j; have S := fun (j i : Fin (m + 1)) => ↑(RowTable.entry T ↑i ↑j); have iStar := MR07Shorten.maxSqNormIndex S; have tE := MR07Shorten.toEuclidean fun (k : Fin (m + 1)) => (ratOrthoTargetIntTable T).getD (↑k) 0; intTableMaxSqNormIdx T = ↑iStar ∧ ‖intCol TMat iStar‖ = ‖intCol TMat‖ ∧ (∀ (j : Fin (m + 1)), j ≠ iStar → inner ℝ tE (intCol TMat j) = 0) ∧ 1 / 2 * ‖intCol TMat‖ < ‖tE‖ ∧ ‖tE‖ ≤ 9 / 16 * ‖intCol TMat‖

Geometric specification of ratOrthoTargetIntTable: orthogonality to all columns j ≠ iStar and norm window (1 / 2) * ‖intCol TMat‖ < ‖tE‖ ≤ (9 / 16) * ‖intCol TMat‖.

3. Strict-PPT guardedUpdateIntTable matching MR07Shorten.shortenGuardedStep #

Executable guarded column update for the shortening loop (IsPPTOn.iterateWith_spec).

Unconditional invariants of guardedUpdateIntTable: malformed inputs are returned unchanged, and well-formed n × n inputs stay well-formed n × n with every column squared norm bounded by intTableMaxColSqNorm T.

Real linear independence of the columns intCol M is equivalent to M.det ≠ 0.

theorem Cslib.Crypto.SIS.MR07.guardedUpdateIntTable_eq_shortenGuardedStep {n : ℕ} (B : Matrix (Fin n) (Fin n) ℤ) (hB : B.det ≠ 0) (T : LinearAlgebra.IntTable) (hr : T.numRows = n) (hc : T.numCols = n) (hwf : RowTable.WellFormed T) (iStar : Fin n) (u : List ℤ) (hu_len : u.length = n) (hu_mem : (WithLp.toLp 2 fun (i : Fin n) => ↑(u.getD (↑i) 0)) ∈ intLattice B) :
have TMat := Matrix.of fun (i j : Fin n) => RowTable.entry T ↑i ↑j; have T' := guardedUpdateIntTable n T (↑iStar) u; have T'Mat := Matrix.of fun (i j : Fin n) => RowTable.entry T' ↑i ↑j; have uE := WithLp.toLp 2 fun (i : Fin n) => ↑(u.getD (↑i) 0); intColCast B T'Mat hB = MR07Shorten.shortenGuardedStep (intLattice B) (intColCast B TMat hB) (Fin.cast ⋯ iStar) uE

Exact column-by-column bridge from executable guardedUpdateIntTable to MR07Shorten.shortenGuardedStep via MR07.intColCast.

4. Cubic IntTable.enc encoding-length bound for IsPPTOn.iterateWith_spec #

Direct cubic IntTable.enc encoding-length bound: any well-formed n × n IntTable T whose column squared norms are at most intTableMaxColSqNorm B₀ satisfies (IntTable.enc T).length ≤ 14 * ((IntTable.enc B₀).length + 1) ^ 3.