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.StandardCap.Persistence.SourceNames.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Sphere.SphereJetMargin |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Sphere.AxialJetMargin |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Sphere.CylinderPlaneRank |
| 5 | |
| 6 | /-! |
| 7 | # A uniform open sectional margin on the whole sphere |
| 8 | |
| 9 | Local sphere coordinate frames define an open condition in the |
| 10 | sphere point and the ambient metric two-jet. Compact model families |
| 11 | therefore have one positive tolerance, without a global frame. |
| 12 | Morgan--Tian, Claim 16.10, pp. 374-375; M44 derivation 78. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | -- Joint curvature evaluation retains nested coefficient and vector slots. |
| 18 | set_option maxSynthPendingDepth 16 |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Manifold ContDiff Topology |
| 22 | |
| 23 | namespace PoincareMT.M44 |
| 24 | |
| 25 | open SpacetimeBounds |
| 26 | |
| 27 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 28 | local notation "E2" => EuclideanSpace ℝ (Fin 2) |
| 29 | local notation "b" => EuclideanSpace.basisFun (Fin 2) ℝ |
| 30 | |
| 31 | noncomputable local instance sphereOpenCoefficientNorm : NormedAddCommGroup (MetricCoefficient 3) := |
| 32 | ContinuousLinearMap.toNormedAddCommGroup |
| 33 | |
| 34 | noncomputable local instance sphereOpenCoefficientSpace : NormedSpace ℝ (MetricCoefficient 3) := |
| 35 | ContinuousLinearMap.toNormedSpace |
| 36 | |
| 37 | noncomputable local instance sphereOpenTwoJetNorm : NormedAddCommGroup (MetricTwoJet 3) := |
| 38 | Prod.normedAddCommGroup |
| 39 | |
| 40 | noncomputable local instance sphereOpenTwoJetSpace : NormedSpace ℝ (MetricTwoJet 3) := |
| 41 | Prod.normedSpace |
| 42 | |
| 43 | /-- The coordinate differential of the actual sphere map in a |
| 44 | fixed stereographic chart. Source: Claim 16.10; derivation 78. -/ |
| 45 | noncomputable def sphereCoordinateDifferential (sigma : UnitTwoSphere → E) |
| 46 | (z x : UnitTwoSphere) : E2 →L[ℝ] E := |
| 47 | fderiv ℝ (sigma ∘ (chartAt E2 z).symm) ((chartAt E2 z) x) |
| 48 | |
| 49 | /-- Each fixed sphere chart has a continuous coordinate |
| 50 | differential throughout its source. Source: Claim 16.10; |
| 51 | M44 derivation 78. -/ |
| 52 | theorem continuousAt_sphereCoordinateDifferential {sigma : UnitTwoSphere → E} |
| 53 | (hsigma : ContMDiff (𝓡 2) (𝓡 3) ∞ sigma) (z : UnitTwoSphere) |
| 54 | {x : UnitTwoSphere} (hx : x ∈ (chartAt E2 z).source) : |
| 55 | ContinuousAt (sphereCoordinateDifferential sigma z) x := by |
| 56 | have hs : ContDiff ℝ ∞ (sigma ∘ (chartAt E2 z).symm) := |
| 57 | contMDiff_iff_contDiff.mp (hsigma.comp (M36.sphere_chart_inverse_contMDiff z)) |
| 58 | exact ((hs.contDiffAt.fderiv_right (m := ∞) (by simp)).continuousAt).comp |
| 59 | ((chartAt E2 z).continuousOn.continuousAt ((chartAt E2 z).open_source.mem_nhds hx)) |
| 60 | |
| 61 | /-- A local sphere frame witnesses the strict ambient |
| 62 | sectional margin of the actual sphere plane. Source: |
| 63 | Claim 16.10, pp. 374-375; M44 derivation 78. -/ |
| 64 | def sphereSectionalJetRegion (sigma : UnitTwoSphere → E) (k : ℝ) : |
| 65 | Set (UnitTwoSphere × MetricTwoJet 3) := |
| 66 | {p | ∃ z : UnitTwoSphere, p.1 ∈ (chartAt E2 z).source ∧ |
| 67 | p.2 ∈ sectionalJetLowerRegion k |
| 68 | (sphereCoordinateDifferential sigma z p.1 (b 0)) |
| 69 | (sphereCoordinateDifferential sigma z p.1 (b 1))} |
| 70 | |
| 71 | /-- The whole-sphere sectional region is open despite the |
| 72 | absence of a global tangent frame. Source: Claim 16.10; |
| 73 | M44 derivation 78. -/ |
| 74 | theorem isOpen_sphereSectionalJetRegion {sigma : UnitTwoSphere → E} |
| 75 | (hsigma : ContMDiff (𝓡 2) (𝓡 3) ∞ sigma) (k : ℝ) : |
| 76 | IsOpen (sphereSectionalJetRegion sigma k) := by |
| 77 | rw [isOpen_iff_mem_nhds] |
| 78 | rintro ⟨x, J⟩ ⟨z, hx, hJ⟩ |
| 79 | have hD := (continuousAt_sphereCoordinateDifferential hsigma z hx).comp |
| 80 | (continuousAt_fst (p := (x, J))) |
| 81 | have hu := hD.clm_apply (continuousAt_const (y := b 0)) |
| 82 | have hv := hD.clm_apply (continuousAt_const (y := b 1)) |
| 83 | let G (p : UnitTwoSphere × MetricTwoJet 3) := collarJetGram |
| 84 | (sphereCoordinateDifferential sigma z p.1 (b 0)) |
| 85 | (sphereCoordinateDifferential sigma z p.1 (b 1)) p.2 |
| 86 | have hG : ContinuousAt G (x, J) := by |
| 87 | dsimp [G, collarJetGram] |
| 88 | fun_prop |
| 89 | have hR := continuousAt_jetCurvature_family continuousAt_snd hJ.1 hu hv hu hv |
| 90 | have hmargin : 0 < jetCurvature J |
| 91 | (sphereCoordinateDifferential sigma z x (b 0)) |
| 92 | (sphereCoordinateDifferential sigma z x (b 1)) |
| 93 | (sphereCoordinateDifferential sigma z x (b 0)) |
| 94 | (sphereCoordinateDifferential sigma z x (b 1)) - k * G (x, J) := |
| 95 | sub_pos.mpr hJ.2.2 |
| 96 | filter_upwards [continuousAt_fst.eventually ((chartAt E2 z).open_source.mem_nhds hx), |
| 97 | continuousAt_snd.eventually ((isOpen_ricciFlowOperator_domain 3).mem_nhds hJ.1), |
| 98 | hG.eventually (lt_mem_nhds hJ.2.1), |
| 99 | (hR.sub (continuousAt_const.mul hG)).eventually (lt_mem_nhds hmargin)] |
| 100 | with p hp hI hGram hLower |
| 101 | exact ⟨z, hp, hI, hGram, sub_pos.mp hLower⟩ |
| 102 | |
| 103 | /-- A compact model family of whole-sphere margins has one |
| 104 | positive ambient two-jet tolerance at every point and model time. |
| 105 | Source: Claim 16.10; M44 derivation 78. -/ |
| 106 | theorem exists_uniform_sphere_jet_margin {sigma : UnitTwoSphere → E} |
| 107 | (hsigma : ContMDiff (𝓡 2) (𝓡 3) ∞ sigma) (k : ℝ) |
| 108 | {X : Type*} [TopologicalSpace X] {K : Set X} (hK : IsCompact K) |
| 109 | (J : X → UnitTwoSphere → MetricTwoJet 3) |
| 110 | (hJ : ContinuousOn (fun p : X × UnitTwoSphere => J p.1 p.2) (K ×ˢ univ)) |
| 111 | (hmargin : ∀ t ∈ K, ∀ z, (z, J t z) ∈ sphereSectionalJetRegion sigma k) : |
| 112 | ∃ delta : ℝ, 0 < delta ∧ ∀ t ∈ K, ∀ z, ∀ J' : MetricTwoJet 3, |
| 113 | ‖J' - J t z‖ ≤ delta → (z, J') ∈ sphereSectionalJetRegion sigma k := by |
| 114 | let L := (fun p : X × UnitTwoSphere => (p.2, J p.1 p.2)) '' (K ×ˢ univ) |
| 115 | have hL : IsCompact L := (hK.prod isCompact_univ).image_of_continuousOn |
| 116 | (continuousOn_snd.prodMk hJ) |
| 117 | have hsub : L ⊆ sphereSectionalJetRegion sigma k := by |
| 118 | rintro _ ⟨⟨t, z⟩, ht, rfl⟩ |
| 119 | exact hmargin t ht.1 z |
| 120 | obtain ⟨delta, hdelta, hinside⟩ := |
| 121 | hL.exists_cthickening_subset_open (isOpen_sphereSectionalJetRegion hsigma k) hsub |
| 122 | refine ⟨delta, hdelta, ?_⟩ |
| 123 | intro t ht z J' hnear |
| 124 | apply hinside |
| 125 | apply Metric.mem_cthickening_of_dist_le (z, J') (z, J t z) delta L |
| 126 | (show (z, J t z) ∈ L from ⟨(t, z), ⟨ht, mem_univ z⟩, rfl⟩) |
| 127 | simpa only [Prod.dist_eq, dist_self, dist_eq_norm, max_eq_right (norm_nonneg _)] using hnear |
| 128 | |
| 129 | /-- The coordinate differential has the actual sphere |
| 130 | differential composed with the inverse chart differential. |
| 131 | Source: Claim 16.10; M44 derivation 78. -/ |
| 132 | theorem sphereCoordinateDifferential_eq {sigma : UnitTwoSphere → E} |
| 133 | (hsigma : ContMDiff (𝓡 2) (𝓡 3) ∞ sigma) (z : UnitTwoSphere) |
| 134 | {x : UnitTwoSphere} (hx : x ∈ (chartAt E2 z).source) : |
| 135 | sphereCoordinateDifferential sigma z x = |
| 136 | (mfderiv (𝓡 2) (𝓡 3) sigma x).comp |
| 137 | (mfderiv (𝓡 2) (𝓡 2) (chartAt E2 z).symm ((chartAt E2 z) x)) := by |
| 138 | rw [sphereCoordinateDifferential, ← mfderiv_eq_fderiv, |
| 139 | mfderiv_comp _ ((hsigma _).mdifferentiableAt (by simp)) |
| 140 | (((M36.sphere_chart_inverse_contMDiff z) _).mdifferentiableAt (by simp))] |
| 141 | rw [(chartAt E2 z).left_inv hx] |
| 142 | |
| 143 | /-- Every actual sphere tangent image lies in the plane |
| 144 | spanned by either local coordinate frame. Source: Claim 16.10; |
| 145 | M44 derivation 78. -/ |
| 146 | theorem sphere_tangent_mem_coordinate_span {sigma : UnitTwoSphere → E} |
| 147 | (hsigma : ContMDiff (𝓡 2) (𝓡 3) ∞ sigma) (z : UnitTwoSphere) |
| 148 | {x : UnitTwoSphere} (hx : x ∈ (chartAt E2 z).source) |
| 149 | (v : TangentSpace (𝓡 2) x) : |
| 150 | mfderiv (𝓡 2) (𝓡 3) sigma x v ∈ Submodule.span ℝ |
| 151 | ({sphereCoordinateDifferential sigma z x (b 0), |
| 152 | sphereCoordinateDifferential sigma z x (b 1)} : Set E) := by |
| 153 | have hi : (mfderiv (𝓡 2) (𝓡 2) (chartAt E2 z).symm ((chartAt E2 z) x)).IsInvertible := by |
| 154 | convert! isInvertible_mfderivWithin_extChartAt_symm |
| 155 | (I := 𝓡 2) ((extChartAt (𝓡 2) z).map_source (by simpa using hx)) using 1 |
| 156 | simp |
| 157 | obtain ⟨w, hw⟩ := hi.surjective v |
| 158 | apply cylinder_plane_mem_span |
| 159 | refine ⟨w, ?_⟩ |
| 160 | rw [sphereCoordinateDifferential_eq hsigma z hx] |
| 161 | change mfderiv (𝓡 2) (𝓡 3) sigma x |
| 162 | (mfderiv (𝓡 2) (𝓡 2) (chartAt E2 z).symm ((chartAt E2 z) x) w) = _ |
| 163 | rw [hw] |
| 164 | |
| 165 | /-- A local frame margin gives the same strict sectional lower |
| 166 | bound on every nondegenerate pair of actual sphere tangents. |
| 167 | Source: Claim 16.10, pp. 374-375; M44 derivation 78. -/ |
| 168 | theorem sectional_lower_of_sphereJetRegion |
| 169 | {sigma : UnitTwoSphere → E} (hsigma : ContMDiff (𝓡 2) (𝓡 3) ∞ sigma) |
| 170 | {g : RiemannianMetric 3 E} (D : LeviCivitaData g) {x : UnitTwoSphere} {k : ℝ} |
| 171 | (hJ : (x, metricTwoJet g.euclideanCoefficients (sigma x)) ∈ |
| 172 | sphereSectionalJetRegion sigma k) |
| 173 | (u v : TangentSpace (𝓡 2) x) |
| 174 | (hgram : 0 < g.inner (sigma x) (mfderiv (𝓡 2) (𝓡 3) sigma x u) |
| 175 | (mfderiv (𝓡 2) (𝓡 3) sigma x u) * |
| 176 | g.inner (sigma x) (mfderiv (𝓡 2) (𝓡 3) sigma x v) |
| 177 | (mfderiv (𝓡 2) (𝓡 3) sigma x v) - |
| 178 | (g.inner (sigma x) (mfderiv (𝓡 2) (𝓡 3) sigma x u) |
| 179 | (mfderiv (𝓡 2) (𝓡 3) sigma x v)) ^ 2) : |
| 180 | k < D.sectionalCurvature (sigma x) (mfderiv (𝓡 2) (𝓡 3) sigma x u) |
| 181 | (mfderiv (𝓡 2) (𝓡 3) sigma x v) := by |
| 182 | obtain ⟨z, hx, hz⟩ := hJ |
| 183 | have hlower : k < D.sectionalCurvature (sigma x) |
| 184 | (sphereCoordinateDifferential sigma z x (b 0)) |
| 185 | (sphereCoordinateDifferential sigma z x (b 1)) := by |
| 186 | apply (lt_div_iff₀ hz.2.1).mpr |
| 187 | rw [← jetCurvature_metricTwoJet D] |
| 188 | exact hz.2.2 |
| 189 | exact sectional_lower_on_physical_plane D (sigma x) hz.2.1 hlower |
| 190 | (sphere_tangent_mem_coordinate_span hsigma z hx u) |
| 191 | (sphere_tangent_mem_coordinate_span hsigma z hx v) hgram |
| 192 | |
| 193 | end PoincareMT.M44 |