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.Extinction.Width.Transport.Assembly.ClassPath.Data |
| 2 | import PoincareLib.Geometry.RicciFlow.Extinction.Width.Transport.Assembly.ClassPath.Finite |
| 3 | import PoincareLib.Geometry.RicciFlow.Extinction.Width.Transport.Class.SlabCoherence |
| 4 | |
| 5 | set_option autoImplicit false |
| 6 | |
| 7 | open scoped Manifold ContDiff Bundle Topology unitInterval |
| 8 | |
| 9 | universe u |
| 10 | |
| 11 | namespace PoincareMT |
| 12 | |
| 13 | variable {g₀ : StandardInitialMetric} {D : RepairedSurgeryFlowData.{u} g₀} |
| 14 | {W : RepairedEventChildWitness D.flow} {T : ℝ} |
| 15 | {P : RepairedComponentPath D.flow T W} |
| 16 | {K : RepairedComparisonMapData D} {C : RepairedComparisonHomotopyData D K} |
| 17 | (H : RepairedAncestryTransportInput D W P K C) |
| 18 | (S : M59IdentificationSystem.{u}) (B : M59HigherBasepointTransportService.{u}) |
| 19 | |
| 20 | noncomputable def m67RegularClassDatumLE |
| 21 | (a b : Set.Icc (0 : ℝ) T) (hab : a ≤ b) |
| 22 | (hJ : Disjoint D.flow.surgery_times (Set.Ioc a.1 b.1)) |
| 23 | (x : M67ClassDatum S (P.component a)) : M67ClassDatum S (P.component b) := |
| 24 | if heq : a = b then heq ▸ x else |
| 25 | m67RegularClassDatum H S B a b |
| 26 | (lt_of_le_of_ne hab (fun h => heq (Subtype.ext h))) hJ x |
| 27 | |
| 28 | theorem m67RegularClassDatumLE_refl |
| 29 | (a : Set.Icc (0 : ℝ) T) |
| 30 | (hJ : Disjoint D.flow.surgery_times (Set.Ioc a.1 a.1)) |
| 31 | (x : M67ClassDatum S (P.component a)) : |
| 32 | m67RegularClassDatumLE H S B a a le_rfl hJ x = x := by |
| 33 | simp [m67RegularClassDatumLE] |
| 34 | |
| 35 | theorem m67RegularClassDatumLE_of_lt |
| 36 | (a b : Set.Icc (0 : ℝ) T) (hab : a.1 < b.1) |
| 37 | (hJ : Disjoint D.flow.surgery_times (Set.Ioc a.1 b.1)) |
| 38 | (x : M67ClassDatum S (P.component a)) : |
| 39 | m67RegularClassDatumLE H S B a b hab.le hJ x = |
| 40 | m67RegularClassDatum H S B a b hab hJ x := by |
| 41 | simp [m67RegularClassDatumLE, ne_of_lt (show a < b from hab)] |
| 42 | |
| 43 | theorem m67RegularClassDatum_comp |
| 44 | (a b c : Set.Icc (0 : ℝ) T) (hab : a.1 < b.1) (hbc : b.1 < c.1) |
| 45 | (hJab : Disjoint D.flow.surgery_times (Set.Ioc a.1 b.1)) |
| 46 | (hJbc : Disjoint D.flow.surgery_times (Set.Ioc b.1 c.1)) |
| 47 | (hJac : Disjoint D.flow.surgery_times (Set.Ioc a.1 c.1)) |
| 48 | (x : M67ClassDatum S (P.component a)) : |
| 49 | m67RegularClassDatum H S B b c hbc hJbc |
| 50 | (m67RegularClassDatum H S B a b hab hJab x) = |
| 51 | m67RegularClassDatum H S B a c (hab.trans hbc) hJac x := by |
| 52 | let y := m67RegularClassDatum H S B a b hab hJab x |
| 53 | let z := m67RegularClassDatum H S B b c hbc hJbc y |
| 54 | have htrans := m67_alpha_transport_trans B |
| 55 | (m67RegularClassDatum_transport H S B a b hab hJab x) |
| 56 | (m67RegularClassDatum_transport H S B b c hbc hJbc y) |
| 57 | have hmap : (repairedDiffeomorphContinuousMap (P.regular_transport b c hbc hJbc)).comp |
| 58 | (repairedDiffeomorphContinuousMap (P.regular_transport a b hab hJab)) = |
| 59 | repairedDiffeomorphContinuousMap (P.regular_transport a c (hab.trans hbc) hJac) := by |
| 60 | ext p |
| 61 | exact m67_regular_transport_comp P a b c hab hbc hJab hJbc hJac p |
| 62 | rw [hmap] at htrans |
| 63 | apply M67ClassDatum.ext |
| 64 | exact m67_alpha_transport_unique S B (P.regular_transport a c (hab.trans hbc) hJac).contMDiff |
| 65 | (S.core (P.component a).compact (P.component a).connected |
| 66 | (P.component a).basepoint x.pi_two_trivial) |
| 67 | (S.core (P.component c).compact (P.component c).connected |
| 68 | (P.component c).basepoint z.pi_two_trivial) htrans |
| 69 | (m67RegularClassDatum_transport H S B a c (hab.trans hbc) hJac x) |
| 70 | |
| 71 | theorem m67RegularClassDatumLE_comp |
| 72 | (a b c : Set.Icc (0 : ℝ) T) (hab : a ≤ b) (hbc : b ≤ c) |
| 73 | (hJab : Disjoint D.flow.surgery_times (Set.Ioc a.1 b.1)) |
| 74 | (hJbc : Disjoint D.flow.surgery_times (Set.Ioc b.1 c.1)) |
| 75 | (hJac : Disjoint D.flow.surgery_times (Set.Ioc a.1 c.1)) |
| 76 | (x : M67ClassDatum S (P.component a)) : |
| 77 | m67RegularClassDatumLE H S B b c hbc hJbc |
| 78 | (m67RegularClassDatumLE H S B a b hab hJab x) = |
| 79 | m67RegularClassDatumLE H S B a c (hab.trans hbc) hJac x := by |
| 80 | by_cases heq : a = b |
| 81 | · subst b |
| 82 | rw [m67RegularClassDatumLE_refl] |
| 83 | by_cases heq' : b = c |
| 84 | · subst c |
| 85 | rw [m67RegularClassDatumLE_refl] |
| 86 | have hab' : a.1 < b.1 := lt_of_le_of_ne hab (fun h => heq (Subtype.ext h)) |
| 87 | have hbc' : b.1 < c.1 := lt_of_le_of_ne hbc (fun h => heq' (Subtype.ext h)) |
| 88 | rw [m67RegularClassDatumLE_of_lt H S B a b hab', |
| 89 | m67RegularClassDatumLE_of_lt H S B b c hbc', |
| 90 | m67RegularClassDatumLE_of_lt H S B a c (hab'.trans hbc')] |
| 91 | exact m67RegularClassDatum_comp H S B a b c hab' hbc' hJab hJbc hJac x |
| 92 | |
| 93 | theorem m67_ordinaryBetween_surgery_disjoint |
| 94 | {events : Finset (Set.Icc (0 : ℝ) T)} |
| 95 | (hevents : ∀ t : Set.Icc (0 : ℝ) T, t ∈ events ↔ t.1 ∈ D.flow.surgery_times) |
| 96 | {a b : Set.Icc (0 : ℝ) T} (h : M67OrdinaryBetween events a b) : |
| 97 | Disjoint D.flow.surgery_times (Set.Ioc a.1 b.1) := by |
| 98 | apply Set.disjoint_left.mpr |
| 99 | intro t ht htab |
| 100 | let ti : Set.Icc (0 : ℝ) T := |
| 101 | ⟨t, a.2.1.trans htab.1.le, htab.2.trans b.2.2⟩ |
| 102 | exact Set.disjoint_left.mp h.2 ((hevents ti).mpr ht) htab |
| 103 | |
| 104 | noncomputable def m67OrdinaryClassDatum |
| 105 | {events : Finset (Set.Icc (0 : ℝ) T)} |
| 106 | (hevents : ∀ t : Set.Icc (0 : ℝ) T, t ∈ events ↔ t.1 ∈ D.flow.surgery_times) |
| 107 | (a b : Set.Icc (0 : ℝ) T) (h : M67OrdinaryBetween events a b) : |
| 108 | M67ClassDatum S (P.component a) → M67ClassDatum S (P.component b) := |
| 109 | m67RegularClassDatumLE H S B a b h.1 (m67_ordinaryBetween_surgery_disjoint hevents h) |
| 110 | |
| 111 | theorem m67OrdinaryClassDatum_refl |
| 112 | {events : Finset (Set.Icc (0 : ℝ) T)} |
| 113 | (hevents : ∀ t : Set.Icc (0 : ℝ) T, t ∈ events ↔ t.1 ∈ D.flow.surgery_times) |
| 114 | (a : Set.Icc (0 : ℝ) T) (h : M67OrdinaryBetween events a a) |
| 115 | (x : M67ClassDatum S (P.component a)) : |
| 116 | m67OrdinaryClassDatum H S B hevents a a h x = x := |
| 117 | m67RegularClassDatumLE_refl H S B a _ x |
| 118 | |
| 119 | theorem m67OrdinaryClassDatum_trans |
| 120 | {events : Finset (Set.Icc (0 : ℝ) T)} |
| 121 | (hevents : ∀ t : Set.Icc (0 : ℝ) T, t ∈ events ↔ t.1 ∈ D.flow.surgery_times) |
| 122 | (a b c : Set.Icc (0 : ℝ) T) |
| 123 | (hab : M67OrdinaryBetween events a b) (hbc : M67OrdinaryBetween events b c) |
| 124 | (x : M67ClassDatum S (P.component a)) : |
| 125 | m67OrdinaryClassDatum H S B hevents b c hbc |
| 126 | (m67OrdinaryClassDatum H S B hevents a b hab x) = |
| 127 | m67OrdinaryClassDatum H S B hevents a c (hab.trans hbc) x := |
| 128 | m67RegularClassDatumLE_comp H S B a b c hab.1 hbc.1 _ _ _ x |
| 129 | |
| 130 | end PoincareMT |