Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import PoincareLib.Geometry.CurveShortening.Comparison.Annulus |
| 2 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Lipschitz.Gluing |
| 3 | |
| 4 | /-! |
| 5 | # Local Lipschitz bounds across the angular cut |
| 6 | |
| 7 | A periodic rectangle map keeps its Lipschitz constant on every translated |
| 8 | fundamental cell. Gluing two neighboring cells gives local Lipschitz control |
| 9 | on the full closed strip, including points on the angular cut. |
| 10 | |
| 11 | Morgan--Tian context: Section 19.6, Lemmas 19.30-19.31, printed pp. 461-466. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Topology ENNReal NNReal |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | private theorem annulusPoint_coordinates (p : LoopPlane) : |
| 22 | annulusPoint (p 0) (p 1) = p := by |
| 23 | ext i |
| 24 | fin_cases i <;> rfl |
| 25 | |
| 26 | /-- Angular periodicity preserves a rectangle map's Lipschitz constant on every translated |
| 27 | fundamental cell. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk |
| 28 | collar in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 29 | theorem m64_periodic_rectangle_lipschitz_translate |
| 30 | {Y : Type*} [PseudoEMetricSpace Y] {f : LoopPlane → Y} |
| 31 | (hperiodic : ∀ x s : ℝ, |
| 32 | f (annulusPoint (x + curvePeriod) s) = f (annulusPoint x s)) |
| 33 | {K : ℝ≥0} (hLip : LipschitzOnWith K f m64AnnulusDomain) (k : ℤ) : |
| 34 | LipschitzOnWith K f {p | (k : ℝ) * curvePeriod ≤ p 0 ∧ |
| 35 | p 0 ≤ (k : ℝ) * curvePeriod + curvePeriod ∧ 0 ≤ p 1 ∧ p 1 ≤ 1} := by |
| 36 | let v := annulusPoint ((k : ℝ) * curvePeriod) 0 |
| 37 | have heq (p : LoopPlane) : f (p - v) = f p := by |
| 38 | have hp : Function.Periodic (fun x => f (annulusPoint x (p 1))) curvePeriod := |
| 39 | fun x => hperiodic x (p 1) |
| 40 | have h := hp.int_mul k (p 0 - (k : ℝ) * curvePeriod) |
| 41 | have hpoint : p - v = annulusPoint (p 0 - (k : ℝ) * curvePeriod) (p 1) := by |
| 42 | ext i |
| 43 | fin_cases i <;> simp [v, annulusPoint] |
| 44 | rw [hpoint] |
| 45 | simpa only [sub_add_cancel, annulusPoint_coordinates] using h.symm |
| 46 | have hmem {p : LoopPlane} |
| 47 | (hp : (k : ℝ) * curvePeriod ≤ p 0 ∧ |
| 48 | p 0 ≤ (k : ℝ) * curvePeriod + curvePeriod ∧ 0 ≤ p 1 ∧ p 1 ≤ 1) : |
| 49 | p - v ∈ m64AnnulusDomain := by |
| 50 | change 0 ≤ (p - v) 0 ∧ (p - v) 0 ≤ curvePeriod ∧ |
| 51 | 0 ≤ (p - v) 1 ∧ (p - v) 1 ≤ 1 |
| 52 | simp only [PiLp.sub_apply, v, annulusPoint, Matrix.cons_val_zero, |
| 53 | Matrix.cons_val_one, Matrix.cons_val_fin_one, sub_zero] |
| 54 | exact ⟨by linarith [hp.1], by linarith [hp.2.1], hp.2.2⟩ |
| 55 | intro p hp q hq |
| 56 | have h := hLip (hmem hp) (hmem hq) |
| 57 | simpa only [heq, edist_sub_right] using h |
| 58 | |
| 59 | /-- Glue neighboring periodic cells to obtain local Lipschitz control across the angular |
| 60 | cut. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 61 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 62 | theorem m64_periodic_rectangle_locally_lipschitz |
| 63 | {Y : Type*} [PseudoEMetricSpace Y] {f : LoopPlane → Y} |
| 64 | (hperiodic : ∀ x s : ℝ, |
| 65 | f (annulusPoint (x + curvePeriod) s) = f (annulusPoint x s)) |
| 66 | {K : ℝ≥0} (hLip : LipschitzOnWith K f m64AnnulusDomain) : |
| 67 | LocallyLipschitzOn {p : LoopPlane | 0 ≤ p 1 ∧ p 1 ≤ 1} f := by |
| 68 | classical |
| 69 | intro p hp |
| 70 | let k : ℤ := Int.floor (p 0 / curvePeriod) |
| 71 | let lo : ℝ := ((k : ℝ) - 1) * curvePeriod |
| 72 | let mid : ℝ := (k : ℝ) * curvePeriod |
| 73 | let hi : ℝ := ((k : ℝ) + 1) * curvePeriod |
| 74 | let S : Set LoopPlane := {q | lo ≤ q 0 ∧ q 0 ≤ hi ∧ 0 ≤ q 1 ∧ q 1 ≤ 1} |
| 75 | have hlo : lo < p 0 := by |
| 76 | have h := (le_div_iff₀ Real.two_pi_pos).mp (Int.floor_le (p 0 / curvePeriod)) |
| 77 | dsimp only [lo, k, curvePeriod] at h ⊢ |
| 78 | nlinarith [Real.pi_pos] |
| 79 | have hhi : p 0 < hi := by |
| 80 | have h := (div_lt_iff₀ Real.two_pi_pos).mp (Int.lt_floor_add_one (p 0 / curvePeriod)) |
| 81 | simpa only [hi, k, curvePeriod] using h |
| 82 | have hconvex : Convex ℝ S := by |
| 83 | intro x hx y hy a b ha hb hab |
| 84 | change lo ≤ (a • x + b • y) 0 ∧ (a • x + b • y) 0 ≤ hi ∧ |
| 85 | 0 ≤ (a • x + b • y) 1 ∧ (a • x + b • y) 1 ≤ 1 |
| 86 | simp only [PiLp.add_apply, PiLp.smul_apply, smul_eq_mul] |
| 87 | refine ⟨?_, ?_, add_nonneg (mul_nonneg ha hx.2.2.1) |
| 88 | (mul_nonneg hb hy.2.2.1), ?_⟩ |
| 89 | · calc |
| 90 | lo = a * lo + b * lo := by rw [← add_mul, hab, one_mul] |
| 91 | _ ≤ a * x 0 + b * y 0 := add_le_add |
| 92 | (mul_le_mul_of_nonneg_left hx.1 ha) (mul_le_mul_of_nonneg_left hy.1 hb) |
| 93 | · calc |
| 94 | a * x 0 + b * y 0 ≤ a * hi + b * hi := add_le_add |
| 95 | (mul_le_mul_of_nonneg_left hx.2.1 ha) (mul_le_mul_of_nonneg_left hy.2.1 hb) |
| 96 | _ = hi := by rw [← add_mul, hab, one_mul] |
| 97 | · calc |
| 98 | a * x 1 + b * y 1 ≤ a * 1 + b * 1 := add_le_add |
| 99 | (mul_le_mul_of_nonneg_left hx.2.2.2 ha) |
| 100 | (mul_le_mul_of_nonneg_left hy.2.2.2 hb) |
| 101 | _ = 1 := by rw [← add_mul, hab, one_mul] |
| 102 | have hleft : LipschitzOnWith K f (S ∩ {q | q 0 ≤ mid}) := by |
| 103 | apply (m64_periodic_rectangle_lipschitz_translate hperiodic hLip (k - 1)).mono |
| 104 | intro q hq |
| 105 | refine ⟨?_, ?_, hq.1.2.2⟩ |
| 106 | · simpa only [Int.cast_sub, Int.cast_one] using hq.1.1 |
| 107 | · simp only [Int.cast_sub, Int.cast_one] |
| 108 | calc |
| 109 | q 0 ≤ (k : ℝ) * curvePeriod := hq.2 |
| 110 | _ = ((k : ℝ) - 1) * curvePeriod + curvePeriod := by ring |
| 111 | have hright : LipschitzOnWith K f (S ∩ {q | mid ≤ q 0}) := by |
| 112 | apply (m64_periodic_rectangle_lipschitz_translate hperiodic hLip k).mono |
| 113 | intro q hq |
| 114 | refine ⟨hq.2, ?_, hq.1.2.2⟩ |
| 115 | calc |
| 116 | q 0 ≤ hi := hq.1.2.1 |
| 117 | _ = (k : ℝ) * curvePeriod + curvePeriod := by dsimp only [hi]; ring |
| 118 | have hglue := M60.lipschitzOnWith_piecewise_of_convex hconvex |
| 119 | (fun q : LoopPlane => q 0) |
| 120 | (PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 0).continuousOn mid hleft hright |
| 121 | (fun _ _ _ => rfl) |
| 122 | have hS : S ∈ 𝓝[{q : LoopPlane | 0 ≤ q 1 ∧ q 1 ≤ 1}] p := by |
| 123 | have hopen : IsOpen {q : LoopPlane | lo < q 0 ∧ q 0 < hi} := |
| 124 | (isOpen_lt continuous_const (PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 0)).inter |
| 125 | (isOpen_lt (PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 0) continuous_const) |
| 126 | apply mem_of_superset (inter_mem (nhdsWithin_le_nhds (hopen.mem_nhds ⟨hlo, hhi⟩)) |
| 127 | self_mem_nhdsWithin) |
| 128 | intro q hq |
| 129 | exact ⟨hq.1.1.le, hq.1.2.le, hq.2⟩ |
| 130 | refine ⟨K, S, hS, ?_⟩ |
| 131 | simpa only [piecewise_same, max_self] using hglue |
| 132 | |
| 133 | end PoincareMT |