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.Geometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Flow.Basic |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.HornSelection |
| 4 | |
| 5 | /-! |
| 6 | Adapted from Mapher `PoincareMT/Definitions/Ch16/ControlledSurgery.lean` at |
| 7 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. Declaration bodies are retained; |
| 8 | see `references/ricci-flow/mapher/surgery-adapters-port.json`. |
| 9 | -/ |
| 10 | |
| 11 | /-! |
| 12 | # Shared controls for the inductive surgery estimates |
| 13 | |
| 14 | The observation interval is a subinterval of an already existing surgery |
| 15 | flow. It is never manufactured as a new `SurgeryFlowData`, whose finite |
| 16 | endpoints are required to be maximal. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | structure SurgeryControlSetup (K : MetricSurgeryConstants) where |
| 28 | standard_initial : StandardInitialMetric |
| 29 | standard_flow : MaximalStandardCapFlow standard_initial |
| 30 | standard_lifetime_one : standard_flow.base.lifetime = 1 |
| 31 | epsilon : ℝ |
| 32 | C : ℝ |
| 33 | epsilon_pos : 0 < epsilon |
| 34 | epsilon_lt_half : epsilon < 1 / 2 |
| 35 | epsilon_le : epsilon ≤ min (1 / 200) (K.delta₀ / 2) |
| 36 | C_pos : 0 < C |
| 37 | C_large : 1 ≤ C |
| 38 | C_ge_local : K.C₀ ≤ C |
| 39 | selector : CommonSurgeryScaleSelector |
| 40 | selector_delta : ∀ rho delta, 0 < rho → 0 < delta → |
| 41 | selector.h rho delta ≤ K.delta₀ * rho |
| 42 | |
| 43 | noncomputable def surgeryEpochStart (j : ℕ) : ℝ := (2 : ℝ) ^ j / 32 |
| 44 | |
| 45 | def surgeryEpoch (j : ℕ) : Set ℝ := |
| 46 | Set.Ico (surgeryEpochStart j) (surgeryEpochStart (j + 1)) |
| 47 | |
| 48 | /-- Definition 15.7's interval assigned to the `j`th prefix entry. Entry |
| 49 | zero controls the short-time interval; every later entry controls one dyadic |
| 50 | epoch. -/ |
| 51 | def surgeryEpochEntry (j : ℕ) : Set ℝ := |
| 52 | if j = 0 then Set.Ico 0 (surgeryEpochStart 0) else |
| 53 | Set.Ico (surgeryEpochStart (j - 1)) (surgeryEpochStart j) |
| 54 | |
| 55 | structure SurgeryParameterPrefix (K : MetricSurgeryConstants) where |
| 56 | setup : SurgeryControlSetup K |
| 57 | i : ℕ |
| 58 | i_pos : 0 < i |
| 59 | r : Fin (i + 1) → ℝ |
| 60 | kappa : Fin (i + 1) → ℝ |
| 61 | Delta : Fin (i + 1) → ℝ |
| 62 | r_pos : ∀ j, 0 < r j |
| 63 | kappa_pos : ∀ j, 0 < kappa j |
| 64 | Delta_pos : ∀ j, 0 < Delta j |
| 65 | r_antitone : ∀ ⦃j k⦄, j.val ≤ k.val → r k ≤ r j |
| 66 | kappa_antitone : ∀ ⦃j k⦄, j.val ≤ k.val → kappa k ≤ kappa j |
| 67 | Delta_antitone : ∀ ⦃j k⦄, j.val ≤ k.val → Delta k ≤ Delta j |
| 68 | r_zero : r ⟨0, Nat.zero_lt_succ _⟩ = setup.epsilon |
| 69 | r_le_epsilon : ∀ j, r j ≤ setup.epsilon |
| 70 | Delta_le_setup : ∀ j, Delta j ≤ K.delta₀ |
| 71 | |
| 72 | structure SurgeryObservation (F : SurgeryFlowData.{u}) where |
| 73 | H : ℝ |
| 74 | H_pos : 0 < H |
| 75 | interval_subset : Set.Ico 0 H ⊆ F.time_domain |
| 76 | standard_flow : MaximalStandardCapFlow F.standard_initial |
| 77 | |
| 78 | /-- Replace the standard-model decoration without changing the observed flow |
| 79 | or its time interval. The source theorem has no independent model datum; |
| 80 | M44/M33 applications choose this decoration when needed. -/ |
| 81 | def SurgeryObservation.redecorate {F : SurgeryFlowData.{u}} |
| 82 | (O : SurgeryObservation F) |
| 83 | (standard_flow : MaximalStandardCapFlow F.standard_initial) : |
| 84 | SurgeryObservation F := |
| 85 | { H := O.H |
| 86 | H_pos := O.H_pos |
| 87 | interval_subset := O.interval_subset |
| 88 | standard_flow := standard_flow } |
| 89 | |
| 90 | /-- Redecorate after identifying the flow's initial model with a calibrated |
| 91 | setup model. The equality is explicit because the two dependent standard |
| 92 | flow types are not definitionally equal. -/ |
| 93 | def SurgeryObservation.redecorateTo |
| 94 | {K : MetricSurgeryConstants} {p : SurgeryParameterPrefix K} |
| 95 | {F : SurgeryFlowData.{u}} (O : SurgeryObservation F) |
| 96 | (hstandard : F.standard_initial = p.setup.standard_initial) : |
| 97 | SurgeryObservation F := |
| 98 | O.redecorate (hstandard ▸ p.setup.standard_flow) |
| 99 | |
| 100 | def SurgeryCanonicalOn (F : SurgeryFlowData.{u}) |
| 101 | (J : Set ℝ) (r : ℝ) : Prop := |
| 102 | ∀ t ∈ J, t ∈ F.time_domain → ∀ x : (F.slice t).carrier, |
| 103 | r⁻¹ ^ 2 ≤ (F.connection t).scalarCurvature x → |
| 104 | SurgeryCanonicalControl F t x F.parameters.epsilon F.parameters.C |
| 105 | |
| 106 | def SurgeryNoncollapsedOn (F : SurgeryFlowData.{u}) |
| 107 | (J : Set ℝ) (kappa : ℝ) : Prop := |
| 108 | ∀ t ∈ J, t ∈ F.time_domain → ∀ x : (F.slice t).carrier, |
| 109 | ¬ SurgeryPositiveComponentAt F t x → |
| 110 | ∀ r : ℝ, 0 < r → r ≤ F.parameters.epsilon → |
| 111 | ∀ e : SurgeryFlowCylinder F (F.slice t) t 1 |
| 112 | (Set.Icc (-r ^ 2) 0) ((F.metric t).ball x r), |
| 113 | (∀ (h : (0 : ℝ) ∈ Set.Icc (-r ^ 2) 0) y, |
| 114 | y ∈ (F.metric t).ball x r → HEq (e.forward 0 h y) y) → |
| 115 | (∀ s hs y, y ∈ (F.metric t).ball x r → |
| 116 | (F.connection (t + s / 1)).curvatureTensorNorm (e.forward s hs y) ≤ r⁻¹ ^ 2) → |
| 117 | ENNReal.ofReal (kappa * r ^ 3) ≤ |
| 118 | calibratedMetricVolume (F.metric t) ((F.metric t).ball x r) |
| 119 | |
| 120 | /-- The source continuation hypothesis restricted to an observation, retaining |
| 121 | the actual parameter profile and the closed backward interval used by |
| 122 | `SurgeryNoncollapsed`. -/ |
| 123 | def SurgeryNoncollapsedAssumptionOn (F : SurgeryFlowData.{u}) |
| 124 | (J : Set ℝ) : Prop := |
| 125 | ∀ t ∈ J, t ∈ F.time_domain → ∀ x : (F.slice t).carrier, |
| 126 | ¬ SurgeryPositiveComponentAt F t x → |
| 127 | ∀ r : ℝ, 0 < r → r ≤ F.parameters.epsilon → |
| 128 | ∀ e : SurgeryFlowCylinder F (F.slice t) t 1 |
| 129 | (Set.Icc (-r ^ 2) 0) ((F.metric t).ball x r), |
| 130 | (∀ h y, y ∈ (F.metric t).ball x r → HEq (e.forward 0 h y) y) → |
| 131 | (∀ s hs y, y ∈ (F.metric t).ball x r → |
| 132 | (F.connection (t + s / 1)).curvatureTensorNorm |
| 133 | (e.forward s hs y) ≤ r⁻¹ ^ 2) → |
| 134 | ENNReal.ofReal (F.parameters.kappa t * r ^ 3) ≤ |
| 135 | calibratedMetricVolume (F.metric t) ((F.metric t).ball x r) |
| 136 | |
| 137 | def surgeryObservationInterval {F : SurgeryFlowData.{u}} |
| 138 | (O : SurgeryObservation F) : Set ℝ := |
| 139 | Set.Ico 0 O.H |
| 140 | |
| 141 | structure SurgeryPrefixControls {K : MetricSurgeryConstants} |
| 142 | (p : SurgeryParameterPrefix K) |
| 143 | (F : SurgeryFlowData.{u}) (O : SurgeryObservation F) : Prop where |
| 144 | standard_initial_eq : F.standard_initial = p.setup.standard_initial |
| 145 | local_constants_eq : F.local_constants = K |
| 146 | epsilon_eq : F.parameters.epsilon = p.setup.epsilon |
| 147 | C_eq : F.parameters.C = p.setup.C |
| 148 | admissible : SurgeryFlowAdmissible F |
| 149 | pinched : ∀ t ∈ surgeryObservationInterval O, |
| 150 | t ∈ F.time_domain → SurgeryPinchedAt (F.connection t) t |
| 151 | canonical : ∀ (j : Fin (p.i + 1)), j.val ≤ p.i → |
| 152 | SurgeryCanonicalOn F |
| 153 | (surgeryObservationInterval O ∩ surgeryEpochEntry j.val) (p.r j) |
| 154 | noncollapsed : ∀ (j : Fin (p.i + 1)), j.val ≤ p.i → |
| 155 | SurgeryNoncollapsedOn F (surgeryObservationInterval O ∩ surgeryEpochEntry j.val) |
| 156 | (p.kappa j) |
| 157 | delta_bound : ∀ (j : Fin (p.i + 1)), j.val ≤ p.i → |
| 158 | ∀ t ∈ surgeryObservationInterval O ∩ surgeryEpochEntry j.val, |
| 159 | F.parameters.delta t ≤ p.Delta j |
| 160 | r_schedule : ∀ (j : Fin (p.i + 1)), j.val ≤ p.i → |
| 161 | ∀ t ∈ surgeryObservationInterval O ∩ surgeryEpochEntry j.val, |
| 162 | F.parameters.r t = p.r j |
| 163 | kappa_schedule : ∀ (j : Fin (p.i + 1)), j.val ≤ p.i → |
| 164 | ∀ t ∈ surgeryObservationInterval O ∩ surgeryEpochEntry j.val, |
| 165 | F.parameters.kappa t = p.kappa j |
| 166 | h_schedule : ∀ (j : Fin (p.i + 1)), j.val ≤ p.i → |
| 167 | ∀ t ∈ surgeryObservationInterval O ∩ surgeryEpochEntry j.val, |
| 168 | F.parameters.h t = p.setup.selector.h |
| 169 | (F.parameters.delta t * F.parameters.r t) |
| 170 | (F.parameters.delta t) |
| 171 | |
| 172 | def overlapInterval {K : MetricSurgeryConstants} |
| 173 | (p : SurgeryParameterPrefix K) : Set ℝ := |
| 174 | Set.Ico (surgeryEpochStart (p.i - 1)) |
| 175 | (surgeryEpochStart (p.i + 1)) |
| 176 | |
| 177 | def prefixFinalInterval {K : MetricSurgeryConstants} |
| 178 | (p : SurgeryParameterPrefix K) : Set ℝ := |
| 179 | Set.Ico 0 (surgeryEpochStart p.i) |
| 180 | |
| 181 | /-- The actual profile uses the common cutoff selector. Its radius is bounded |
| 182 | below by the threshold radius; it may change at the epoch boundary. -/ |
| 183 | structure SurgeryFixedScalesOn {K : MetricSurgeryConstants} |
| 184 | (setup : SurgeryControlSetup K) (F : SurgeryFlowData.{u}) |
| 185 | (O : SurgeryObservation F) (start r deltaUpper : ℝ) : Prop where |
| 186 | standard_initial_eq : F.standard_initial = setup.standard_initial |
| 187 | local_constants_eq : F.local_constants = K |
| 188 | epsilon_eq : F.parameters.epsilon = setup.epsilon |
| 189 | C_eq : F.parameters.C = setup.C |
| 190 | r_lower : ∀ t ∈ surgeryObservationInterval O ∩ Set.Ici start, |
| 191 | r ≤ F.parameters.r t |
| 192 | delta_le : ∀ t ∈ surgeryObservationInterval O ∩ Set.Ici start, |
| 193 | F.parameters.delta t ≤ deltaUpper |
| 194 | h_eq : ∀ t ∈ surgeryObservationInterval O ∩ Set.Ici start, |
| 195 | F.parameters.h t = setup.selector.h |
| 196 | (F.parameters.delta t * F.parameters.r t) (F.parameters.delta t) |
| 197 | |
| 198 | /- The surgery induction only uses derivative estimates above the selected |
| 199 | curvature scale. This guarded predicate records the two actual scalar |
| 200 | quantities appearing in the source estimates; it does not assert an |
| 201 | all-point estimate through low-curvature regions or surgery jumps. -/ |
| 202 | def SurgeryHighCurvatureAnalyticOn (F : SurgeryFlowData.{u}) |
| 203 | (J : Set ℝ) (r C : ℝ) : Prop := |
| 204 | ∀ t ∈ J, t ∈ F.time_domain → ∀ x : (F.slice t).carrier, |
| 205 | r⁻¹ ^ 2 ≤ (F.connection t).scalarCurvature x → |
| 206 | scalarGradientNorm (F.metric t) (F.connection t) x ≤ |
| 207 | C * (F.connection t).scalarCurvature x ^ (3 / 2 : ℝ) ∧ |
| 208 | |(F.connection t).laplacian |
| 209 | (F.connection t).scalarCurvature x + |
| 210 | 2 * (F.connection t).ricciNormSq x| ≤ |
| 211 | C * (F.connection t).scalarCurvature x ^ 2 |
| 212 | |
| 213 | /-- The guarded scalar-time derivative estimate used by the surgery induction, |
| 214 | expressed on the genuine ordinary slabs of the changing-carrier flow. The |
| 215 | radius parameter is part of the predicate: only points with `R >= r⁻²` are |
| 216 | tested. `CapCertificate` supplies an absolute scalar-evolution bound; |
| 217 | controlling every canonical alternative on the actual ordinary slabs |
| 218 | remains a separate obligation. -/ |
| 219 | def SurgeryScalarDerivativeControlOn (F : SurgeryFlowData.{u}) |
| 220 | (J : Set ℝ) (r C : ℝ) : Prop := |
| 221 | ∀ a b : ℝ, ∀ hab : a < b, ∀ hJ : Set.Icc a b ⊆ F.time_domain, |
| 222 | ∀ hS : Disjoint F.surgery_times (Set.Ioc a b), |
| 223 | ∀ x : (F.slice a).carrier, ∀ t ∈ J ∩ Set.Ioo a b, |
| 224 | r⁻¹ ^ 2 ≤ |
| 225 | ((F.regular_slabs a b hab hJ hS).flow.connection t).scalarCurvature x → |
| 226 | ∃ d : ℝ, |
| 227 | HasDerivAt |
| 228 | (fun s => ((F.regular_slabs a b hab hJ hS).flow.connection s).scalarCurvature x) |
| 229 | d t ∧ |
| 230 | |d| ≤ C * |
| 231 | (((F.regular_slabs a b hab hJ hS).flow.connection t).scalarCurvature x) ^ 2 |
| 232 | |
| 233 | end PoincareMT |