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.Induction.EpochExtension.History.RegularAnalytics |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.Analytics.ScalarEvolution |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.Analytics.TimeEstimate |
| 4 | |
| 5 | /-! |
| 6 | # Scalar-time control on the actual selected generalized history |
| 7 | |
| 8 | Box worldlines agree with the actual ordinary slab transports. After |
| 9 | identifying their scalar functions, the strict auxiliary threshold permits |
| 10 | extension across the finite old-event set by continuity of the derivative. |
| 11 | Sources: Morgan--Tian Assumptions 11.18, p. 279, Lemma 14.11 / |
| 12 | Proposition 14.12, pp. 349-350, and Section 17.2, pp. 409-410. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | namespace M48Predecessors |
| 26 | |
| 27 | variable (P : M48Predecessors.{u}) {F : SurgeryFlowData.{u}} {T : ℝ} |
| 28 | {L : RepairedPreterminalSlab F T} (R : M48RegularSpacetimeData L) |
| 29 | |
| 30 | include P |
| 31 | |
| 32 | /-- The scalar functions agree along the literal regular-slab worldline. -/ |
| 33 | theorem regular_box_slab_scalar (b : R.history.generalized.box_index) |
| 34 | (a c : ℝ) (hac : a < c) (hJ : Icc a c ⊆ F.time_domain) |
| 35 | (hS : Disjoint F.surgery_times (Ioc a c)) |
| 36 | (t s : ℝ) (ht : t ∈ Icc a c) (hs : s ∈ Icc a c) |
| 37 | (htb : t ∈ (R.history.generalized.box b).interval) |
| 38 | (hsb : s ∈ (R.history.generalized.box b).interval) |
| 39 | (x : (R.history.generalized.box b).carrier.carrier) : |
| 40 | ((R.history.generalized.box b).flow.connection s).scalarCurvature x = |
| 41 | ((F.regular_slabs a c hac hJ hS).flow.connection s).scalarCurvature |
| 42 | (((F.regular_slabs a c hac hJ hS).identify ⟨t, ht⟩).symm |
| 43 | (R.history.history.forward t (m33BoxIntervalSubset _ b htb) |
| 44 | ((R.history.generalized.box b).forward t htb x))) := by |
| 45 | let B := F.regular_slabs a c hac hJ hS |
| 46 | rw [P.regular_box_scalar R b s hsb x] |
| 47 | rw [← R.history.history.slab_compatibility b a c hac hJ hS t s ht hs htb hsb x] |
| 48 | exact B.m48_scalarCurvature_eq ⟨s, hs⟩ (F.connection s) _ |
| 49 | |
| 50 | theorem regular_box_ordinary_derivative {J : Set ℝ} {r C : ℝ} |
| 51 | (hJ : R.history.generalized.interval ⊆ J) |
| 52 | (hderiv : SurgeryScalarDerivativeControlOn F J r C) |
| 53 | (b : R.history.generalized.box_index) (t : ℝ) |
| 54 | (ht : t ∈ interior (R.history.generalized.box b).interval) |
| 55 | (hregular : t ∉ F.surgery_times) |
| 56 | (x : (R.history.generalized.box b).carrier.carrier) |
| 57 | (hQ : r⁻¹ ^ 2 ≤ ((R.history.generalized.box b).flow.connection t).scalarCurvature x) : |
| 58 | ∃ d, HasDerivAt |
| 59 | (fun s => ((R.history.generalized.box b).flow.connection s).scalarCurvature x) d t ∧ |
| 60 | |d| ≤ C * ((R.history.generalized.box b).flow.connection t).scalarCurvature x ^ 2 := by |
| 61 | let E := F.surgery_times ∩ L.regularHistoryWindow.interval |
| 62 | have hE : E.Finite := L.regularHistoryWindow.events_finite |
| 63 | have hnot : t ∉ E := fun h => hregular h.1 |
| 64 | have hnb : ((R.history.generalized.box b).interval \ E) ∈ 𝓝 t := |
| 65 | inter_mem (mem_interior_iff_mem_nhds.mp ht) (hE.isClosed.isOpen_compl.mem_nhds hnot) |
| 66 | obtain ⟨a, c, htc, hnbhd, hsub⟩ := exists_Icc_mem_subset_of_mem_nhds hnb |
| 67 | have hti : t ∈ Ioo a c := Icc_mem_nhds_iff.mp hnbhd |
| 68 | have hac : a < c := hti.1.trans hti.2 |
| 69 | have hbox : Icc a c ⊆ (R.history.generalized.box b).interval := fun s hs => (hsub hs).1 |
| 70 | have hdom : Icc a c ⊆ F.time_domain := |
| 71 | fun s hs => R.history.history.time_subset (m33BoxIntervalSubset _ b (hbox hs)) |
| 72 | have hfree : Disjoint F.surgery_times (Ioc a c) := by |
| 73 | apply disjoint_left.mpr |
| 74 | intro s hs hsc |
| 75 | have hb := hsub ⟨hsc.1.le, hsc.2⟩ |
| 76 | apply hb.2 |
| 77 | exact ⟨hs, R.history.interval_eq ▸ m33BoxIntervalSubset _ b hb.1⟩ |
| 78 | let B := F.regular_slabs a c hac hdom hfree |
| 79 | let y := (B.identify ⟨t, htc⟩).symm |
| 80 | (R.history.history.forward t (m33BoxIntervalSubset _ b (interior_subset ht)) |
| 81 | ((R.history.generalized.box b).forward t (interior_subset ht) x)) |
| 82 | have heq (s : ℝ) (hs : s ∈ Icc a c) : |
| 83 | ((R.history.generalized.box b).flow.connection s).scalarCurvature x = |
| 84 | (B.flow.connection s).scalarCurvature y := |
| 85 | P.regular_box_slab_scalar R b a c hac hdom hfree t s htc hs |
| 86 | (interior_subset ht) (hbox hs) x |
| 87 | have hthreshold : r⁻¹ ^ 2 ≤ (B.flow.connection t).scalarCurvature y := by |
| 88 | rw [← heq t htc] |
| 89 | exact hQ |
| 90 | obtain ⟨d, hd, hb⟩ := hderiv a c hac hdom hfree y t |
| 91 | ⟨hJ (m33BoxIntervalSubset _ b (interior_subset ht)), hti⟩ hthreshold |
| 92 | refine ⟨d, hd.congr_of_eventuallyEq ?_, ?_⟩ |
| 93 | · filter_upwards [hnbhd] with s hs |
| 94 | exact heq s hs |
| 95 | · simpa only [heq t htc] using hb |
| 96 | |
| 97 | /-- M31's full box-time estimate, including the retained points at old events. -/ |
| 98 | theorem regular_box_derivative {J : Set ℝ} {r C r' : ℝ} |
| 99 | (hJ : R.history.generalized.interval ⊆ J) |
| 100 | (hderiv : SurgeryScalarDerivativeControlOn F J r C) |
| 101 | (hmargin : r⁻¹ ^ 2 < r'⁻¹ ^ 2) |
| 102 | (b : R.history.generalized.box_index) (t : ℝ) |
| 103 | (ht : t ∈ (R.history.generalized.box b).interval) |
| 104 | (x : (R.history.generalized.box b).carrier.carrier) |
| 105 | (hQ : r'⁻¹ ^ 2 ≤ ((R.history.generalized.box b).flow.connection t).scalarCurvature x) : |
| 106 | ∃ d, HasDerivWithinAt |
| 107 | (fun s => ((R.history.generalized.box b).flow.connection s).scalarCurvature x) d |
| 108 | (R.history.generalized.box b).interval t ∧ |
| 109 | |d| ≤ C * ((R.history.generalized.box b).flow.connection t).scalarCurvature x ^ 2 := by |
| 110 | let E := F.surgery_times ∩ L.regularHistoryWindow.interval |
| 111 | apply M48.time_estimate_extend (E := E) |
| 112 | (R.history.generalized.box b).flow.interval.convex |
| 113 | (R.history.generalized.box b).flow.nontrivial L.regularHistoryWindow.events_finite |
| 114 | ((R.history.generalized.box b).flow.contDiffOn_scalarCurvature_timeSlice x) |
| 115 | ?_ t ht (hmargin.trans_le hQ) |
| 116 | intro s hs hqs |
| 117 | apply P.regular_box_ordinary_derivative R hJ hderiv b s hs.1 _ x hqs.le |
| 118 | intro hevent |
| 119 | apply hs.2 |
| 120 | exact ⟨hevent, R.history.interval_eq ▸ m33BoxIntervalSubset _ b (interior_subset hs.1)⟩ |
| 121 | |
| 122 | end M48Predecessors |
| 123 | |
| 124 | /-- Apply the actual calibrated estimate, with no supplied derivative premise. -/ |
| 125 | theorem M48AnalyticCalibration.regular_time_derivative |
| 126 | {S : RepairedControlledSchedulesData.{u}} (A : M48AnalyticCalibration S) |
| 127 | (P : M48Predecessors.{u}) {p : SurgeryParameterPrefix S.constants} |
| 128 | {F : SurgeryFlowData.{u}} {O : SurgeryObservation F} |
| 129 | (hp : S.SeedCompatible p) (old : SurgeryPrefixControls p F O) |
| 130 | {Q : SurgeryNoncollapseExtension.{u} p} {N : SurgeryCanonicalExtension p Q} |
| 131 | (controls : SurgeryEpochContinuationControls p F O Q N) |
| 132 | {L : RepairedPreterminalSlab F O.H} (R : M48RegularSpacetimeData L) |
| 133 | (b : R.history.generalized.box_index) (t : ℝ) |
| 134 | (ht : t ∈ (R.history.generalized.box b).interval) |
| 135 | (x : (R.history.generalized.box b).carrier.carrier) |
| 136 | (hQ : (A.historyRadius N.rNext)⁻¹ ^ 2 ≤ |
| 137 | ((R.history.generalized.box b).flow.connection t).scalarCurvature x) : |
| 138 | ∃ d, HasDerivWithinAt |
| 139 | (fun s => ((R.history.generalized.box b).flow.connection s).scalarCurvature x) d |
| 140 | (R.history.generalized.box b).interval t ∧ |
| 141 | |d| ≤ S.calibration.analytic_constant * |
| 142 | ((R.history.generalized.box b).flow.connection t).scalarCurvature x ^ 2 := by |
| 143 | apply P.regular_box_derivative R _ (A.continuation hp old controls).scalar_derivative |
| 144 | (A.history_threshold N.r_pos) b t ht x hQ |
| 145 | intro s hs |
| 146 | exact (show s ∈ L.regularHistoryWindow.interval from R.history.interval_eq ▸ hs) |
| 147 | |
| 148 | end PoincareMT |