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.Topology.Manifold.Poincare.Final.Compatibility.SourceNames |
| 2 | import PoincareLib.Topology.Manifold.Poincare.Final.Compatibility.Metric |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Common.TerminalCommonIntervalSearch |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Blowup.Controls.BlowupControlsSourceBoundedCapCanonical |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Blowup.Controls.BlowupControlsSourceZeroCapCanonical |
| 6 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Blowup.Controls.BlowupControlsSourceMetric |
| 7 | |
| 8 | /-! |
| 9 | # An actual uniform source cylinder after the terminal scalar bound |
| 10 | |
| 11 | The stopped search retains every curvature estimate. Both cap contacts |
| 12 | contradict the original bad point; the surviving cylinder has one duration |
| 13 | chosen before its radius. Morgan--Tian Claim 17.11, pp. 407-408. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M47 |
| 25 | |
| 26 | private theorem uniformSource_zero_contact |
| 27 | {F : SurgeryFlowData.{u}} {base Q : ℝ} {U : Set (F.slice base).carrier} |
| 28 | (e : SurgeryFlowCylinder F (F.slice base) base Q (Icc 0 0) U) |
| 29 | (hbased : ∀ hs y, y ∈ U → HEq (e.forward 0 hs y) y) |
| 30 | (hcontact : ∃ hT : base + 0 / Q ∈ F.surgery_times, |
| 31 | ∀ [Nonempty (F.slice (base + 0 / Q)).carrier], |
| 32 | ∃ i : Fin (F.event (base + 0 / Q) hT).cap_count, |
| 33 | (e.forward 0 ⟨le_rfl, le_rfl⟩ '' U ∩ |
| 34 | ((F.event (base + 0 / Q) hT).caps i).carrier).Nonempty) : |
| 35 | ∃ hT : base ∈ F.surgery_times, ∀ [Nonempty (F.slice base).carrier], |
| 36 | ∃ i : Fin (F.event base hT).cap_count, |
| 37 | ∃ y ∈ U, y ∈ ((F.event base hT).caps i).carrier := by |
| 38 | let Contact (p : (t : ℝ) × (U → (F.slice t).carrier)) : Prop := |
| 39 | ∃ hT : p.1 ∈ F.surgery_times, ∀ [Nonempty (F.slice p.1).carrier], |
| 40 | ∃ i : Fin (F.event p.1 hT).cap_count, |
| 41 | (range p.2 ∩ ((F.event p.1 hT).caps i).carrier).Nonempty |
| 42 | have hsource : Contact ⟨base + 0 / Q, |
| 43 | fun z : U => e.forward 0 ⟨le_rfl, le_rfl⟩ z.1⟩ := by |
| 44 | obtain ⟨hT, hcontact⟩ := hcontact |
| 45 | refine ⟨hT, ?_⟩ |
| 46 | intro hn |
| 47 | obtain ⟨i, z, ⟨y, hy, rfl⟩, hz⟩ := hcontact |
| 48 | exact ⟨i, _, ⟨⟨y, hy⟩, rfl⟩, hz⟩ |
| 49 | have hmap : (⟨base + 0 / Q, fun z : U => e.forward 0 ⟨le_rfl, le_rfl⟩ z.1⟩ : |
| 50 | (t : ℝ) × (U → (F.slice t).carrier)) = ⟨base, fun z : U => z.1⟩ := by |
| 51 | apply Sigma.ext (by simp) |
| 52 | apply Function.hfunext rfl |
| 53 | intro z w hzw |
| 54 | cases hzw |
| 55 | exact hbased _ z.1 z.2 |
| 56 | have htarget : Contact ⟨base, fun z : U => z.1⟩ := |
| 57 | (congrArg Contact hmap).mp hsource |
| 58 | obtain ⟨hT, htarget⟩ := htarget |
| 59 | refine ⟨hT, ?_⟩ |
| 60 | intro hn |
| 61 | obtain ⟨i, z, ⟨y, rfl⟩, hz⟩ := htarget |
| 62 | exact ⟨i, y.1, y.2, hz⟩ |
| 63 | |
| 64 | /-- The terminal scalar ceiling yields one actual controlled source |
| 65 | duration before the radius and pinching error; both cap cases are excluded |
| 66 | at the exact first-failure point using the literal standard transfer. -/ |
| 67 | theorem exists_first_failure_uniform_source_cylinder_of_pointwise |
| 68 | (P : M46Predecessors.{u}) (S : RepairedControlledSchedulesData.{u}) |
| 69 | (B : M47ComponentAnalyticBounds.{u} S.setup.C) |
| 70 | (p : SurgeryParameterPrefix S.constants) (hp : S.SeedCompatible p) |
| 71 | (pointwise : ∀ theta : ℝ, theta < 1 → ∀ v ∈ Icc 0 theta, |
| 72 | ∀ z : StandardCapSpace, |
| 73 | ∃ A0 eta0 nearTime Q0 : ℝ, ∃ V : Set StandardCapSpace, |
| 74 | 0 < A0 ∧ 0 < eta0 ∧ 0 < nearTime ∧ 0 < Q0 ∧ IsOpen V ∧ z ∈ V ∧ |
| 75 | ∀ A : ℝ, A0 ≤ A → ∀ eta : ℝ, 0 < eta → eta ≤ eta0 → |
| 76 | ∀ rNext : ℝ, 0 < rNext → rNext ≤ p.r (Fin.last p.i) → |
| 77 | ∃ cutoff : ℝ, 0 < cutoff ∧ cutoff ≤ p.Delta (Fin.last p.i) ∧ |
| 78 | ∀ (F : SurgeryFlowData.{u}) (O : SurgeryObservation F), |
| 79 | O.H ≤ surgeryEpochStart (p.i + 1) → |
| 80 | ∀ prior : SurgeryPrefixControls p F O, |
| 81 | SurgeryFlowAdmissible F → SurgeryFlowPinched F → |
| 82 | SurgeryPostPrefixScales p F O rNext cutoff → |
| 83 | (∀ b ∈ surgeryObservationInterval O ∩ overlapInterval p, |
| 84 | F.parameters.delta b ≤ cutoff) → |
| 85 | ∀ (t : ℝ) (hT : t ∈ F.surgery_times), |
| 86 | ∀ [Nonempty (F.slice t).carrier], ∀ (i : Fin (F.event t hT).cap_count) |
| 87 | (J : Set ℝ) |
| 88 | (e : SurgeryFlowCylinder F (F.slice t) t ((F.parameters.h t)⁻¹ ^ 2) J |
| 89 | ((F.metric t).ball ((F.event t hT).caps i).tip (A * F.parameters.h t))) |
| 90 | (initial : SurgeryCapInitialComparison F t hT i A), |
| 91 | SurgeryCapFamilyComparison F |
| 92 | (O.redecorateTo prior.standard_initial_eq).standard_flow A eta e initial.chart → |
| 93 | ∀ hzero : (0 : ℝ) ∈ J, |
| 94 | (∀ y ∈ (F.metric t).ball ((F.event t hT).caps i).tip (A * F.parameters.h t), |
| 95 | HEq (e.forward 0 hzero y) y) → |
| 96 | 0 < F.parameters.h t → |
| 97 | ∀ (s : ℝ) (hs : s ∈ J), s ∈ Icc 0 theta → Icc 0 s ⊆ J → |
| 98 | |s - v| < nearTime → ∀ z' ∈ V, |
| 99 | let base := t + s / ((F.parameters.h t)⁻¹ ^ 2) |
| 100 | let x := e.forward s hs (initial.chart z') |
| 101 | let Q := (F.connection base).scalarCurvature x |
| 102 | base ∈ Ico (surgeryEpochStart p.i) O.H → Q0 ≤ Q → rNext⁻¹ ^ 2 ≤ Q → |
| 103 | SurgeryCanonicalOn F (surgeryObservationInterval O ∩ Iio base) rNext → |
| 104 | Q * (base - t) ∈ Icc 0 1 → |
| 105 | SurgeryCanonicalControl F base x S.setup.epsilon S.setup.C) |
| 106 | {K : ℝ} (hK : 1 ≤ K) : |
| 107 | ∃ tau : ℝ, 0 < tau ∧ tau ≤ 1 ∧ |
| 108 | ∀ A : ℝ, 0 < A → ∃ Q0 : ℝ, 0 < Q0 ∧ |
| 109 | ∀ rNext : ℝ, 0 < rNext → rNext ≤ p.r (Fin.last p.i) → |
| 110 | ∃ cutoff : ℝ, 0 < cutoff ∧ cutoff ≤ p.Delta (Fin.last p.i) ∧ |
| 111 | ∀ (F : SurgeryFlowData.{u}) (O : SurgeryObservation F), |
| 112 | O.H ≤ surgeryEpochStart (p.i + 1) → |
| 113 | ∀ _prior : SurgeryPrefixControls p F O, |
| 114 | SurgeryFlowAdmissible F → SurgeryFlowPinched F → |
| 115 | SurgeryPostPrefixScales p F O rNext cutoff → |
| 116 | (∀ b ∈ surgeryObservationInterval O ∩ overlapInterval p, |
| 117 | F.parameters.delta b ≤ cutoff) → |
| 118 | ∀ (W : M33RegularHistoryWindow F) (H : M33RegularHistoryData W) |
| 119 | {base Q : ℝ} (ht : base ∈ H.generalized.interval), |
| 120 | base ∈ Ico (surgeryEpochStart p.i) O.H → Q0 ≤ Q → rNext⁻¹ ^ 2 ≤ Q → |
| 121 | SurgeryCanonicalOn F (surgeryObservationInterval O ∩ Iio base) rNext → |
| 122 | ∀ x : (H.generalized.slice base).carrier, |
| 123 | H.generalized.scalar ⟨base, x⟩ = Q → |
| 124 | ¬ SurgeryCanonicalControl F base (H.history.forward base ht x) |
| 125 | F.parameters.epsilon F.parameters.C → |
| 126 | ∀ eta : ℝ, 0 < eta → blowupPinchingThreshold (8 * K) eta ≤ Q → |
| 127 | (∀ y ∈ (F.metric base).ball (H.history.forward base ht x) (A / Real.sqrt Q), |
| 128 | (F.connection base).scalarCurvature y ≤ (2 * K) * Q) → |
| 129 | ∃ e : SurgeryFlowCylinder F (F.slice base) base Q (Icc (-tau) 0) |
| 130 | ((F.metric base).ball (H.history.forward base ht x) (A / Real.sqrt Q)), |
| 131 | (∀ hs y, |
| 132 | y ∈ (F.metric base).ball (H.history.forward base ht x) (A / Real.sqrt Q) → |
| 133 | HEq (e.forward 0 hs y) y) ∧ |
| 134 | ∀ s hs y, |
| 135 | y ∈ (F.metric base).ball (H.history.forward base ht x) (A / Real.sqrt Q) → |
| 136 | |(F.connection (base + s / Q)).curvatureTensorNorm (e.forward s hs y)| ≤ |
| 137 | (13 * max (8 * K) 1) * Q ∧ |
| 138 | (F.connection (base + s / Q)).negativeCurvaturePart (e.forward s hs y) ≤ |
| 139 | eta * Q := by |
| 140 | let D := terminalCommonIntervalDuration S B K |
| 141 | let B0 : ℝ := 13 * max (8 * K) 1 |
| 142 | have hD : 0 < D := (terminalCommonInterval_duration_bounds S B hK).1 |
| 143 | have hDOne : D ≤ 1 := (terminalCommonInterval_duration_bounds S B hK).2.1 |
| 144 | have hB0 : 0 < B0 := by dsimp only [B0]; positivity |
| 145 | let tau := min D (12 * B0)⁻¹ |
| 146 | have htau : 0 < tau := lt_min hD (inv_pos.mpr (by positivity)) |
| 147 | have htauD : tau ≤ D := min_le_left _ _ |
| 148 | have htauOne : tau ≤ 1 := htauD.trans hDOne |
| 149 | have hshort : 6 * B0 * tau ≤ 1 / 2 := by |
| 150 | have hmul : tau * (12 * B0) ≤ 1 := (le_div_iff₀ (by positivity : 0 < 12 * B0)).mp |
| 151 | (by simpa only [one_div] using (min_le_right D (12 * B0)⁻¹)) |
| 152 | nlinarith only [hmul] |
| 153 | refine ⟨tau, htau, htauOne, fun A hA => ?_⟩ |
| 154 | obtain ⟨Qpositive, hQpositive, _h128, positive⟩ := |
| 155 | exists_bounded_positive_cap_canonical_cutoff P S p hp |
| 156 | (by linarith only [hK] : 0 < 8 * K) hA pointwise |
| 157 | obtain ⟨Qzero, _hQzero, zero⟩ := |
| 158 | exists_first_failure_zero_cap_canonical_cutoff S p hp hA pointwise |
| 159 | let Q0 := max Qpositive (max Qzero (max B.curvature_threshold (64 * (2 * D + 1)))) |
| 160 | refine ⟨Q0, hQpositive.trans_le (le_max_left _ _), fun rNext hrNext hrLast => ?_⟩ |
| 161 | obtain ⟨deltaPositive, hdeltaPositive, hdeltaLast, applyPositive⟩ := |
| 162 | positive rNext hrNext hrLast |
| 163 | obtain ⟨deltaZero, hdeltaZero, _hdeltaZeroLast, applyZero⟩ := zero rNext hrNext hrLast |
| 164 | let cutoff := min deltaPositive (min deltaZero (B.delta S.setup.standard_initial S.constants)) |
| 165 | have hcutPositive : cutoff ≤ deltaPositive := min_le_left _ _ |
| 166 | have hcutZero : cutoff ≤ deltaZero := (min_le_right _ _).trans (min_le_left _ _) |
| 167 | have hcutAnalytic : cutoff ≤ B.delta S.setup.standard_initial S.constants := |
| 168 | (min_le_right _ _).trans (min_le_right _ _) |
| 169 | refine ⟨cutoff, lt_min hdeltaPositive (lt_min hdeltaZero (B.delta_pos _ _)), |
| 170 | hcutPositive.trans hdeltaLast, ?_⟩ |
| 171 | intro F O hH prior hadmissible hpinch next overlap W H base Q ht hBase hLarge |
| 172 | hThreshold hEarlier x hscale hfail eta heta hPinchingScale hTerminal |
| 173 | have hQpositiveQ : Qpositive ≤ Q := (le_max_left _ _).trans hLarge |
| 174 | have hQzeroQ : Qzero ≤ Q := |
| 175 | (le_max_left _ _).trans ((le_max_right _ _).trans hLarge) |
| 176 | have hQlarge : B.curvature_threshold ≤ Q := |
| 177 | (le_max_left _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans hLarge)) |
| 178 | have hQtime : 64 * (2 * D + 1) ≤ Q := |
| 179 | (le_max_right _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans hLarge)) |
| 180 | have hQ : 0 < Q := hQpositive.trans_le hQpositiveQ |
| 181 | have hInitial : F.standard_initial = S.setup.standard_initial := by |
| 182 | rw [prior.standard_initial_eq, hp.setup_eq] |
| 183 | have hC : F.parameters.C = S.setup.C := by rw [prior.C_eq, hp.setup_eq] |
| 184 | have hOverlap : ∀ s ∈ surgeryObservationInterval O ∩ |
| 185 | Ico (surgeryEpochStart (p.i - 1)) O.H, |
| 186 | F.parameters.delta s ≤ B.delta S.setup.standard_initial S.constants := by |
| 187 | intro s hs |
| 188 | exact (overlap s ⟨hs.1, ⟨hs.2.1, hs.2.2.trans_le hH⟩⟩).trans hcutAnalytic |
| 189 | let U := (F.metric base).ball (H.history.forward base ht x) (A / Real.sqrt Q) |
| 190 | have hcenter : H.history.forward base ht x ∈ U := by |
| 191 | change (F.metric base).edist _ _ < ENNReal.ofReal (A / Real.sqrt Q) |
| 192 | rw [M36.metric_edist_self] |
| 193 | exact ENNReal.ofReal_pos.mpr (div_pos hA (Real.sqrt_pos.mpr hQ)) |
| 194 | obtain ⟨b, hb, e, hbased, hbounds, hstop⟩ := |
| 195 | terminalCommonInterval_exists_bounded_search S B hK p O hInitial prior.local_constants_eq |
| 196 | hC hBase hQtime hQlarge hThreshold hpinch hEarlier hOverlap P U |
| 197 | (M04.initial_ball_isOpen _ _ _) ⟨_, hcenter⟩ hTerminal heta hPinchingScale |
| 198 | by_cases hlong : b < -tau |
| 199 | · have htime : Icc (-tau) 0 ⊆ Icc b 0 := Icc_subset_Icc hlong.le le_rfl |
| 200 | refine ⟨e.restrict htime ordConnected_Icc (Subset.refl _), |
| 201 | fun hs y hy => hbased (htime hs) y hy, ?_⟩ |
| 202 | intro s hs y hy |
| 203 | exact (hbounds s (htime hs) y hy).2 |
| 204 | · have hnear : -tau ≤ b := le_of_not_gt hlong |
| 205 | have hcap := hstop.resolve_left (by |
| 206 | intro hbD |
| 207 | exact hlong (hbD.trans_le (neg_le_neg htauD))) |
| 208 | by_cases hbNeg : b < 0 |
| 209 | · have ha : b ∈ Ico (-1 : ℝ) 0 := ⟨by linarith only [hnear, htauOne], hbNeg⟩ |
| 210 | have hmetric := normalized_search_metric_comparison ⟨P.m04, P.m13.ordinary_flow⟩ |
| 211 | hpinch e (M04.initial_ball_isOpen _ _ _) hb.2 hB0.le hbased |
| 212 | (fun s hs y hy => (le_abs_self _).trans (hbounds s hs y hy).2.1) |
| 213 | ((mul_le_mul_of_nonneg_left (by linarith only [hnear] : -b ≤ tau) |
| 214 | (by positivity : 0 ≤ 6 * B0)).trans hshort) |
| 215 | obtain ⟨hT, hcap⟩ := hcap.2 |
| 216 | let _inst : Nonempty (F.slice (base + b / Q)).carrier := |
| 217 | ⟨e.forward b ⟨le_rfl, hb.2⟩ (H.history.forward base ht x)⟩ |
| 218 | obtain ⟨i, z, ⟨contact, hcontact, rfl⟩, hc⟩ := hcap |
| 219 | exact (hfail (applyPositive F O hH prior hadmissible hpinch |
| 220 | (next.mono_delta hcutPositive) (fun s hs => (overlap s hs).trans hcutPositive) |
| 221 | hBase hQpositiveQ hThreshold hEarlier ha (H.history.forward base ht x) |
| 222 | ((H.scalar_pullback base ht x).trans hscale) e hbased |
| 223 | (fun s hs y hy => (hbounds s hs y hy).1) |
| 224 | (fun y hy v => (hmetric b ⟨le_rfl, hb.2⟩ y hy v).2) |
| 225 | hT i contact hcontact hc)).elim |
| 226 | · have hbZero : b = 0 := le_antisymm hb.2 (le_of_not_gt hbNeg) |
| 227 | subst b |
| 228 | obtain ⟨hT, contact⟩ := uniformSource_zero_contact e hbased hcap.2 |
| 229 | let _inst : Nonempty (F.slice base).carrier := ⟨H.history.forward base ht x⟩ |
| 230 | obtain ⟨i, y, hy, hcapY⟩ := contact |
| 231 | exact (hfail (applyZero F O hH prior hadmissible hpinch |
| 232 | (next.mono_delta hcutZero) (fun s hs => (overlap s hs).trans hcutZero) |
| 233 | W H ht hBase hQzeroQ hThreshold hEarlier x hscale hT i y hy hcapY)).elim |
| 234 | |
| 235 | end PoincareMT.M47 |