Skip to content

Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.

Python

refactor(Lib/Weil): extract formRep_conjForm and conjForm_mem_levelSpace_iff

Harry Kalodnerb5f9d11e386a
diff --git a/src/Lib/Weil/Lift.lean b/src/Lib/Weil/Lift.lean
index b162357f896..7c3f94069d8 100644
--- a/src/Lib/Weil/Lift.lean
+++ b/src/Lib/Weil/Lift.lean
@@ -785,6 +785,18 @@ def conjForm {e' : GInf E s → ℂ} (h : e' = star e) : S.Form e →ₗ⋆[ℂ]
lemma coe_conjForm {e' : GInf E s → ℂ} (he' : e' = star e) (y : S.Form e) :
(conjForm he' y : S.Form e') = fun g : G E s ↦ conj (y g) := rfl
+/-- Right translation by a finite adelic point commutes with complex conjugation of forms. -/
+lemma formRep_conjForm {e' : GInf E s → ℂ} (h : e' = star e) (k : Gf E n) (y : S.Form e) :
+ S.formRep e' k (conjForm h y) = conjForm h (S.formRep e k y) := rfl
+
+/-- Complex conjugation preserves membership in the forms of a given level `K`. -/
+lemma conjForm_mem_levelSpace_iff {e' : GInf E s → ℂ} (h : e' = star e) {K : Subgroup (Gf E n)}
+ {y : S.Form e} :
+ conjForm h y ∈ levelSpace (S.formRep e') K ↔ y ∈ levelSpace (S.formRep e) K := by
+ have h_inj : Function.Injective (conjForm (S := S) h) := fun x y hxy ↦
+ Subtype.ext <| funext fun g ↦ star_injective (congrFun (congrArg Subtype.val hxy) g)
+ simp [formRep_conjForm, h_inj.eq_iff]
+
/-- Let Φ be an edge e → e' for the real Weil representation `realPairWeil γ γ'`. This means Φ is a
half edge from e to e', and also, with the two groups exchanged, from ē' to ē. A half edge requires
that e is a cusp kernel of order 0, that ∫⟨Φ, Ω(x,1)Φ⟩·conj e(x)/e(1) dx ≠ 0, and that lifts with Φ
diff --git a/src/New/Determinant/AuxiliaryForms/FirstPath.lean b/src/New/Determinant/AuxiliaryForms/FirstPath.lean
index 2051cee9fa7..4e46fd971c3 100644
--- a/src/New/Determinant/AuxiliaryForms/FirstPath.lean
+++ b/src/New/Determinant/AuxiliaryForms/FirstPath.lean
@@ -241,14 +241,14 @@ lemma gridLevelForms_eq_map_transposedChain :
rintro z ⟨hz_orth, hz_level⟩
-- `y` is the conjugate of `z`, `U` its chain of lifts, and `φ` the conjugate of `U`.
let y : D.triangleBase true := ⟨conjForm (isConjKernelPair_gridKernel (by simp) true).2 z,
- mem_levelSpace_formRep_iff.2 fun k hk g ↦
- congrArg star (mem_levelSpace_formRep_iff.1 hz_level k hk g)⟩
+ (conjForm_mem_levelSpace_iff _).2 hz_level⟩
let U := weightedChain (fun ϑ n ↦ (D.triangleGLCard true ϑ n : ℝ)) (D.triangleLift true) 1 0 D.m y
let φ := conjForm (isConjKernelPair_gridKernel (by simp) false).2 U
- have φ_mem : φ ∈ D.gridLevelForms D.m := mem_levelSpace_formRep_iff.2 fun k hk g ↦
- congrArg star <| congrFun (congrArg Subtype.val <|
- D.triangleRep_weightedChain_eq_self true 1 (NeZero.ne D.m) le_rfl y ⟨k, hk.1⟩
- ((mem_principalLevel_iff gridModulus_one_ideal _).1 hk)) g
+ have φ_mem : φ ∈ D.gridLevelForms D.m :=
+ (conjForm_mem_levelSpace_iff _).2 fun k ↦
+ (D.triangleRep_weightedChain_eq_self true 1 (NeZero.ne D.m) le_rfl y ⟨k.val, k.property.1⟩
+ ((mem_principalLevel_iff gridModulus_one_ideal _).1 k.property)).trans
+ (one_smul ℂ U).symm
-- By transposition, `⟪U, U⟫ = ⟪z, Θ^♭ φ⟫ = 0`, so `U = 0` and hence `z = 0`.
have h := D.integral_transposedChain_mul_weightedChain true 1 le_rfl y φ
simp only [transposedChain_self, mul_comm (D.transposedChain 1 true 0 φ _)] at h
@@ -376,13 +376,14 @@ lemma IsFlatRestriction.integral_lowerChainUpTo {g : GInf D.E (D.gridSigns true
conjForm (isConjKernelPair_gridKernel (by simp) true).2 y'Lift
have h_level : y'Lift_conj ∈
levelSpace ((D.gridSpace 0 false 0 0).formRep (D.gridKernel false 0 0 false))
- (levelY ϑ 0) := by
- refine mem_levelSpace_formRep_iff.2 fun k hk x ↦ ?_
- have h_fix :
- (D.gridSpace 0 false 0 0).formRep (D.gridKernel false 0 0 true) k y'Lift = y'Lift :=
- D.formRep_transposedChain_eq_self false ϑ (Nat.pos_of_neZero D.m) y' ⟨k, (mem_levelOf.1 hk).1⟩
- ((LevelPlaces.ker_reductionGL_eq _).ge (mem_levelOf.1 hk).2)
- exact congrArg (fun F : D.GridForm false 0 0 ↦ star (F x)) h_fix
+ (levelY ϑ 0) :=
+ (conjForm_mem_levelSpace_iff _).2 fun k ↦ by
+ have h_fix : (D.gridSpace 0 false 0 0).formRep (D.gridKernel false 0 0 true) k.val y'Lift =
+ y'Lift :=
+ D.formRep_transposedChain_eq_self false ϑ (Nat.pos_of_neZero D.m) y'
+ ⟨k.val, (mem_levelOf.1 k.property).1⟩
+ ((LevelPlaces.ker_reductionGL_eq _).ge (mem_levelOf.1 k.property).2)
+ exact h_fix.trans (one_smul ℂ y'Lift).symm
have h_restrict :
∫ x, y'Lift x * (r φ).val x ∂(D.spaceY 0).quotMeasure =
diagonalPeriodForm ϑ zero_le g y'Lift (D.transposedChain 1 true 0 φ) := by
diff --git a/src/New/Determinant/AuxiliaryForms/GridFirstColumns.lean b/src/New/Determinant/AuxiliaryForms/GridFirstColumns.lean
index cd5be5ea050..24b67668ca6 100644
--- a/src/New/Determinant/AuxiliaryForms/GridFirstColumns.lean
+++ b/src/New/Determinant/AuxiliaryForms/GridFirstColumns.lean
@@ -273,12 +273,10 @@ lemma exists_petersson_eq_diagonalPeriodForm (D : Data P)
have h_form : conjForm he_star (ρ u y) =
(D.gridSpace 0 false 0 0).formRep (D.gridKernel false 0 0 true) (u * v).val
(conjForm he_star y) := by
- refine Subtype.ext (funext fun x ↦ ?_)
- have h_g : (x * (1, u.val)) * (1, v.val) = x * (1, u.val * v.val) := by
- rw [mul_assoc]
- exact congrArg (x * ·) (Prod.ext (one_mul 1) rfl)
- exact congrArg star ((mem_levelSpace_formRep_iff.1 hy v.1 hv (x * (1, u.1))).symm.trans
- (congrArg y.val h_g))
+ have h_uv : ρ u y = ρ (u * v).val y := by
+ rw [Subgroup.coe_mul, map_mul, mul_apply_eq_comp,
+ (hy ⟨v.val, hv⟩).trans (one_smul ℂ y)]
+ rw [h_uv, ← formRep_conjForm he_star]
have h_diag : diagonalPeriodForm 1 zero_le g = diagonalPeriodForm ϑ zero_le g := by
simp only [diagonalPeriodForm, pow_zero]
rw [conjPeriod_apply, h_diag, h_form]