Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.
Python
refactor(Lib/Weil/Periods): generalize additivity of the positive degree part
alkor20009ea94595ff0a
diff --git a/src/Lib/Weil/Periods/Equivariant.lean b/src/Lib/Weil/Periods/Equivariant.leanindex ade660cb9c1..6d53f04b47d 100644--- a/src/Lib/Weil/Periods/Equivariant.lean+++ b/src/Lib/Weil/Periods/Equivariant.lean@@ -156,22 +156,23 @@ lemma degreePart_one {d : ℤ} (hd : d ≠ 0) : Y.degreePart d 1 = 0 := byexact fun h_grade ↦ one_apply_ne (by rintro rfl; omega)omit [Fintype X] in-/-- On `U^{≥2}` the part of degree `2` of the matrix in rational coordinates is additive:-`(u u')₂ = u₂ + u'₂`, because `(u - 1) (u' - 1)` raises grades by at least `4`. -/-lemma degreePart_two_ratCoordMatrix_mul {u u' : G E ε}- (hu : HasDegreeGe Y.gradeOf Y.gradeOf 2 (V.ratCoordMatrix u - 1))- (hu' : HasDegreeGe Y.gradeOf Y.gradeOf 2 (V.ratCoordMatrix u' - 1)) :- Y.degreePart 2 (V.ratCoordMatrix (u * u')) =- Y.degreePart 2 (V.ratCoordMatrix u) + Y.degreePart 2 (V.ratCoordMatrix u') := by- have h_high : HasDegreeGe Y.gradeOf Y.gradeOf 4+/-- If the matrices of `u` and `u'` in rational coordinates differ from `1` by terms raising+grades by at least `d > 0`, their degree-`d` parts add under multiplication.+The cross term raises grades by at least `d + d`. -/+lemma degreePart_ratCoordMatrix_mul {d : ℤ} (hd : 0 < d) {u u' : G E ε}+ (hu : HasDegreeGe Y.gradeOf Y.gradeOf d (V.ratCoordMatrix u - 1))+ (hu' : HasDegreeGe Y.gradeOf Y.gradeOf d (V.ratCoordMatrix u' - 1)) :+ Y.degreePart d (V.ratCoordMatrix (u * u')) =+ Y.degreePart d (V.ratCoordMatrix u) + Y.degreePart d (V.ratCoordMatrix u') := by+ have h_high : HasDegreeGe Y.gradeOf Y.gradeOf (d + d)((V.ratCoordMatrix u - 1) * (V.ratCoordMatrix u' - 1)) := hu.mul hu' le_rflhave h_expand : V.ratCoordMatrix (u * u') =(V.ratCoordMatrix u - 1) * (V.ratCoordMatrix u' - 1) +(V.ratCoordMatrix u + V.ratCoordMatrix u') - 1 := byrw [map_mul]noncomm_ring- rw [h_expand, map_sub, map_add, map_add, Y.degreePart_eq_zero h_high (by norm_num),- Y.degreePart_one two_ne_zero, zero_add, sub_zero]+ rw [h_expand, map_sub, map_add, map_add, Y.degreePart_eq_zero h_high (by omega),+ Y.degreePart_one hd.ne', zero_add, sub_zero]omit [Fintype X] in/-- The shift `𝔢` lowers grades by `2`: its entry `(a, b)` vanishes unless@@ -246,7 +247,7 @@ lemma unipotentChar_mul {u u' : G E ε}Y.unipotentChar (u * u') = Y.unipotentChar u * Y.unipotentChar u' := byhave h_trace : (Y.shift * V.ratCoordMatrix (u * u')).trace =(Y.shift * V.ratCoordMatrix u).trace + (Y.shift * V.ratCoordMatrix u').trace := by- rw [trace_shift_mul, Y.degreePart_two_ratCoordMatrix_mul hu hu', mul_add, trace_add,+ rw [trace_shift_mul, Y.degreePart_ratCoordMatrix_mul (by decide) hu hu', mul_add, trace_add,← trace_shift_mul,← trace_shift_mul]rw [unipotentChar, h_trace, mul_add, AddChar.map_add_eq_mul, Circle.coe_mul, unipotentChar,