Skip to content

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

Python

fix(Lib/General/NumberTheory/FrobeniusOrbits): move h_star comment to helper and drop duplicate

Rohan Arun4b9f9ae847a4
diff --git a/src/Lib/General/NumberTheory/FrobeniusOrbits.lean b/src/Lib/General/NumberTheory/FrobeniusOrbits.lean
index 7cb250bcfba..aabe58a1135 100644
--- a/src/Lib/General/NumberTheory/FrobeniusOrbits.lean
+++ b/src/Lib/General/NumberTheory/FrobeniusOrbits.lean
@@ -72,6 +72,7 @@ elements of `selfAdjoint k` are in bijection with `k` via `(x, y) ↦ (x - i * y
private lemma card_pairs_selfAdjoint_eq {k : Type*} [Field k] [StarRing k] [Finite k]
{i : k} (hi_sq : i * i = -1) (hi_moved : star i ≠ i) :
Nat.card (selfAdjoint k × selfAdjoint k) = Nat.card k := by
+ -- `star i` is a square root of `-1` other than `i`, so it is `-i`, and `-i ≠ i` gives `2 ≠ 0`.
have h_star : star i = -i := by grind [star_mul, star_neg, star_one, mul_self_eq_mul_self_iff]
refine card_congr ⟨fun (x, y) ↦ (x - i * y) / 2,
fun z ↦ (⟨z + star z, .add_star_self z⟩, ⟨i * z + star (i * z), .add_star_self _⟩),
@@ -85,8 +86,6 @@ where `r`, the number of fixed points, is `3` modulo `4`. -/
lemma New.card_selfAdjoint {k : Type*} [Field k] [StarRing k] [Finite k] {i : k}
(hi_sq : i * i = -1) (hi_moved : star i ≠ i) :
Nat.card (selfAdjoint k) ^ 2 = Nat.card k ∧ Nat.card (selfAdjoint k) % 4 = 3 := by
- -- `star i` is a square root of `-1` other than `i`, so it is `-i`, and `-i ≠ i` gives `2 ≠ 0`.
- have h_star : star i = -i := by grind [star_mul, star_neg, star_one, mul_self_eq_mul_self_iff]
refine ⟨?_, ?_⟩
· rw [sq, ← card_prod]
exact card_pairs_selfAdjoint_eq hi_sq hi_moved