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 Mathlib.Geometry.Manifold.Instances.Sphere |
| 2 | import Mathlib.Geometry.Manifold.ContMDiff.Atlas |
| 3 | import Mathlib.Topology.Order.Compact |
| 4 | |
| 5 | /-! |
| 6 | # Compact arcs of the smooth unit circle |
| 7 | |
| 8 | A compact connected proper subset of the unit circle is a closed interval in |
| 9 | stereographic coordinates based at any omitted point. The interval coordinates |
| 10 | extend smoothly to the whole real line and have a smooth inverse on the |
| 11 | punctured circle. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Metric IsManifold |
| 19 | open scoped Manifold ContDiff |
| 20 | |
| 21 | namespace Poincare.Geometry.Manifold.Circle |
| 22 | |
| 23 | private abbrev E1 := EuclideanSpace Real (Fin 1) |
| 24 | private abbrev S1 := sphere (0 : EuclideanSpace Real (Fin 2)) 1 |
| 25 | private instance : Fact (Module.finrank Real (EuclideanSpace Real (Fin 2)) = 1 + 1) := |
| 26 | ⟨by simp⟩ |
| 27 | |
| 28 | /-- Real stereographic coordinates on the complement of one circle point. -/ |
| 29 | theorem exists_real_stereographic_chart (p : S1) : |
| 30 | ∃ e : OpenPartialHomeomorph Real S1, |
| 31 | e.source = univ ∧ e.target = {p}ᶜ ∧ |
| 32 | ContMDiff 𝓘(Real, Real) (𝓡 1) ∞ e ∧ |
| 33 | ContMDiffOn (𝓡 1) 𝓘(Real, Real) ∞ e.symm e.target ∧ |
| 34 | Function.Injective e := by |
| 35 | let A : Real ≃L[Real] E1 := |
| 36 | ((EuclideanSpace.equiv (Fin 1) Real).trans |
| 37 | (LinearEquiv.funUnique (Fin 1) Real Real).toContinuousLinearEquiv).symm |
| 38 | let c := stereographic' 1 p |
| 39 | have hc : c ∈ maximalAtlas (𝓡 1) ∞ S1 := |
| 40 | IsManifold.subset_maximalAtlas ⟨p, rfl⟩ |
| 41 | have hcs : ContMDiff (𝓡 1) (𝓡 1) ∞ c.symm := by |
| 42 | rw [← contMDiffOn_univ] |
| 43 | simpa only [c, stereographic'_target] using contMDiffOn_symm_of_mem_maximalAtlas hc |
| 44 | let e := A.toHomeomorph.toOpenPartialHomeomorph.trans c.symm |
| 45 | have hes : e.source = univ := by simp [e, c] |
| 46 | have het : e.target = {p}ᶜ := by simp [e, c] |
| 47 | refine ⟨e, hes, het, hcs.comp A.contDiff.contMDiff, ?_, ?_⟩ |
| 48 | · simpa [e, c] using |
| 49 | A.symm.contDiff.contMDiff.comp_contMDiffOn (contMDiffOn_of_mem_maximalAtlas hc) |
| 50 | · intro x y hxy |
| 51 | exact e.injOn (hes ▸ mem_univ x) (hes ▸ mem_univ y) hxy |
| 52 | |
| 53 | /-- Every compact connected proper subset of the circle is a closed interval |
| 54 | in a smooth global parametrization of the punctured circle. -/ |
| 55 | theorem exists_interval_parametrization_of_compact_connected |
| 56 | {K : Set S1} (hK : IsCompact K) (hconn : IsConnected K) |
| 57 | (p : S1) (hp : p ∉ K) : |
| 58 | ∃ (e : OpenPartialHomeomorph Real S1) (a b : Real), |
| 59 | e.source = univ ∧ e.target = {p}ᶜ ∧ |
| 60 | ContMDiff 𝓘(Real, Real) (𝓡 1) ∞ e ∧ |
| 61 | ContMDiffOn (𝓡 1) 𝓘(Real, Real) ∞ e.symm e.target ∧ |
| 62 | Function.Injective e ∧ a ≤ b ∧ e '' Icc a b = K ∧ |
| 63 | (K.Nontrivial → a < b) := by |
| 64 | obtain ⟨e, hes, het, he, hei, heinj⟩ := exists_real_stereographic_chart p |
| 65 | have hKt : K ⊆ e.target := by |
| 66 | intro x hx |
| 67 | rw [het] |
| 68 | simpa only [mem_compl_iff, mem_singleton_iff] using ne_of_mem_of_not_mem hx hp |
| 69 | have hcont : ContinuousOn e.symm K := e.continuousOn_symm.mono hKt |
| 70 | have hcompact : IsCompact (e.symm '' K) := hK.image_of_continuousOn hcont |
| 71 | have hconnected : IsConnected (e.symm '' K) := hconn.image _ hcont |
| 72 | have hinterval := eq_Icc_of_connected_compact hconnected hcompact |
| 73 | have hle : sInf (e.symm '' K) ≤ sSup (e.symm '' K) := |
| 74 | csInf_le_csSup hconnected.nonempty hcompact.bddBelow hcompact.bddAbove |
| 75 | have himage : e '' Icc (sInf (e.symm '' K)) (sSup (e.symm '' K)) = K := by |
| 76 | rw [← hinterval] |
| 77 | ext x |
| 78 | constructor |
| 79 | · rintro ⟨t, ⟨y, hy, rfl⟩, rfl⟩ |
| 80 | simpa only [e.right_inv (hKt hy)] using hy |
| 81 | · intro hx |
| 82 | exact ⟨e.symm x, ⟨x, hx, rfl⟩, e.right_inv (hKt hx)⟩ |
| 83 | refine ⟨e, _, _, hes, het, he, hei, heinj, hle, himage, ?_⟩ |
| 84 | intro hn |
| 85 | refine lt_of_le_of_ne hle ?_ |
| 86 | intro hab |
| 87 | rw [hab, Icc_self, image_singleton] at himage |
| 88 | exact hn.not_subsingleton (himage ▸ subsingleton_singleton) |
| 89 | |
| 90 | end Poincare.Geometry.Manifold.Circle |