Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.
Python
module
import Mathlib.Algebra.Order.Star.Real
import TauCeti.RingTheory.DedekindDomain.FiniteAdeleRing.FiniteIndexIdeal
import TauCeti.LinearAlgebra.Matrix.Range
import TauCeti.LinearAlgebra.Submodule.Prod.Index
public import TauCeti.LinearAlgebra.Submodule.Zeta
import TauCeti.NumberTheory.NumberField.CMField.AdelicLattice
import TauCeti.RingTheory.Ideal.Norm.AbsNorm
public import Lib.SiegelWeil.Mass
public import New.Spanning.RemainingTerms.SiegelLemma
import Lib.Adelic.Adeles.LocalFactors
import Lib.Adelic.Unitary.CongruenceLevels
import Lib.Adelic.Witt.WittTheorem
import Lib.General.LinearAlgebra.HermiteForm
import Lib.General.NumberTheory.LatticeCovolumes
/-!
# Discriminants of lattices and sums over sublattices
Lattices of rational subspaces of a space with the standard hermitian form, written over `Ô`;
their discriminants; and a bound for the sum of a negative power of the index over all sublattices
of finite index.
The bound for the sum over sublattices is a consequence of Hey's formula for the zeta function of a
lattice. Here we use Tau Ceti's bound, proved by induction on the rank over any ring whose
left ideals of finite index are principal.
The formula that compares the discriminant of `L ∩ W` with that of the dual lattice in `W^⊥` is
`New.Filling.jacobi_perp_discriminant`, stated for Gram determinants.
-/
@[expose] public section
noncomputable section
namespace New.Filling
open NumberField Matrix Module ENNReal
section SubmoduleZeta
variable {R N N' : Type*} [CommRing R] [AddCommGroup N] [Module R N] [AddCommGroup N'] [Module R N']
/-- The index of the preimage of `M` under `f` is the index of `M ⊓ range f` in the range of `f`. -/
lemma cardQuot_comap (f : N →ₗ[R] N') (M : Submodule R N') :
(M.comap f).cardQuot = M.toAddSubgroup.relIndex (LinearMap.range f).toAddSubgroup :=
M.toAddSubgroup.index_comap f.toAddMonoidHom
/-- The sum of `[range f : M] ^ (-s)` over the submodules `M` of finite index in the range of a
linear map `f` is at most the same sum over the submodules of finite index in its domain. -/
lemma tsum_relIndex_range_le_submoduleZeta (f : N →ₗ[R] N') (s : ℕ) :
∑' M : {M : Submodule R N' // M ≤ LinearMap.range f ∧
M.toAddSubgroup.relIndex (LinearMap.range f).toAddSubgroup ≠ 0},
(M.val.toAddSubgroup.relIndex (LinearMap.range f).toAddSubgroup : ℝ≥0∞)⁻¹ ^ s ≤
submoduleZeta R N s := by
let pull (M : {M : Submodule R N' // M ≤ LinearMap.range f ∧
M.toAddSubgroup.relIndex (LinearMap.range f).toAddSubgroup ≠ 0}) :
{M : Submodule R N // M.cardQuot ≠ 0} :=
⟨M.val.comap f, (cardQuot_comap f M.val).trans_ne M.property.2⟩
have h_inj : Function.Injective pull := by
rintro ⟨M₁, h₁_le, _⟩ ⟨M₂, h₂_le, _⟩ h_eq
have h_comap : M₁.comap f = M₂.comap f := congrArg Subtype.val h_eq
simpa [Submodule.map_comap_eq_self, h₁_le, h₂_le] using congrArg (Submodule.map f) h_comap
calc _ = ∑' M, ((pull M).val.cardQuot : ℝ≥0∞)⁻¹ ^ s :=
tsum_congr fun M ↦ by simp only [pull, cardQuot_comap]
_ ≤ submoduleZeta R N s := submoduleZeta_def R N s ▸
tsum_comp_le_tsum_of_injective h_inj fun M ↦ (M.val.cardQuot : ℝ≥0∞)⁻¹ ^ s
end SubmoduleZeta
section Columns
variable {A l m n : Type} [CommRing A] {R : Subring A} [Fintype m] [Fintype n]
/-- The lattice of the columns of `B * C` is the image under `B` of that of the columns of `C`. -/
lemma colLattice_mul (B : Matrix l m A) (C : Matrix m n A) :
colLattice R (B * C) = (colLattice R C).map (B.mulVecLin.restrictScalars R) := by
rw [colLattice, colLattice, ← Submodule.map_comp, mulVecLin_mul, LinearMap.restrictScalars_comp]
/-- If `U` has entries in `R`, then the lattice of the columns of `B * U` lies in that of the
columns of `B`. -/
lemma colLattice_mul_le (B : Matrix l m A) {U : Matrix m n A} (hU : IsIntMatrix R U) :
colLattice R (B * U) ≤ colLattice R B := by
rw [colLattice_mul]
exact Submodule.map_mono (colLattice_le fun j i ↦ hU i j)
omit [Fintype m] in
/-- Let `R` be a subring of a commutative ring `A`. The `R`-span `colLattice R B` of the columns of
an `m × n` matrix `B` over `A` is the range of an `R`-linear map from `R ^ n` to `A ^ m`. -/
lemma exists_range_eq_colLattice (B : Matrix m n A) :
∃ f : (n → R) →ₗ[R] (m → A), LinearMap.range f = colLattice R B := by
let coeVec : (n → R) →ₗ[R] (n → A) := (Algebra.linearMap R A).compLeft n
have h_range : LinearMap.range coeVec = intVectors R n := by
ext v
refine ⟨?_, fun hv ↦ ⟨fun i ↦ ⟨v i, hv i⟩, rfl⟩⟩
rintro ⟨w, rfl⟩ i
exact (w i).property
refine ⟨B.mulVecLin.restrictScalars R ∘ₗ coeVec, ?_⟩
rw [LinearMap.range_comp, h_range, colLattice]
/-- Let `R` be a subring of a commutative ring `A` and suppose that any `a`, `b` in `A` are
`R`-multiples of `(1 - e) a + e b` for some idempotent `e` of `R` (`IsValuationPair R`). Then the
`R`-span `colLattice R Y` of the columns of an `m × n` matrix `Y` over `A` is the span of the
columns of a square `m × m` matrix `D`. -/
lemma _root_.New.IsValuationPair.exists_square_colLattice_eq (hR : IsValuationPair R)
(Y : Matrix m n A) : ∃ D : Matrix m m A, colLattice R D = colLattice R Y := by
classical
-- Column operations over `R` on `(0 | Y)` clear the columns of the second block.
let X : Matrix m (m ⊕ n) A := fromCols 0 Y
obtain ⟨V, hV, h_clear⟩ : ∃ V ∈ intGL (m ⊕ n) R,
∀ a : m, ∀ j ∉ Set.range (Function.Embedding.inl : m ↪ m ⊕ n), (X * V.val) a j = 0 :=
hR.exists_mul_clear_cols X .inl
let D : Matrix m m A := (X * V.val).toCols₁
have hD : Y * V.val.toBlocks₂₁ = D := by
ext i j
simp [D, X, toBlocks₂₁, Matrix.mul_apply]
have hY : D * V⁻¹.val.toBlocks₁₂ = Y := by
ext i j
have h_cancel : (X * V.val * V⁻¹.val) i (.inr j) = Y i j := by simp [X, Matrix.mul_assoc]
have h_zero (b : n) : (X * V.val) i (.inr b) = 0 := h_clear i (.inr b) (by simp)
rw [← h_cancel, Matrix.mul_apply, Matrix.mul_apply, Fintype.sum_sum_type]
simp [h_zero, D, toCols₁, toBlocks₁₂]
obtain ⟨hV_int, hV_inv_int⟩ := mem_intGL.1 hV
refine ⟨D, le_antisymm ?_ ?_⟩
· rw [← hD]
exact colLattice_mul_le Y fun i j ↦ hV_int (.inr i) (.inl j)
· rw [← hY]
exact colLattice_mul_le D fun i j ↦ hV_inv_int (.inl i) (.inr j)
end Columns
variable {E κ P : Type} [Field E] [NumberField E] [IsCMField E] [HasPrimitiveRoot5040 E] [Fintype κ]
[Fintype P] {r : ℕ}
/-- Let `𝔸f E` be the finite adeles of the number field `E` and `Ô E` the integral ones. An
`Ô E`-submodule `L` of `(𝔸f E) ^ κ` is a lattice of rank `r` if it is spanned over `Ô E` by the
columns of `x a`, where the `r` columns of `x` are independent vectors in `E ^ κ` and `a` is an
invertible `r × r` matrix over `𝔸f E`. -/
def IsLatticeOfRank (r : ℕ) (L : Submodule (Ô E) (κ → 𝔸f E)) : Prop :=
∃ (x : Matrix κ (Fin r) E) (a : GL (Fin r) (𝔸f E)),
HasLeftInv x ∧ colLattice (Ô E) (finAdeleMatrix x * a.val) = L
open scoped Classical in
/-- The discriminant of a lattice `L` of rank `r`: the square root of `genIndex (det (Bᴴ * B))` for
some chosen basis `B = x a`. Here `ᴴ` is the conjugate transpose and `genIndex u` is the inverse of
the factor by which a unit `u` scales Haar measure on the finite adeles (`0` for a non-unit). The
value is `0` if `L` is not a lattice of rank `r`. -/
def discriminant (r : ℕ) (L : Submodule (Ô E) (κ → 𝔸f E)) : ℝ :=
if h : IsLatticeOfRank r L then
√(genIndex ((finAdeleMatrix h.choose * h.choose_spec.choose.val)ᴴ *
(finAdeleMatrix h.choose * h.choose_spec.choose.val)).det)
else 0
omit [IsCMField E] [HasPrimitiveRoot5040 E] in
/-- If `x` has a left inverse over `E` and `a` is an invertible matrix over the finite adeles
`𝔸f E`, then `finAdeleMatrix x * a` (with `x` read over `𝔸f E`) has a left inverse over `𝔸f E`. -/
lemma hasLeftInv_finAdeleMatrix_mul {x : Matrix κ (Fin r) E} (hx : HasLeftInv x)
(a : GL (Fin r) (𝔸f E)) : HasLeftInv (finAdeleMatrix x * a.val) := by
exact Matrix.exists_mul_map_mul_eq_one_of_linearIndependent_col
(Matrix.mulVec_injective_iff.1 hx.injective_mulVec) a
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. Let `B`, `C` be matrices over `𝔸f E` whose columns have the same `Ô E`-span, and
let `B` have a left inverse. Then the Gram determinants `det (Bᴴ * B)` and `det (Cᴴ * C)`, with `ᴴ`
the conjugate transpose, have the same generalised index: `genIndex a` is the inverse of the factor
by which a unit `a` scales Haar measure, and `0` for a non-unit. -/
lemma genIndex_det_gram_eq_of_colLattice_eq {B C : Matrix κ (Fin r) (𝔸f E)} (hB : HasLeftInv B)
(h_eq : colLattice (Ô E) B = colLattice (Ô E) C) :
genIndex (Bᴴ * B).det = genIndex (Cᴴ * C).det := by
-- The bases differ by an integral matrix with integral inverse.
obtain ⟨l, hl⟩ : ∃ l : Matrix (Fin r) κ (𝔸f E), l * B = 1 := hB
obtain ⟨U, hU_int, rfl⟩ : ∃ U : Matrix (Fin r) (Fin r) (𝔸f E),
IsIntMatrix (Ô E) U ∧ B * U = C :=
exists_isIntMatrix_mul_eq h_eq.ge
obtain ⟨V, hV_int, hV⟩ : ∃ V : Matrix (Fin r) (Fin r) (𝔸f E),
IsIntMatrix (Ô E) V ∧ B * U * V = B :=
exists_isIntMatrix_mul_eq h_eq.le
have hUV : U * V = 1 :=
calc U * V = l * B * (U * V) := by rw [hl, Matrix.one_mul]
_ = l * (B * U * V) := by rw [Matrix.mul_assoc l, Matrix.mul_assoc B]
_ = 1 := by rw [hV, hl]
have h_gram : (B * U)ᴴ * (B * U) = Uᴴ * (Bᴴ * B) * U := by
simp only [conjTranspose_mul, Matrix.mul_assoc]
rw [h_gram]
exact genIndex_det_conj_of_isIntMatrix hU_int hV_int (mul_eq_one_comm.1 hUV) hUV
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. Let `x` be a matrix over `E` with a left inverse, `a` an invertible matrix over
`𝔸f E`, and `B = finAdeleMatrix x * a`, with `x` read over `𝔸f E`. The discriminant of the
`Ô E`-span of the columns of `B`, defined from a chosen basis of this form, can be computed from
`B`: it is `√(genIndex (Bᴴ * B).det)`. -/
lemma discriminant_colLattice {x : Matrix κ (Fin r) E} (hx : HasLeftInv x) (a : GL (Fin r) (𝔸f E)) :
discriminant r (colLattice (Ô E) (finAdeleMatrix x * a.val)) =
√(genIndex ((finAdeleMatrix x * a.val)ᴴ * (finAdeleMatrix x * a.val)).det) := by
have hL : IsLatticeOfRank r (colLattice (Ô E) (finAdeleMatrix x * a.val)) := ⟨x, a, hx, rfl⟩
rw [discriminant, dite_eq_left hL]
-- The discriminant is defined by a chosen basis `y b`, which spans the same lattice as `x a`.
set y : Matrix κ (Fin r) E := hL.choose
set b : GL (Fin r) (𝔸f E) := hL.choose_spec.choose
obtain ⟨-, h_chosen⟩ : HasLeftInv y ∧
colLattice (Ô E) (finAdeleMatrix y * b.val) = colLattice (Ô E) (finAdeleMatrix x * a.val) :=
hL.choose_spec.choose_spec
rw [genIndex_det_gram_eq_of_colLattice_eq (hasLeftInv_finAdeleMatrix_mul hx a) h_chosen.symm]
open ComplexOrder in
omit [HasPrimitiveRoot5040 E] in
/-- Let `E` be a CM field, with `ᴴ` the conjugate transpose for its complex conjugation. If the
columns of `x` are independent over `E` (`x` has a left inverse), then their Gram determinant
`det (xᴴ * x)` for the standard hermitian form is not zero. -/
lemma det_gram_ne_zero {x : Matrix κ (Fin r) E} (hx : HasLeftInv x) : (xᴴ * x).det ≠ 0 := by
exact NumberField.IsCMField.det_transpose_map_complexConj_mul_ne_zero
(Matrix.mulVec_injective_iff.1 hx.injective_mulVec)
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. Let `L` be a lattice of rank `r` in `(𝔸f E) ^ κ`: the `Ô E`-span of the columns
of `x a`, where `x` has `r` independent columns over `E` and `a` is invertible over `𝔸f E`. Then
the discriminant of `L`, the square root of the generalised index `genIndex` of the Gram
determinant of such a basis, is positive. -/
lemma IsLatticeOfRank.discriminant_pos {L : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) : 0 < discriminant r L := by
obtain ⟨x, a, hx, rfl⟩ := hL
have h_gram : (finAdeleMatrix x * a.val)ᴴ * (finAdeleMatrix x * a.val) =
a.valᴴ * finAdeleMatrix (xᴴ * x) * a.val := by
simp [finAdeleMatrix_conjTranspose, Matrix.mul_assoc]
have h_unit : IsUnit (finAdeleMatrix (xᴴ * x)).det := by
simpa only [RingHom.map_det, RingHom.mapMatrix_apply] using
(det_gram_ne_zero hx).isUnit.map (algebraMap E (𝔸f E))
rw [discriminant_colLattice hx, h_gram, genIndex_det_conj]
exact Real.sqrt_pos.2 (mul_pos (genIndex_pos h_unit.unit) (pow_pos (genIndex_pos a.det) 2))
omit [IsCMField E] [HasPrimitiveRoot5040 E] in
/-- Let `E` be a number field, `𝔸f E` its finite adeles and `Ô E` the integral ones. If an
`Ô E`-submodule `M` of `(𝔸f E) ^ n` contains the `Ô E`-span `colLattice (Ô E) C` of the columns of
`C` with finite index (`submoduleIndex` is not `0`), then `M` is spanned by the columns of `C` and
finitely many further vectors, the columns of `reps`. -/
lemma exists_colLattice_fromCols_eq {n : Type} [Fintype n] {M : Submodule (Ô E) (n → 𝔸f E)}
(C : Matrix n n (𝔸f E)) (h_le : colLattice (Ô E) C ≤ M)
(h_index : submoduleIndex (colLattice (Ô E) C) M ≠ 0) :
∃ (Q : Type) (_ : Fintype Q) (reps : Matrix n Q (𝔸f E)),
colLattice (Ô E) (fromCols C reps) = M := by
classical
let K : AddSubgroup M.toAddSubgroup := (colLattice (Ô E) C).toAddSubgroup.addSubgroupOf _
let : Fintype (M.toAddSubgroup ⧸ K) := AddSubgroup.fintypeOfIndexNeZero h_index
let reps : Matrix n (M.toAddSubgroup ⧸ K) (𝔸f E) := of fun i q ↦ q.out.val i
refine ⟨_, inferInstance, reps, le_antisymm (colLattice_le ?_) fun v hv ↦ ?_⟩
· rintro (j | q)
· exact h_le (col_mem_colLattice j)
· exact q.out.property
· obtain ⟨k, hk⟩ : ∃ k : K, (QuotientAddGroup.mk (s := K) ⟨v, hv⟩).out = ⟨v, hv⟩ + k.val :=
QuotientAddGroup.mk_out_eq_add K ⟨v, hv⟩
have h_col : (fromCols C reps).col (.inr (QuotientAddGroup.mk ⟨v, hv⟩)) = v + k :=
congrArg Subtype.val hk
have hC_le : colLattice (Ô E) C ≤ colLattice (Ô E) (fromCols C reps) :=
colLattice_le fun j ↦ col_mem_colLattice (M := fromCols C reps) (.inl j)
have h_rep : v + k ∈ colLattice (Ô E) (fromCols C reps) := by
rw [← h_col]
exact col_mem_colLattice _
exact (add_mem_cancel_right (hC_le k.property)).1 h_rep
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. If an `Ô E`-submodule `M` of the module `intVectors (Ô E) n` of vectors in
`(𝔸f E) ^ n` with entries in `Ô E` has finite index, then it has a basis: it is the `Ô E`-span
`colLattice` of the columns of a matrix that is invertible over `𝔸f E`. -/
lemma exists_colLattice_eq_of_submoduleIndex_ne_zero {n : Type} [Fintype n] [DecidableEq n]
{M : Submodule (Ô E) (n → 𝔸f E)} (h_le : M ≤ intVectors (Ô E) n)
(h_index : submoduleIndex M (intVectors (Ô E) n) ≠ 0) :
∃ A : GL n (𝔸f E), colLattice (Ô E) A.val = M := by
-- With `N` the index, `M` contains `N Ô ^ n`, spanned by the columns of `C = N • 1`, with finite
-- index. So `M` is spanned by the columns of `C` and finitely many coset representatives, hence
-- by the columns of a square matrix `D`; and `D` divides `C`.
set N : ℕ := submoduleIndex M (intVectors (Ô E) n)
obtain ⟨c, hc⟩ : IsUnit (N : 𝔸f E) := by
simpa using (Nat.cast_ne_zero.2 h_index).isUnit.map (algebraMap E (𝔸f E))
let C : GL n (𝔸f E) := c • 1
have hC_le : colLattice (Ô E) C.val ≤ M := colLattice_le fun j ↦ by
have h_col : C.val.col j = N • (Pi.single j 1 : n → 𝔸f E) := by
ext i
simp [C, Units.smul_def, Matrix.one_apply, Pi.single_apply, hc]
rw [h_col]
exact M.toAddSubgroup.nsmul_relIndex_mem (K := (intVectors (Ô E) n).toAddSubgroup)
(single_mem_intVectors j)
have hC_index : submoduleIndex (colLattice (Ô E) C.val) (intVectors (Ô E) n) ≠ 0 := by
rw [← Nat.cast_ne_zero (R := ℝ),
submoduleIndex_colLattice_intVectors (.smul (by simp [hc]) .one)]
exact (genIndex_pos C.det).ne'
obtain ⟨Q, _, reps, h_reps⟩ := exists_colLattice_fromCols_eq C.val hC_le
(mt (AddSubgroup.relIndex_eq_zero_of_le_right h_le) hC_index)
obtain ⟨D, hD⟩ : ∃ D : Matrix n n (𝔸f E), colLattice (Ô E) D = M := by
simpa [h_reps] using IsAdelic.isValuationPair.exists_square_colLattice_eq (fromCols C.val reps)
obtain ⟨U, -, hU : D * U = C.val⟩ := exists_isIntMatrix_mul_eq (hC_le.trans hD.ge)
obtain ⟨A, rfl⟩ : IsUnit D := isUnit_of_mul_isUnit_left (y := U) (by simp [hU])
exact ⟨A, hD⟩
/-- For an adelic matrix `B` and an invertible adelic matrix `A`, passing from `B` to `B * A`
multiplies the square root of the generalised index `genIndex` of the Gram determinant by the
generalised index of `det A`. -/
lemma sqrt_genIndex_det_gram_mul (B : Matrix κ (Fin r) (𝔸f E)) (A : GL (Fin r) (𝔸f E)) :
√(genIndex ((B * A.val)ᴴ * (B * A.val)).det) =
√(genIndex (Bᴴ * B).det) * genIndex A.val.det := by
have h_gram : (B * A.val)ᴴ * (B * A.val) = A.valᴴ * (Bᴴ * B) * A.val := by
simp only [conjTranspose_mul, Matrix.mul_assoc]
rw [h_gram, genIndex_det_conj, Real.sqrt_mul' _ (sq_nonneg _), Real.sqrt_sq]
exact (genIndex_pos A.det).le
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. Let `B` be a matrix over `𝔸f E` with a left inverse, and `M` a submodule of
finite index in the `Ô E`-span `colLattice` of the columns of `B`. Then `M` is spanned by the
columns of `B * A` for some `A` invertible over `𝔸f E`, and the index of `M` is `genIndex (det A)`,
the inverse of the factor by which `det A` scales Haar measure. -/
lemma exists_colLattice_mul_eq_of_le {B : Matrix κ (Fin r) (𝔸f E)} (hB : HasLeftInv B)
{M : Submodule (Ô E) (κ → 𝔸f E)} (h_le : M ≤ colLattice (Ô E) B)
(h_index : submoduleIndex M (colLattice (Ô E) B) ≠ 0) :
∃ A : GL (Fin r) (𝔸f E), colLattice (Ô E) (B * A.val) = M ∧
(submoduleIndex M (colLattice (Ô E) B) : ℝ) = genIndex A.val.det := by
-- In the coordinates of `B` the submodule `M` has finite index in `Ô ^ r`, so it has a basis `A`.
let M₀ : Submodule (Ô E) (Fin r → 𝔸f E) := M.comap (B.mulVecLin.restrictScalars (Ô E))
have h₀_le : M₀ ≤ intVectors (Ô E) (Fin r) := fun v hv ↦ by
obtain ⟨w, hw, hwv⟩ : ∃ w ∈ intVectors (Ô E) (Fin r), B *ᵥ w = B *ᵥ v := h_le hv
obtain ⟨l, hl⟩ := hB
have h_cancel (y : Fin r → 𝔸f E) : l *ᵥ B *ᵥ y = y := by rw [mulVec_mulVec, hl, one_mulVec]
rwa [← h_cancel v, ← hwv, h_cancel]
have h₀_index : submoduleIndex M₀ (intVectors (Ô E) (Fin r)) =
submoduleIndex M (colLattice (Ô E) B) :=
M.toAddSubgroup.relIndex_comap B.mulVecLin.toAddMonoidHom _
obtain ⟨A, hA : colLattice (Ô E) A.val = M₀⟩ :=
exists_colLattice_eq_of_submoduleIndex_ne_zero h₀_le (h₀_index.trans_ne h_index)
have hA_int : IsIntMatrix (Ô E) A.val := fun i j ↦ h₀_le (hA.le (col_mem_colLattice j)) i
refine ⟨A, ?_, ?_⟩
· rw [colLattice_mul, hA, Submodule.map_comap_eq_self (h_le.trans LinearMap.map_le_range)]
· rw [← h₀_index, ← hA, submoduleIndex_colLattice_intVectors hA_int]
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. A lattice of rank `r` is the `Ô E`-span in `(𝔸f E) ^ κ` of the columns of `x a`,
with `r` independent columns of `x` over `E` and `a` invertible over `𝔸f E`. An `Ô E`-submodule `M`
of finite index (`submoduleIndex M L` is not `0`) in such a lattice `L` is again one. -/
lemma IsLatticeOfRank.of_submoduleIndex_ne_zero {L M : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) (h_le : M ≤ L) (h_index : submoduleIndex M L ≠ 0) :
IsLatticeOfRank r M := by
obtain ⟨x, a, hx, rfl⟩ := hL
obtain ⟨A, hM, -⟩ :=
exists_colLattice_mul_eq_of_le (hasLeftInv_finAdeleMatrix_mul hx a) h_le h_index
exact ⟨x, a * A, hx, by rw [Units.val_mul, ← Matrix.mul_assoc, hM]⟩
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. Let `L` be a lattice of rank `r` in `(𝔸f E) ^ κ`: the `Ô E`-span of the columns
of `B = x a`, with `r` independent columns of `x` over `E` and `a` invertible over `𝔸f E`. If `M` is
an `Ô E`-submodule of `L` of finite non-zero index `submoduleIndex M L`, then its discriminant is
that of `L` times this index. -/
lemma IsLatticeOfRank.discriminant_eq_mul_submoduleIndex {L M : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) (h_le : M ≤ L) (h_index : submoduleIndex M L ≠ 0) :
discriminant r M = discriminant r L * submoduleIndex M L := by
-- If `x a` is a basis of `L`, then `x a A` is a basis of `M`, and the index is that of `det A`.
obtain ⟨x, a, hx, rfl⟩ := hL
obtain ⟨A, hM, h_det⟩ : ∃ A : GL (Fin r) (𝔸f E),
colLattice (Ô E) (finAdeleMatrix x * a.val * A.val) = M ∧
(submoduleIndex M (colLattice (Ô E) (finAdeleMatrix x * a.val)) : ℝ) = genIndex A.val.det :=
exists_colLattice_mul_eq_of_le (hasLeftInv_finAdeleMatrix_mul hx a) h_le h_index
have h_basis : finAdeleMatrix x * (a * A).val = finAdeleMatrix x * a.val * A.val :=
(Matrix.mul_assoc ..).symm
rw [h_det, ← hM, ← h_basis, discriminant_colLattice hx, discriminant_colLattice hx, h_basis,
sqrt_genIndex_det_gram_mul]
/-- An `Ô E`-submodule `M` of finite index in a lattice `L` of rank `r` is a lattice of the same
rank, and its discriminant is the discriminant of `L` times the index `submoduleIndex M L` of `M` in
`L`. -/
lemma IsLatticeOfRank.of_le_and_discriminant_eq_mul_index {L M : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) (h_le : M ≤ L) (h_index : submoduleIndex M L ≠ 0) :
IsLatticeOfRank r M ∧ discriminant r M = discriminant r L * submoduleIndex M L :=
⟨hL.of_submoduleIndex_ne_zero h_le h_index, hL.discriminant_eq_mul_submoduleIndex h_le h_index⟩
omit [IsCMField E] [HasPrimitiveRoot5040 E] in
/-- The `Ô`-span `colLattice` of the columns of `B` lies in `preimageLattice (Ô E) H`, the vectors
that `H` maps to integral ones, if and only if `H * B` has all entries in `Ô`. -/
lemma colLattice_le_preimageLattice_iff {σ τ : Type} [Fintype τ] {H : Matrix σ κ (𝔸f E)}
{B : Matrix κ τ (𝔸f E)} :
colLattice (Ô E) B ≤ preimageLattice (Ô E) H ↔ IsIntMatrix (Ô E) (H * B) := by
classical
exact ⟨fun h_le i j ↦ h_le (col_mem_colLattice j) i,
fun h_int ↦ colLattice_le fun j i ↦ h_int i j⟩
variable [DecidableEq κ]
omit [IsCMField E] [HasPrimitiveRoot5040 E] [DecidableEq κ] in
/-- The image under a rational matrix `η` of the lattice spanned by the columns of `x a` is the
lattice spanned by the columns of `(η x) a`. -/
lemma map_colLattice_finAdeleMatrix_mul (η : Matrix κ κ E) (x : Matrix κ (Fin r) E)
(a : Matrix (Fin r) (Fin r) (𝔸f E)) :
(colLattice (Ô E) (finAdeleMatrix x * a)).map
((finAdeleMatrix η).mulVecLin.restrictScalars (Ô E)) =
colLattice (Ô E) (finAdeleMatrix (η * x) * a) := by
have h_map : finAdeleMatrix (η * x) = finAdeleMatrix η * finAdeleMatrix x := Matrix.map_mul
rw [h_map, Matrix.mul_assoc, colLattice_mul (finAdeleMatrix η)]
omit [IsCMField E] [HasPrimitiveRoot5040 E] in
/-- A matrix `η` over `E` with a left inverse maps a lattice of rank `r` in `(𝔸f E) ^ κ` (the
`Ô E`-span of the adelic basis `x a` of an `r`-dimensional subspace of `E ^ κ`) to a lattice of
rank `r`. -/
lemma IsLatticeOfRank.map_of_hasLeftInv {L : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) {η : Matrix κ κ E} (hη : HasLeftInv η) :
IsLatticeOfRank r (L.map ((finAdeleMatrix η).mulVecLin.restrictScalars (Ô E))) := by
obtain ⟨x, a, hx, rfl⟩ := hL
exact ⟨η * x, a, hη.mul hx, (map_colLattice_finAdeleMatrix_mul η x a.val).symm⟩
/-- An isometry `η` of the standard hermitian form over `E` (`ηᴴ * η = 1`) keeps the discriminant
of a lattice of rank `r`, that is, the square root of the generalised index of the Gram determinant
of a basis of the lattice. -/
lemma IsLatticeOfRank.discriminant_map_of_unitary {L : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) {η : Matrix κ κ E} (hη : ηᴴ * η = 1) :
discriminant r (L.map ((finAdeleMatrix η).mulVecLin.restrictScalars (Ô E))) =
discriminant r L := by
-- The basis `x a` is moved to `(η x) a`, which has the same Gram matrix.
obtain ⟨x, a, hx, rfl⟩ := hL
have h_inv : HasLeftInv (η * x) := HasLeftInv.mul ⟨ηᴴ, hη⟩ hx
have hη_adelic : (finAdeleMatrix η)ᴴ * finAdeleMatrix η = 1 := by
simp [← finAdeleMatrix_conjTranspose, ← Matrix.map_mul, hη]
have h_gram : (finAdeleMatrix (η * x) * a.val)ᴴ * (finAdeleMatrix (η * x) * a.val) =
(finAdeleMatrix x * a.val)ᴴ * (finAdeleMatrix x * a.val) := by
simp [Matrix.mul_assoc, ← Matrix.mul_assoc (finAdeleMatrix η)ᴴ, hη_adelic]
rw [map_colLattice_finAdeleMatrix_mul, discriminant_colLattice h_inv,
discriminant_colLattice hx, h_gram]
/-- An isometry `η` of the standard hermitian form over `E` (`ηᴴ * η = 1`) maps a lattice of rank
`r` to a lattice of rank `r` with the same discriminant. -/
lemma IsLatticeOfRank.map_of_unitary {L : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) {η : Matrix κ κ E} (hη : ηᴴ * η = 1) :
IsLatticeOfRank r (L.map ((finAdeleMatrix η).mulVecLin.restrictScalars (Ô E))) ∧
discriminant r (L.map ((finAdeleMatrix η).mulVecLin.restrictScalars (Ô E))) =
discriminant r L :=
⟨hL.map_of_hasLeftInv ⟨ηᴴ, hη⟩, hL.discriminant_map_of_unitary hη⟩
section Saturated
variable {H' : Matrix κ P (𝔸f E)} {H : Matrix P κ (𝔸f E)}
/-- The saturated lattice of a subspace `V` of `E ^ κ` for a matrix `H` with left inverse `H'`: the
`Ô`-span of the chosen basis `sublatticeBasis u V`, where `u` is the identity `H' * H = 1`. Its
columns are adelic points of `V`, and their image under `H` is a primitive integral matrix. -/
def saturatedLattice (u : H' * H = 1) (V : Submodule E (κ → E)) : Submodule (Ô E) (κ → 𝔸f E) :=
colLattice (Ô E) (sublatticeBasis u V).val
/-- The matrix `H`, which has the left inverse `H'`, maps the saturated lattice of `V` to integral
vectors. -/
lemma saturatedLattice_le (h_left_inv : H' * H = 1) (V : Submodule E (κ → E)) :
saturatedLattice h_left_inv V ≤ preimageLattice (Ô E) H :=
colLattice_le_preimageLattice_iff.2 (isPrimitiveMatrix_mul_sublatticeBasis h_left_inv V).left
/-- The saturated lattice of `V` is a lattice whose rank is the dimension of `V`. -/
lemma isLatticeOfRank_saturatedLattice (h_left_inv : H' * H = 1) (V : Submodule E (κ → E)) :
IsLatticeOfRank (finrank E V) (saturatedLattice h_left_inv V) := by
obtain ⟨y, a, hy_inv, -, h_basis⟩ := exists_sublatticeBasis_eq_finAdeleMatrix_mul h_left_inv V
exact ⟨y, a, hy_inv, by rw [saturatedLattice, h_basis]⟩
/-- The discriminant of the saturated lattice of `V` is `sublatticeDiscriminant h_left_inv V`, the
square root of the generalised index of the Gram determinant of its chosen basis. -/
lemma discriminant_saturatedLattice (h_left_inv : H' * H = 1) (V : Submodule E (κ → E)) :
discriminant (finrank E V) (saturatedLattice h_left_inv V) =
sublatticeDiscriminant h_left_inv V := by
obtain ⟨y, a, hy_inv, -, h_basis⟩ := exists_sublatticeBasis_eq_finAdeleMatrix_mul h_left_inv V
rw [saturatedLattice, sublatticeDiscriminant, h_basis, discriminant_colLattice hy_inv]
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones. Let the matrix `H` over `𝔸f E` have the left inverse `H'`, and let `V` be a
subspace of `E ^ κ`. Suppose that, for every adelic matrix `m` with `finrank E V` columns, the Gram
matrix `mᴴ * m` has entries in `Ô E` whenever `H * m` has. Then the discriminant
`sublatticeDiscriminant h_left_inv V` is at least `1`. -/
lemma one_le_sublatticeDiscriminant (h_left_inv : H' * H = 1) (V : Submodule E (κ → E))
(h_int : ∀ m : Matrix κ (Fin (finrank E V)) (𝔸f E),
IsIntMatrix (Ô E) (H * m) → IsIntMatrix (Ô E) (mᴴ * m)) :
1 ≤ sublatticeDiscriminant h_left_inv V := by
-- The Gram determinant is integral, and it is a unit because the discriminant is positive.
have h_pos : 0 < sublatticeDiscriminant h_left_inv V := by
simpa [discriminant_saturatedLattice] using
(isLatticeOfRank_saturatedLattice h_left_inv V).discriminant_pos
set m : Matrix κ (Fin (finrank E V)) (𝔸f E) := (sublatticeBasis h_left_inv V).val with hm
rw [sublatticeDiscriminant, ← hm] at h_pos ⊢
have h_unit : IsUnit (mᴴ * m).det := genIndex.apply_ne_zero_iff.1 (Real.sqrt_pos.1 h_pos).ne'
have h_gram_int : IsIntMatrix (Ô E) (mᴴ * m) :=
h_int m (isPrimitiveMatrix_mul_sublatticeBasis h_left_inv V).left
exact Real.one_le_sqrt.2 (one_le_genIndex h_gram_int.det_mem h_unit)
/-- Let `E` be a CM field with a primitive 5040th root of unity, `𝔸f E` its finite adeles and `Ô E`
the integral ones, and let the matrix `H` over `𝔸f E` have the left inverse `H'`. Let `L` be a
lattice of rank `r` that `H` maps to integral vectors: the `Ô E`-span in `(𝔸f E) ^ κ` of the columns
of `x a`, with `r` independent columns of `x` over `E` and `a` invertible over `𝔸f E`. Then `L` is
spanned by the columns of `S * A` for some subspace `W` of `E ^ κ` of dimension `r` and some
integral `A` invertible over `𝔸f E`. Here `S = sublatticeBasis h_left_inv W` is the chosen basis of
the saturated lattice of `W`. The discriminant of a lattice is the square root of `genIndex` of the
Gram determinant of a basis, with `genIndex u` the inverse of the factor by which a unit `u` scales
Haar measure; that of `L` is `sublatticeDiscriminant h_left_inv W`, the one of `S`, times
`genIndex (det A)`. -/
lemma IsLatticeOfRank.exists_eq_colLattice_sublatticeBasis_mul {L : Submodule (Ô E) (κ → 𝔸f E)}
{H' : Matrix κ P (𝔸f E)} {H : Matrix P κ (𝔸f E)} (h_left_inv : H' * H = 1)
(hL : IsLatticeOfRank r L) (h_le : L ≤ preimageLattice (Ô E) H) :
∃ (W : Submodule E (κ → E)) (A : GL (Fin (finrank E W)) (𝔸f E)),
finrank E W = r ∧
IsIntMatrix (Ô E) A.val ∧
colLattice (Ô E) ((sublatticeBasis h_left_inv W).val * A.val) = L ∧
discriminant r L = sublatticeDiscriminant h_left_inv W * genIndex A.val.det := by
classical
-- Take the rational column space of a basis of the lattice.
obtain ⟨x, a, hx, rfl⟩ := hL
obtain ⟨W, hW⟩ : ∃ W : Submodule E (κ → E), colSpan x = W := ⟨colSpan x, rfl⟩
obtain rfl : finrank E W = r := by
rw [← hW, LinearMap.finrank_range_of_inj hx.injective_mulVec, Module.finrank_fin_fun]
obtain ⟨A, hA_int, hA⟩ := exists_integral_sublatticeBasis_factor h_left_inv hW.le
(det_gram_ne_zero hx) a (colLattice_le_preimageLattice_iff.1 h_le)
refine ⟨W, A, rfl, hA_int, by rw [← hA], ?_⟩
rw [discriminant_colLattice hx, hA, sqrt_genIndex_det_gram_mul, sublatticeDiscriminant]
end Saturated
omit [Fintype κ] [DecidableEq κ] [IsCMField E] [HasPrimitiveRoot5040 E] in
/-- For an adelic matrix `B` with `r` columns, the sum of `[L : M] ^ (-(r + μ))` over the submodules
`M` of finite index in the span `L = colLattice (Ô E) B` of its columns is at most `ζ(μ) ^ r`, where
`ζ(μ) = idealZeta (Ô E) μ` is the sum of `[Ô : I] ^ (-μ)` over the ideals `I` of finite index. -/
lemma tsum_submoduleIndex_colLattice_inv_pow_le (B : Matrix κ (Fin r) (𝔸f E)) (μ : ℕ) :
∑' M : {M : Submodule (Ô E) (κ → 𝔸f E) // M ≤ colLattice (Ô E) B ∧
submoduleIndex M (colLattice (Ô E) B) ≠ 0},
(submoduleIndex M.val (colLattice (Ô E) B) : ℝ≥0∞)⁻¹ ^ (r + μ) ≤ idealZeta (Ô E) μ ^ r := by
obtain ⟨f, hf⟩ := exists_range_eq_colLattice (R := Ô E) B
rw [← hf, show idealZeta (Ô E) μ = submoduleZeta (Ô E) (Ô E) μ from (submoduleZeta_def ..).symm]
exact (tsum_relIndex_range_le_submoduleZeta f (r + μ)).trans
(submoduleZeta_pi_le (fun _ ↦
IsDedekindDomain.FiniteAdeleRing.isPrincipal_of_cardQuot_ne_zero (R := 𝓞 E) (K := E)) r μ)
omit [DecidableEq κ] [IsCMField E] [HasPrimitiveRoot5040 E] in
/-- For a lattice `L` of rank `r`, the sum of `[L : M] ^ (-(r + μ))` over the sublattices `M` of
finite index is at most `ζ(μ) ^ r`, where `ζ(μ) = idealZeta (Ô E) μ` is the sum of
`[Ô : I] ^ (-μ)` over the ideals `I` of finite index in `Ô`. (Hey's formula would give the sum
exactly, as a product of zeta values; only this bound is used, and it is proved without the
formula.) -/
theorem IsLatticeOfRank.tsum_submoduleIndex_inv_pow_le {L : Submodule (Ô E) (κ → 𝔸f E)}
(hL : IsLatticeOfRank r L) (μ : ℕ) :
∑' M : {M : Submodule (Ô E) (κ → 𝔸f E) // M ≤ L ∧ submoduleIndex M L ≠ 0},
(submoduleIndex M.val L : ℝ≥0∞)⁻¹ ^ (r + μ) ≤ idealZeta (Ô E) μ ^ r := by
obtain ⟨x, a, -, rfl⟩ := hL
exact tsum_submoduleIndex_colLattice_inv_pow_le _ μ
end New.Filling
end