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.CanonicalInduction.Component.ComponentEstimateStrictHistory |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimateCylinder |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimateCanonical |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimateCrossing |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimateMinimum |
| 6 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimatePinching |
| 7 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Canonical.Scalar.CanonicalScalarStability |
| 8 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Blowup.Caps.CapScalarEstimates |
| 9 | |
| 10 | /-! |
| 11 | # Scalar ceiling on the actual strict backward component history |
| 12 | |
| 13 | The compact scalar maximum, actual minimum point, original canonical |
| 14 | alternatives and pinching discharge all stopped analytic bounds. |
| 15 | Source: the component-history induction on pp. 402-405. |
| 16 | See `proof-work/tasks/M47/derivations/component-estimate.md`, Stage D6. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set |
| 23 | open scoped Manifold ContDiff Bundle Topology |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.M47 |
| 28 | |
| 29 | private theorem scalar_sup_univ_attained |
| 30 | {M : Type u} [TopologicalSpace M] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 32 | [CompactSpace M] [Nonempty M] (g : RiemannianMetric 3 M) (D : LeviCivitaData g) : |
| 33 | ∃ p : M, scalarCurvatureSupOn g D univ = D.scalarCurvature p ∧ |
| 34 | ∀ y : M, D.scalarCurvature y ≤ D.scalarCurvature p := by |
| 35 | obtain ⟨p, _hp, hmax⟩ := isCompact_univ.exists_isMaxOn Set.univ_nonempty |
| 36 | (M34.contMDiff_scalarCurvature D).continuous.continuousOn |
| 37 | have hbound (y : M) := hmax (mem_univ y) |
| 38 | refine ⟨p, ?_, hbound⟩ |
| 39 | change sSup (range (fun y : (univ : Set M) => D.scalarCurvature y.val)) = _ |
| 40 | have hb : BddAbove (range (fun y : (univ : Set M) => D.scalarCurvature y.val)) := by |
| 41 | refine ⟨D.scalarCurvature p, ?_⟩ |
| 42 | rintro _ ⟨y, rfl⟩ |
| 43 | exact hbound y.val |
| 44 | apply le_antisymm |
| 45 | · apply csSup_le (s := range (fun y : (univ : Set M) => D.scalarCurvature y.val)) |
| 46 | ⟨D.scalarCurvature p, ⟨⟨p, mem_univ p⟩, rfl⟩⟩ |
| 47 | rintro _ ⟨y, rfl⟩ |
| 48 | exact hbound y.val |
| 49 | · exact le_csSup hb ⟨⟨p, mem_univ p⟩, rfl⟩ |
| 50 | |
| 51 | /-- A fixed short duration controls every strict interior point of every |
| 52 | actual based partial cylinder on the terminal weak-2C component. The |
| 53 | stopped analytic and ordinary-history inputs are constructed here; |
| 54 | the component induction on pp. 402-405. -/ |
| 55 | theorem exists_component_strict_scalar_duration |
| 56 | (P : M47Predecessors.{u}) (PS : M47ScalarPersistencePredecessors.{u}) |
| 57 | (C : ℝ) (hC : 1 ≤ C) : |
| 58 | ∃ d : ℝ, 0 < d ∧ d ≤ 1 ∧ 156 * (4 * (C + 1)) * d ≤ 1 ∧ |
| 59 | ∀ (F : SurgeryFlowData.{u}) (origin Q : ℝ) (x : (F.slice origin).carrier), |
| 60 | (F.connection origin).scalarCurvature x = Q → 6 ≤ Q → Real.exp 4 ≤ Q → |
| 61 | ∀ N : SingularCComponent (F.metric origin) (F.connection origin) (2 * C), |
| 62 | x ∈ N.carrier → |
| 63 | ∀ (U : TopologicalSpace.Opens (F.slice origin).carrier), |
| 64 | (U : Set (F.slice origin).carrier) = N.carrier → |
| 65 | ∀ a : ℝ, -d / Q ≤ a → a < 0 → |
| 66 | ∀ e : SurgeryFlowCylinder F (F.slice origin) origin 1 (Icc a 0) U, |
| 67 | (∀ hs y, y ∈ U → HEq (e.forward 0 hs y) y) → |
| 68 | (∀ t ∈ Icc (origin - d / Q) origin, |
| 69 | SurgeryPinchedAt (F.connection t) t) → |
| 70 | (∀ t ∈ Ico (origin - d / Q) origin, ∀ y : (F.slice t).carrier, |
| 71 | Q ≤ (F.connection t).scalarCurvature y → |
| 72 | SurgeryCanonicalControl F t y F.parameters.epsilon C) → |
| 73 | ∀ s : ℝ, ∀ hs : s ∈ Ioc a 0, ∀ y : U, |
| 74 | (F.connection (origin + s / 1)).scalarCurvature |
| 75 | (e.forward s ⟨hs.1.le, hs.2⟩ y.val) < 4 * (C + 1) * Q := by |
| 76 | let L := 4 * (C + 1) |
| 77 | have hL : 1 ≤ L := by dsimp only [L]; linarith |
| 78 | have hLpos : 0 < L := zero_lt_one.trans_le hL |
| 79 | obtain ⟨B, hB, hcanonicalBound⟩ := exists_component_crossing_analytic_bound.{u} C |
| 80 | obtain ⟨tau, htau, _htau1, hexclude⟩ := |
| 81 | exists_component_maximum_exclusion_duration PS P.m13 13 B (by norm_num) hB |
| 82 | let d := min 1 (min (tau / L) (1 / (156 * L))) |
| 83 | have hd : 0 < d := lt_min zero_lt_one (lt_min (div_pos htau hLpos) (by positivity)) |
| 84 | have hd1 : d ≤ 1 := min_le_left _ _ |
| 85 | have hLd : L * d ≤ tau := by |
| 86 | have hle : d ≤ tau / L := (min_le_right _ _).trans (min_le_left _ _) |
| 87 | have h := (le_div_iff₀ hLpos).1 hle |
| 88 | linarith |
| 89 | have hmetricDuration : 156 * L * d ≤ 1 := by |
| 90 | have hle : d ≤ 1 / (156 * L) := (min_le_right _ _).trans (min_le_right _ _) |
| 91 | have h := (le_div_iff₀ (by positivity : 0 < 156 * L)).1 hle |
| 92 | linarith |
| 93 | refine ⟨d, hd, hd1, hmetricDuration, ?_⟩ |
| 94 | intro F origin Q x hxQ hQ6 hQexp N hx U hU a ha ha0 e he hpinch hcanonical |
| 95 | simp only [neg_div] at ha |
| 96 | have hQ : 0 < Q := by linarith |
| 97 | let H := L * Q |
| 98 | have hH : 0 < H := mul_pos hLpos hQ |
| 99 | have hxU : x ∈ U := by change x ∈ (U : Set _); rw [hU]; exact hx |
| 100 | have hcompact : IsCompact (U : Set (F.slice origin).carrier) := hU.symm ▸ N.compact |
| 101 | have hconnected : IsConnected (U : Set (F.slice origin).carrier) := by |
| 102 | rw [hU, N.component_eq] |
| 103 | exact isConnected_connectedComponent |
| 104 | let : CompactSpace U := isCompact_iff_compactSpace.mp hcompact |
| 105 | let : Nonempty U := ⟨⟨x, hxU⟩⟩ |
| 106 | obtain ⟨G, hread⟩ := exists_component_strict_ordinary_history P ha0 U ⟨x, hxU⟩ e |
| 107 | have hterminalScalar (y : U) : |
| 108 | (G.connection origin).scalarCurvature y = |
| 109 | (F.connection origin).scalarCurvature y.val := by |
| 110 | have hpoint : (⟨origin + 0 / 1, e.forward 0 ⟨ha0.le, le_rfl⟩ y.val⟩ : |
| 111 | (t : ℝ) × (F.slice t).carrier) = ⟨origin, y.val⟩ := |
| 112 | Sigma.ext (by simp) (he _ y.val y.property) |
| 113 | have hs := congrArg (fun p : (t : ℝ) × (F.slice t).carrier => |
| 114 | (F.connection p.1).scalarCurvature p.2) hpoint |
| 115 | exact (congrArg (fun t => (G.connection t).scalarCurvature y) |
| 116 | (show origin + 0 / 1 = origin by simp)).symm.trans |
| 117 | (((hread 0 ⟨ha0, le_rfl⟩ y).2.1).trans hs) |
| 118 | have hterminalBound (y : U) : (G.connection origin).scalarCurvature y < H / 4 := by |
| 119 | rw [hterminalScalar] |
| 120 | have hyN : y.val ∈ N.carrier := hU ▸ y.property |
| 121 | have h := twoComponent_scalar_bound N hx hxQ hyN |
| 122 | have hfactor : (C / 3) * Q < H / 4 := by |
| 123 | dsimp only [H, L] |
| 124 | nlinarith |
| 125 | exact h.trans hfactor |
| 126 | let f (t : ℝ) := scalarCurvatureSupOn (G.metric t) (G.connection t) univ |
| 127 | have hf : ContinuousOn f (Ioc (origin + a) origin) := |
| 128 | continuousOn_iff_continuous_domRestrict.mpr |
| 129 | (Proofs.M47.continuous_scalarSup_on_compact P.m04 G isCompact_univ) |
| 130 | have hsup (t : ℝ) (y : U) : (G.connection t).scalarCurvature y ≤ f t := by |
| 131 | obtain ⟨p, hp, hmax⟩ := scalar_sup_univ_attained (G.metric t) (G.connection t) |
| 132 | exact (hmax y).trans_eq hp.symm |
| 133 | have hfterminal : f origin < H / 4 := by |
| 134 | obtain ⟨p, hp, _hmax⟩ := scalar_sup_univ_attained (G.metric origin) (G.connection origin) |
| 135 | exact hp.trans_lt (hterminalBound p) |
| 136 | let param (t : ℝ) := t - origin |
| 137 | have hparam (t : ℝ) (ht : t ∈ Ioc (origin + a) origin) : param t ∈ Ioc a 0 := by |
| 138 | dsimp only [param] |
| 139 | constructor <;> linarith [ht.1, ht.2] |
| 140 | have hclock (t : ℝ) : origin + param t / 1 = t := by |
| 141 | simp only [param, div_one, add_sub_cancel] |
| 142 | have hwindow (t : ℝ) (ht : t ∈ Ioc (origin + a) origin) : |
| 143 | t ∈ Icc (origin - d / Q) origin := by |
| 144 | constructor |
| 145 | · have hlow : origin - d / Q ≤ origin + a := by linarith |
| 146 | exact hlow.trans ht.1.le |
| 147 | · exact ht.2 |
| 148 | have hscalar (t : ℝ) (ht : t ∈ Ioc (origin + a) origin) (y : U) : |
| 149 | (G.connection t).scalarCurvature y = |
| 150 | (F.connection (origin + param t / 1)).scalarCurvature |
| 151 | (e.forward (param t) ⟨(hparam t ht).1.le, (hparam t ht).2⟩ y.val) := |
| 152 | (congrArg (fun v => (G.connection v).scalarCurvature y) (hclock t)).symm.trans |
| 153 | (hread (param t) (hparam t ht) y).2.1 |
| 154 | have hnorm (t : ℝ) (ht : t ∈ Ioc (origin + a) origin) (y : U) : |
| 155 | (G.connection t).curvatureTensorNorm y = |
| 156 | (F.connection (origin + param t / 1)).curvatureTensorNorm |
| 157 | (e.forward (param t) ⟨(hparam t ht).1.le, (hparam t ht).2⟩ y.val) := |
| 158 | (congrArg (fun v => (G.connection v).curvatureTensorNorm y) (hclock t)).symm.trans |
| 159 | (hread (param t) (hparam t ht) y).2.2 |
| 160 | intro s hs y |
| 161 | by_contra hbad |
| 162 | let t0 := origin + s / 1 |
| 163 | have ht0 : t0 ∈ Ioc (origin + a) origin := by |
| 164 | dsimp only [t0] |
| 165 | simp only [div_one] |
| 166 | constructor <;> linarith [hs.1, hs.2] |
| 167 | have hft0 : H ≤ f t0 := by |
| 168 | have hRy : H ≤ (G.connection t0).scalarCurvature y := by |
| 169 | rw [(hread s hs y).2.1] |
| 170 | exact le_of_not_gt hbad |
| 171 | exact hRy.trans (hsup t0 y) |
| 172 | have hI : Icc t0 origin ⊆ Ioc (origin + a) origin := |
| 173 | fun _ ht => ⟨ht0.1.trans_le ht.1, ht.2⟩ |
| 174 | obtain ⟨c, hc, hfc, hafter, _hstrict⟩ := exists_last_component_scalar_crossing ht0.2 |
| 175 | (hf.mono hI) hft0 (hfterminal.trans (by linarith)) |
| 176 | have hcJ : c ∈ Ioc (origin + a) origin := ⟨ht0.1.trans_le hc.1, hc.2.le⟩ |
| 177 | have hJ : Icc c origin ⊆ Ioc (origin + a) origin := |
| 178 | fun _ ht => ⟨hcJ.1.trans_le ht.1, ht.2⟩ |
| 179 | let Gc : RicciFlow 3 U (Icc c origin) := { |
| 180 | metric := G.metric |
| 181 | connection := G.connection |
| 182 | interval := ordConnected_Icc |
| 183 | nontrivial := ⟨c, ⟨le_rfl, hc.2.le⟩, origin, ⟨hc.2.le, le_rfl⟩, hc.2.ne⟩ |
| 184 | smooth := G.smooth.mono (Set.prod_mono hJ Subset.rfl) |
| 185 | equation := fun t ht z v w => (G.equation t (hJ ht) z v w).mono hJ |
| 186 | } |
| 187 | obtain ⟨p, hp, hmax⟩ := scalar_sup_univ_attained (G.metric c) (G.connection c) |
| 188 | have hpH : (Gc.connection c).scalarCurvature p = H := hp.symm.trans hfc |
| 189 | have hceiling (t : ℝ) (ht : t ∈ Icc c origin) (z : U) : |
| 190 | (G.connection t).scalarCurvature z ≤ H := (hsup t z).trans (hafter t ht) |
| 191 | have hcurvature : ∀ t ∈ Icc c origin, ∀ z : U, |
| 192 | (Gc.connection t).curvatureTensorNorm z ≤ 13 * H := by |
| 193 | intro t ht z |
| 194 | change (G.connection t).curvatureTensorNorm z ≤ 13 * H |
| 195 | rw [hnorm t (hJ ht) z] |
| 196 | apply component_pinched_curvature_bound P |
| 197 | (hpinch (origin + param t / 1) (by rw [hclock]; exact hwindow t (hJ ht))) |
| 198 | hQexp hL (mem_univ _) |
| 199 | exact (hscalar t (hJ ht) z).symm.trans_le (hceiling t ht z) |
| 200 | have hfloor : ∀ t ∈ Icc c origin, ∀ z : U, |
| 201 | -H ≤ (Gc.connection t).scalarCurvature z := by |
| 202 | intro t ht z |
| 203 | change -H ≤ (G.connection t).scalarCurvature z |
| 204 | rw [hscalar t (hJ ht) z] |
| 205 | exact component_pinched_scaled_scalar_floor |
| 206 | (hpinch (origin + param t / 1) (by rw [hclock]; exact hwindow t (hJ ht))) |
| 207 | hQ6 hL (mem_univ _) |
| 208 | obtain ⟨q, _hq, hqQ⟩ := exists_earlier_component_scalar_le PS G isCompact_univ isOpen_univ |
| 209 | hc.2.le hJ (mem_univ (⟨x, hxU⟩ : U)) |
| 210 | rw [hterminalScalar, hxQ] at hqQ |
| 211 | let sc := param c |
| 212 | have hsc : sc ∈ Ioc a 0 := hparam c hcJ |
| 213 | let point (z : U) := e.forward sc ⟨hsc.1.le, hsc.2⟩ z.val |
| 214 | have himage : e.forward sc ⟨hsc.1.le, hsc.2⟩ '' (U : Set (F.slice origin).carrier) = |
| 215 | connectedComponent (point p) := |
| 216 | component_cylinder_image_eq e U.isOpen hcompact hconnected sc _ p.property |
| 217 | have hpoint (z : U) : point z ∈ connectedComponent (point p) := |
| 218 | himage ▸ mem_image_of_mem _ z.property |
| 219 | have hpActual : (F.connection (origin + sc / 1)).scalarCurvature (point p) = H := |
| 220 | (hscalar c hcJ p).symm.trans hpH |
| 221 | have hqActual : (F.connection (origin + sc / 1)).scalarCurvature (point q) ≤ Q := |
| 222 | (hscalar c hcJ q).symm.trans_le hqQ |
| 223 | have hgap : (C / 6) * (F.connection (origin + sc / 1)).scalarCurvature (point q) ≤ |
| 224 | (F.connection (origin + sc / 1)).scalarCurvature (point p) := by |
| 225 | rw [hpActual] |
| 226 | have hmul := mul_le_mul_of_nonneg_left hqActual (by linarith : 0 ≤ C / 6) |
| 227 | dsimp only [H, L] |
| 228 | nlinarith |
| 229 | have hmap : ContMDiff (𝓡 3) (𝓡 3) ∞ point := by |
| 230 | intro z |
| 231 | exact ((e.forward_smooth sc ⟨hsc.1.le, hsc.2⟩ z.val z.property).contMDiffAt |
| 232 | (U.isOpen.mem_nhds z.property)).comp z (contMDiff_subtype_val (n := ∞) z) |
| 233 | have hm (z : U) (v w : TangentSpace (𝓡 3) z) : |
| 234 | (G.metric c).inner z v w = (F.metric (origin + sc / 1)).inner (point z) |
| 235 | (mfderiv (𝓡 3) (𝓡 3) point z v) (mfderiv (𝓡 3) (𝓡 3) point z w) := |
| 236 | (congrArg (fun t => (G.metric t).inner z v w) (hclock c)).symm.trans |
| 237 | ((hread sc hsc z).1 v w).symm |
| 238 | have hgradient : ∀ z : U, 3 * H / 4 ≤ (Gc.connection c).scalarCurvature z → |
| 239 | ∀ v : TangentSpace (𝓡 3) z, (Gc.metric c).inner z v v = 1 → |
| 240 | |mvfderiv (𝓡 3) (Gc.connection c).scalarCurvature z v| ≤ |
| 241 | B * (Gc.connection c).scalarCurvature z ^ (3 / 2 : ℝ) := by |
| 242 | intro z hz v hv |
| 243 | have hzQ : Q ≤ (F.connection (origin + sc / 1)).scalarCurvature (point z) := by |
| 244 | have hfactor : Q ≤ 3 * H / 4 := by dsimp only [H, L]; nlinarith |
| 245 | exact (hfactor.trans hz).trans_eq (hscalar c hcJ z) |
| 246 | have hcWindow : origin + sc / 1 ∈ Ico (origin - d / Q) origin := by |
| 247 | rw [hclock c] |
| 248 | exact ⟨(hwindow c hcJ).1, hc.2⟩ |
| 249 | have hcan := hcanonical (origin + sc / 1) hcWindow (point z) hzQ |
| 250 | have hestimate := hcanonicalBound F (origin + sc / 1) (point p) (point q) |
| 251 | (point z) (hpoint q) (hpoint z) hgap hcan |
| 252 | have hunit : (F.metric (origin + sc / 1)).inner (point z) |
| 253 | (mfderiv (𝓡 3) (𝓡 3) point z v) (mfderiv (𝓡 3) (𝓡 3) point z v) = 1 := |
| 254 | (hm z v v).symm.trans hv |
| 255 | have hdifferential := M45.model_scalar_differential_eq_of_local_isometry |
| 256 | (G.connection c) (F.connection (origin + sc / 1)) isOpen_univ hmap.contMDiffOn |
| 257 | (fun w _hw => hm w) (mem_univ z) v |
| 258 | change |mvfderiv (𝓡 3) (G.connection c).scalarCurvature z v| ≤ |
| 259 | B * (G.connection c).scalarCurvature z ^ (3 / 2 : ℝ) |
| 260 | rw [hdifferential, hscalar c hcJ z] |
| 261 | exact ((F.connection (origin + sc / 1)).abs_scalar_directional_le_scalarGradientNorm |
| 262 | (point z) _ hunit).trans hestimate.2.1 |
| 263 | have hshort : H * (origin - c) ≤ tau := by |
| 264 | have hcLower := (hwindow c hcJ).1 |
| 265 | have htime : (origin - c) * Q ≤ d := (le_div_iff₀ hQ).1 (by linarith : origin - c ≤ d / Q) |
| 266 | have hscaled := mul_le_mul_of_nonneg_left htime hLpos.le |
| 267 | dsimp only [H] |
| 268 | nlinarith [hLd] |
| 269 | have hne := hexclude U c origin H hc.2 hH Gc hcurvature hfloor |
| 270 | (hceiling c ⟨le_rfl, hc.2.le⟩) hgradient hshort hterminalBound p |
| 271 | exact hne hpH |
| 272 | |
| 273 | end PoincareMT.M47 |