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.Extension.ExtensionEvents |
| 2 | |
| 3 | /-! |
| 4 | # Composing old-flow extensions |
| 5 | |
| 6 | This file supplies the admission-free support needed by the finite M51 epoch |
| 7 | iteration. A reflexive extension records an unchanged flow, and `trans` |
| 8 | composes two extensions while preserving the first flow's old event ledger. |
| 9 | The constructors use only the fields of `SurgeryFlowExtension`; they do not |
| 10 | assert an endpoint, an extension-progress theorem, or a new surgery event. |
| 11 | Source: Morgan--Tian Definition 15.8, p. 362. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option linter.style.haveILetI false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | namespace SurgeryFlowExtension |
| 26 | |
| 27 | noncomputable def refl (F : SurgeryFlowData.{u}) : SurgeryFlowExtension F where |
| 28 | extended := F |
| 29 | old_times := Subset.rfl |
| 30 | standard_initial_eq := rfl |
| 31 | local_constants_eq := rfl |
| 32 | parameters_eq := rfl |
| 33 | identify := fun _ _ => Diffeomorph.refl (𝓡 3) _ ∞ |
| 34 | metric_pullback := by |
| 35 | intro t ht x v w |
| 36 | change (F.metric t).inner (id x) |
| 37 | (mfderiv (𝓡 3) (𝓡 3) (id : (F.slice t).carrier → (F.slice t).carrier) x v) |
| 38 | (mfderiv (𝓡 3) (𝓡 3) (id : (F.slice t).carrier → (F.slice t).carrier) x w) = _ |
| 39 | simp only [mfderiv_id] |
| 40 | rfl |
| 41 | old_surgery_times := fun _ _ => Iff.rfl |
| 42 | ordinary_compatibility := by |
| 43 | intro a b hab hJ hfree hJ' hfree' s t x |
| 44 | change (F.regular_slabs a b hab hJ' hfree').transport s t x = |
| 45 | (F.regular_slabs a b hab hJ hfree).transport s t x |
| 46 | exact F.slab_transport_coherent a b a b hab hJ hfree hab hJ' hfree' |
| 47 | s t s.2 t.2 s.2 t.2 x |
| 48 | old_event_reference := by |
| 49 | intro T hT hT' _ _ |
| 50 | rfl |
| 51 | old_retained_post := by |
| 52 | intro T hT hT' _ _ |
| 53 | change (fun x : (F.slice T).carrier => x) '' (F.event T hT).retained_post = _ |
| 54 | exact Set.image_id _ |
| 55 | old_retained_pre := by |
| 56 | intro T hT hT' _ _ t ht ht' |
| 57 | change (fun x => |
| 58 | ((F.event T hT').pre_identify ⟨t.1, ht'⟩).symm |
| 59 | ((F.event T hT).pre_identify t x)) '' (F.event T hT).retained_pre = _ |
| 60 | cases Subsingleton.elim hT' hT |
| 61 | rw [show (F.event T hT).pre_identify ⟨t.1, ht'⟩ = |
| 62 | (F.event T hT).pre_identify t by congr 1] |
| 63 | simp |
| 64 | old_retention := by |
| 65 | intro T hT hT' _ _ t ht ht' x hx |
| 66 | cases Subsingleton.elim hT' hT |
| 67 | simp |
| 68 | old_vanishing_reference := by |
| 69 | intro T hT hT' _ _ |
| 70 | rfl |
| 71 | |
| 72 | noncomputable def trans {F : SurgeryFlowData.{u}} |
| 73 | (E : SurgeryFlowExtension F) |
| 74 | (D : SurgeryFlowExtension E.extended) : SurgeryFlowExtension F where |
| 75 | extended := D.extended |
| 76 | old_times := fun t ht => D.old_times (E.old_times ht) |
| 77 | standard_initial_eq := D.standard_initial_eq.trans E.standard_initial_eq |
| 78 | local_constants_eq := D.local_constants_eq.trans E.local_constants_eq |
| 79 | parameters_eq := D.parameters_eq.trans E.parameters_eq |
| 80 | identify := fun t ht => |
| 81 | (E.identify t ht).trans (D.identify t (E.old_times ht)) |
| 82 | metric_pullback := by |
| 83 | intro t ht x v w |
| 84 | let e := E.identify t ht |
| 85 | let d := D.identify t (E.old_times ht) |
| 86 | change (D.extended.metric t).inner (d (e x)) |
| 87 | (mfderiv (𝓡 3) (𝓡 3) (d ∘ e) x v) |
| 88 | (mfderiv (𝓡 3) (𝓡 3) (d ∘ e) x w) = _ |
| 89 | rw [mfderiv_comp x (d.contMDiff.mdifferentiable (by simp) (e x)) |
| 90 | (e.contMDiff.mdifferentiable (by simp) x)] |
| 91 | change (D.extended.metric t).inner (d (e x)) |
| 92 | (mfderiv (𝓡 3) (𝓡 3) d (e x) |
| 93 | (mfderiv (𝓡 3) (𝓡 3) e x v)) |
| 94 | (mfderiv (𝓡 3) (𝓡 3) d (e x) |
| 95 | (mfderiv (𝓡 3) (𝓡 3) e x w)) = _ |
| 96 | rw [D.metric_pullback] |
| 97 | exact E.metric_pullback t ht x v w |
| 98 | old_surgery_times := by |
| 99 | intro t ht |
| 100 | exact (D.old_surgery_times t (E.old_times ht)).trans (E.old_surgery_times t ht) |
| 101 | ordinary_compatibility := by |
| 102 | intro a b hab hJ hfree hJ' hfree' s t x |
| 103 | have hJE : Icc a b ⊆ E.extended.time_domain := hJ.trans E.old_times |
| 104 | have hfreeE : Disjoint E.extended.surgery_times (Ioc a b) := by |
| 105 | rw [Set.disjoint_left] |
| 106 | intro z hzE hzI |
| 107 | exact Set.disjoint_left.mp hfree' |
| 108 | ((D.old_surgery_times z (hJE ⟨hzI.1.le, hzI.2⟩)).mpr hzE) hzI |
| 109 | have hD := D.ordinary_compatibility a b hab hJE hfreeE hJ' hfree' s t |
| 110 | (E.identify s (hJ s.2) x) |
| 111 | have hE := E.ordinary_compatibility a b hab hJ hfree hJE hfreeE s t x |
| 112 | rw [hE] at hD |
| 113 | exact hD |
| 114 | old_event_reference := by |
| 115 | intro T hT hF hG hT' |
| 116 | haveI : Nonempty (E.extended.slice T).carrier := |
| 117 | Nonempty.map (E.identify T (F.surgery_times_subset hT)) hF |
| 118 | have hTmid : T ∈ E.extended.surgery_times := |
| 119 | (D.old_surgery_times T (E.old_times (F.surgery_times_subset hT))).mp hT' |
| 120 | have hD := D.old_event_reference T hTmid hT' |
| 121 | have hE := E.old_event_reference T hT hTmid |
| 122 | exact hD.trans hE |
| 123 | old_retained_post := by |
| 124 | intro T hT hT' hF hG |
| 125 | haveI : Nonempty (E.extended.slice T).carrier := |
| 126 | Nonempty.map (E.identify T (F.surgery_times_subset hT)) hF |
| 127 | have hTmid : T ∈ E.extended.surgery_times := |
| 128 | (D.old_surgery_times T (E.old_times (F.surgery_times_subset hT))).mp hT' |
| 129 | have hE := E.old_retained_post T hT hTmid |
| 130 | have hD := D.old_retained_post T hTmid hT' |
| 131 | ext y |
| 132 | constructor |
| 133 | · rintro ⟨x, hx, rfl⟩ |
| 134 | change D.identify T (E.extended.surgery_times_subset hTmid) |
| 135 | (E.identify T (F.surgery_times_subset hT) x) ∈ _ |
| 136 | have hy : E.identify T (F.surgery_times_subset hT) x ∈ |
| 137 | (E.extended.event T hTmid).retained_post := by |
| 138 | rw [← hE] |
| 139 | exact ⟨x, hx, rfl⟩ |
| 140 | rw [← hD] |
| 141 | exact ⟨_, hy, rfl⟩ |
| 142 | · intro hy |
| 143 | rw [← hD] at hy |
| 144 | rcases hy with ⟨z, hz, rfl⟩ |
| 145 | rw [← hE] at hz |
| 146 | rcases hz with ⟨x, hx, rfl⟩ |
| 147 | exact ⟨x, hx, rfl⟩ |
| 148 | old_retained_pre := by |
| 149 | intro T hT hT' hF hG t ht ht' |
| 150 | haveI : Nonempty (E.extended.slice T).carrier := |
| 151 | Nonempty.map (E.identify T (F.surgery_times_subset hT)) hF |
| 152 | have hTmid : T ∈ E.extended.surgery_times := |
| 153 | (D.old_surgery_times T (E.old_times (F.surgery_times_subset hT))).mp hT' |
| 154 | have hEref := E.old_event_reference T hT hTmid |
| 155 | have htMidMem : t.1 ∈ Set.Ico (E.extended.event T hTmid).tMinus T := by |
| 156 | simpa only [hEref] using t.2 |
| 157 | let tMid : Set.Ico (E.extended.event T hTmid).tMinus T := |
| 158 | ⟨t.1, htMidMem⟩ |
| 159 | have hE := E.old_retained_pre T hT hTmid t ht htMidMem |
| 160 | have hD := D.old_retained_pre T hTmid hT' tMid |
| 161 | (E.old_times ht) ht' |
| 162 | ext y |
| 163 | constructor |
| 164 | · rintro ⟨x, hx, rfl⟩ |
| 165 | let z := ((E.extended.event T hTmid).pre_identify tMid).symm |
| 166 | (E.identify t.1 ht ((F.event T hT).pre_identify t x)) |
| 167 | have hz : z ∈ (E.extended.event T hTmid).retained_pre := by |
| 168 | rw [← hE] |
| 169 | exact ⟨x, hx, rfl⟩ |
| 170 | rw [← hD] |
| 171 | refine ⟨z, hz, ?_⟩ |
| 172 | simp [z, tMid, Diffeomorph.coe_trans, Function.comp_apply] |
| 173 | · intro hy |
| 174 | rw [← hD] at hy |
| 175 | rcases hy with ⟨z, hz, hzy⟩ |
| 176 | rw [← hE] at hz |
| 177 | rcases hz with ⟨x, hx, hzx⟩ |
| 178 | refine ⟨x, hx, ?_⟩ |
| 179 | have hcomp : |
| 180 | (fun q => ((D.extended.event T hT').pre_identify ⟨tMid.1, ht'⟩).symm |
| 181 | ((D.identify tMid.1 (E.old_times ht)) |
| 182 | ((E.extended.event T hTmid).pre_identify tMid q))) |
| 183 | (((E.extended.event T hTmid).pre_identify ⟨t.1, htMidMem⟩).symm |
| 184 | (E.identify t.1 ht ((F.event T hT).pre_identify t x))) = y := by |
| 185 | exact (congrArg (fun q => |
| 186 | ((D.extended.event T hT').pre_identify ⟨tMid.1, ht'⟩).symm |
| 187 | ((D.identify tMid.1 (E.old_times ht)) |
| 188 | ((E.extended.event T hTmid).pre_identify tMid q))) hzx).trans hzy |
| 189 | simpa [tMid] using hcomp |
| 190 | old_retention := by |
| 191 | intro T hT hT' hF hG t ht ht' x hx |
| 192 | letI : Nonempty (E.extended.slice T).carrier := |
| 193 | Nonempty.map (E.identify T (F.surgery_times_subset hT)) hF |
| 194 | have hTmid : T ∈ E.extended.surgery_times := |
| 195 | (D.old_surgery_times T (E.old_times (F.surgery_times_subset hT))).mp hT' |
| 196 | have hEref := E.old_event_reference T hT hTmid |
| 197 | have htMidMem : t.1 ∈ Set.Ico (E.extended.event T hTmid).tMinus T := by |
| 198 | simpa only [hEref] using t.2 |
| 199 | let tMid : Set.Ico (E.extended.event T hTmid).tMinus T := |
| 200 | ⟨t.1, htMidMem⟩ |
| 201 | let z := ((E.extended.event T hTmid).pre_identify tMid).symm |
| 202 | (E.identify t.1 ht ((F.event T hT).pre_identify t x)) |
| 203 | have hEpre := E.old_retained_pre T hT hTmid t ht htMidMem |
| 204 | have hz : z ∈ (E.extended.event T hTmid).retained_pre := by |
| 205 | rw [← hEpre] |
| 206 | exact ⟨x, hx, rfl⟩ |
| 207 | have hEret := E.old_retention T hT hTmid t ht htMidMem x hx |
| 208 | have hDret := D.old_retention T hTmid hT' tMid |
| 209 | (E.old_times ht) ht' z hz |
| 210 | rw [Diffeomorph.coe_trans] |
| 211 | change D.identify T (E.extended.surgery_times_subset hTmid) |
| 212 | (E.identify T (F.surgery_times_subset hT) |
| 213 | ((F.event T hT).retention.map x)) = |
| 214 | (D.extended.event T hT').retention.map |
| 215 | (((D.extended.event T hT').pre_identify ⟨t.1, ht'⟩).symm |
| 216 | ((D.identify t.1 (E.old_times ht)) |
| 217 | (E.identify t.1 ht ((F.event T hT).pre_identify t x)))) |
| 218 | rw [hEret, hDret] |
| 219 | simp [z, tMid] |
| 220 | old_vanishing_reference := by |
| 221 | intro T hT hF hG hT' |
| 222 | haveI : IsEmpty (E.extended.slice T).carrier := |
| 223 | ⟨fun y => isEmptyElim ((E.identify T (F.surgery_times_subset hT)).symm y)⟩ |
| 224 | have hTmid : T ∈ E.extended.surgery_times := |
| 225 | (D.old_surgery_times T (E.old_times (F.surgery_times_subset hT))).mp hT' |
| 226 | have hD := D.old_vanishing_reference T hTmid hT' |
| 227 | have hE := E.old_vanishing_reference T hT hTmid |
| 228 | exact hD.trans hE |
| 229 | |
| 230 | end SurgeryFlowExtension |
| 231 | |
| 232 | end PoincareMT |