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.IntrinsicComparison.Inward.GraphStrip |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Loop.CornerTopology |
| 3 | import Mathlib.Analysis.Calculus.Deriv.Shift |
| 4 | |
| 5 | /-! |
| 6 | # Choose the actual inward orientation of the return loop |
| 7 | |
| 8 | The proved occupied normal side determines whether to retain or reverse |
| 9 | the loop. The resulting original or reversed curve is still simple and |
| 10 | regular on the retained arc, and its positive normal rays enter the region. |
| 11 | |
| 12 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. These project |
| 13 | Jordan-region constructions supply the actual domains, boundary charts and finite |
| 14 | faces used in its regional Gauss--Bonnet arguments. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Topology ContDiff |
| 22 | open Poincare.Topology.Plane.Curves |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | /-- The actual Jordan region determines an orientation with inward positive normal rays. No |
| 27 | orientation or inward-ray certificate is an input. Source: |
| 28 | `proof-work/tasks/M64/reports/2026-09-24-inward-graph-strips.md`. -/ |
| 29 | theorem m64Intrinsic_exists_inward_loop_orientation |
| 30 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) {T a b : ℝ} |
| 31 | (hend : gamma 0 = gamma T) (hinj : InjOn gamma (Ico 0 T)) |
| 32 | (hab : a < b) (ha : 0 < a) (hb : b < T) |
| 33 | (hregular : ∀ t ∈ Icc a b, deriv gamma t ≠ 0) |
| 34 | {U V : Set AnnulusCoordinates} (hU : IsOpen U) (hV : IsOpen V) |
| 35 | (hdisj : Disjoint U V) (hfU : frontier U = gamma '' Icc 0 T) |
| 36 | (hfV : frontier V = gamma '' Icc 0 T) : |
| 37 | ∃ (g : ℝ → AnnulusCoordinates) (l u : ℝ), |
| 38 | (g = gamma ∨ g = fun t => gamma (T - t)) ∧ |
| 39 | ContDiff ℝ ∞ g ∧ g 0 = g T ∧ InjOn g (Ico 0 T) ∧ |
| 40 | g '' Icc 0 T = gamma '' Icc 0 T ∧ |
| 41 | 0 < l ∧ l < u ∧ u < T ∧ |
| 42 | (∀ t ∈ Icc l u, deriv g t ≠ 0) ∧ |
| 43 | ∀ t ∈ Icc l u, ∀ᶠ r in 𝓝[>] (0 : ℝ), |
| 44 | g t + r • quarterTurn (deriv g t) ∈ U := by |
| 45 | obtain ⟨delta, sigma, H, hdelta, hsigma, hmap, _, _, hcollar⟩ := |
| 46 | m64Intrinsic_exists_loop_inward_normal_collar hg hend hinj hab.le ha hb hregular |
| 47 | hU hV hdisj hfU hfV |
| 48 | have hrsmall : ∀ᶠ r in 𝓝[>] (0 : ℝ), r ∈ Ioo (0 : ℝ) delta := |
| 49 | Ioo_mem_nhdsGT hdelta |
| 50 | rcases hsigma with rfl | rfl |
| 51 | · refine ⟨gamma, a, b, Or.inl rfl, hg, hend, hinj, rfl, ha, hab, hb, hregular, ?_⟩ |
| 52 | intro t ht |
| 53 | filter_upwards [hrsmall] with r hr |
| 54 | simpa only [hmap, normalStrip, one_mul] using |
| 55 | (hcollar t ht r ⟨hr.1.le, hr.2.le⟩).2.2 hr.1 |
| 56 | · let g : ℝ → AnnulusCoordinates := fun t => gamma (T - t) |
| 57 | have hT : 0 < T := ha.trans hab |>.trans hb |
| 58 | have hg' : ContDiff ℝ ∞ g := hg.comp (contDiff_const.sub contDiff_id) |
| 59 | have hderiv (t : ℝ) : deriv g t = -deriv gamma (T - t) := |
| 60 | deriv_comp_const_sub gamma T t |
| 61 | have hinj' : InjOn g (Ico 0 T) := by |
| 62 | intro x hx y hy heq |
| 63 | have hxy := m64Intrinsic_loop_injOn_Ioc hT hend hinj |
| 64 | ⟨by linarith [hx.2], by linarith [hx.1]⟩ |
| 65 | ⟨by linarith [hy.2], by linarith [hy.1]⟩ heq |
| 66 | linarith |
| 67 | have himage : g '' Icc 0 T = gamma '' Icc 0 T := by |
| 68 | ext p |
| 69 | constructor |
| 70 | · rintro ⟨t, ht, rfl⟩ |
| 71 | exact ⟨T - t, ⟨by linarith [ht.2], by linarith [ht.1]⟩, rfl⟩ |
| 72 | · rintro ⟨t, ht, rfl⟩ |
| 73 | refine ⟨T - t, ⟨by linarith [ht.2], by linarith [ht.1]⟩, ?_⟩ |
| 74 | simp only [g, sub_sub_cancel] |
| 75 | have hparam {t : ℝ} (ht : t ∈ Icc (T - b) (T - a)) : T - t ∈ Icc a b := |
| 76 | ⟨by linarith [ht.2], by linarith [ht.1]⟩ |
| 77 | refine ⟨g, T - b, T - a, Or.inr rfl, hg', ?_, hinj', himage, |
| 78 | by linarith, by linarith, by linarith, ?_, ?_⟩ |
| 79 | · simpa only [g, sub_zero, sub_self] using hend.symm |
| 80 | · intro t ht |
| 81 | rw [hderiv] |
| 82 | exact neg_ne_zero.mpr (hregular _ (hparam ht)) |
| 83 | · intro t ht |
| 84 | filter_upwards [hrsmall] with r hr |
| 85 | have h := (hcollar (T - t) (hparam ht) r ⟨hr.1.le, hr.2.le⟩).2.2 hr.1 |
| 86 | simpa only [hmap, normalStrip, g, hderiv, map_neg, smul_neg, |
| 87 | neg_one_mul, neg_smul] using h |
| 88 | |
| 89 | end PoincareMT |