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.Straight.JoinNeighborhood |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Continuous.GraphDefiningFunction |
| 3 | |
| 4 | /-! |
| 5 | # The occupied half-plane at an actual straight boundary join |
| 6 | |
| 7 | The two embedded smooth arcs, their endpoint tangents and the actual Jordan |
| 8 | frontier construct a regular defining function at the join. No smooth |
| 9 | concatenation or occupied-side premise is used. |
| 10 | Source: MT Claim 19.40, pp. 470-471; minimal-contact derivation, Section 9. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Topology ContDiff |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- Actual regular straight-join geometry supplies the nonzero defining derivative and exact |
| 22 | occupied half-plane needed for the metric fan. Source: |
| 23 | `proof-work/tasks/M64/derivations/2026-09-27-minimal-contact-regularity.md`, Section 9. -/ |
| 24 | theorem m64Intrinsic_exists_straight_join_defining_function |
| 25 | {alpha beta : ℝ → AnnulusCoordinates} |
| 26 | (ha : ContDiff ℝ ∞ alpha) (hb : ContDiff ℝ ∞ beta) |
| 27 | {a A B b c : ℝ} (haA : a < A) (hBb : B < b) (hc : 0 < c) |
| 28 | (hai : InjOn alpha (Icc a A)) (hbi : InjOn beta (Icc B b)) |
| 29 | (hend : alpha A = beta B) (hreg : deriv alpha A ≠ 0) |
| 30 | (htan : deriv beta B = c • deriv alpha A) |
| 31 | {K U V : Set AnnulusCoordinates} (hK : IsCompact K) (hpK : alpha A ∉ K) |
| 32 | (hU : IsOpen U) (hV : IsOpen V) (hdisj : Disjoint U V) |
| 33 | (hfU : frontier U = (alpha '' Icc a A ∪ beta '' Icc B b) ∪ K) |
| 34 | (hfV : frontier V = frontier U) : |
| 35 | ∃ (phi : AnnulusCoordinates → ℝ) (ell : AnnulusCoordinates →L[ℝ] ℝ), |
| 36 | HasFDerivAt phi ell (alpha A) ∧ phi (alpha A) = 0 ∧ ell ≠ 0 ∧ |
| 37 | (∀ᶠ z in 𝓝 (alpha A), z ∈ closure U ↔ 0 ≤ phi z) := by |
| 38 | obtain ⟨L, h, X, W, _, hX, hh, hd, hW, hpW, hgraph⟩ := |
| 39 | m64Intrinsic_exists_straight_join_graph_neighborhood ha hb haA hBb hc hai hbi |
| 40 | hend hreg htan hK hpK |
| 41 | apply m64Intrinsic_continuous_graph_defining_function L hX hh hd |
| 42 | hU hV hdisj hfV hW hpW |
| 43 | · rw [hfU] |
| 44 | exact Or.inl (Or.inl ⟨A, right_mem_Icc.mpr haA.le, rfl⟩) |
| 45 | · intro z hz |
| 46 | rw [hfU] |
| 47 | exact hgraph z hz |
| 48 | |
| 49 | end PoincareMT |