goldbach-spectral-bridge
Li and Liu's GRH + S ⇒ Goldbach in Lean, checked against the paper by Comparator: clean it up together, and settle S
| 1 | module |
| 2 | |
| 3 | public import Mathlib.Data.ZMod.Basic |
| 4 | import Mathlib.Tactic.Bound |
| 5 | import Mathlib.Tactic.LinearCombination |
| 6 | import Mathlib.Tactic.NoncommRing |
| 7 | import Mathlib.Tactic.NormNum.RealSqrt |
| 8 | import Mathlib.Tactic.Positivity |
| 9 | |
| 10 | /-! The three disjoint arithmetic families used by Mellin projection. -/ |
| 11 | public section |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | noncomputable section |
| 15 | open scoped BigOperators ComplexConjugate Topology |
| 16 | open Filter Set Complex |
| 17 | namespace ConditionalGoldbach |
| 18 | |
| 19 | lemma difference_congruence_families (N n m : ℕ) (hnm : n ≠ m) : |
| 20 | ((n : ZMod N) = m) ↔ |
| 21 | (∃ k : ℕ, 0 < k ∧ m = n + k * N) ∨ (∃ k : ℕ, 0 < k ∧ n = m + k * N) := by |
| 22 | rw [ZMod.natCast_eq_natCast_iff] |
| 23 | constructor |
| 24 | · intro h |
| 25 | rcases lt_or_gt_of_ne hnm with hlt | hgt |
| 26 | · obtain ⟨k, hk⟩ := (Nat.modEq_iff_dvd' hlt.le).mp h |
| 27 | have hk0 : 0 < k := by |
| 28 | by_contra hn |
| 29 | have : k = 0 := by omega |
| 30 | simp [this] at hk |
| 31 | omega |
| 32 | exact Or.inl ⟨k, hk0, by rw [mul_comm N k] at hk; omega⟩ |
| 33 | · obtain ⟨k, hk⟩ := (Nat.modEq_iff_dvd' hgt.le).mp h.symm |
| 34 | have hk0 : 0 < k := by |
| 35 | by_contra hn |
| 36 | have : k = 0 := by omega |
| 37 | simp [this] at hk |
| 38 | omega |
| 39 | exact Or.inr ⟨k, hk0, by rw [mul_comm N k] at hk; omega⟩ |
| 40 | · rintro (⟨k, hk, rfl⟩ | ⟨k, hk, rfl⟩) |
| 41 | · simp |
| 42 | · simp |
| 43 | |
| 44 | lemma sum_congruence_family (N n m : ℕ) (hn : 0 < n) (_hm : 0 < m) : |
| 45 | ((n : ZMod N) = -(m : ZMod N)) ↔ ∃ k : ℕ, 0 < k ∧ n + m = k * N := by |
| 46 | have hc : ((n : ZMod N) = -(m : ZMod N)) ↔ N ∣ n + m := by |
| 47 | rw [← ZMod.natCast_eq_zero_iff, Nat.cast_add, add_eq_zero_iff_eq_neg] |
| 48 | rw [hc] |
| 49 | constructor |
| 50 | · rintro ⟨k, hk⟩ |
| 51 | refine ⟨k, ?_, by simpa [mul_comm] using hk⟩ |
| 52 | by_contra hk0 |
| 53 | have : k = 0 := by omega |
| 54 | simp [this] at hk |
| 55 | omega |
| 56 | · rintro ⟨k, hk, heq⟩ |
| 57 | exact ⟨k, by simpa [mul_comm] using heq⟩ |
| 58 | |
| 59 | end ConditionalGoldbach |
