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.RicciFlow.Surgery.Metric.Collapse.PolarMap |
| 2 | import Mathlib.Analysis.InnerProductSpace.Calculus |
| 3 | |
| 4 | /-! |
| 5 | # The punctured polar chart |
| 6 | |
| 7 | The normalized direction and radial arclength invert the polar map off |
| 8 | the origin. Both maps are smooth on their chart domains. The total |
| 9 | direction map's arbitrary value at zero is outside that domain. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Topology |
| 15 | |
| 16 | namespace PoincareMT.MetricSurgery |
| 17 | |
| 18 | noncomputable def radialDirection (x : StandardCapSpace) : UnitTwoSphere := |
| 19 | if hx : x = 0 then ⟨axisBasis 0, by simp [axisBasis]⟩ |
| 20 | else ⟨‖x‖⁻¹ • x, by simp [norm_smul, norm_ne_zero_iff.mpr hx]⟩ |
| 21 | |
| 22 | theorem radialDirection_val (x : StandardCapSpace) (hx : x ≠ 0) : |
| 23 | (radialDirection x).1 = ‖x‖⁻¹ • x := by simp [radialDirection, hx] |
| 24 | |
| 25 | theorem radialDirection_contMDiffOn : |
| 26 | ContMDiffOn (𝓡 3) (𝓡 2) ∞ radialDirection ({0}ᶜ : Set StandardCapSpace) := by |
| 27 | let : Fact (Module.finrank ℝ StandardCapSpace = 2 + 1) := ⟨by simp⟩ |
| 28 | let U : TopologicalSpace.Opens StandardCapSpace := ⟨{0}ᶜ, isOpen_compl_singleton⟩ |
| 29 | have hs : ContMDiff (𝓡 3) (𝓡 3) ∞ |
| 30 | (fun x : U => ‖x.1‖⁻¹ • x.1) := by |
| 31 | intro x |
| 32 | have hx : x.1 ≠ 0 := x.2 |
| 33 | exact (((contDiffAt_norm ℝ hx).inv (norm_ne_zero_iff.mpr hx)).smul |
| 34 | contDiffAt_id).contMDiffAt.comp x contMDiff_subtype_val.contMDiffAt |
| 35 | have hunit : ∀ x : U, ‖x.1‖⁻¹ • x.1 ∈ Metric.sphere (0 : StandardCapSpace) 1 := by |
| 36 | intro x |
| 37 | have hx : x.1 ≠ 0 := x.2 |
| 38 | simp [norm_smul, norm_ne_zero_iff.mpr hx] |
| 39 | have hdir : ContMDiff (𝓡 3) (𝓡 2) ∞ (fun x : U => radialDirection x.1) := by |
| 40 | convert! hs.codRestrict_sphere (n := 2) hunit using 1 |
| 41 | funext x |
| 42 | apply Subtype.ext |
| 43 | exact radialDirection_val x.1 x.2 |
| 44 | intro x hx |
| 45 | exact (contMDiffAt_subtype_iff.mp (hdir (⟨x, hx⟩ : U))).contMDiffWithinAt |
| 46 | |
| 47 | noncomputable def radialInverseCoordinates (g₀ : StandardInitialMetric) |
| 48 | (x : StandardCapSpace) : StandardCylinderSpace := |
| 49 | (radialDirection x, radialArclength g₀ ‖x‖) |
| 50 | |
| 51 | theorem radialInverseCoordinates_contMDiffOn (g₀ : StandardInitialMetric) : |
| 52 | ContMDiffOn (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) ∞ |
| 53 | (radialInverseCoordinates g₀) ({0}ᶜ : Set StandardCapSpace) := by |
| 54 | apply radialDirection_contMDiffOn.prodMk |
| 55 | intro x hx |
| 56 | have hx0 : x ≠ 0 := by simpa using hx |
| 57 | exact ((radialArclength_contDiff g₀).contDiffAt.comp x |
| 58 | (contDiffAt_norm ℝ hx0)).contMDiffAt.contMDiffWithinAt |
| 59 | |
| 60 | theorem radialPolarPoint_ne_zero (g₀ : StandardInitialMetric) |
| 61 | (z : StandardCylinderSpace) (hz : 0 < z.2) : radialPolarPoint g₀ z ≠ 0 := by |
| 62 | apply norm_pos_iff.mp |
| 63 | rw [radialPolarPoint_norm g₀ z hz.le] |
| 64 | exact (radialEuclideanRadius_pos_iff g₀ z.2).mpr hz |
| 65 | |
| 66 | theorem radialDirection_polar (g₀ : StandardInitialMetric) |
| 67 | (z : StandardCylinderSpace) (hz : 0 < z.2) : |
| 68 | radialDirection (radialPolarPoint g₀ z) = z.1 := by |
| 69 | apply Subtype.ext |
| 70 | rw [radialDirection_val _ (radialPolarPoint_ne_zero g₀ z hz), |
| 71 | radialPolarPoint_norm g₀ z hz.le] |
| 72 | change (radialEuclideanRadius g₀ z.2)⁻¹ • |
| 73 | (radialEuclideanRadius g₀ z.2 • z.1.1) = z.1.1 |
| 74 | simp [smul_smul, ((radialEuclideanRadius_pos_iff g₀ z.2).mpr hz).ne'] |
| 75 | |
| 76 | theorem radialInverseCoordinates_polar (g₀ : StandardInitialMetric) |
| 77 | (z : StandardCylinderSpace) (hz : 0 < z.2) : |
| 78 | radialInverseCoordinates g₀ (radialPolarPoint g₀ z) = z := by |
| 79 | apply Prod.ext |
| 80 | · exact radialDirection_polar g₀ z hz |
| 81 | · exact radialArclength_norm_polar g₀ z hz.le |
| 82 | |
| 83 | theorem radialPolarPoint_inverse (g₀ : StandardInitialMetric) |
| 84 | (x : StandardCapSpace) (hx : x ≠ 0) : |
| 85 | radialPolarPoint g₀ (radialInverseCoordinates g₀ x) = x := by |
| 86 | change radialEuclideanRadius g₀ (radialArclength g₀ ‖x‖) • (radialDirection x).1 = x |
| 87 | rw [radialEuclideanRadius_arclength, radialDirection_val x hx] |
| 88 | simp [smul_smul, norm_ne_zero_iff.mpr hx] |
| 89 | |
| 90 | noncomputable def radialPolarChart (g₀ : StandardInitialMetric) : |
| 91 | OpenPartialHomeomorph StandardCylinderSpace StandardCapSpace where |
| 92 | toFun := radialPolarPoint g₀ |
| 93 | invFun := radialInverseCoordinates g₀ |
| 94 | source := Set.univ ×ˢ Set.Ioi (0 : ℝ) |
| 95 | target := {0}ᶜ |
| 96 | map_source' z hz := by simpa using radialPolarPoint_ne_zero g₀ z hz.2 |
| 97 | map_target' x hx := ⟨Set.mem_univ _, radialArclength_pos g₀ |
| 98 | (norm_pos_iff.mpr (by simpa using hx))⟩ |
| 99 | left_inv' z hz := radialInverseCoordinates_polar g₀ z hz.2 |
| 100 | right_inv' x hx := radialPolarPoint_inverse g₀ x (by simpa using hx) |
| 101 | open_source := isOpen_univ.prod isOpen_Ioi |
| 102 | open_target := isOpen_compl_singleton |
| 103 | continuousOn_toFun := (radialPolarPoint_continuous g₀).continuousOn |
| 104 | continuousOn_invFun := (radialInverseCoordinates_contMDiffOn g₀).continuousOn |
| 105 | |
| 106 | end PoincareMT.MetricSurgery |