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.Polar.Inverse |
| 2 | import PoincareLib.Topology.Manifold.Schoenflies.CompactExtension |
| 3 | |
| 4 | /-! An inverse neighborhood of a compact embedded normal prefix. |
| 5 | Source: MT Lemma 19.53, p. 478; local-inverse-self-return derivation, |
| 6 | Section 2. The source neighborhood uses the original normal map. -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | open Set Filter |
| 13 | open scoped Topology ContDiff Manifold Matrix |
| 14 | |
| 15 | namespace PoincareMT |
| 16 | |
| 17 | /-- An embedded normal prefix with nonsingular joint differential has one inverse chart |
| 18 | around its whole compact source segment. Source: MT Lemma 19.53; local-inverse-self-return |
| 19 | derivation, Section 2. Source/construction: |
| 20 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Section 2. -/ |
| 21 | theorem m64Intrinsic_exists_compact_normal_inverse |
| 22 | {e : AnnulusCoordinates → AnnulusCoordinates} (he : ContDiff ℝ ∞ e) |
| 23 | {a T : ℝ} (hinj : InjOn (fun t => e !₂[a, t]) (Icc 0 T)) |
| 24 | (hreg : ∀ t ∈ Icc 0 T, Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, t])) : |
| 25 | ∃ F : OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates, |
| 26 | (fun t => !₂[a, t]) '' Icc 0 T ⊆ F.source ∧ |
| 27 | (fun t => e !₂[a, t]) '' Icc 0 T ⊆ F.target ∧ |
| 28 | EqOn F e F.source ∧ |
| 29 | ContMDiffOn (𝓡 2) (𝓡 2) ∞ F F.source ∧ |
| 30 | ContMDiffOn (𝓡 2) (𝓡 2) ∞ F.symm F.target := by |
| 31 | let S : Set AnnulusCoordinates := (fun t => !₂[a, t]) '' Icc 0 T |
| 32 | have hline : Continuous (fun t : ℝ => (!₂[a, t] : AnnulusCoordinates)) := by fun_prop |
| 33 | have hS : IsCompact S := isCompact_Icc.image hline |
| 34 | have hSi : InjOn e S := by |
| 35 | rintro _ ⟨s, hs, rfl⟩ _ ⟨t, ht, rfl⟩ hst |
| 36 | exact congrArg (fun u : ℝ => (!₂[a, u] : AnnulusCoordinates)) (hinj hs ht hst) |
| 37 | have hlocal : ∀ x ∈ S, IsLocalDiffeomorphAt (𝓡 2) (𝓡 2) ∞ e x := by |
| 38 | rintro _ ⟨t, ht, rfl⟩ |
| 39 | obtain ⟨F, hxF, _, hF, hFs, hFi⟩ := |
| 40 | m64Intrinsic_exists_smooth_polar_inverse isOpen_univ |
| 41 | (contMDiff_iff_contDiff.mpr he).contMDiffOn (mem_univ _) (hreg t ht) |
| 42 | refine ⟨{ toPartialEquiv := F.toPartialEquiv |
| 43 | open_source := F.open_source |
| 44 | open_target := F.open_target |
| 45 | contMDiffOn_toFun := contMDiffOn_iff_contDiffOn.mpr hFs |
| 46 | contMDiffOn_invFun := contMDiffOn_iff_contDiffOn.mpr hFi }, hxF, ?_⟩ |
| 47 | intro x _ |
| 48 | exact (congrFun hF x).symm |
| 49 | obtain ⟨F, hsource, htarget, hF, hFs, hFi⟩ := |
| 50 | Poincare.exists_openPartialHomeomorph_of_injOn_compact hS hSi hlocal |
| 51 | refine ⟨F, hsource, ?_, hF, hFs, hFi⟩ |
| 52 | rintro _ ⟨t, ht, rfl⟩ |
| 53 | exact htarget ⟨!₂[a, t], ⟨t, ht, rfl⟩, rfl⟩ |
| 54 | |
| 55 | /-- One source neighborhood controls all nearby closed normal prefixes. The resulting |
| 56 | injectivity is for the actual joint normal map, not only for individual rays. Source: |
| 57 | local-inverse-self-return, Section 2. Source/construction: |
| 58 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Section 2. -/ |
| 59 | theorem m64Intrinsic_exists_embedded_prefix_tube |
| 60 | {e : AnnulusCoordinates → AnnulusCoordinates} (he : ContDiff ℝ ∞ e) |
| 61 | {a T : ℝ} (hinj : InjOn (fun t => e !₂[a, t]) (Icc 0 T)) |
| 62 | (hreg : ∀ t ∈ Icc 0 T, Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, t])) : |
| 63 | ∃ W : Set ℝ, IsOpen W ∧ a ∈ W ∧ |
| 64 | InjOn e {z : AnnulusCoordinates | z 0 ∈ W ∧ z 1 ∈ Icc 0 T} := by |
| 65 | obtain ⟨F, hsource, _, hF, _, _⟩ := |
| 66 | m64Intrinsic_exists_compact_normal_inverse he hinj hreg |
| 67 | have hpair : Continuous (fun p : ℝ × ℝ => (!₂[p.1, p.2] : AnnulusCoordinates)) := by |
| 68 | fun_prop |
| 69 | have hopen : IsOpen {p : ℝ × ℝ | !₂[p.1, p.2] ∈ F.source} := |
| 70 | F.open_source.preimage hpair |
| 71 | have hsub : ({a} : Set ℝ) ×ˢ Icc 0 T ⊆ |
| 72 | {p : ℝ × ℝ | !₂[p.1, p.2] ∈ F.source} := by |
| 73 | rintro ⟨p, t⟩ ⟨hp, ht⟩ |
| 74 | have hpa : p = a := hp |
| 75 | subst p |
| 76 | exact hsource (mem_image_of_mem _ ht) |
| 77 | obtain ⟨W, J, hW, _, haW, hTJ, hWJ⟩ := |
| 78 | generalized_tube_lemma isCompact_singleton isCompact_Icc hopen hsub |
| 79 | have hsource' : {z : AnnulusCoordinates | z 0 ∈ W ∧ z 1 ∈ Icc 0 T} ⊆ F.source := by |
| 80 | intro z hz |
| 81 | have h := hWJ (show (z 0, z 1) ∈ W ×ˢ J from ⟨hz.1, hTJ hz.2⟩) |
| 82 | have heta : !₂[z 0, z 1] = z := by ext i; fin_cases i <;> rfl |
| 83 | change !₂[z 0, z 1] ∈ F.source at h |
| 84 | simpa only [heta] using h |
| 85 | refine ⟨W, hW, haW (mem_singleton a), ?_⟩ |
| 86 | intro x hx y hy hxy |
| 87 | exact F.injOn (hsource' hx) (hsource' hy) |
| 88 | ((hF (hsource' hx)).trans (hxy.trans (hF (hsource' hy)).symm)) |
| 89 | |
| 90 | end PoincareMT |