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.Loop.GraphNeighborhood |
| 2 | |
| 3 | /-! |
| 4 | # Actual local parameters for curves in a simple loop |
| 5 | |
| 6 | A regular tangent projection constructs a smooth scalar inverse. The |
| 7 | simple-loop graph neighborhood excludes the distant parameter tails, |
| 8 | so every nearby curve in the loop has that actual smooth parameter. |
| 9 | |
| 10 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. These project |
| 11 | Jordan-region constructions supply the actual domains, boundary charts and finite |
| 12 | faces used in its regional Gauss--Bonnet arguments. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Topology ContDiff |
| 21 | open Poincare.Topology.Plane.Curves |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- A regular curve locally contained in the original simple loop has an actual smooth local |
| 26 | parameter with nonzero derivative. Source: |
| 27 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-inward-strips-review.md`, round_1, check |
| 28 | 20. -/ |
| 29 | theorem m64Intrinsic_exists_local_loop_reparametrization |
| 30 | {gamma eta : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) {T p t : ℝ} |
| 31 | (hend : gamma 0 = gamma T) (hinj : InjOn gamma (Ico 0 T)) |
| 32 | (hp : p ∈ Ioo (0 : ℝ) T) (hregular : deriv gamma p ≠ 0) |
| 33 | (heta : ContDiffAt ℝ ∞ eta t) (hpoint : eta t = gamma p) |
| 34 | (himage : ∀ᶠ s in 𝓝 t, eta s ∈ gamma '' Icc 0 T) |
| 35 | (hetaregular : deriv eta t ≠ 0) : |
| 36 | ∃ phi : ℝ → ℝ, ContDiffAt ℝ ∞ phi t ∧ phi t = p ∧ |
| 37 | deriv phi t ≠ 0 ∧ eta =ᶠ[𝓝 t] gamma ∘ phi := by |
| 38 | obtain ⟨l, r, G, L, h, hlp, hpr, hsource, hG, hL, hmono, |
| 39 | _, hGi, _, hh, hgraph, _, _, _⟩ := |
| 40 | exists_graph_coordinates_of_positive_projection hg (le_refl p) |
| 41 | (v := deriv gamma p) (by |
| 42 | intro x hx |
| 43 | have hx' : x = p := le_antisymm hx.2 hx.1 |
| 44 | subst x |
| 45 | exact real_inner_self_pos.mpr hregular) |
| 46 | have hmonoG : StrictMonoOn G G.source := by |
| 47 | intro x hx y hy hxy |
| 48 | simpa only [hG] using hmono hx hy hxy |
| 49 | obtain ⟨W, hW, harc, hWgraph⟩ := m64Intrinsic_loop_graph_neighborhood hg.continuous |
| 50 | hend hinj L G h (le_refl p) hp.1 hp.2 hlp hpr hsource hmonoG hgraph |
| 51 | have hpW : eta t ∈ W := by |
| 52 | rw [hpoint] |
| 53 | exact harc ⟨p, ⟨le_rfl, le_rfl⟩, rfl⟩ |
| 54 | let phi : ℝ → ℝ := fun s => G.symm (L (eta s)).1 |
| 55 | have hphi : ContDiffAt ℝ ∞ phi t := |
| 56 | (hGi.contDiffAt (G.open_target.mem_nhds (hWgraph _ hpW).1)).comp t |
| 57 | ((L.contDiff.contDiffAt.comp t heta).fst) |
| 58 | have hpG : p ∈ G.source := by rw [hsource]; exact ⟨hlp, hpr⟩ |
| 59 | have hphip : phi t = p := by |
| 60 | dsimp only [phi] |
| 61 | rw [hpoint, hgraph p hpG] |
| 62 | exact G.left_inv hpG |
| 63 | have heq : eta =ᶠ[𝓝 t] gamma ∘ phi := by |
| 64 | filter_upwards [heta.continuousAt.preimage_mem_nhds (hW.mem_nhds hpW), himage] with s hs hsi |
| 65 | have htarget := (hWgraph _ hs).1 |
| 66 | have hgraphEta := (hWgraph _ hs).2.mp hsi |
| 67 | apply L.injective |
| 68 | change L (eta s) = L (gamma (G.symm (L (eta s)).1)) |
| 69 | rw [hgraph _ (G.map_target htarget), G.right_inv htarget] |
| 70 | exact Prod.ext rfl hgraphEta |
| 71 | refine ⟨phi, hphi, hphip, ?_, heq⟩ |
| 72 | intro hzero |
| 73 | have hd := ((hg.differentiable (by simp) (phi t)).hasDerivAt.scomp t |
| 74 | (hphi.differentiableAt (by simp)).hasDerivAt).deriv |
| 75 | rw [hzero, zero_smul] at hd |
| 76 | exact hetaregular (heq.deriv_eq.trans hd) |
| 77 | |
| 78 | end PoincareMT |