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.Ancestry.Finite.ComponentTrace |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Ancestry.Finite.EqualRangeDiffeomorph |
| 3 | |
| 4 | /-! |
| 5 | # Smooth component models for a coherent trace |
| 6 | |
| 7 | Fix the initial model once, then use open component submanifolds at every |
| 8 | positive time. Component-class coherence restricts the literal ambient slab |
| 9 | maps to those models. Source: MT Definition 18.2, printed pp. 419--420. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- Use one fixed zero-time component in every trace, as required by |
| 22 | MT Definition 18.2 and its initial component, pp. 419--420. -/ |
| 23 | noncomputable def m56TraceComponents {F : SurgeryFlowData.{u}} {T : ℝ} |
| 24 | (P : M56ComponentTrace F T) (C0 : SurgerySelectedComponent (F.slice 0)) |
| 25 | (s : Icc (0 : ℝ) T) : SurgerySelectedComponent (F.slice s.1) := by |
| 26 | classical |
| 27 | exact if h : s.1 = 0 then h.symm ▸ C0 |
| 28 | else m56SelectedComponent (F.slices_compact s.1 (P.time_subset s.2)) (P.point s) |
| 29 | |
| 30 | /-- Every constructed trace uses the literal fixed initial component |
| 31 | (MT Definition 18.2, pp. 419--420). -/ |
| 32 | theorem m56TraceComponents_zero {F : SurgeryFlowData.{u}} {T : ℝ} |
| 33 | (P : M56ComponentTrace F T) (C0 : SurgerySelectedComponent (F.slice 0)) (hT : 0 ≤ T) : |
| 34 | m56TraceComponents P C0 ⟨0, le_rfl, hT⟩ = C0 := by |
| 35 | simp only [m56TraceComponents, ↓reduceDIte] |
| 36 | |
| 37 | /-- The smooth models represent exactly the trace's component classes |
| 38 | (MT Definition 18.2, pp. 419--420). -/ |
| 39 | theorem m56TraceComponents_range {F : SurgeryFlowData.{u}} {T : ℝ} |
| 40 | (P : M56ComponentTrace F T) (C0 : SurgerySelectedComponent (F.slice 0)) |
| 41 | (hC0 : range C0.inclusion = univ) |
| 42 | (hconn : IsConnected (univ : Set (F.slice 0).carrier)) (s : Icc (0 : ℝ) T) : |
| 43 | range (m56TraceComponents P C0 s).inclusion = connectedComponent (P.point s) := by |
| 44 | classical |
| 45 | by_cases hs : s.1 = 0 |
| 46 | · obtain ⟨s, hs0, hsT⟩ := s |
| 47 | dsimp at hs |
| 48 | subst s |
| 49 | rw [m56TraceComponents_zero P C0 hsT, hC0] |
| 50 | let : ConnectedSpace (F.slice 0).carrier := connectedSpace_iff_univ.mpr hconn |
| 51 | exact (PreconnectedSpace.connectedComponent_eq_univ _).symm |
| 52 | · rw [m56TraceComponents, dif_neg hs] |
| 53 | exact m56SelectedComponent_range (F.slices_compact s.1 (P.time_subset s.2)) (P.point s) |
| 54 | |
| 55 | /-- Matching ambient component classes restricts a diffeomorphism with its |
| 56 | literal map retained (MT Definition 18.2, pp. 419--420). -/ |
| 57 | theorem m56ComponentDiffeomorph_exists {A B : GeneralizedSliceCarrier.{u}} |
| 58 | (P : SurgerySelectedComponent A) (Q : SurgerySelectedComponent B) |
| 59 | (d : Diffeomorph (𝓡 3) (𝓡 3) A.carrier B.carrier ∞) |
| 60 | (x : A.carrier) (y : B.carrier) |
| 61 | (hP : range P.inclusion = connectedComponent x) |
| 62 | (hQ : range Q.inclusion = connectedComponent y) |
| 63 | (h : ConnectedComponents.mk (d x) = ConnectedComponents.mk y) : |
| 64 | ∃ e : Diffeomorph (𝓡 3) (𝓡 3) P.carrier.carrier Q.carrier.carrier ∞, |
| 65 | ∀ z, Q.inclusion (e z) = d (P.inclusion z) := by |
| 66 | have hf (z : P.carrier.carrier) : d (P.inclusion z) ∈ range Q.inclusion := by |
| 67 | rw [hQ] |
| 68 | have hz : P.inclusion z ∈ connectedComponent x := hP ▸ mem_range_self z |
| 69 | exact ConnectedComponents.coe_eq_coe'.mp |
| 70 | ((m56ComponentClass_map d.continuous (ConnectedComponents.coe_eq_coe'.mpr hz)).trans h) |
| 71 | have hback : ConnectedComponents.mk (d.symm y) = ConnectedComponents.mk x := by |
| 72 | have h' := m56ComponentClass_map d.symm.continuous h.symm |
| 73 | simpa only [d.symm_apply_apply] using h' |
| 74 | have hg (z : Q.carrier.carrier) : d.symm (Q.inclusion z) ∈ range P.inclusion := by |
| 75 | rw [hP] |
| 76 | have hz : Q.inclusion z ∈ connectedComponent y := hQ ▸ mem_range_self z |
| 77 | exact ConnectedComponents.coe_eq_coe'.mp |
| 78 | ((m56ComponentClass_map d.symm.continuous (ConnectedComponents.coe_eq_coe'.mpr hz)).trans |
| 79 | hback) |
| 80 | exact ⟨m56EqualRangeDiffeomorph P Q d hf hg, |
| 81 | m56EqualRangeDiffeomorph_inclusion P Q d hf hg⟩ |
| 82 | |
| 83 | /-- A coherent trace supplies the exact regular diffeomorphisms in |
| 84 | MT Definition 18.2, pp. 419--420. -/ |
| 85 | theorem m56Trace_regularDiffeomorph {F : SurgeryFlowData.{u}} {T : ℝ} |
| 86 | (P : M56ComponentTrace F T) |
| 87 | (C : ∀ s : Icc (0 : ℝ) T, SurgerySelectedComponent (F.slice s.1)) |
| 88 | (hC : ∀ s, range (C s).inclusion = connectedComponent (P.point s)) |
| 89 | (a b : Icc (0 : ℝ) T) (hab : a.1 < b.1) |
| 90 | (hfree : Disjoint F.surgery_times (Ioc a.1 b.1)) : |
| 91 | ∃ e : Diffeomorph (𝓡 3) (𝓡 3) (C a).carrier.carrier (C b).carrier.carrier ∞, |
| 92 | ∀ x, (C b).inclusion (e x) = |
| 93 | (F.regular_slabs a.1 b.1 hab |
| 94 | (fun _u hu => P.time_subset ⟨a.2.1.trans hu.1, hu.2.trans b.2.2⟩) hfree).transport |
| 95 | ⟨a.1, le_rfl, hab.le⟩ ⟨b.1, hab.le, le_rfl⟩ ((C a).inclusion x) := by |
| 96 | let hJ : Icc a.1 b.1 ⊆ F.time_domain := |
| 97 | fun _u hu => P.time_subset ⟨a.2.1.trans hu.1, hu.2.trans b.2.2⟩ |
| 98 | let S := F.regular_slabs a.1 b.1 hab hJ hfree |
| 99 | let d := (S.identify ⟨a.1, le_rfl, hab.le⟩).symm.trans |
| 100 | (S.identify ⟨b.1, hab.le, le_rfl⟩) |
| 101 | apply m56ComponentDiffeomorph_exists (C a) (C b) d (P.point a) (P.point b) (hC a) (hC b) |
| 102 | have h := P.regular a.1 b.1 hab hJ hfree a b ⟨le_rfl, hab.le⟩ ⟨hab.le, le_rfl⟩ |
| 103 | have h' := m56ComponentClass_map (S.identify ⟨b.1, hab.le, le_rfl⟩).continuous h |
| 104 | change ConnectedComponents.mk |
| 105 | (S.identify ⟨b.1, hab.le, le_rfl⟩ ((S.identify ⟨a.1, le_rfl, hab.le⟩).symm (P.point a))) = |
| 106 | ConnectedComponents.mk |
| 107 | (S.identify ⟨b.1, hab.le, le_rfl⟩ ((S.identify ⟨b.1, hab.le, le_rfl⟩).symm (P.point b))) at h' |
| 108 | simpa only [d, Diffeomorph.coe_trans, Function.comp_apply, Diffeomorph.apply_symm_apply] using h' |
| 109 | |
| 110 | end PoincareMT |