Exact rational Gram–Schmidt on the rows of a matrix #
The LLL algorithm of [LLL82] computes the Gram–Schmidt vectors b*ᵢ and the
coefficients μᵢⱼ of an integer basis exactly, over ℚ. This file provides that computation on
the rows of a Vector (Vector ℚ m) n and proves that it agrees with Mathlib's real
InnerProductSpace.gramSchmidt after the coordinate embedding
Cslib.Algorithms.LatticeReduction.ratToEuclidean : (Fin m → ℚ) → EuclideanSpace ℝ (Fin m).
Cslib.Algorithms.LatticeReduction.gramSchmidtRowsAux bq t orthogonalizes rows 0, …, t - 1,
each with one pass over the earlier rows (formulas (1.2)–(1.3) of [LLL82]), so
n rows cost O(n² m) rational operations. The rows are data, not functions, so each b*ⱼ is
computed once.
Main definitions #
Cslib.Algorithms.LatticeReduction.ratToEuclidean: a rational vector as a point ofℝᵐ.Cslib.Algorithms.LatticeReduction.projCoeff: the coefficient⟨g, v⟩ / ⟨g, g⟩.Cslib.Algorithms.LatticeReduction.gramSchmidtRowsAux: exact Gram–Schmidt on rows.
Main results #
Cslib.Algorithms.LatticeReduction.gramSchmidtRowsAux_spec: the computed rows are the real Gram–Schmidt vectors.
References #
Rational vectors in Euclidean space #
A rational vector as a point of Euclidean space.
@[simp]
theorem Cslib.Algorithms.LatticeReduction.ratToEuclidean_apply {m : ℕ} (v : Fin m → ℚ) (k : Fin m) :
theorem Cslib.Algorithms.LatticeReduction.ratToEuclidean_sub_sum {m : ℕ} {ι : Type u_1} (v : Fin m → ℚ) (s : Finset ι) (c : ι → ℚ) (g : ι → Fin m → ℚ) :
(ratToEuclidean fun (k : Fin m) => v k - ∑ j ∈ s, c j * g j k) = ratToEuclidean v - ∑ j ∈ s, ↑(c j) • ratToEuclidean (g j)
Exact Gram–Schmidt on rows #
theorem Cslib.Algorithms.LatticeReduction.gramSchmidtRowsAux_spec {m n : ℕ} (bq : Vector (Vector ℚ m) n) (t : ℕ) (i : Fin n) :
↑i < t →
(ratToEuclidean fun (k : Fin m) => (gramSchmidtRowsAux bq t)[i][k]) = InnerProductSpace.gramSchmidt ℝ (fun (l : Fin n) => ratToEuclidean fun (k : Fin m) => bq[l][k]) i