The identity matrix is independent: every executable leading Gram
determinant is positive. Used by benchmarks of
lll.firstShortVector, where the identity basis is the degenerate BZ-style
recombination input with all-zero lift coefficients.
Size reduction preserves the executable Gram-determinant independence predicate. This public theorem lives in the Mathlib-side library so the Mathlib-free LLL implementation does not expose determinant-bound preservation theorems.
Adjacent swap preserves the executable Gram-determinant independence
predicate. Mirrors sizeReduce_independent for the swap step of the LLL
inner loop.
For i + 1 < k, the squared norm of the i-th Gram-Schmidt basis row
is unchanged by swapStep s k.
The prefix δ-LLL-reduced predicate: the first k Gram-Schmidt rows
satisfy size reduction (for all i < k, j < i) and the adjacent Lovász
condition at (i, i + 1) (for all i + 1 < k). At k = n this coincides
with isLLLReduced; at k ≤ 1 it is vacuously true.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Shrinking the row prefix weakens the predicate.
Extending the prefix by one row: given prefixLLLReduced b k δ, the new
size-reducedness data for row k and the new Lovász data at the pair
(k - 1, k) (vacuous when k = 0) jointly yield prefixLLLReduced b (k + 1) δ.
This is the "add one row to the certified prefix" lemma consumed by the
lllLoop advance branch.
At the empty prefix k = 1, prefixLLLReduced holds vacuously: the
i < 1 (so i = 0, then j < 0 impossible) and i + 1 < 1 quantifiers are
empty. This is the starting state for the lllLoop invariant induction.
At the full prefix k = n, prefixLLLReduced upgrades to
isLLLReduced b δ (1/2): prefixLLLReduced always carries the algorithm's
classical |μ| ≤ 1/2 size-reduction guarantee, which is the
η = 1/2 instance of the size-reduced condition μ² ≤ η².
swapStep s k preserves the prefix LLL-reduced predicate, with the
prefix shrunk by one (clamped below by 1 to stay in the trivially-true
regime when k ≤ 2). Mechanism: the swap only touches rows k - 1 and
k, so every Gram-Schmidt quantity at indices strictly below k - 1 is
preserved (swapStep_basisNormSq_below, swapStep_coeffs_below).
The single-column size reduction preserves Valid.
The size-reduction outer foldl preserves Valid.
Integer formulation: after s.sizeReduce k, every column j < k of
row k of the scaled coefficients satisfies 2 * |ν[k][j]| ≤ d[j+1].
After LLLState.sizeReduce s k, the row k of the rational Gram-Schmidt
coefficients is size-reduced: 4 * μ[k][j]² ≤ 1 for every j < k.
Size reduction leaves the multiplicative termination potential unchanged, since it does not modify the stored Gram determinants.
Value lemma for the post-swap Gram-determinant slot at the pivot
index. Reads swapStep directly: at index k, the updated d holds
Int.toNat ⌊(d_{k+1}·d_{k-1} + B²)/d_k⌋, where B = ν[k][k-1]. Pairs
with swapStep_d_eq to identify this slot with the post-swap basis'
Gram determinant via gramDet_adjacentSwap_pivot.
Strict decrease of the LLL termination potential across a swap that
fails the integer Lovász test at row k.
Hypotheses:
s.Valid,s.b.independent: the proof-facing interpretation of the state. Independence gives positivity of alld_jfactors.0 < k < n: the swap acts on adjacent rowsk - 1, k.0 < δnumandδnum ≤ δden: the Lovász parameterδ ∈ (0, 1]as an integer inequality on its numerator and denominator (in the formlllLoop's integer Lovász test consumes; follows from1/4 < δ ≤ 1).hfail: the failing integer Lovász condition atk, exactly the testlllLoopevaluates before selecting the swap branch.
Conclusion: (s.swapStep k).potential < s.potential.
Fuel sufficiency for lllLoop. For a valid state s with an
independent basis, started at row k = 1, the bound
lllFuel s = (s.potential + 1) * (n + 1) is enough fuel to reach the
k = n base case. Equivalently, lllLoop is fuel-stable above this
threshold: running with any fuel' ≥ lllFuel s returns the same matrix.
Thus the fuel = 0 fallback in lllLoop is unreachable from valid public
computation inputs.
Size reduction preserves prefixLLLReduced at the same prefix length: rows
strictly below k are unaffected by the row-k update, so the prefix invariant
on the input transfers to the output.
With enough fuel and a starting state carrying prefixLLLReduced s.b k δ,
lllLoop produces a δ-LLL-reduced basis. The fuel hypothesis
s.potential * (n + 1) + (n - k) < fuel matches the measure used by
lllLoop_eq_of_fuel_gt_measure.
lllLoop preserves the independence of the starting basis: every iteration
is either a sizeReduce (preserved by sizeReduce_independent) or an adjacent
swap (preserved by swapStep_independent).