# Hermitian lattices over number fields: trace form, genus, class-number finiteness: its Lean files in plain English

Written by AI from the Lean source at commit 40e56bab; each sentence checked against the code by a second pass.

Alpöge original · Cluster k0427 (https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/) · 26 Lean files, by distance from Main.lean · data: https://riemannhypothesissolved.com/api/file-lines/k0427.json

## Contents

- 9 import steps from Main:
  - [Formalism.HermitianLattices.DefsCS](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.DefsCS)
  - [Formalism.HermitianLattices.FinalNeighbourConstruct](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.FinalNeighbourConstruct)
- 10 import steps from Main:
  - [Formalism.FockGram.FockGramProofs.CovolGram](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.FockGram.FockGramProofs.CovolGram)
  - [Formalism.FockGram.StatementHerm](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.FockGram.StatementHerm)
  - [Formalism.HermitianLattices.DiscrFinite](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.DiscrFinite)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.AutFinite](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.AutFinite)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetAssembly](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetAssembly)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetFinite](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetFinite)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovol](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovol)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovolBound](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovolBound)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.GenusScale](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.GenusScale)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.IsomOfTrace](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.IsomOfTrace)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.MajBasic](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.MajBasic)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.MajDual](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.MajDual)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.MajLattice](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.MajLattice)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.OpBound](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.OpBound)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.ThetaBasic](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.ThetaBasic)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.ThetaSummable](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.ThetaSummable)
  - [Formalism.HermitianLattices.HermitianLatticesProofs.TraceReal](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.HermitianLatticesProofs.TraceReal)
  - [Formalism.HermitianLattices.StatementTheta](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.StatementTheta)
- 11 import steps from Main:
  - [Development.AutomorphicArithmetic.IntegralCasts.CapelliIdentities.CommonMajorizingLattice](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Development.AutomorphicArithmetic.IntegralCasts.CapelliIdentities.CommonMajorizingLattice)
  - [Formalism.AlphaUniqueness.Statement](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.AlphaUniqueness.Statement)
  - [Formalism.HermitianLattices.GenusCovolBound](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.GenusCovolBound)
  - [Formalism.HermitianLattices.ThetaLEuclid](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Formalism.HermitianLattices.ThetaLEuclid)
  - [Lemmata.GeneralBFactSecondRest.Imports](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Lemmata.GeneralBFactSecondRest.Imports)
  - [Lemmata.GeneralBFactSecondSide.Imports](https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/#Lemmata.GeneralBFactSecondSide.Imports)

## The files

### Formalism.HermitianLattices.DefsCS

9 import steps from Main · 64 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.DefsCS)

**Defines Euclidean trace realizations and auxiliary propositions for Hermitian lattice genera.**

The additive image construction regards a submodule's image as a ℤ-submodule. The propositions specify a Euclidean realization of the positive-definite trace form, equality of covolumes within a genus, and a single integer clearing the denominators of all pairings in that genus. They also state a uniform bound for independent short vectors, finiteness of intermediate subgroups when the quotient is finite, and recovery of Hermitian isometries from trace preservation by K-linear automorphisms. The proof modules use these definitions as theorem statements.

Key declarations:

- `Formalism.HermitianLatticesTheory.TraceReal`: A Hermitian form with positive-definite trace admits an additive Euclidean realization whose inner product is the trace pairing, in which each field scalar acts boundedly and each lattice maps to a discrete full lattice.

  ```lean
  def TraceReal : Prop := …
  ```
- `Formalism.HermitianLatticesTheory.GenusCovol`: In a common Euclidean realization of the positive-definite trace form, two lattices in the same genus have equal covolumes when both images are discrete full lattices.

  ```lean
  def GenusCovol : Prop := …
  ```
- `Formalism.HermitianLatticesTheory.ShortVectors`: For discrete full ℤ-lattices in Euclidean dimension N, a positive lower bound on nonzero vector lengths and an upper bound on covolume give a uniform upper bound on the lengths of N real-linearly independent lattice vectors.

  ```lean
  def ShortVectors : Prop :=
    ∀ (N : ℕ) (c C : ℝ), 0 < c → ∃ B : ℝ, ∀ (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin N)))
      [DiscreteTopology Λ] [IsZLattice ℝ Λ],
      (∀ v ∈ Λ, v ≠ 0 → c ≤ ‖v‖) → ZLattice.covolume Λ ≤ C →
      ∃ v : Fin N → EuclideanSpace ℝ (Fin N), (∀ i, v i ∈ Λ) ∧ LinearIndependent ℝ v ∧
        ∀ i, ‖v i‖ ≤ B
  ```
- `Formalism.HermitianLatticesTheory.GenusScale`: One positive integer makes every Hermitian pairing of two vectors in any lattice of a fixed genus integral.

  ```lean
  def GenusScale : Prop :=
    ∀ (K V : Type) [Field K] [NumberField K] [StarRing K] [AddCommGroup V] [Module K V]
      [FiniteDimensional K V] [Module (NumberField.RingOfIntegers K) V]
      [IsScalarTower (NumberField.RingOfIntegers K) K V]
      (h : V →ₗ⋆[K] V →ₗ[K] K), h.IsSymm →
      ∀ L : Submodule (NumberField.RingOfIntegers K) V, Submodule.IsLattice K L →
      ∃ d : ℕ, 0 < d ∧ ∀ M ∈ genus h L, ∀ x ∈ M, ∀ y ∈ M,
        (d : K) * h x y ∈ (1 : Submodule (NumberField.RingOfIntegers K) K)
  ```
- `Formalism.HermitianLatticesTheory.IsomOfTrace`: A K-linear automorphism preserving the rational trace pairing also preserves the original sesquilinear form.

  ```lean
  def IsomOfTrace : Prop :=
    ∀ (K V : Type) [Field K] [NumberField K] [StarRing K] [AddCommGroup V] [Module K V]
      (h : V →ₗ⋆[K] V →ₗ[K] K) (g : V ≃ₗ[K] V),
      (∀ x y : V, Algebra.trace ℚ K (h (g x) (g y)) = Algebra.trace ℚ K (h x y)) → g ∈ isom h
  ```

### Formalism.HermitianLattices.FinalNeighbourConstruct

9 import steps from Main · 47 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.FinalNeighbourConstruct)

**Collects existing theorems on Hermitian lattice duality, Euclidean trace realizations, and finiteness in a genus.**

The theorem aliases re-export duality and localization laws, genus invariance of integrality and unimodularity, and the Euclidean trace realization with its short-vector and covolume results. For positive-definite trace forms, the theta-orbit-sum development uses the class and automorphism finiteness theorems to choose one representative per isometry class and clear the denominators of inverse automorphism weights.

Key declarations:

- `Formalism.HermitianLatticesTheory.final_locDual`: For a Hermitian form over the fraction field of an involution-stable domain and a finitely generated submodule, duality commutes with Hermitian localization, which inverts elements outside the prime whose conjugates also lie outside it, and unimodularity is equivalent to Hermitian-local unimodularity at every maximal ideal.

  ```lean
  theorem final_locDual : LocDual := …
  ```
- `Formalism.HermitianLatticesTheory.final_traceReal`: A positive-definite rational trace pairing is realized as a Euclidean inner product by an additive map under which each field scalar acts boundedly and each lattice has discrete full image.

  ```lean
  theorem final_traceReal : TraceReal := …
  ```
- `Formalism.HermitianLatticesTheory.final_genusCovol`: Lattices in the same genus have equal covolumes when their images under a common positive-definite trace realization are discrete full lattices.

  ```lean
  theorem final_genusCovol : GenusCovol := …
  ```
- `Formalism.HermitianLatticesTheory.final_autFinite`: The group of ambient Hermitian isometries stabilizing a lattice is finite when the rational trace pairing is positive definite.

  ```lean
  theorem final_autFinite : AutFinite := …
  ```
- `Formalism.HermitianLatticesTheory.final_classSetFinite`: For a positive-definite rational trace pairing, every genus admits a finite set of lattices meeting every Hermitian isometry class in the genus.

  ```lean
  theorem final_classSetFinite : ClassSetFinite := …
  ```

### Formalism.FockGram.FockGramProofs.CovolGram

10 import steps from Main · 34 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.FockGram.FockGramProofs.CovolGram)

**Proves that the covolume of the lattice generated by a real basis is the square root of its Gram determinant.**

In orthonormal coordinates, the volume of the basis parallelepiped is the absolute determinant of the coordinate matrix A. The Gram matrix is AᵀA, whose determinant is the square of det A. The Hermitian-lattice genus proofs use the formula to express covolumes through Gram determinants and turn determinant bounds into covolume bounds.

Key declarations:

- `Formalism.E.covolumeEqSqrtDetGram`: For any basis of a finite-dimensional real inner product space, the covolume of its integer span equals the square root of the determinant of its Gram matrix.

  ```lean
  theorem covolumeEqSqrtDetGram : CovolGram := …
  ```

### Formalism.FockGram.StatementHerm

10 import steps from Main · 38 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.FockGram.StatementHerm)

**Defines the sesquilinear dual and states Gram determinant formulas for the dual index and the trace pairing.**

The dual consists of vectors whose pairings with the original submodule in the first argument lie in the coefficient ring’s image. If the coefficient ring embeds in K with involution-stable image, a basis span lies in its dual exactly when the Gram entries are integral. Under the same hypotheses, over a ring finite free over ℤ, a nonzero integral Gram determinant gives dual index equal to its absolute norm and self-duality exactly when it is a unit. In the product basis from the S-basis and the ℤ-basis of S, the trace Gram determinant is the original determinant’s norm times the rank-th power of the involutive trace-pairing determinant in that ℤ-basis. Lattice duality uses this dual.

Key declarations:

- `Formalism.E.hdual`: Defines the dual as the intersection, over vectors y in the submodule, of the inverse images of the coefficient ring’s image under x ↦ B(y,x).

  ```lean
  def hdual {S K V : Type*} [CommRing S] [Field K] [StarRing K] [Algebra S K] [AddCommGroup V]
      [Module K V] [Module S V] [IsScalarTower S K V] (B : V →ₗ⋆[K] V →ₗ[K] K)
      (L : Submodule S V) : Submodule S V :=
    ⨅ y ∈ L, (1 : Submodule S K).comap ((B y).restrictScalars S)
  ```
- `Formalism.E.HermDual`: States the Gram-entry criterion for containment in the dual over an involution-stable subring, together with the norm formula for the index and the unit criterion for self-duality when the subring is finite free over ℤ and the integral Gram determinant is nonzero.

  ```lean
  def HermDual : Prop := …
  ```
- `Formalism.E.HermTraceGram`: States that the Gram determinant of the traced form in the product basis is the norm of the original Gram determinant times the rank-th power of the determinant of the pairing (a,b) ↦ Tr(star(a) · b) on the coefficient ring.

  ```lean
  def HermTraceGram : Prop :=
    ∀ (S M ι κ : Type) [CommRing S] [StarRing S] [AddCommGroup M] [Module S M]
      [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ]
      (B : M →ₗ⋆[S] M →ₗ[S] S) (b : Basis ι S M) (ω : Basis κ ℤ S),
      (Matrix.of fun p q : ι × κ => Algebra.trace ℤ S (B (ω p.2 • b p.1) (ω q.2 • b q.1))).det =
        (Matrix.of fun k l : κ => Algebra.trace ℤ S (star (ω k) * ω l)).det ^ Fintype.card ι *
          Algebra.norm ℤ (sgram B b).det
  ```

### Formalism.HermitianLattices.DiscrFinite

10 import steps from Main · 61 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.DiscrFinite)

**Defines the trace discriminant module and states finiteness and Weil transformation laws for Hermitian lattice theta vectors.**

The discriminant module is the trace dual modulo its intersection with the lattice. A chosen representative of each class supplies both the quadratic phase and the shift for its theta component. For full trace-integral lattices with positive-definite Hermitian trace pairing, the module states finiteness of the discriminant module. With the same hypotheses, even trace norms, and a finite discriminant module, it states nondegeneracy of the quadratic phase and the Weil laws for translation and inversion, with weight half the rational dimension.

Key declarations:

- `Formalism.HermitianLatticesTheory.discr`: Forms the quotient of the trace dual by its intersection with the lattice.

  ```lean
  abbrev discr (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (NumberField.RingOfIntegers K) V) : Type _ :=
    (tdualSub h L) ⧸ (L.comap (tdualSub h L).subtype)
  ```
- `Formalism.HermitianLatticesTheory.qDiscr`: Assigns to each class the exponential of πi times the trace norm of its chosen representative.

  ```lean
  def qDiscr (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (NumberField.RingOfIntegers K) V)
      (δ : discr h L) : ℂ :=
    Complex.exp (Real.pi * Complex.I *
      ((Algebra.trace ℚ K (h (drep h L δ) (drep h L δ)) : ℚ) : ℂ))
  ```
- `Formalism.HermitianLatticesTheory.thetaVec`: Indexes shifted lattice theta series by discriminant classes, using the chosen representative as the shift.

  ```lean
  def thetaVec (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (NumberField.RingOfIntegers K) V) (τ : ℂ)
      (δ : discr h L) : ℂ :=
    thetaL h L (drep h L δ) τ
  ```
- `Formalism.HermitianLatticesTheory.ThetaWeil`: States that for a full trace-integral lattice with positive-definite Hermitian trace pairing, even trace norms, and finite discriminant module, the phase is a nondegenerate unitary quadratic function and the theta vector transforms by Weil T under τ ↦ τ + 1 and by Weil S times (−iτ) to half the rational dimension under upper-half-plane inversion.

  ```lean
  def ThetaWeil : Prop := …
  ```
- `Formalism.HermitianLatticesTheory.DiscrFinite`: States that a full lattice contained in its trace dual has finite discriminant module when the Hermitian trace pairing is positive definite.

  ```lean
  def DiscrFinite : Prop :=
    ∀ (K V : Type) [Field K] [NumberField K] [StarRing K] [AddCommGroup V] [Module K V]
      [FiniteDimensional K V] [Module (NumberField.RingOfIntegers K) V]
      [IsScalarTower (NumberField.RingOfIntegers K) K V]
      (h : V →ₗ⋆[K] V →ₗ[K] K), h.IsSymm →
      (∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x)) →
      ∀ L : Submodule (NumberField.RingOfIntegers K) V, Submodule.IsLattice K L →
      L ≤ tdualSub h L → Finite (discr h L)
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.AutFinite

10 import steps from Main · 79 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.AutFinite)

**Proves finiteness of bounded trace sublevel sets and of automorphism groups of Hermitian lattices with positive-definite trace form.**

Writing q(v) = Tr_{K/ℚ}(h(v,v)), summability of the theta series at i implies that only finitely many lattice vectors satisfy q(v) ≤ R, since each contributes at least exp(−πR). A lattice automorphism is determined by the images of finitely many lattice generators, and those images lie in a common finite trace sublevel set. The two results are used to prove finiteness of sets of vectors representing a fixed form value and of stabilizers in a unitary double-coset space.

Key declarations:

- `Formalism.HermitianLatticesTheory.autFinite_short`: If the trace of the diagonal of a sesquilinear form is positive on every nonzero vector, only finitely many lattice vectors have diagonal trace at most a given rational bound.

  ```lean
  lemma autFinite_short (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x))
      (L : Submodule (NumberField.RingOfIntegers K) V) [Submodule.IsLattice K L] (R : ℚ) :
      Set.Finite {v : V | v ∈ L ∧ Algebra.trace ℚ K (h v v) ≤ R} := …
  ```
- `Formalism.HermitianLatticesTheory.autFinite`: For a Hermitian form with positive-definite trace form on a finite-dimensional vector space over a number field K, the group of K-linear isometries preserving a given lattice over the ring of integers of K is finite.

  ```lean
  theorem autFinite : AutFinite := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetAssembly

10 import steps from Main · 759 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetAssembly)

**Proves a finiteness criterion for Hermitian lattice isometry classes and applies it to a genus.**

A common denominator d gives a lower bound of 1/d on the Euclidean norms of nonzero lattice vectors, so a covolume bound yields uniformly short independent vectors via the short-vector theorem. Their trace Gram matrices, including pairings with integral-basis multiples, take finitely many values and determine the frames up to K-linear trace isometry. For each matrix tuple, the Gram determinant confines the transported lattices between a fixed integer span and a finite-index enlargement. The genus specialization is used to prove class-set finiteness.

Key declarations:

- `Formalism.HermitianLatticesTheory.classSetAssembly_denom`: If a positive integer makes the trace Gram matrix of a full frame integral, its scaled matrix determinant clears the frame coordinates of every vector whose pairings with the frame become integral under the same scaling.

  ```lean
  theorem classSetAssembly_denom {n : ℕ} (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x))
      (ι : V →+ EuclideanSpace ℝ (Fin n))
      (hι : ∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ))
      (u : Fin n → V) (hu : LinearIndependent ℝ (ι ∘ u)) (d : ℕ) (hd : 0 < d)
      (hint : ∀ i j, ∃ z : ℤ, (d : ℚ) * Algebra.trace ℚ K (h (u i) (u j)) = z) :
      ∃ e : ℤ, e ≠ 0 ∧ ∀ x : V, (∀ j, ∃ z : ℤ, (d : ℚ) * Algebra.trace ℚ K (h x (u j)) = z) →
        e • x ∈ AddSubgroup.closure (Set.range u) := …
  ```
- `Formalism.HermitianLatticesTheory.classSetAssembly_exists_isom`: Two full frames with matching trace Gram matrices and matching trace pairings after multiplication in the first slot by each element of a rational basis of K are related by a K-linear trace isometry.

  ```lean
  theorem classSetAssembly_exists_isom {n : ℕ} (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x))
      (ι : V →+ EuclideanSpace ℝ (Fin n))
      (hι : ∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ))
      {κ : Type*} [Fintype κ] (ω : Basis κ ℚ K)
      (u u' : Fin n → V) (hu : LinearIndependent ℝ (ι ∘ u)) (hu' : LinearIndependent ℝ (ι ∘ u'))
      (hG : ∀ i l, Algebra.trace ℚ K (h (u i) (u l)) = Algebra.trace ℚ K (h (u' i) (u' l)))
      (hA : ∀ k i l, Algebra.trace ℚ K (h (ω k • u i) (u l)) =
        Algebra.trace ℚ K (h (ω k • u' i) (u' l))) :
      ∃ φ : V ≃ₗ[K] V, (∀ x y, Algebra.trace ℚ K (h (φ x) (φ y)) = Algebra.trace ℚ K (h x y)) ∧
        ∀ i, φ (u i) = u' i := …
  ```
- `Formalism.HermitianLatticesTheory.classSetAssembly_main`: Given a positive-definite Euclidean realization of the trace form with bounded scalar multiplication, a family with a common denominator and uniformly short full frames admits a finite set of Hermitian isometry representatives, assuming intermediate-subgroup finiteness and recovery of Hermitian isometries from K-linear trace isometries.

  ```lean
  theorem classSetAssembly_main (hE : FinIntermediate) (hF : IsomOfTrace)
      (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x))
      {n : ℕ} (ι : V →+ EuclideanSpace ℝ (Fin n))
      (hι : ∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ))
      (hmul : ∀ a : K, ∃ C : ℝ, ∀ x : V, ‖ι (a • x)‖ ≤ C * ‖ι x‖)
      (d : ℕ) (hd : 0 < d) (S : Set (Submodule (NumberField.RingOfIntegers K) V))
      (hdM : ∀ M ∈ S, ∀ x ∈ M, ∀ y ∈ M,
        (d : K) * h x y ∈ (1 : Submodule (NumberField.RingOfIntegers K) K))
      (B : ℝ)
      (hgood : ∀ M ∈ S, ∃ u : Fin n → V, (∀ i, u i ∈ M) ∧ LinearIndependent ℝ (ι ∘ u) ∧
        ∀ i, ‖ι (u i)‖ ≤ B) :
      ∃ s : Finset (Submodule (NumberField.RingOfIntegers K) V), (∀ M ∈ s, M ∈ S) ∧
        ∀ M ∈ S, ∃ N ∈ s, ∃ g ∈ isom h, gmap g N = M := …
  ```
- `Formalism.HermitianLatticesTheory.classSetFinite_core`: Under the same realization, subgroup, and isometry hypotheses, a common integral scaling and discrete full ℤ-lattice images of uniformly bounded covolume give uniformly short full frames via the short-vector theorem and hence finitely many Hermitian isometry representatives.

  ```lean
  theorem classSetFinite_core (hC : ShortVectors) (hE : FinIntermediate) (hF : IsomOfTrace)
      {K V : Type} [Field K] [NumberField K] [StarRing K] [AddCommGroup V] [Module K V]
      [Module (NumberField.RingOfIntegers K) V] [IsScalarTower (NumberField.RingOfIntegers K) K V]
      (h : V →ₗ⋆[K] V →ₗ[K] K) (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x))
      (n : ℕ) (ι : V →+ EuclideanSpace ℝ (Fin n))
      (hι : ∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ))
      (hmul : ∀ a : K, ∃ C : ℝ, ∀ x : V, ‖ι (a • x)‖ ≤ C * ‖ι x‖)
      (d : ℕ) (hd : 0 < d) (C : ℝ) (S : Set (Submodule (NumberField.RingOfIntegers K) V))
      (hSd : ∀ M ∈ S, ∀ x ∈ M, ∀ y ∈ M,
        (d : K) * h x y ∈ (1 : Submodule (NumberField.RingOfIntegers K) K))
      (hSlat : ∀ M ∈ S, ∃ _ : DiscreteTopology (zmap ι M), IsZLattice ℝ (zmap ι M))
      (hSC : ∀ M ∈ S, ∀ [DiscreteTopology (zmap ι M)] [IsZLattice ℝ (zmap ι M)],
        ZLattice.covolume (zmap ι M) ≤ C) :
      ∃ s : Finset (Submodule (NumberField.RingOfIntegers K) V), (∀ N ∈ s, N ∈ S) ∧
        ∀ M ∈ S, ∃ N ∈ s, ∃ g ∈ isom h, gmap g N = M := …
  ```
- `Formalism.HermitianLatticesTheory.classSetFinite_of`: Combines trace realization, genus covolume and denominator bounds, the short-vector theorem, intermediate-subgroup finiteness, and recovery of Hermitian isometries from trace isometries to prove finiteness of isometry classes in a genus.

  ```lean
  theorem classSetFinite_of (hA : TraceReal) (hB : GenusCovolBound) (hC : ShortVectors)
      (hD : GenusScale) (hE : FinIntermediate) (hF : IsomOfTrace) : ClassSetFinite := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetFinite

10 import steps from Main · 14 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.ClassSetFinite)

**Proves finiteness of the isometry classes in a genus of Hermitian lattices.**

For a finite-dimensional space over a number field, a symmetric Hermitian form whose trace is positive on nonzero vectors, and a lattice over the ring of integers, classSetFinite gives finitely many representatives in the genus whose isometric images cover it. The proof applies the class-set finiteness assembly theorem to results on the real trace form, covolume bounds, short vectors, genus scaling, intermediate lattices, and isometries of trace forms. The result is restated as final_classSetFinite in FinalNeighbourConstruct.

Key declarations:

- `Formalism.HermitianLatticesTheory.classSetFinite`: Establishes that every lattice in the genus is isometric to one of finitely many lattices in that genus, under the stated trace-positivity hypothesis.

  ```lean
  theorem classSetFinite : ClassSetFinite := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovol

10 import steps from Main · 611 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovol)

**Proves that Euclidean covolume for a positive-definite trace form is constant within a Hermitian lattice genus.**

Inverting the trace Gram matrix constructs a basis for the trace dual and shows that its covolume is reciprocal to the original covolume. The squared covolume is the ratio of the indices of the intersection in the dual and in the original lattice, respectively. Local Hermitian isometries match both lattices and their trace duals, and induction on finite index turns these local identifications into equality of the two global indices across the genus. The same index lemma is used to prove genus invariance of the discriminant order of integral Hermitian lattices.

Key declarations:

- `Formalism.HermitianLatticesTheory.genusCovol_tdual`: Defines the trace dual of a lattice L as the module of vectors y for which Tr_{K/ℚ}(h(x,y)) is integral for every x in L.

  ```lean
  def genusCovol_tdual (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (𝓞 K) V) : Submodule (𝓞 K) V
  ```
- `Formalism.HermitianLatticesTheory.genusCovol_lemmaS`: Two inclusions of finite additive index have equal indices if, at every maximal ideal, an injective additive map identifies both localized submodules of the first inclusion with their counterparts in the second.

  ```lean
  theorem genusCovol_lemmaS : ∀ (n : ℕ) (X Y X' Y' : Submodule R W), X ≤ Y → X' ≤ Y' →
      X.toAddSubgroup.relIndex Y.toAddSubgroup = n → n ≠ 0 →
      X'.toAddSubgroup.relIndex Y'.toAddSubgroup ≠ 0 →
      (∀ (P : Ideal R) [P.IsMaximal], ∃ f : W →+ W, Function.Injective f ∧
        (locS P.primeCompl X).toAddSubgroup.map f = (locS P.primeCompl X').toAddSubgroup ∧
        (locS P.primeCompl Y).toAddSubgroup.map f = (locS P.primeCompl Y').toAddSubgroup) →
      X'.toAddSubgroup.relIndex Y'.toAddSubgroup = n := …
  ```
- `Formalism.HermitianLatticesTheory.genusCovol_sq`: In a Euclidean realization preserving the positive-definite trace pairing where A maps to a discrete full lattice, if a positive integer multiple of A lies in its trace dual A*, then J = A ∩ A* has finite index in both and the squared trace covolume of A is [A*:J] divided by [A:J].

  ```lean
  theorem genusCovol_sq (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x)) (N : ℕ)
      (ι : V →+ EuclideanSpace ℝ (Fin N))
      (hι : ∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ))
      (A : Submodule (𝓞 K) V) [DiscreteTopology (zmap ι A)] [IsZLattice ℝ (zmap ι A)]
      (D : ℕ) (hD0 : 0 < D) (hD : ∀ x ∈ A, D • x ∈ genusCovol_tdual h A) :
      (A ⊓ genusCovol_tdual h A).toAddSubgroup.relIndex A.toAddSubgroup ≠ 0 ∧
      (A ⊓ genusCovol_tdual h A).toAddSubgroup.relIndex (genusCovol_tdual h A).toAddSubgroup ≠ 0 ∧
      ZLattice.covolume (zmap ι A) ^ 2 *
          ((A ⊓ genusCovol_tdual h A).toAddSubgroup.relIndex A.toAddSubgroup : ℝ) =
        ((A ⊓ genusCovol_tdual h A).toAddSubgroup.relIndex (genusCovol_tdual h A).toAddSubgroup : ℝ) := …
  ```
- `Formalism.HermitianLatticesTheory.genusCovol_local`: An isometry witnessing Hermitian local equivalence at a prime identifies the ordinary localizations of the two finitely generated modules and of their trace duals.

  ```lean
  theorem genusCovol_local (h : V →ₗ⋆[K] V →ₗ[K] K) (L M : Submodule (𝓞 K) V) (hLfg : L.FG)
      (hMfg : M.FG) (P : Ideal (𝓞 K)) [P.IsPrime] (g : V ≃ₗ[K] V) (hg : g ∈ isom h)
      (hgL : gmap g (loc (K := K) P L) = loc (K := K) P M) :
      gmap g (locS P.primeCompl L) = locS P.primeCompl M ∧
      gmap g (locS P.primeCompl (genusCovol_tdual h L)) =
        locS P.primeCompl (genusCovol_tdual h M) := …
  ```
- `Formalism.HermitianLatticesTheory.genusCovol`: Two Hermitian lattices in the same genus have equal covolume in any common Euclidean realization of the positive-definite trace form in which both images are full lattices.

  ```lean
  theorem genusCovol : GenusCovol := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovolBound

10 import steps from Main · 334 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.GenusCovolBound)

**Proves a uniform upper bound on the Euclidean trace covolumes of lattices in a Hermitian genus.**

Hermitian duals of lattices in one genus lie in one genus, so a single positive integer d clears their Hermitian pairings. The field discriminant Δ sends each trace dual into the corresponding Hermitian dual, so D = dΔ² clears the trace pairings on every trace dual. The scaled inverse Gram matrix then has positive integer determinant, giving the covolume bound D^(N/2) in Euclidean dimension N. The class-set finiteness proof uses this uniform bound.

Key declarations:

- `Formalism.HermitianLatticesTheory.genusCovolBound_covol_le`: A full Euclidean trace lattice in dimension N has covolume at most D^(N/2) if multiplying the trace form by the positive integer D makes all pairings on its trace dual integral.

  ```lean
  theorem genusCovolBound_covol_le (h : V →ₗ⋆[K] V →ₗ[K] K) (N : ℕ)
      (ι : V →+ EuclideanSpace ℝ (Fin N))
      (hι : ∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ))
      (M : Submodule (𝓞 K) V) [DiscreteTopology (zmap ι M)] [IsZLattice ℝ (zmap ι M)]
      (D : ℕ) (hD0 : 0 < D)
      (hD : ∀ y y' : V, (∀ x ∈ M, ∃ z : ℤ, Algebra.trace ℚ K (h x y) = z) →
         (∀ x ∈ M, ∃ z : ℤ, Algebra.trace ℚ K (h x y') = z) →
         ∃ z : ℤ, (D : ℚ) * Algebra.trace ℚ K (h y y') = z) :
      ZLattice.covolume (zmap ι M) ≤ Real.sqrt ((D : ℝ) ^ N) := …
  ```
- `Formalism.HermitianLatticesTheory.genusCovolBound_dualAt_gmap`: Taking the local Hermitian dual at an ideal commutes with the action of a Hermitian isometry.

  ```lean
  theorem genusCovolBound_dualAt_gmap (h : V →ₗ⋆[K] V →ₗ[K] K) (g : V ≃ₗ[K] V) (hg : g ∈ isom h)
      (p : Ideal (𝓞 K)) (X : Submodule (𝓞 K) V) :
      dualAt h p (gmap g X) = gmap g (dualAt h p X) := …
  ```
- `Formalism.HermitianLatticesTheory.genusCovolBound_dual_genus`: For a nondegenerate Hermitian form whose involution preserves the ring of integers, the duals of two lattices in the same genus belong to the same genus.

  ```lean
  theorem genusCovolBound_dual_genus [FiniteDimensional K V] (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hs : h.IsSymm) (hnd : h.Nondegenerate)
      (hstar : ∀ r : 𝓞 K, star (algebraMap (𝓞 K) K r) ∈ Set.range (algebraMap (𝓞 K) K))
      (L : Submodule (𝓞 K) V) (hL : Submodule.IsLattice K L) (M : Submodule (𝓞 K) V)
      (hM : M ∈ genus h L) : dual h M ∈ genus h (dual h L) := …
  ```
- `Formalism.HermitianLatticesTheory.genusCovolBound_discr`: Multiplication by the field discriminant sends the trace dual of the ring of integers into the ring of integers.

  ```lean
  theorem genusCovolBound_discr (a : K)
      (ha : ∀ r : 𝓞 K, ∃ z : ℤ, Algebra.trace ℚ K (a * algebraMap (𝓞 K) K r) = z) :
      ((NumberField.discr K : ℤ) : K) * a ∈ (1 : Submodule (𝓞 K) K) := …
  ```
- `Formalism.HermitianLatticesTheory.genusCovolBound`: For a positive-definite trace form realized in Euclidean space, one upper bound applies to the covolumes of all full Euclidean lattice images in a given Hermitian genus.

  ```lean
  theorem genusCovolBound : GenusCovolBound := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.GenusScale

10 import steps from Main · 114 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.GenusScale)

**Proves that one positive integer clears all Hermitian pairings on every lattice in a genus.**

The proof multiplies the denominators of all pairings of a finite generating set, then uses sesquilinearity to extend integrality to the whole lattice. Local isometries transfer the scaled pairings to each lattice in the genus, and the local-to-global membership criterion gives integrality over the ring of integers. The covolume and class-set finiteness proofs use this common denominator.

Key declarations:

- `Formalism.HermitianLatticesTheory.genusScale_span`: Over a coefficient ring embedded in K and stable under the involution, integrality of the scaled pairings of generators implies integrality of all scaled pairings on their span.

  ```lean
  theorem genusScale_span (hinj : Function.Injective (algebraMap R K))
      (hstar : ∀ r : R, star (algebraMap R K r) ∈ Set.range (algebraMap R K))
      (h : V →ₗ⋆[K] V →ₗ[K] K) (c : K) (s : Set V)
      (hs : ∀ a ∈ s, ∀ b ∈ s, c * h a b ∈ (1 : Submodule R K)) :
      ∀ x ∈ Submodule.span R s, ∀ y ∈ Submodule.span R s, c * h x y ∈ (1 : Submodule R K) := …
  ```
- `Formalism.HermitianLatticesTheory.genusScale_transfer`: Over such a coefficient ring, a scalar that makes all pairings integral on one module does the same on any module in its Hermitian genus.

  ```lean
  theorem genusScale_transfer (hinj : Function.Injective (algebraMap R K))
      (hstar : ∀ r : R, star (algebraMap R K r) ∈ Set.range (algebraMap R K))
      (h : V →ₗ⋆[K] V →ₗ[K] K) (c : K) (L M : Submodule R V) (hLM : SameGenus h L M)
      (hL : ∀ x ∈ L, ∀ y ∈ L, c * h x y ∈ (1 : Submodule R K)) :
      ∀ x ∈ M, ∀ y ∈ M, c * h x y ∈ (1 : Submodule R K) := …
  ```
- `Formalism.HermitianLatticesTheory.exists_nat_pos_mul_mem_one`: Every element of a number field has a positive integer multiple in its ring of integers.

  ```lean
  private theorem exists_nat_pos_mul_mem_one {K : Type} [Field K] [NumberField K] (z : K) :
      ∃ n : ℕ, 0 < n ∧ (n : K) * z ∈ (1 : Submodule (𝓞 K) K) := …
  ```
- `Formalism.HermitianLatticesTheory.genusScale`: For a Hermitian lattice over the ring of integers of a number field, there is a positive integer d such that d times the Hermitian form takes integral values on each lattice in its genus.

  ```lean
  theorem genusScale : GenusScale := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.IsomOfTrace

10 import steps from Main · 27 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.IsomOfTrace)

**Proves that a K-linear automorphism preserving the rational trace pairing also preserves the original sesquilinear form.**

If two form values before and after applying the automorphism differ, scaling the second argument by the inverse of their difference forces the trace of 1 to vanish, contradicting Tr_{K/ℚ}(1) = [K:ℚ]. The class-set finiteness proof uses this result to turn K-linear trace isometries into Hermitian isometries.

Key declarations:

- `Formalism.HermitianLatticesTheory.isomOfTrace`: For a K-valued sesquilinear form over a number field K, every K-linear automorphism preserving the pairing Tr_{K/ℚ} ∘ h preserves h itself.

  ```lean
  theorem isomOfTrace : IsomOfTrace := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.MajBasic

10 import steps from Main · 25 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.MajBasic)

**Records a coordinate identity for the majorant pairing at an archimedean place.**

For arbitrary square matrices X_v, the majorant pairs the two embedded coordinate vectors after applying Lean’s totalized matrix inverse X_v⁻¹ to each. Moving the inverse from the first argument to the second as its conjugate transpose gives the matrix (X_v⁻¹)* X_v⁻¹ in the original coordinates.

Key declarations:

- `Formalism.HermitianLatticesTheory.majBasic_majAt`: At an infinite place v, the majorant of x and y is x_v* (X_v⁻¹)* X_v⁻¹ y_v, where x_v and y_v are the embedded basis coordinates and * denotes conjugate transpose.

  ```lean
  theorem majBasic_majAt (b : Module.Basis ι K V) (X : InfinitePlace K → Matrix ι ι ℂ)
      (v : InfinitePlace K) (x y : V) :
      majAt b X v x y = star (vecAt b v x) ⬝ᵥ ((((X v)⁻¹)ᴴ * (X v)⁻¹) *ᵥ vecAt b v y) := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.MajDual

10 import steps from Main · 440 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.MajDual)

**Identifies the Euclidean dual of an archimedean majorant lattice and relates trace duality to the inverse different.**

Over a totally complex field with signature frames at every infinite place and embeddings intertwining the involution with conjugation, the signed Euclidean pairing equals half the rational trace pairing. For a discrete full Euclidean lattice image, inverting the rational Gram matrix gives every dual vector as a signed realization with even trace pairings against the lattice. The trace dual is the inverse-different-valued Hermitian dual, which for a unimodular lattice is its product with the inverse different. The proof that the coordinate Hermitian dual is a lattice uses preservation of algebraic integers under the field involution.

Key declarations:

- `Formalism.HermitianLatticesTheory.majDual_inner`: Over a totally complex field with archimedean signature frames and embeddings that intertwine the field involution with complex conjugation, the signed Euclidean pairing equals half the field trace of the Hermitian pairing.

  ```lean
  lemma majDual_inner [IsTotallyComplex K] (h : V →ₗ⋆[K] V →ₗ[K] K) (b : Module.Basis ι K V)
      (X : InfinitePlace K → Matrix ι ι ℂ)
      (hst : ∀ (φ : K →+* ℂ) (a : K), φ (star a) = starRingEnd ℂ (φ a))
      (hX : ∀ v, IsFrame h b v (X v)) (x y : V) :
      inner ℝ (realize b X x) (jW h b X (realize b X y)) =
        ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ) / 2 := …
  ```
- `Formalism.HermitianLatticesTheory.majDual_tdual`: A vector lies in the trace dual exactly when all its Hermitian pairings against the lattice lie in the inverse different.

  ```lean
  lemma majDual_tdual (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (RingOfIntegers K) V) (y : V) :
      y ∈ tdual h L ↔ y ∈ dualI h L (invDiff K) := …
  ```
- `Formalism.HermitianLatticesTheory.majDual_unimod`: For a Hermitian-unimodular lattice L, the inverse-different-valued dual is the product of the inverse different with L.

  ```lean
  lemma majDual_unimod (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (RingOfIntegers K) V)
      (hU : IsUnimodular h L) (y : V) :
      y ∈ dualI h L (invDiff K) ↔ y ∈ idealSmul (invDiffSub K) L := …
  ```
- `Formalism.HermitianLatticesTheory.majDual_zdual`: Over a totally complex field with embeddings compatible with the involution and signature frames at every infinite place, the Euclidean dual of the discrete full lattice image consists exactly of signed realizations of vectors whose trace pairings with L lie in 2ℤ.

  ```lean
  lemma majDual_zdual [IsTotallyComplex K] (h : V →ₗ⋆[K] V →ₗ[K] K) (b : Module.Basis ι K V)
      (X : InfinitePlace K → Matrix ι ι ℂ)
      (hst : ∀ (φ : K →+* ℂ) (a : K), φ (star a) = starRingEnd ℂ (φ a))
      (hX : ∀ v, IsFrame h b v (X v)) (L : Submodule (RingOfIntegers K) V)
      [DiscreteTopology (zmap (realize b X) L)] [IsZLattice ℝ (zmap (realize b X) L)]
      (w : EuclideanSpace ℝ (InfinitePlace K × ι × Fin 2)) :
      w ∈ Formalism.HadamardInequality.zdual (zmap (realize b X) L) ↔
        ∃ y : V, (∀ x ∈ L, ∃ z : ℤ, Algebra.trace ℚ K (h x y) = 2 * z) ∧
          w = jW h b X (realize b X y) := …
  ```
- `Formalism.HermitianLatticesTheory.majDual`: For a full Hermitian lattice over a totally complex field with compatible embeddings and signature frames, the majorant realization is a discrete full Euclidean lattice with the stated signed Euclidean dual and inverse-different-valued trace dual, which is the product of the inverse different with the lattice in the unimodular case.

  ```lean
  theorem majDual : MajDual := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.MajLattice

10 import steps from Main · 203 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.MajLattice)

**Proves that the archimedean majorant realization of a lattice over a totally complex field is a full Euclidean lattice.**

At each complex place the realization applies the inverse X(v)⁻¹ of the invertible coordinate matrix at place v and separates real and imaginary parts, giving a real linear isomorphism from the product of Minkowski spaces. Integral-basis multiples of the chosen field-basis vectors give a real basis after realization. A common integer denominator puts the scaled lattice image inside the integer span of this basis, proving discreteness, while nonzero multiples of the basis vectors in the image prove full real span. The majorant duality theorem uses both properties.

Key declarations:

- `Formalism.HermitianLatticesTheory.majLattice_T_injective`: The real coordinate map from the product of Minkowski spaces is injective when every archimedean coordinate matrix is invertible.

  ```lean
  theorem majLattice_T_injective (X : InfinitePlace K → Matrix ι ι ℂ)
      (hX : ∀ v, IsUnit (X v).det) : Function.Injective (majLattice_alt X) := …
  ```
- `Formalism.HermitianLatticesTheory.majLattice_B_apply`: Each vector of the constructed real basis is the realization of a chosen K-basis vector multiplied by an element of the integral basis of K.

  ```lean
  theorem majLattice_B_apply (b : Basis ι K V) (X : InfinitePlace K → Matrix ι ι ℂ)
      (hX : ∀ v, IsUnit (X v).det) (k : Σ _ : ι, Free.ChooseBasisIndex ℤ (𝓞 K)) :
      majLattice_B X hX k = realize b X (integralBasis K k.2 • b k.1) := …
  ```
- `Formalism.HermitianLatticesTheory.majLattice_exists_d`: For a finitely generated module over the ring of integers, one nonzero integer clears all denominators in its coordinates relative to a fixed K-basis.

  ```lean
  theorem majLattice_exists_d (b : Basis ι K V) (L : Submodule (𝓞 K) V) (hfg : L.FG) :
      ∃ d : ℤ, d ≠ 0 ∧ ∀ x ∈ L, ∀ i, IsIntegral ℤ ((d : K) * b.repr x i) := …
  ```
- `Formalism.HermitianLatticesTheory.majLattice_exists_c`: If a module spans the ambient K-vector space, every ambient vector has a nonzero integer multiple in the module.

  ```lean
  theorem majLattice_exists_c (L : Submodule (𝓞 K) V)
      (hL : Submodule.span K (L : Set V) = ⊤) (y : V) : ∃ c : ℤ, c ≠ 0 ∧ c • y ∈ L := …
  ```
- `Formalism.HermitianLatticesTheory.majLattice`: Over a totally complex number field, invertible coordinate matrices at every infinite place give a lattice image that is discrete and spans the full Euclidean space over ℝ.

  ```lean
  theorem majLattice : MajLattice := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.OpBound

10 import steps from Main · 65 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.OpBound)

**Proves a Euclidean displacement bound from a uniform bound at the infinite places of a number field.**

If the displacement operator g − 𝟙 satisfies a common nonnegative bound δ in the local coordinate seminorm at every infinite place, then the Euclidean norm of the realized displacement of any vector y is at most δ times the norm of its realization. The proof expresses the local displacement by matrix multiplication and identifies the squared realization norm with the sum of squared complex coordinate norms over the infinite places. Squaring and summing the local inequalities gives the global estimate.

Key declarations:

- `Formalism.HermitianLatticesTheory.opBound`: A common nonnegative displacement bound at all infinite places gives the same bound in the Euclidean realization.

  ```lean
  theorem opBound : OpBound := …
  ```
- `Formalism.HermitianLatticesTheory.opBound_normSq`: The squared norm of the Euclidean realization equals the sum of squared complex coordinate norms over the infinite places.

  ```lean
  theorem opBound_normSq (b : Module.Basis ι K V) (X : InfinitePlace K → Matrix ι ι ℂ) (z : V) :
      ‖realize b X z‖ ^ 2 = ∑ v, cnorm (fcoord b X v z) ^ 2 := …
  ```
- `Formalism.HermitianLatticesTheory.opBound_fcoord`: The transformed coordinates of g(y) − y at v come from applying the embedded matrix of g minus the identity to the embedded coordinates of y, then applying X(v)⁻¹, taken to be zero for singular X(v).

  ```lean
  theorem opBound_fcoord (b : Module.Basis ι K V) (X : InfinitePlace K → Matrix ι ι ℂ)
      (v : InfinitePlace K) (g : V →ₗ[K] V) (y : V) :
      fcoord b X v (g y - y) = (X v)⁻¹ *ᵥ ((matAt b v g - 1) *ᵥ vecAt b v y) := …
  ```
- `Formalism.HermitianLatticesTheory.opBound_vecAt_map`: The embedded coordinates of g(y) are obtained by multiplying the embedded matrix of g by the embedded coordinates of y.

  ```lean
  theorem opBound_vecAt_map (b : Module.Basis ι K V) (v : InfinitePlace K) (g : V →ₗ[K] V) (y : V) :
      vecAt b v (g y) = matAt b v g *ᵥ vecAt b v y := …
  ```
- `Formalism.HermitianLatticesTheory.opBound_cnorm_sq`: The squared Euclidean norm of a complex coordinate vector equals the sum of the squared absolute values of its entries.

  ```lean
  theorem opBound_cnorm_sq (u : ι → ℂ) : cnorm u ^ 2 = ∑ i, ‖u i‖ ^ 2 := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.ThetaBasic

10 import steps from Main · 90 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.ThetaBasic)

**Proves the translation, sign, and isometry symmetries of Hermitian lattice theta sums and the phase law under τ ↦ τ + 1.**

Reindexing shows that the scalar theta sum depends only on the shift modulo the lattice and is even in that shift. Simultaneously transporting the lattice and shifts by a Hermitian isometry preserves both scalar and higher-degree sums, and degree one recovers the scalar sum. If diagonal lattice traces are even integers and the shift pairs with the lattice in integral trace, then τ ↦ τ + 1 multiplies the scalar sum by exp(πi Tr(h(γ,γ))), where γ is the shift. This follows by expanding the traced Hermitian norm and using invariance of the field trace under the involution.

Key declarations:

- `Formalism.HermitianLatticesTheory.thetaBasic`: Establishes the shift symmetries, isometry invariance, scalar phase law, and reduction from degree one to the scalar theta sum.

  ```lean
  theorem thetaBasic : ThetaBasic := …
  ```
- `Formalism.HermitianLatticesTheory.thetaBasic_trace_star`: The field trace to ℚ is invariant under the field involution.

  ```lean
  theorem thetaBasic_trace_star {K : Type*} [Field K] [NumberField K] [StarRing K] (a : K) :
      Algebra.trace ℚ K (star a) = Algebra.trace ℚ K a := …
  ```
- `Formalism.HermitianLatticesTheory.thetaBasic_eqv`: A linear automorphism of the ambient space induces a bijection from the lattice onto its image.

  ```lean
  def thetaBasic_eqv {K V : Type*} [Field K] [NumberField K] [StarRing K] [AddCommGroup V]
      [Module K V] [Module (NumberField.RingOfIntegers K) V]
      [IsScalarTower (NumberField.RingOfIntegers K) K V] (g : V ≃ₗ[K] V)
      (L : Submodule (NumberField.RingOfIntegers K) V) : L ≃ gmap g L
  ```
- `Formalism.HermitianLatticesTheory.thetaBasic_eqv_apply`: On each lattice vector, the induced bijection agrees with the ambient automorphism.

  ```lean
  theorem thetaBasic_eqv_apply {K V : Type*} [Field K] [NumberField K] [StarRing K] [AddCommGroup V]
      [Module K V] [Module (NumberField.RingOfIntegers K) V]
      [IsScalarTower (NumberField.RingOfIntegers K) K V] (g : V ≃ₗ[K] V)
      (L : Submodule (NumberField.RingOfIntegers K) V) (x : L) :
      ((thetaBasic_eqv g L x : gmap g L) : V) = g x := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.ThetaSummable

10 import steps from Main · 388 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.ThetaSummable)

**Proves absolute convergence of shifted Hermitian lattice theta series on the upper half-plane for positive-definite trace forms.**

In a ℤ-basis, the trace quadratic form is bounded below by a positive multiple of the squared coordinate norm. Clearing denominators gives positivity on rational vectors, and the real symmetrization is positive definite by density and nonsingularity, yielding the bound by compactness. The parallelogram identity controls the shift, so the absolute values are dominated by a constant times a product of summable one-dimensional Gaussians. AutFinite uses convergence to prove finiteness of bounded trace sublevel sets, and TraceReal uses the coordinate bound to obtain a positive lower bound on nonzero lattice vectors.

Key declarations:

- `Formalism.HermitianLatticesTheory.thetaSummable_main`: For a positive-definite trace form, the theta series converges absolutely for every shift and every parameter with positive imaginary part.

  ```lean
  lemma thetaSummable_main (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x))
      (L : Submodule (NumberField.RingOfIntegers K) V) [Submodule.IsLattice K L]
      (γ : V) (τ : ℂ) (hτ : 0 < τ.im) :
      Summable (fun x : L => Complex.exp (Real.pi * Complex.I * τ *
          ((Algebra.trace ℚ K (h (γ + x) (γ + x)) : ℚ) : ℂ))) := …
  ```
- `Formalism.HermitianLatticesTheory.thetaSummable_shift`: The shifted trace quadratic value is at least half the unshifted value minus the trace quadratic value of the shift.

  ```lean
  lemma thetaSummable_shift (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x)) (γ x : V) :
      Algebra.trace ℚ K (h x x) ≤
        2 * Algebra.trace ℚ K (h (γ + x) (γ + x)) + 2 * Algebra.trace ℚ K (h γ γ) := …
  ```
- `Formalism.HermitianLatticesTheory.thetaSummable_coercive_rat`: A positive-definite rational quadratic form bounds a positive multiple of the sum of squared coordinates on rational vectors.

  ```lean
  lemma thetaSummable_coercive_rat (G : Matrix ι ι ℚ)
      (hG : ∀ w : ι → ℚ, w ≠ 0 → 0 < w ⬝ᵥ (G *ᵥ w)) :
      ∃ l : ℝ, 0 < l ∧ ∀ w : ι → ℚ, l * ∑ i, ((w i : ℚ) : ℝ) ^ 2 ≤ ((w ⬝ᵥ (G *ᵥ w) : ℚ) : ℝ) := …
  ```
- `Formalism.HermitianLatticesTheory.thetaSummable_gauss`: For every δ > 0, the Gaussian exp(−δn²) is summable over the integers.

  ```lean
  lemma thetaSummable_gauss {δ : ℝ} (hδ : 0 < δ) :
      Summable (fun n : ℤ => Real.exp (-δ * (n : ℝ) ^ 2)) := …
  ```
- `Formalism.HermitianLatticesTheory.thetaSummable_pi`: The product of a nonnegative summable sequence evaluated in finitely many coordinates is summable over the corresponding integer tuples.

  ```lean
  lemma thetaSummable_pi {ι : Type*} [Fintype ι] [DecidableEq ι] {g : ℤ → ℝ} (hg0 : ∀ n, 0 ≤ g n)
      (hg : Summable g) : Summable (fun c : ι → ℤ => ∏ i, g (c i)) := …
  ```

### Formalism.HermitianLattices.HermitianLatticesProofs.TraceReal

10 import steps from Main · 253 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.HermitianLatticesProofs.TraceReal)

**Realizes positive-definite Hermitian trace forms as Euclidean inner products and sends lattices to full Euclidean lattices.**

The realization rescales an orthogonal ℚ-basis by the square roots of its diagonal trace values, and multiplication by each field element is bounded in the resulting norm. A uniform positive lower bound on the trace values of nonzero lattice vectors gives discreteness, while taking nonzero integer multiples into the lattice gives full real span. ClassSetFinite uses the realization in the proof of finiteness of the isometry classes in a genus.

Key declarations:

- `Formalism.HermitianLatticesTheory.traceReal`: A Hermitian form with positive-definite trace on a finite-dimensional vector space over a number field with involution admits an additive Euclidean realization preserving the trace pairing, bounding field multiplication, and taking every lattice to a full Euclidean lattice.

  ```lean
  theorem traceReal : TraceReal := …
  ```
- `Formalism.HermitianLatticesTheory.traceReal_main`: Establishes existence of an additive Euclidean realization, using the rational dimension of the ambient space for the construction in the proof.

  ```lean
  theorem traceReal_main (h : V →ₗ⋆[K] V →ₗ[K] K) (hS : h.IsSymm)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x)) :
      ∃ (N : ℕ) (ι : V →+ EuclideanSpace ℝ (Fin N)),
        (∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ)) ∧
        (∀ a : K, ∃ C : ℝ, ∀ x : V, ‖ι (a • x)‖ ≤ C * ‖ι x‖) ∧
        (∀ M : Submodule (NumberField.RingOfIntegers K) V, Submodule.IsLattice K M →
          ∃ _ : DiscreteTopology (zmap ι M), IsZLattice ℝ (zmap ι M)) := …
  ```
- `Formalism.HermitianLatticesTheory.traceReal_lower`: If the trace quadratic form is positive on every nonzero ambient vector, then each full lattice has a uniform positive lower bound on its nonzero trace self-pairings.

  ```lean
  lemma traceReal_lower (h : V →ₗ⋆[K] V →ₗ[K] K)
      (hpos : ∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x))
      (L : Submodule (NumberField.RingOfIntegers K) V) [Submodule.IsLattice K L] :
      ∃ l : ℝ, 0 < l ∧ ∀ x ∈ L, x ≠ 0 → l ≤ ((Algebra.trace ℚ K (h x x) : ℚ) : ℝ) := …
  ```
- `Formalism.HermitianLatticesTheory.traceReal_mult`: Every ambient vector has a nonzero integer multiple in any full lattice.

  ```lean
  lemma traceReal_mult (M : Submodule (NumberField.RingOfIntegers K) V) (hM : Submodule.IsLattice K M)
      (x : V) : ∃ n : ℤ, n ≠ 0 ∧ n • x ∈ M := …
  ```
- `Formalism.HermitianLatticesTheory.traceReal_star`: The field trace to ℚ is invariant under the field involution.

  ```lean
  lemma traceReal_star (z : K) : Algebra.trace ℚ K (starRingEnd K z) = Algebra.trace ℚ K z := …
  ```

### Formalism.HermitianLattices.StatementTheta

10 import steps from Main · 83 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.StatementTheta)

**Defines shifted theta series and states Hermitian symmetries, scalar Hermitian summability, Euclidean inversion, and finite Weil relations.**

Hermitian terms use rational trace pairings and Euclidean terms use squared norms. The scalar series is periodic modulo the lattice and even in the shift, with a τ ↦ τ + 1 phase for even trace lattices and trace-dual shifts. Both Hermitian series respect joint isometric transport of lattice and shifts. In the upper half-plane, scalar summability assumes a lattice in finite dimension with positive-definite trace form, and Euclidean inversion for discrete full lattices in finite-dimensional real inner-product spaces uses a phase-weighted dual sum. The finite Weil relations use normalized Fourier and diagonal phase operators, and the theta lift uses the scalar series at zero shift.

Key declarations:

- `Formalism.HermitianLatticesTheory.thetaL`: Sums the exponentials of πiτ times the rational trace of the Hermitian self-pairing over a shifted lattice.

  ```lean
  def thetaL (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (NumberField.RingOfIntegers K) V) (γ : V)
      (τ : ℂ) : ℂ :=
    ∑' x : L, Complex.exp (Real.pi * Complex.I * τ *
      ((Algebra.trace ℚ K (h (γ + x) (γ + x)) : ℚ) : ℂ))
  ```
- `Formalism.HermitianLatticesTheory.thetaN`: Sums over lattice n-tuples using the matrix trace of the product of the shifted tuple’s trace Gram matrix and the complex parameter matrix in the exponent.

  ```lean
  def thetaN (h : V →ₗ⋆[K] V →ₗ[K] K) (L : Submodule (NumberField.RingOfIntegers K) V) (n : ℕ)
      (γ : Fin n → V) (τ : Matrix (Fin n) (Fin n) ℂ) : ℂ :=
    ∑' x : Fin n → L, Complex.exp (Real.pi * Complex.I * ∑ i, ∑ j,
      ((Algebra.trace ℚ K (h (γ i + x i) (γ j + x j)) : ℚ) : ℂ) * τ j i)
  ```
- `Formalism.HermitianLatticesTheory.WeilFinite`: For a nondegenerate unitary quadratic phase on a finite abelian group, states that S preserves the squared ℓ² norm, S² acts by negation, and (ST)³ acts by negation times the normalized Gauss sum.

  ```lean
  def WeilFinite : Prop :=
    ∀ (D : Type) [AddCommGroup D] [Fintype D] (Q : D → ℂ), IsUQuad Q → Nondeg Q →
      (∀ f : D → ℂ, weilS Q (weilS Q f) = fun γ => f (-γ)) ∧
      (∀ f : D → ℂ, ∑ γ, ‖weilS Q f γ‖ ^ 2 = ∑ γ, ‖f γ‖ ^ 2) ∧
      (∀ f : D → ℂ, weilS Q (weilT Q (weilS Q (weilT Q (weilS Q (weilT Q f))))) =
        fun γ => gsum Q / ((Real.sqrt (Fintype.card D) : ℝ) : ℂ) * f (-γ))
  ```
- `Formalism.HermitianLatticesTheory.ThetaSummable`: States summability for every shift and upper-half-plane parameter for a lattice in a finite-dimensional Hermitian space with positive-definite trace pairing.

  ```lean
  def ThetaSummable : Prop := …
  ```
- `Formalism.HermitianLatticesTheory.ThetaSEuclid`: For a discrete full lattice in a finite-dimensional real inner-product space and Im τ > 0, states that the shifted theta series at −1/τ is a phase-weighted dual-lattice sum times (−iτ)^(dim/2) divided by the covolume.

  ```lean
  def ThetaSEuclid : Prop :=
    ∀ (W : Type) [NormedAddCommGroup W] [InnerProductSpace ℝ W] [MeasurableSpace W] [BorelSpace W]
      [FiniteDimensional ℝ W] (Λ : Submodule ℤ W) [DiscreteTopology Λ] [IsZLattice ℝ Λ]
      (γ : W) (τ : ℂ), 0 < τ.im →
      thetaE Λ γ (-τ⁻¹) =
        (-Complex.I * τ) ^ ((Module.finrank ℝ W : ℂ) / 2) / (ZLattice.covolume Λ : ℂ) *
          ∑' μ : Formalism.H.dual Λ, Complex.exp (2 * Real.pi * Complex.I * ((inner ℝ γ (μ : W) : ℝ) : ℂ)) *
            Complex.exp (Real.pi * Complex.I * τ * ((‖(μ : W)‖ ^ 2 : ℝ) : ℂ))
  ```

### Development.AutomorphicArithmetic.IntegralCasts.CapelliIdentities.CommonMajorizingLattice

11 import steps from Main · 8 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Development.AutomorphicArithmetic.IntegralCasts.CapelliIdentities.CommonMajorizingLattice)

**Proves that a single nonzero integer clears denominators for any finite subset of a number field.**

The proof applies the integral-multiples theorem over ℤ ⊂ ℚ and identifies integer scalar multiplication with multiplication in the number field. In MajLattice, the theorem is applied to all basis coordinates of a finite generating set, yielding a single multiplier that makes the coordinates of every element of the generated module integral.

Key declarations:

- `UpperTheory.Reformulated.B.CommonMajorizingLattice.majLattice_common`: For any finite subset S of a number field K, there is a nonzero integer d such that da belongs to the ring of integers of K for every a in S.

  ```lean
  theorem UpperTheory.Reformulated.B.CommonMajorizingLattice.majLattice_common.{u_1} :
      ∀ {K : Type u_1} [inst : Field K] [NumberField K] (t : Finset K),
      ∃ (d : ℤ), d ≠ (0 : ℤ) ∧ ∀ a ∈ t, IsIntegral ℤ ((↑d : K) * a) := …
  ```

### Formalism.AlphaUniqueness.Statement

11 import steps from Main · 97 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.AlphaUniqueness.Statement)

**Defines unitary quadratic functions and states Gauss sum, determinant phase, and invariant quadratic refinement identities.**

For unitary quadratic functions on finite abelian groups, nondegeneracy is characterized by the squared Gauss sum modulus. For a nondegenerate Q preserved by an endomorphism whose first ℓ powers sum to zero, the Gauss sum squares to the group order if ℓ is prime and 1 mod 4 and the other primary subgroups have square order. A normalized Gauss sum enters a phase identity for products of unitary determinants. An orbit-pair sum modulo 2 gives the candidate invariant refinement of an alternating pairing, with statements of existence, uniqueness, and invariance under commuting pairing-preserving endomorphisms. The discriminant-form and theta modules use the unitary quadratic definitions.

Key declarations:

- `Formalism.K.GaussAbs`: States that a unitary quadratic function on a finite abelian group is nondegenerate exactly when the squared modulus of its Gauss sum equals the group order.

  ```lean
  def GaussAbs : Prop :=
    ∀ (M : Type) [AddCommGroup M] [Fintype M] (Q : M → ℂ), IsUQuad Q →
      (Nondeg Q ↔ ‖gsum Q‖ ^ 2 = (Fintype.card M : ℝ))
  ```
- `Formalism.K.QuadraticGaussSumSign`: States that the Gauss sum of a nondegenerate unitary quadratic function squares to the group order when an endomorphism preserves the function, its first ℓ powers sum to zero for a prime ℓ congruent to 1 modulo 4, and every other primary subgroup has square order.

  ```lean
  def QuadraticGaussSumSign : Prop :=
    ∀ (M : Type) [AddCommGroup M] [Fintype M] (Q : M → ℂ) (l : ℕ) (σ : AddMonoid.End M),
      l.Prime → l % 4 = 1 → IsUQuad Q → Nondeg Q →
      (∀ x, Q (σ x) = Q x) → (∀ x, ∑ i ∈ range l, (σ ^ i) x = 0) →
      (∀ p : ℕ, p.Prime → p ≠ l → IsSquare (Nat.card (prim (M := M) p))) →
      gsum Q ^ 2 = (Fintype.card M : ℂ)
  ```
- `Formalism.K.SquareClassUnitaryProduct`: Under the Gauss sum sign hypotheses, states that for an even family of unitary matrices γ with nonzero det(𝟙 − γ⁻¹), the normalized Gauss sum times the inverse phase of the product of these determinants squares to the product of det γ.

  ```lean
  def SquareClassUnitaryProduct : Prop := …
  ```
- `Formalism.K.AlphaRefine`: States that summing the alternating modulo-2 pairing over pairs of iterates with indices 0 ≤ i < j < ℓ gives an invariant quadratic refinement when ℓ is odd and the first ℓ powers of the pairing-preserving endomorphism sum to zero.

  ```lean
  def AlphaRefine : Prop :=
    ∀ (L : Type) [AddCommGroup L] (ψ : L →+ L →+ ZMod 2) (σ : AddMonoid.End L) (l : ℕ),
      Odd l → (∀ x, ψ x x = 0) → (∀ x y, ψ (σ x) (σ y) = ψ x y) →
      (∀ x, ∑ i ∈ range l, (σ ^ i) x = 0) →
      (∀ x y, qRef ψ σ l (x + y) = qRef ψ σ l x + qRef ψ σ l y + ψ x y) ∧
      (∀ x, qRef ψ σ l (σ x) = qRef ψ σ l x)
  ```
- `Formalism.K.AlphaUnique`: States that under the same odd-length vanishing-sum hypotheses, every invariant quadratic refinement of the pairing equals the orbit-pair sum.

  ```lean
  def AlphaUnique : Prop :=
    ∀ (L : Type) [AddCommGroup L] (ψ : L →+ L →+ ZMod 2) (σ : AddMonoid.End L) (l : ℕ),
      Odd l → (∀ x, ψ x x = 0) → (∀ x y, ψ (σ x) (σ y) = ψ x y) →
      (∀ x, ∑ i ∈ range l, (σ ^ i) x = 0) →
      ∀ q' : L → ZMod 2, (∀ x y, q' (x + y) = q' x + q' y + ψ x y) → (∀ x, q' (σ x) = q' x) →
        q' = qRef ψ σ l
  ```

### Formalism.HermitianLattices.GenusCovolBound

11 import steps from Main · 38 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.GenusCovolBound)

**Defines the trace-dual submodule and states a genus-wide covolume bound and finiteness of lattice automorphisms.**

The trace-dual submodule is the span over the ring of integers of vectors that pair integrally with the given submodule under the rational trace. For a positive-definite Hermitian trace pairing, the statements give a uniform covolume bound within a fixed genus in a common Euclidean realization and finiteness of each lattice’s Hermitian isometry stabilizer. The class finiteness argument assumes the covolume bound, and the Hermitian theta inversion formula sums over the trace-dual submodule.

Key declarations:

- `Formalism.HermitianLatticesTheory.tdualSub`: Takes the span over the ring of integers of all vectors whose sesquilinear pairing with every vector of the given submodule in the first argument has integer trace.

  ```lean
  def tdualSub {K V : Type*} [Field K] [NumberField K] [StarRing K] [AddCommGroup V] [Module K V]
      [Module (NumberField.RingOfIntegers K) V] (h : V →ₗ⋆[K] V →ₗ[K] K)
      (M : Submodule (NumberField.RingOfIntegers K) V) :
      Submodule (NumberField.RingOfIntegers K) V :=
    Submodule.span (NumberField.RingOfIntegers K)
      {y | ∀ x ∈ M, ∃ z : ℤ, Algebra.trace ℚ K (h x y) = z}
  ```
- `Formalism.HermitianLatticesTheory.GenusCovolBound`: States that in a fixed Euclidean realization of a positive-definite Hermitian trace pairing, one constant bounds the covolumes of all discrete full lattice images in a fixed genus.

  ```lean
  def GenusCovolBound : Prop := …
  ```
- `Formalism.HermitianLatticesTheory.AutFinite`: States that the group of linear Hermitian isometries carrying a full lattice onto itself is finite when the rational trace pairing is positive definite.

  ```lean
  def AutFinite : Prop :=
    ∀ (K V : Type) [Field K] [NumberField K] [StarRing K] [AddCommGroup V] [Module K V]
      [FiniteDimensional K V] [Module (NumberField.RingOfIntegers K) V]
      [IsScalarTower (NumberField.RingOfIntegers K) K V]
      (h : V →ₗ⋆[K] V →ₗ[K] K), h.IsSymm →
      (∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x)) →
      ∀ L : Submodule (NumberField.RingOfIntegers K) V, Submodule.IsLattice K L →
        Set.Finite {g : V ≃ₗ[K] V | g ∈ isom h ∧ gmap g L = L}
  ```

### Formalism.HermitianLattices.ThetaLEuclid

11 import steps from Main · 37 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Formalism.HermitianLattices.ThetaLEuclid)

**States the Euclidean comparison and inversion formulas for shifted Hermitian theta series.**

An additive realization of a positive trace pairing as a Euclidean inner product identifies the shifted theta series with the Euclidean series of the image and the transported shift. For a Hermitian form on a finite-dimensional K-space with positive trace pairing and a discrete full Euclidean lattice image, the upper-half-plane inversion formula uses a sum over the trace-dual submodule, with phases determined by pairing with the shift and a prefactor of (−iτ) to half the Euclidean dimension divided by the image covolume.

Key declarations:

- `Formalism.HermitianLatticesTheory.ThetaLEuclid`: States that for a positive trace pairing, an additive map carrying that pairing to the Euclidean inner product identifies the scalar shifted Hermitian theta series with the Euclidean theta series of the transported submodule and shift.

  ```lean
  def ThetaLEuclid : Prop :=
    ∀ (K V : Type) [Field K] [NumberField K] [StarRing K] [AddCommGroup V] [Module K V]
      [Module (NumberField.RingOfIntegers K) V] [IsScalarTower (NumberField.RingOfIntegers K) K V]
      (h : V →ₗ⋆[K] V →ₗ[K] K), (∀ x : V, x ≠ 0 → 0 < Algebra.trace ℚ K (h x x)) →
      ∀ (N : ℕ) (ι : V →+ EuclideanSpace ℝ (Fin N)),
      (∀ x y : V, inner ℝ (ι x) (ι y) = ((Algebra.trace ℚ K (h x y) : ℚ) : ℝ)) →
      ∀ (L : Submodule (NumberField.RingOfIntegers K) V) (γ : V) (τ : ℂ),
        thetaL h L γ τ = thetaE (zmap ι L) (ι γ) τ
  ```
- `Formalism.HermitianLatticesTheory.ThetaLSLaw`: States that for Im τ > 0, a Hermitian form with positive trace pairing on a finite-dimensional K-space and a discrete full Euclidean lattice image give the theta series at −1/τ as a trace-dual theta sum weighted by the character of the shift and scaled by the dimension factor and inverse covolume.

  ```lean
  def ThetaLSLaw : Prop := …
  ```

### Lemmata.GeneralBFactSecondRest.Imports

11 import steps from Main · 49 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Lemmata.GeneralBFactSecondRest.Imports)

**Proves that every vector has a nonzero integer multiple in any ring-of-integers submodule that spans the ambient space.**

For a totally complex number field K with an involution, every vector in a K-vector space has a nonzero integer multiple in any submodule over the ring of integers of K that spans the space over K. The proof proceeds by induction on the span, multiplying the integer factors when adding vectors and clearing the denominator of a field scalar by making it integral. The MajLattice proof uses the theorem to show that the realized lattice spans its ambient real vector space.

Key declarations:

- `Bl.general_b_fact_second_rest.goal1`: If a submodule over the ring of integers of a totally complex number field with an involution spans the ambient vector space over that field, every vector has a nonzero integer multiple in the submodule.

  ```lean
  theorem goal1 :
    ∀ {K : Type u_1} {V : Type u_2} [inst : Field.{u_1} K] [NumberField.{u_1} K] [NumberField.IsTotallyComplex.{u_1} K]
    [StarRing.{u_1} K] [inst_4 : AddCommGroup.{u_2} V] [inst_5 : Module.{u_1, u_2} K V]
    [inst_6 : Module.{u_1, u_2} (NumberField.RingOfIntegers.{u_1} K) V]
    [IsScalarTower.{u_1, u_1, u_2} (NumberField.RingOfIntegers.{u_1} K) K V]
    (L : Submodule.{u_1, u_2} (NumberField.RingOfIntegers.{u_1} K) V),
    Eq.{u_2 + 1} (Submodule.span.{u_1, u_2} K (SetLike.coe.{u_2, u_2} L)) Top.top.{u_2} →
      ∀ (y : V), Exists.{1} fun (c : Int) ↦ And (Ne.{1} c 0) (Membership.mem.{u_2, u_2} L (HSMul.hSMul.{0, u_2, u_2} c y)) := …
  ```
- `Bl.general_b_fact_second_rest.aux`: Every element of a number field has a nonzero integer multiple that is integral over the integers.

  ```lean
  private lemma aux {K : Type u_1} [Field K] [NumberField K] (a : K) :
      ∃ d : ℤ, d ≠ 0 ∧ IsIntegral ℤ ((d : K) * a) := …
  ```

### Lemmata.GeneralBFactSecondSide.Imports

11 import steps from Main · 43 lines · Checked against the code · [Open in the Lean viewer](https://riemannhypothesissolved.com/file/Lemmata.GeneralBFactSecondSide.Imports)

**Proves that every vector in the ambient space of a number-field lattice has a nonzero integer multiple in the lattice.**

The proof uses induction on the span of the lattice over the number field. For sums it multiplies the two integer factors, and for scalar multiples it uses the fact that each field element has a nonzero integer multiple in the ring of integers. TraceReal uses the theorem to show that the lattice image and the ambient vector space image have the same real span.

Key declarations:

- `Bl.general_b_fact_second'''''.goal1`: For a lattice M over the ring of integers of a number field K with involution, every vector x in the ambient K-vector space admits a nonzero integer n with nx in M.

  ```lean
  theorem goal1 :
    ∀ {K V : Type} [inst : Field.{0} K] [NumberField.{0} K] [StarRing.{0} K] [inst_3 : AddCommGroup.{0} V]
    [inst_4 : Module.{0, 0} K V] [inst_5 : Module.{0, 0} (NumberField.RingOfIntegers.{0} K) V]
    [inst_6 : IsScalarTower.{0, 0, 0} (NumberField.RingOfIntegers.{0} K) K V]
    (M : Submodule.{0, 0} (NumberField.RingOfIntegers.{0} K) V),
    Submodule.IsLattice.{0, 0, 0} K M →
      ∀ (x : V), Exists.{1} fun (n : Int) ↦ And (Ne.{1} n 0) (Membership.mem.{0, 0} M (HSMul.hSMul.{0, 0, 0} n x)) := …
  ```


---

Hermitian lattices over number fields… · Alpöge Lean readings. Web page: https://riemannhypothesissolved.com/cluster/k0427-hermitian-lattices-over-number-fields-trace-form-genus/lean/ · updated 2026-11-26 · site map for machines: https://riemannhypothesissolved.com/llms.txt
