Executable row-lattice membership agrees with membership in the generated submodule.
26.3. The Mathlib correspondence
HexLLLMathlib is the proof-facing bridge for the Mathlib-free executable
library. It identifies the row lattice used by the reducer with a Mathlib
Submodule ℤ (Fin m → ℤ), transports reducedness and lattice preservation
through both reduction paths, and states the short-vector guarantee with the
norm on EuclideanSpace ℝ (Fin m). Importing it does not replace or wrap the
computational path: calls to Hex.lll and Hex.lllNative still run
the same native Lean definitions from HexLLL.
The generated submodule is characterized by the executable membership predicate, so a proof can cross the boundary in either direction with one rewrite.
HexLLLMathlib.mem_latticeSubmodule_iff {n m : ℕ} (b : Hex.Matrix ℤ n m) (v : Vector ℤ m) : HexMatrixMathlib.vectorEquiv v ∈ HexLLLMathlib.latticeSubmodule b ↔ b.memLattice vHexLLLMathlib.mem_latticeSubmodule_iff {n m : ℕ} (b : Hex.Matrix ℤ n m) (v : Vector ℤ m) : HexMatrixMathlib.vectorEquiv v ∈ HexLLLMathlib.latticeSubmodule b ↔ b.memLattice v
Reduction preserves this submodule. The public-path theorem needs no independence hypothesis: same-lattice certification is valid independently of the reducedness and short-vector arguments that use independence.
HexLLLMathlib.lll_mem_latticeSubmodule_iff {n m : ℕ} (b : Hex.Matrix ℤ n m) (δ : ℚ) (hδ : 121 / 400 < δ) (hδ' : δ ≤ 1) (hn : 1 ≤ n) (x : Fin m → ℤ) : x ∈ HexLLLMathlib.latticeSubmodule (Hex.lll b δ hδ hδ' hn) ↔ x ∈ HexLLLMathlib.latticeSubmodule bHexLLLMathlib.lll_mem_latticeSubmodule_iff {n m : ℕ} (b : Hex.Matrix ℤ n m) (δ : ℚ) (hδ : 121 / 400 < δ) (hδ' : δ ≤ 1) (hn : 1 ≤ n) (x : Fin m → ℤ) : x ∈ HexLLLMathlib.latticeSubmodule (Hex.lll b δ hδ hδ' hn) ↔ x ∈ HexLLLMathlib.latticeSubmodule b
Membership in the Mathlib latticeSubmodule is preserved by Hex.lll.
The integer row and integer function embeddings have explicit squared-norm
characterizations. They connect the executable Vector.normSq quantity to the
standard Euclidean norm without introducing a second lattice representation.
HexLLLMathlib.norm_sq_intRowToEuclidean {m : ℕ} (row : Vector ℤ m) : ‖HexLLLMathlib.intRowToEuclidean row‖ ^ 2 = ↑row.normSqHexLLLMathlib.norm_sq_intRowToEuclidean {m : ℕ} (row : Vector ℤ m) : ‖HexLLLMathlib.intRowToEuclidean row‖ ^ 2 = ↑row.normSq
The Euclidean squared norm of an integer row embedded into
EuclideanSpace ℝ (Fin m) equals the real cast of the executable integer
squared norm.
HexLLLMathlib.norm_sq_intVectorToEuclidean {m : ℕ} (x : Fin m → ℤ) : ‖HexLLLMathlib.intVectorToEuclidean x‖ ^ 2 = ↑(HexMatrixMathlib.vectorEquiv.symm x).normSqHexLLLMathlib.norm_sq_intVectorToEuclidean {m : ℕ} (x : Fin m → ℤ) : ‖HexLLLMathlib.intVectorToEuclidean x‖ ^ 2 = ↑(HexMatrixMathlib.vectorEquiv.symm x).normSq
The Euclidean squared norm of a lattice vector embedded into
EuclideanSpace ℝ (Fin m) equals the real cast of the executable integer
squared norm of its Vector preimage.
The headline theorem composes the reducedness proof, same-lattice result, and norm transport. Its hypotheses are exactly the public reducer's range conditions, nonempty and independent basis assumptions, and a nonzero vector in the input submodule; callers do not need to prove anything about the selected native or externally certified branch.
HexLLLMathlib.lll_first_row_norm_sq_le {n m : ℕ} (b : Hex.Matrix ℤ n m) (δ : ℚ) (hδ : 121 / 400 < δ) (hδ' : δ ≤ 1) (hn : 1 ≤ n) (hind : b.independent) (x : Fin m → ℤ) (hx : x ∈ HexLLLMathlib.latticeSubmodule b) (hx0 : x ≠ 0) : ‖HexLLLMathlib.intRowToEuclidean ((Hex.lll b δ hδ hδ' hn).row ⟨0, ⋯⟩)‖ ^ 2 ≤ ↑((1 / (δ - 121 / 400)) ^ (n - 1)) * ‖HexLLLMathlib.intVectorToEuclidean x‖ ^ 2HexLLLMathlib.lll_first_row_norm_sq_le {n m : ℕ} (b : Hex.Matrix ℤ n m) (δ : ℚ) (hδ : 121 / 400 < δ) (hδ' : δ ≤ 1) (hn : 1 ≤ n) (hind : b.independent) (x : Fin m → ℤ) (hx : x ∈ HexLLLMathlib.latticeSubmodule b) (hx0 : x ≠ 0) : ‖HexLLLMathlib.intRowToEuclidean ((Hex.lll b δ hδ hδ' hn).row ⟨0, ⋯⟩)‖ ^ 2 ≤ ↑((1 / (δ - 121 / 400)) ^ (n - 1)) * ‖HexLLLMathlib.intVectorToEuclidean x‖ ^ 2