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.ReferenceSlab |
| 2 | |
| 3 | /-! |
| 4 | # Construct M31's final reference from the actual selected history |
| 5 | |
| 6 | The reference has the actual preterminal metric and connection. Its full |
| 7 | product embedding and vertical compatibility come from the same M33 cylinder |
| 8 | lift, while M13 supplies scalar naturality for the actual slab identification. |
| 9 | Sources: Morgan--Tian Theorem 11.19, p. 279, and Proposition 14.12, p. 350. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | /-- Retain the identities needed by the later M33 bridge, on this same history. -/ |
| 23 | structure M48RegularReferenceData {F : SurgeryFlowData.{u}} {T : ℝ} |
| 24 | (L : RepairedPreterminalSlab F T) (H : M33RegularHistoryData L.regularHistoryWindow) where |
| 25 | reference : SingularTimeReference H.generalized T (F.slice L.start).carrier |
| 26 | start_inside : L.start < reference.tMinus |
| 27 | metric_eq : reference.flow.metric = L.flow.metric |
| 28 | connection_eq : HEq reference.flow.connection L.flow.connection |
| 29 | history_eq : ∀ t ht x, |
| 30 | H.history.forward t (reference.window_subset ht) (reference.forward t ht x) = |
| 31 | L.identify ⟨t, start_inside.le.trans ht.1, ht.2⟩ x |
| 32 | |
| 33 | namespace M48Predecessors |
| 34 | |
| 35 | variable (P : M48Predecessors.{u}) {F : SurgeryFlowData.{u}} {T : ℝ} |
| 36 | {L : RepairedPreterminalSlab F T} (R : M48RegularSpacetimeData L) |
| 37 | |
| 38 | include P |
| 39 | |
| 40 | /-- For any time strictly inside the last slab, construct M31's reference |
| 41 | starting at that time on the fixed old carrier. It retains the slab's metric |
| 42 | and connection and commutes with the same history map at every included time. -/ |
| 43 | theorem regular_reference (a : ℝ) (ha : L.start < a) (haT : a < T) : |
| 44 | ∃ D : M48RegularReferenceData L R.history, D.reference.tMinus = a := by |
| 45 | let H := R.history |
| 46 | let J := Ico a T |
| 47 | have htime (t : ℝ) (ht : t ∈ J) : t ∈ H.generalized.interval := by |
| 48 | rw [H.interval_eq] |
| 49 | exact ⟨(F.time_domain_nonnegative L.start_mem).trans (ha.le.trans ht.1), ht.2⟩ |
| 50 | let f (t : ℝ) (ht : t ∈ J) : Diffeomorph (𝓡 3) (𝓡 3) |
| 51 | (F.slice L.start).carrier (H.generalized.slice t).carrier ∞ := |
| 52 | (L.identify ⟨t, L.reference_window_subset ha ht⟩).trans |
| 53 | (H.regularDiffeomorph t (htime t ht) (L.reference_regular ha t ht)).symm |
| 54 | have hcommute (t : ℝ) (ht : t ∈ J) (x : (F.slice L.start).carrier) : |
| 55 | H.history.forward t (htime t ht) (f t ht x) = |
| 56 | L.identify ⟨t, L.reference_window_subset ha ht⟩ x := by |
| 57 | exact (H.regularDiffeomorph t (htime t ht) (L.reference_regular ha t ht)).apply_symm_apply _ |
| 58 | let e := L.referenceCylinder ha |
| 59 | have hclock (t : ℝ) (ht : t ∈ J) : 0 + t / 1 ∈ H.generalized.interval := by |
| 60 | simpa only [div_one, zero_add] using htime t ht |
| 61 | obtain ⟨d, hd, hmetric⟩ := H.cylinders_from_surgery (F.slice L.start) 0 1 J univ |
| 62 | isOpen_univ hclock e (by |
| 63 | intro s hs |
| 64 | have hsreg : 0 + s / 1 ∉ F.surgery_times := by |
| 65 | simpa only [div_one, zero_add] using L.reference_regular ha s hs |
| 66 | rw [m33RegularRegion_of_regular F _ hsreg] |
| 67 | exact subset_univ _) |
| 68 | have heq (t : ℝ) (ht : t ∈ J) : d.forward t ht = |
| 69 | ⇑(f (0 + t / 1) (by simpa only [div_one, zero_add] using ht)) := by |
| 70 | funext x |
| 71 | apply (H.history.forward_openEmbedding (0 + t / 1) (hclock t ht)).injective |
| 72 | exact (hd t ht x (mem_univ x)).trans |
| 73 | (hcommute _ (by simpa only [div_one, zero_add] using ht) x).symm |
| 74 | have hpoint : (fun p : J × (F.slice L.start).carrier => |
| 75 | (⟨p.1.1, f p.1.1 p.1.2 p.2⟩ : H.generalized.point)) = |
| 76 | (fun p : J × (univ : Set (F.slice L.start).carrier) => |
| 77 | d.pointMap p.1.1 p.1.2 p.2.1) ∘ |
| 78 | (Homeomorph.prodCongr (Homeomorph.refl J) |
| 79 | (Homeomorph.Set.univ (F.slice L.start).carrier).symm) := by |
| 80 | funext p |
| 81 | dsimp [GeneralizedFlowCylinder.pointMap] |
| 82 | rw [heq] |
| 83 | exact congrArg (fun s : J => (⟨s.1, f s.1 s.2 p.2⟩ : H.generalized.point)) |
| 84 | (show p.1 = (⟨0 + p.1.1 / 1, by simpa only [div_one, zero_add] using p.1.2⟩ : J) |
| 85 | from Subtype.ext (by simp only [div_one, zero_add])) |
| 86 | have hmetric' (t : ℝ) (ht : t ∈ J) (x : (F.slice L.start).carrier) |
| 87 | (v w : TangentSpace (𝓡 3) x) : |
| 88 | (H.generalized.metric t).inner (f t ht x) |
| 89 | (mfderiv (𝓡 3) (𝓡 3) (f t ht) x v) |
| 90 | (mfderiv (𝓡 3) (𝓡 3) (f t ht) x w) = (L.flow.metric t).inner x v w := by |
| 91 | have h := hmetric t ht x (mem_univ x) v w |
| 92 | dsimp only [GeneralizedFlowCylinder.pullbackInner, SurgeryFlowCylinder.pullbackInner] at h |
| 93 | rw [heq] at h |
| 94 | simp only [e, RepairedPreterminalSlab.referenceCylinder, one_mul] at h |
| 95 | have h' := h.trans (L.metric_pullback ⟨0 + t / 1, by |
| 96 | simpa only [div_one, zero_add] using L.reference_window_subset ha ht⟩ x v w) |
| 97 | have hvalue := congrArg (fun s : J => |
| 98 | (H.generalized.metric s.1).inner (f s.1 s.2 x) |
| 99 | (mfderiv (𝓡 3) (𝓡 3) (f s.1 s.2) x v) |
| 100 | (mfderiv (𝓡 3) (𝓡 3) (f s.1 s.2) x w)) |
| 101 | (show (⟨t, ht⟩ : J) = ⟨0 + t / 1, by simpa using ht⟩ from |
| 102 | Subtype.ext (by simp)) |
| 103 | exact hvalue.trans (h'.trans (by simp only [div_one, zero_add])) |
| 104 | have hscalar (t : ℝ) (ht : t ∈ J) (x : (F.slice L.start).carrier) : |
| 105 | (H.generalized.connection t).scalarCurvature (f t ht x) = |
| 106 | (L.flow.connection t).scalarCurvature x := by |
| 107 | rw [← H.scalar_pullback t (htime t ht), hcommute t ht x] |
| 108 | have hhom : MetricHomothety (L.flow.metric t) (F.metric t) |
| 109 | (L.identify ⟨t, L.reference_window_subset ha ht⟩) 1 := by |
| 110 | intro y v w |
| 111 | simpa only [one_mul] using |
| 112 | L.metric_pullback ⟨t, L.reference_window_subset ha ht⟩ y v w |
| 113 | have hc := P.m13.metric_homothety _ _ (L.flow.metric t) (F.metric t) |
| 114 | (L.identify ⟨t, L.reference_window_subset ha ht⟩) 1 zero_lt_one hhom |
| 115 | simpa only [div_one] using hc.scalar_eq (L.flow.connection t) (F.connection t) x |
| 116 | let reference : SingularTimeReference H.generalized T (F.slice L.start).carrier := { |
| 117 | tMinus := a |
| 118 | tMinus_mem := htime a ⟨le_rfl, haT⟩ |
| 119 | tMinus_lt := haT |
| 120 | window_subset := fun t ht => htime t ht |
| 121 | flow := L.referenceFlow ha haT |
| 122 | forward := fun t ht => f t ht |
| 123 | inverse := fun t ht => (f t ht).symm |
| 124 | forward_openEmbedding := fun t ht => (f t ht).toHomeomorph.isOpenEmbedding |
| 125 | forward_smooth := fun t ht => (f t ht).contMDiff |
| 126 | inverse_smooth := fun t ht => (f t ht).symm.contMDiff |
| 127 | forward_surjective := fun t ht => (f t ht).surjective |
| 128 | left_inverse := fun t ht => (f t ht).left_inv |
| 129 | right_inverse := fun t ht => (f t ht).right_inv |
| 130 | metric_pullback := hmetric' |
| 131 | scalar_pullback := hscalar |
| 132 | spacetime_forward := fun p => ⟨p.1.1, f p.1.1 p.1.2 p.2⟩ |
| 133 | spacetime_time := fun _ => rfl |
| 134 | spacetime_spatial := fun _ => HEq.rfl |
| 135 | spacetime_embedding := by |
| 136 | rw [hpoint] |
| 137 | exact d.embedding.comp (Homeomorph.prodCongr (Homeomorph.refl J) |
| 138 | (Homeomorph.Set.univ (F.slice L.start).carrier).symm).isEmbedding |
| 139 | spacetime_image := by |
| 140 | ext p |
| 141 | constructor |
| 142 | · rintro ⟨q, rfl⟩ |
| 143 | exact q.1.2 |
| 144 | · intro hp |
| 145 | exact ⟨(⟨p.1, hp⟩, (f p.1 hp).symm p.2), by simp⟩ |
| 146 | vertical_compatibility := by |
| 147 | intro t ht x |
| 148 | obtain ⟨b, y, δ, hδ, hv⟩ := d.vertical_compatibility t ht x (mem_univ x) |
| 149 | refine ⟨b, y, δ, hδ, ?_⟩ |
| 150 | intro s hs hst |
| 151 | obtain ⟨hb, hforward⟩ := hv s hs hst |
| 152 | rw [heq] at hforward |
| 153 | have h' : ∃ hb : 0 + s / 1 ∈ (H.generalized.box b).interval, |
| 154 | f (0 + s / 1) (by simpa only [div_one, zero_add] using hs) x = |
| 155 | (H.generalized.box b).forward (0 + s / 1) hb y := ⟨hb, hforward⟩ |
| 156 | have htimeEq : (⟨0 + s / 1, by |
| 157 | simpa only [div_one, zero_add] using (show s ∈ J from hs)⟩ : J) = ⟨s, hs⟩ := |
| 158 | Subtype.ext (by simp) |
| 159 | exact (congrArg (fun q : J => ∃ hb : q.1 ∈ (H.generalized.box b).interval, |
| 160 | f q.1 q.2 x = (H.generalized.box b).forward q.1 hb y) htimeEq).mp h' } |
| 161 | exact ⟨⟨reference, ha, rfl, HEq.rfl, hcommute⟩, rfl⟩ |
| 162 | |
| 163 | /-- The interval guards needed by the reference producer always have a witness. -/ |
| 164 | theorem regular_reference_exists : Nonempty (M48RegularReferenceData L R.history) := by |
| 165 | obtain ⟨a, ha, haT⟩ := exists_between L.start_lt |
| 166 | obtain ⟨D, _⟩ := P.regular_reference R a ha haT |
| 167 | exact ⟨D⟩ |
| 168 | |
| 169 | end M48Predecessors |
| 170 | |
| 171 | end PoincareMT |