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.Continuation.Construction.EventRebuild.Transport |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.EventPreservation |
| 3 | |
| 4 | /-! |
| 5 | # Rebuilding an old nonempty surgery event |
| 6 | |
| 7 | The constructor from `PoincareMT/Proofs/M51/EmptyEventCopy.lean` at upstream |
| 8 | commit `117c0a267a0f7cf105397c586e1df2f92dbee2bf` is generalized from equality |
| 9 | of time indices to equality of slice and metric pairs. It keeps |
| 10 | the actual terminal record, necks and local surgery results. This implements |
| 11 | the literal old-event preservation in Morgan--Tian, Definition 15.8, p. 362. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.SurgeryEventData |
| 22 | |
| 23 | open SurgeryEventRebuild |
| 24 | |
| 25 | variable {g₀ : StandardInitialMetric} {K : MetricSurgeryConstants} |
| 26 | {P : SurgeryParameters} {past future : ℝ → SliceMetric.{u}} {T : ℝ} |
| 27 | |
| 28 | /-- Copy an event to a family agreeing through its event time. -/ |
| 29 | noncomputable def copyPast |
| 30 | (E : SurgeryEventData g₀ K P (fun t => (past t).1) (fun t => (past t).2) T) |
| 31 | (hPast : ∀ t ∈ Set.Icc 0 T, past t = future t) : |
| 32 | SurgeryEventData g₀ K P (fun t => (future t).1) (fun t => (future t).2) T := by |
| 33 | have hm := hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩ |
| 34 | have hT := hPast T ⟨E.tMinus_nonnegative.trans E.tMinus_lt.le, le_rfl⟩ |
| 35 | refine { |
| 36 | tMinus := E.tMinus |
| 37 | tMinus_nonnegative := E.tMinus_nonnegative |
| 38 | tMinus_lt := E.tMinus_lt |
| 39 | preterminal_close := E.preterminal_close |
| 40 | pre_flow := flow hm E.pre_flow |
| 41 | pre_identify := fun t => diffeomorph hm |
| 42 | (hPast t.1 ⟨E.tMinus_nonnegative.trans t.2.1, t.2.2.le⟩) (E.pre_identify t) |
| 43 | pre_initial := by |
| 44 | intro x |
| 45 | obtain ⟨y, rfl⟩ := (identify (past E.tMinus) (future E.tMinus) hm).surjective x |
| 46 | exact (diffeomorph_apply hm hm |
| 47 | (E.pre_identify ⟨E.tMinus, ⟨le_rfl, E.tMinus_lt⟩⟩) y).trans |
| 48 | (congrArg (identify (past E.tMinus) (future E.tMinus) hm) (E.pre_initial y)) |
| 49 | pre_metric := fun t => diffeomorph_flow_metric_pullback |
| 50 | hm (hPast t.1 ⟨E.tMinus_nonnegative.trans t.2.1, t.2.2.le⟩) |
| 51 | E.pre_flow t.1 (E.pre_identify t) (E.pre_metric t) |
| 52 | regular_limit := relabel (C := fun p => Set p.1.carrier) hm E.regular_limit |
| 53 | regular_limit_eq := ?_ |
| 54 | regular_limit_open := ?_ |
| 55 | terminal := E.terminal |
| 56 | limit_identify := regionSource hm E.terminal E.regular_limit Set.univ E.limit_identify |
| 57 | limit_metric := E.limit_metric |
| 58 | limit_connection := E.limit_connection |
| 59 | metric_converges := ?_ |
| 60 | retained_pre := relabel (C := fun p => Set p.1.carrier) hm E.retained_pre |
| 61 | retained_pre_compact := ?_ |
| 62 | retained_pre_subset := ?_ |
| 63 | low_curvature_retained := ?_ |
| 64 | retained_post := relabel (C := fun p => Set p.1.carrier) hT E.retained_post |
| 65 | retained_post_compact := ?_ |
| 66 | retention := region hm hT E.retained_pre E.retained_post E.retention |
| 67 | retained_metric := ?_ |
| 68 | cap_count := E.cap_count |
| 69 | caps := relabel |
| 70 | (C := fun p => Fin E.cap_count → SurgeryCapChart g₀ p.1 p.2 (P.h T)) hT E.caps |
| 71 | cap_disjoint := ?_ |
| 72 | post_cover := ?_ |
| 73 | cap_boundary := ?_ |
| 74 | necks := E.necks |
| 75 | neck_carrier_disjoint := E.neck_carrier_disjoint |
| 76 | neck_time := E.neck_time |
| 77 | neck_delta := E.neck_delta |
| 78 | neck_scale := E.neck_scale |
| 79 | pre_boundary := ?_ |
| 80 | boundary_correspondence := ?_ |
| 81 | neck_negative_retained := ?_ |
| 82 | neck_positive_discarded := ?_ |
| 83 | local_result := E.local_result |
| 84 | local_embed := relabel |
| 85 | (C := fun p => ∀ i, (E.local_result i).output.carrier → p.1.carrier) hT E.local_embed |
| 86 | local_embed_smooth := ?_ |
| 87 | local_embed_injective := ?_ |
| 88 | local_metric := ?_ |
| 89 | local_tip := ?_ |
| 90 | local_cap_image := ?_ |
| 91 | local_retention := ?_ |
| 92 | disappearing_start := E.disappearing_start |
| 93 | disappearing_start_bounds := E.disappearing_start_bounds |
| 94 | disappearing_curvature := ?_ |
| 95 | disappearing_cover := ?_ } |
| 96 | all_goals |
| 97 | try dsimp only [flow, diffeomorph, relabel, regionSource, region] at * |
| 98 | generalize hval : future E.tMinus = m at * |
| 99 | clear hval |
| 100 | subst m |
| 101 | generalize hval : future T = b at * |
| 102 | clear hval |
| 103 | subst b |
| 104 | · exact E.regular_limit_eq |
| 105 | · exact E.regular_limit_open |
| 106 | · exact E.metric_converges |
| 107 | · exact E.retained_pre_compact |
| 108 | · exact E.retained_pre_subset |
| 109 | · exact E.low_curvature_retained |
| 110 | · exact E.retained_post_compact |
| 111 | · exact E.retained_metric |
| 112 | · exact E.cap_disjoint |
| 113 | · exact E.post_cover |
| 114 | · exact E.cap_boundary |
| 115 | · exact E.pre_boundary |
| 116 | · exact E.boundary_correspondence |
| 117 | · exact E.neck_negative_retained |
| 118 | · exact E.neck_positive_discarded |
| 119 | · exact E.local_embed_smooth |
| 120 | · exact E.local_embed_injective |
| 121 | · exact E.local_metric |
| 122 | · exact E.local_tip |
| 123 | · exact E.local_cap_image |
| 124 | · exact E.local_retention |
| 125 | · exact E.disappearing_curvature |
| 126 | · exact E.disappearing_cover |
| 127 | |
| 128 | variable (E : SurgeryEventData g₀ K P (fun t => (past t).1) (fun t => (past t).2) T) |
| 129 | (hPast : ∀ t ∈ Set.Icc 0 T, past t = future t) |
| 130 | |
| 131 | @[simp] theorem copyPast_tMinus : (E.copyPast hPast).tMinus = E.tMinus := rfl |
| 132 | |
| 133 | @[simp] theorem copyPast_terminal : (E.copyPast hPast).terminal = E.terminal := rfl |
| 134 | |
| 135 | @[simp] theorem copyPast_limit_metric : (E.copyPast hPast).limit_metric = E.limit_metric := rfl |
| 136 | |
| 137 | @[simp] theorem copyPast_limit_connection : |
| 138 | (E.copyPast hPast).limit_connection = E.limit_connection := rfl |
| 139 | |
| 140 | @[simp] theorem copyPast_cap_count : (E.copyPast hPast).cap_count = E.cap_count := rfl |
| 141 | |
| 142 | @[simp] theorem copyPast_necks : (E.copyPast hPast).necks = E.necks := rfl |
| 143 | |
| 144 | @[simp] theorem copyPast_local_result : (E.copyPast hPast).local_result = E.local_result := rfl |
| 145 | |
| 146 | theorem copyPast_pre_flow_heq : HEq (E.copyPast hPast).pre_flow E.pre_flow := |
| 147 | flow_heq (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) E.pre_flow |
| 148 | |
| 149 | theorem copyPast_pre_identify_apply (t : Set.Ico E.tMinus T) |
| 150 | (x : (past E.tMinus).1.carrier) : |
| 151 | (E.copyPast hPast).pre_identify t |
| 152 | (identify (past E.tMinus) (future E.tMinus) |
| 153 | (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) x) = |
| 154 | identify (past t.1) (future t.1) |
| 155 | (hPast t.1 ⟨E.tMinus_nonnegative.trans t.2.1, t.2.2.le⟩) (E.pre_identify t x) := |
| 156 | diffeomorph_apply (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) |
| 157 | (hPast t.1 ⟨E.tMinus_nonnegative.trans t.2.1, t.2.2.le⟩) (E.pre_identify t) x |
| 158 | |
| 159 | theorem copyPast_retained_pre_image : |
| 160 | identify (past E.tMinus) (future E.tMinus) (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) '' |
| 161 | E.retained_pre = (E.copyPast hPast).retained_pre := |
| 162 | relabel_set_image (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) E.retained_pre |
| 163 | |
| 164 | theorem copyPast_retained_post_image : |
| 165 | identify (past T) (future T) (hPast T ⟨E.tMinus_nonnegative.trans E.tMinus_lt.le, le_rfl⟩) '' |
| 166 | E.retained_post = (E.copyPast hPast).retained_post := |
| 167 | relabel_set_image (hPast T ⟨E.tMinus_nonnegative.trans E.tMinus_lt.le, le_rfl⟩) E.retained_post |
| 168 | |
| 169 | theorem copyPast_limit_identify_map (x : (past E.tMinus).1.carrier) : |
| 170 | (E.copyPast hPast).limit_identify.map |
| 171 | (identify (past E.tMinus) (future E.tMinus) |
| 172 | (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) x) = |
| 173 | E.limit_identify.map x := |
| 174 | regionSource_map (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) |
| 175 | E.terminal E.regular_limit Set.univ E.limit_identify x |
| 176 | |
| 177 | theorem copyPast_retention_map (x : (past E.tMinus).1.carrier) : |
| 178 | (E.copyPast hPast).retention.map |
| 179 | (identify (past E.tMinus) (future E.tMinus) |
| 180 | (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) x) = |
| 181 | identify (past T) (future T) |
| 182 | (hPast T ⟨E.tMinus_nonnegative.trans E.tMinus_lt.le, le_rfl⟩) |
| 183 | (E.retention.map x) := |
| 184 | region_map (hPast E.tMinus ⟨E.tMinus_nonnegative, E.tMinus_lt.le⟩) |
| 185 | (hPast T ⟨E.tMinus_nonnegative.trans E.tMinus_lt.le, le_rfl⟩) |
| 186 | E.retained_pre E.retained_post E.retention x |
| 187 | |
| 188 | /-- Every primitive datum used by the old terminal policy is retained. -/ |
| 189 | theorem copyPast_preservation : M33NonemptyEventDataPreservation E (E.copyPast hPast) := by |
| 190 | refine { |
| 191 | terminal_eq := rfl |
| 192 | limit_metric_heq := HEq.rfl |
| 193 | limit_connection_heq := HEq.rfl |
| 194 | cap_count_eq := rfl |
| 195 | necks_heq := HEq.rfl |
| 196 | retained_image_heq := ?_ } |
| 197 | apply heq_of_eq |
| 198 | rw [← E.copyPast_retained_pre_image hPast, Set.image_image] |
| 199 | apply Set.image_congr |
| 200 | intro x _ |
| 201 | exact E.copyPast_limit_identify_map hPast x |
| 202 | |
| 203 | end PoincareMT.SurgeryEventData |