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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Geometry.CoverTrimming |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Geometry.SliceCover |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Spheres.RoundUniformScalar |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Geometry.CanonicalCarrierUnion |
| 6 | |
| 7 | /-! |
| 8 | # Original strong-neck provenance on the Claim 10.4 segment |
| 9 | |
| 10 | The compact canonical alternatives are excluded using the actual low and |
| 11 | high endpoints of the minimizing curve, which may have been recentered. |
| 12 | The original scalar-component base stays independent of those endpoints. |
| 13 | The higher retained band returns to that original component before fresh |
| 14 | canonical control is applied (Morgan--Tian Claim 10.4, pp. 249--250). |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle ENNReal |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M28 |
| 25 | |
| 26 | /-- At one universal accuracy, the original endpoints of the Claim 10.4 |
| 27 | curve exclude both compact canonical alternatives on its whole image. The |
| 28 | round scalar ratio is produced by the actual metric certificate. -/ |
| 29 | theorem exists_claim10_4_compact_exclusion_accuracy |
| 30 | (P : RicciFlowCurvatureTheory.{u}) : |
| 31 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 32 | ∀ (F : GeneralizedRicciFlowData.{u}) (time epsilon C Q : ℝ), |
| 33 | epsilon ≤ epsilon₀ → 0 < C → 0 < Q → |
| 34 | ∀ (γ : ℝ → (F.slice time).carrier) (a b : ℝ), a ≤ b → |
| 35 | ContinuousOn γ (Icc a b) → |
| 36 | F.scalar ⟨time, γ a⟩ ≤ 8 * Q → |
| 37 | 32 * (max C 2) ^ 2 * Q < F.scalar ⟨time, γ b⟩ → |
| 38 | (∀ N : SingularCComponent (F.metric time) (F.connection time) C, |
| 39 | Disjoint (γ '' Icc a b) N.carrier) ∧ |
| 40 | ∀ N : SingularRoundComponent (F.metric time) epsilon, |
| 41 | Disjoint (γ '' Icc a b) N.carrier := by |
| 42 | obtain ⟨epsilon₀, hepsilon₀, hthreshold, hround⟩ := |
| 43 | tube.exists_round_scalar_ratio_accuracy.{u} |
| 44 | refine ⟨epsilon₀, hepsilon₀, hthreshold, ?_⟩ |
| 45 | intro F time epsilon C Q hsmall hC hQ γ a b hab hγ hstart hend |
| 46 | let B := max C 2 |
| 47 | have hB : 2 ≤ B := le_max_right C 2 |
| 48 | have hCB : C ≤ B := le_max_left C 2 |
| 49 | have hBpos : 0 < B := lt_of_lt_of_le (by norm_num) hB |
| 50 | have hBsquare : B ≤ B ^ 2 := by nlinarith [sq_nonneg (B - 1)] |
| 51 | have hBsquareQ : B * Q ≤ B ^ 2 * Q := |
| 52 | mul_le_mul_of_nonneg_right hBsquare hQ.le |
| 53 | have hBQ : 0 < B * Q := mul_pos hBpos hQ |
| 54 | have hCstart : C * F.scalar ⟨time, γ a⟩ ≤ 8 * B * Q := by |
| 55 | calc |
| 56 | C * F.scalar ⟨time, γ a⟩ ≤ C * (8 * Q) := |
| 57 | mul_le_mul_of_nonneg_left hstart hC.le |
| 58 | _ ≤ B * (8 * Q) := mul_le_mul_of_nonneg_right hCB (by positivity) |
| 59 | _ = 8 * B * Q := by ring |
| 60 | have hend' : 32 * B ^ 2 * Q < F.scalar ⟨time, γ b⟩ := hend |
| 61 | have hCratio : C * F.scalar ⟨time, γ a⟩ < 6 * F.scalar ⟨time, γ b⟩ := by |
| 62 | nlinarith only [hCstart, hBsquareQ, hBQ, hend'] |
| 63 | have hQle : 2 * Q ≤ B * Q := mul_le_mul_of_nonneg_right hB hQ.le |
| 64 | have hroundRatio : 2 * F.scalar ⟨time, γ a⟩ < F.scalar ⟨time, γ b⟩ := by |
| 65 | nlinarith only [hstart, hQ, hQle, hBsquareQ, hend'] |
| 66 | constructor |
| 67 | · intro N |
| 68 | apply disjoint_left.mpr |
| 69 | rintro x ⟨s, hs, rfl⟩ hsN |
| 70 | exact F.not_singularCComponent_on_path P time C hab γ hγ hCratio hs N hsN |
| 71 | · intro N |
| 72 | apply disjoint_left.mpr |
| 73 | rintro x ⟨s, hs, rfl⟩ hsN |
| 74 | have hsubset : γ '' Icc a b ⊆ N.carrier := by |
| 75 | rw [N.component_eq] at hsN ⊢ |
| 76 | rw [connectedComponent_eq hsN] |
| 77 | exact (isPreconnected_Icc.image γ hγ).subset_connectedComponent |
| 78 | (mem_image_of_mem γ hs) |
| 79 | have hratio := hround (F.slice time).carrier (F.metric time) (F.connection time) |
| 80 | epsilon N hsmall (γ b) (hsubset (mem_image_of_mem γ (right_mem_Icc.mpr hab))) |
| 81 | (γ a) (hsubset (mem_image_of_mem γ (left_mem_Icc.mpr hab))) |
| 82 | exact (not_lt_of_ge hratio) hroundRatio |
| 83 | |
| 84 | /-- An actual finite regional minimizer gives the Claim 10.4 scalar cuts |
| 85 | and an actual neck-only cover with literal original strong-neck provenance. |
| 86 | The shared confinement producer supplies the displayed carrier nesting and |
| 87 | intrinsic minimum; cap-core avoidance is derived here (pp. 249--250). -/ |
| 88 | theorem exists_claim10_4_source_necks_accuracy |
| 89 | (P : RicciFlowCurvatureTheory.{u}) : |
| 90 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 91 | ∀ (F : GeneralizedRicciFlowData.{u}) (time epsilon C Q : ℝ), |
| 92 | 0 < epsilon → epsilon ≤ epsilon₀ → 0 < C → 0 < Q → |
| 93 | ∀ (H : ConnectedNeckCapCover (F.metric time)), |
| 94 | H.epsilon = epsilon → H.cap_constant = C → |
| 95 | ∀ (component_base : (F.slice time).carrier) (U : Set (F.slice time).carrier) |
| 96 | (γ : ℝ → (F.slice time).carrier) (a b : ℝ), a ≤ b → |
| 97 | H.X = connectedComponentIn {p | 4 * Q < F.scalar ⟨time, p⟩} |
| 98 | component_base → |
| 99 | H.X ⊆ U → U ⊆ H.canonicalCarrierUnion → |
| 100 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc a b) → |
| 101 | MapsTo γ (Icc a b) U → |
| 102 | (F.metric time).pathELength γ a b ≠ ⊤ → |
| 103 | (F.metric time).pathELength γ a b = |
| 104 | intrinsicEDist (F.metric time) U (γ a) (γ b) → |
| 105 | F.scalar ⟨time, γ a⟩ ≤ 8 * (max C 2) * Q → |
| 106 | 32 * (max C 2) ^ 3 * Q < F.scalar ⟨time, γ b⟩ → |
| 107 | generalizedSliceStrongCanonicalNeighborhoods F epsilon C (4 * Q) time → |
| 108 | ∃ s t : ℝ, a < s ∧ s < t ∧ t < b ∧ |
| 109 | F.scalar ⟨time, γ s⟩ = 16 * (max C 2) ^ 2 * Q ∧ |
| 110 | F.scalar ⟨time, γ t⟩ = F.scalar ⟨time, γ b⟩ / (2 * (max C 2)) ∧ |
| 111 | (∀ v ∈ Icc s t, F.scalar ⟨time, γ v⟩ ∈ |
| 112 | Icc (16 * (max C 2) ^ 2 * Q) |
| 113 | (F.scalar ⟨time, γ b⟩ / (2 * (max C 2)))) ∧ |
| 114 | (F.metric time).pathELength γ s t ≤ (F.metric time).pathELength γ a b ∧ |
| 115 | ∃ hhalf : epsilon < 1 / 2, ∃ K : NeckOnlyCover (F.metric time), |
| 116 | K.X = γ '' Icc s t ∧ K.epsilon = epsilon ∧ |
| 117 | K.X ⊆ H.X ∧ |
| 118 | (∀ N ∈ K.necks, ∃ S : GeneralizedStrongNeck F time epsilon, |
| 119 | N = strongNeck_top S hhalf ∧ S.center ∈ K.X) ∧ |
| 120 | ∀ v ∈ Icc s t, ∃ S : GeneralizedStrongNeck F time epsilon, |
| 121 | S.center = γ v := by |
| 122 | obtain ⟨epsilonC, hCpos, hCthreshold, hcompact⟩ := |
| 123 | exists_claim10_4_compact_exclusion_accuracy P |
| 124 | obtain ⟨epsilonU, hUpos, _, hcapture⟩ := |
| 125 | exists_canonicalCarrierUnion_scalar_accuracy.{u} |
| 126 | let epsilon₀ := min epsilonC (min epsilonU neckShorteningEpsilon) |
| 127 | have hpos : 0 < epsilon₀ := |
| 128 | lt_min hCpos (lt_min hUpos neckShorteningEpsilon_pos) |
| 129 | have hthreshold : epsilon₀ ≤ (1 / 200 : ℝ) := |
| 130 | (min_le_left _ _).trans hCthreshold |
| 131 | refine ⟨epsilon₀, hpos, hthreshold, ?_⟩ |
| 132 | intro F time epsilon C Q hepsilon hsmall hC hQ H hHepsilon hHC component_base U γ a b hab |
| 133 | hHX hXU hUV hγ hγU hfinite hmin hstart hend hcanonical |
| 134 | have hsmallC : epsilon ≤ epsilonC := hsmall.trans (min_le_left _ _) |
| 135 | have hsmallU : epsilon ≤ epsilonU := |
| 136 | hsmall.trans ((min_le_right _ _).trans (min_le_left _ _)) |
| 137 | have hshort : epsilon ≤ neckShorteningEpsilon := |
| 138 | hsmall.trans ((min_le_right _ _).trans (min_le_right _ _)) |
| 139 | have hhalf : epsilon < 1 / 2 := |
| 140 | lt_of_le_of_lt (hsmall.trans hthreshold) (by norm_num) |
| 141 | have hB : 2 ≤ max C 2 := le_max_right C 2 |
| 142 | have hBQ : 0 < max C 2 * Q := mul_pos (lt_of_lt_of_le (by norm_num) hB) hQ |
| 143 | have hQle : Q ≤ max C 2 * Q := by |
| 144 | nlinarith only [mul_le_mul_of_nonneg_right hB hQ.le, hQ] |
| 145 | have hstart' : F.scalar ⟨time, γ a⟩ ≤ 8 * (max C 2 * Q) := by |
| 146 | simpa only [mul_assoc] using hstart |
| 147 | have hend' : 32 * (max C 2) ^ 2 * (max C 2 * Q) < F.scalar ⟨time, γ b⟩ := by |
| 148 | convert hend using 1 |
| 149 | ring |
| 150 | obtain ⟨hcomponent, hround⟩ := hcompact F time epsilon C (max C 2 * Q) |
| 151 | hsmallC hC hBQ γ a b hab hγ.continuousOn hstart' hend' |
| 152 | have hscalar : ContinuousOn (fun v => F.scalar ⟨time, γ v⟩) (Icc a b) := |
| 153 | (F.continuous_scalar_slice P time).comp_continuousOn hγ.continuousOn |
| 154 | obtain ⟨s, t, has, hst, htb, hsvalue, htvalue, hband⟩ := |
| 155 | exists_claim10_4_scalar_band hab hscalar hB hBQ hstart' hend' |
| 156 | have hsub : Icc s t ⊆ Icc a b := Icc_subset_Icc has.le htb.le |
| 157 | have hretained (v : ℝ) (hv : v ∈ Icc s t) : γ v ∈ H.X := by |
| 158 | apply hcapture (F.slice time).carrier (F.metric time) (F.connection time) |
| 159 | H Q component_base hQ (by simpa only [hHepsilon] using hsmallU) hHX (γ v) |
| 160 | (hUV (hγU (hsub hv))) |
| 161 | rw [hHC] |
| 162 | change 8 * (max C 2) * Q ≤ F.scalar ⟨time, γ v⟩ |
| 163 | have hlow := (hband v hv).1 |
| 164 | nlinarith only [hlow, hBQ, mul_le_mul_of_nonneg_right hB hBQ.le] |
| 165 | have hcapfree (v : ℝ) (hv : v ∈ Icc s t) |
| 166 | (N : CapCertificate (F.metric time)) (hNepsilon : N.epsilon = epsilon) |
| 167 | (hNC : N.cap_constant ≤ C) : γ v ∉ N.core := by |
| 168 | have hcomponentU : connectedComponentIn |
| 169 | {p | 4 * (max C 2 * Q) < (F.connection time).scalarCurvature p} (γ v) ⊆ U := by |
| 170 | have hcomp := connectedComponentIn_eq (hHX ▸ hretained v hv) |
| 171 | have hmono : {p | 4 * (max C 2 * Q) < F.scalar ⟨time, p⟩} ⊆ |
| 172 | {p | 4 * Q < F.scalar ⟨time, p⟩} := by |
| 173 | intro p hp |
| 174 | change 4 * (max C 2 * Q) < F.scalar ⟨time, p⟩ at hp |
| 175 | change 4 * Q < F.scalar ⟨time, p⟩ |
| 176 | linarith only [hp, hQle] |
| 177 | apply (connectedComponentIn_mono (γ v) hmono).trans |
| 178 | rw [← hcomp, ← hHX] |
| 179 | exact hXU |
| 180 | exact N.not_mem_core_of_scalar_band (F.connection time) |
| 181 | (by simpa only [hNepsilon] using hshort) (hNC.trans (le_max_left C 2)) hBQ |
| 182 | (hsub hv) hγ hγU hfinite hmin hcomponentU hstart' (hband v hv).1 (hband v hv).2 |
| 183 | have hX : IsConnected (γ '' Icc s t) := |
| 184 | (isConnected_Icc hst.le).image γ (hγ.continuousOn.mono hsub) |
| 185 | have hcan : ∀ x ∈ γ '' Icc s t, |
| 186 | Nonempty (GeneralizedCanonicalControl (F := F) time x epsilon C) := by |
| 187 | rintro x ⟨v, hv, rfl⟩ |
| 188 | apply hcanonical |
| 189 | have hlow := (hband v hv).1 |
| 190 | have hbase : 4 * Q ≤ 16 * (max C 2) * (max C 2 * Q) := by |
| 191 | nlinarith only [hQle, hBQ, mul_le_mul_of_nonneg_right hB hBQ.le] |
| 192 | exact hbase.trans hlow |
| 193 | have hcomponent' (N : SingularCComponent (F.metric time) (F.connection time) C) : |
| 194 | Disjoint (γ '' Icc s t) N.carrier := by |
| 195 | apply disjoint_left.mpr |
| 196 | rintro x ⟨v, hv, rfl⟩ hxN |
| 197 | exact disjoint_left.mp (hcomponent N) (mem_image_of_mem γ (hsub hv)) hxN |
| 198 | have hround' (N : SingularRoundComponent (F.metric time) epsilon) : |
| 199 | Disjoint (γ '' Icc s t) N.carrier := by |
| 200 | apply disjoint_left.mpr |
| 201 | rintro x ⟨v, hv, rfl⟩ hxN |
| 202 | exact disjoint_left.mp (hround N) (mem_image_of_mem γ (hsub hv)) hxN |
| 203 | let T := testedSliceNeckCapCover hepsilon hsmall hthreshold hC |
| 204 | (γ '' Icc s t) hX hcan hcomponent' hround' |
| 205 | have hcenters : ∀ x ∈ T.X, ∃ N, N ∈ T.necks ∧ N.center = x := by |
| 206 | intro x hx |
| 207 | rcases T.pointwise_cover x hx with hneck | ⟨N, hN, hxcore⟩ |
| 208 | · exact hneck |
| 209 | · obtain ⟨v, hv, rfl⟩ := hx |
| 210 | exact False.elim (hcapfree v hv N (T.cap_epsilon N hN) |
| 211 | (T.cap_constant_bound N hN) hxcore) |
| 212 | let K : NeckOnlyCover (F.metric time) := { |
| 213 | epsilon := T.epsilon |
| 214 | epsilon_pos := T.epsilon_pos |
| 215 | epsilon_threshold := T.epsilon_threshold |
| 216 | epsilon_threshold_pos := T.epsilon_threshold_pos |
| 217 | epsilon_threshold_le_one_two_hundred := T.epsilon_threshold_le_one_two_hundred |
| 218 | epsilon_le_threshold := T.epsilon_le_threshold |
| 219 | X := T.X |
| 220 | connected_X := T.connected_X |
| 221 | necks := T.necks |
| 222 | pointwise_center_cover := hcenters |
| 223 | neck_epsilon := T.neck_epsilon } |
| 224 | have hprovenance (N : EpsilonNeck (F.metric time)) (hN : N ∈ K.necks) : |
| 225 | ∃ S : GeneralizedStrongNeck F time epsilon, |
| 226 | N = strongNeck_top S hhalf ∧ S.center ∈ K.X := by |
| 227 | exact testedSliceNeckCapCover_neck_provenance hepsilon hsmall hthreshold hC |
| 228 | (γ '' Icc s t) hX hcan hcomponent' hround' N hN |
| 229 | have hloweq : 16 * (max C 2) * (max C 2 * Q) = 16 * (max C 2) ^ 2 * Q := by ring |
| 230 | rw [hloweq] at hsvalue hband |
| 231 | refine ⟨s, t, has, hst, htb, hsvalue, htvalue, hband, ?_, hhalf, K, rfl, rfl, |
| 232 | ?_, hprovenance, ?_⟩ |
| 233 | · let : Bundle.RiemannianBundle |
| 234 | (TangentSpace (𝓡 3) : (F.slice time).carrier → Type _) := |
| 235 | ⟨(F.metric time).toRiemannianMetric⟩ |
| 236 | exact Manifold.pathELength_mono has.le htb.le |
| 237 | · rintro x ⟨v, hv, rfl⟩ |
| 238 | exact hretained v hv |
| 239 | · intro v hv |
| 240 | obtain ⟨N, hN, hcenter⟩ := K.pointwise_center_cover (γ v) (mem_image_of_mem γ hv) |
| 241 | obtain ⟨S, htop, _⟩ := hprovenance N hN |
| 242 | refine ⟨S, ?_⟩ |
| 243 | simpa only [htop, strongNeck_top] using hcenter |
| 244 | |
| 245 | end PoincareMT.M28 |