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.Class.SlabCoherence |
| 2 | import PoincareLib.Geometry.RicciFlow.Extinction.Width.Transport.RegularFlowBridge |
| 3 | |
| 4 | set_option autoImplicit false |
| 5 | set_option backward.isDefEq.respectTransparency false |
| 6 | |
| 7 | open scoped Manifold ContDiff Bundle Topology |
| 8 | |
| 9 | universe u |
| 10 | |
| 11 | namespace PoincareMT |
| 12 | |
| 13 | theorem m67_slab_initial_metric |
| 14 | {F : SurgeryFlowData.{u}} {a b : ℝ} |
| 15 | (slab : SurgeryRegularSlab F.slice F.metric a b) |
| 16 | (x : (F.slice a).carrier) (v w : TangentSpace (𝓡 3) x) : |
| 17 | (slab.flow.metric a).inner x v w = (F.metric a).inner x v w := by |
| 18 | have hid : slab.identify ⟨a, le_rfl, slab.ordered.le⟩ = |
| 19 | Diffeomorph.refl (𝓡 3) (F.slice a).carrier ∞ := by |
| 20 | ext z |
| 21 | exact slab.initial_identify z |
| 22 | have h := slab.metric_pullback ⟨a, le_rfl, slab.ordered.le⟩ x v w |
| 23 | rw [hid] at h |
| 24 | simpa only [Diffeomorph.coe_refl, id_eq, mfderiv_id, |
| 25 | ContinuousLinearMap.id_apply] using h.symm |
| 26 | |
| 27 | theorem m67_regular_flow_initial_metric |
| 28 | {g₀ : StandardInitialMetric} (D : RepairedSurgeryFlowData.{u} g₀) |
| 29 | {W : RepairedEventChildWitness D.flow} {T : ℝ} |
| 30 | (P : RepairedComponentPath D.flow T W) |
| 31 | {a b : ℝ} (ha : 0 ≤ a) (hab : a < b) (hb : b ≤ T) |
| 32 | (hJ : Disjoint D.flow.surgery_times (Set.Ioc a b)) |
| 33 | (g : RiemannianMetric 3 (P.component ⟨a, ha, hab.le.trans hb⟩).carrier.carrier) |
| 34 | (hmetric : ∀ x v w, (D.flow.metric a).inner |
| 35 | ((P.component ⟨a, ha, hab.le.trans hb⟩).inclusion x) |
| 36 | (mfderiv (𝓡 3) (𝓡 3) (P.component ⟨a, ha, hab.le.trans hb⟩).inclusion x v) |
| 37 | (mfderiv (𝓡 3) (𝓡 3) (P.component ⟨a, ha, hab.le.trans hb⟩).inclusion x w) = |
| 38 | g.inner x v w) |
| 39 | (x : (P.component ⟨a, ha, hab.le.trans hb⟩).carrier.carrier) |
| 40 | (v w : TangentSpace (𝓡 3) x) : |
| 41 | ((repairedRegularFlow D P ha hab hb hJ).metric a).inner x v w = g.inner x v w := by |
| 42 | rw [repairedRegularFlow_metric D P ha hab hb hJ ⟨a, le_rfl, hab.le⟩] |
| 43 | rw [m67_slab_initial_metric] |
| 44 | exact hmetric x v w |
| 45 | |
| 46 | /-- The actual ordinary flow is isometric to the selected slice at each |
| 47 | strictly later time, using the component path's regular transport. -/ |
| 48 | theorem m67_regular_flow_metric_at |
| 49 | {g₀ : StandardInitialMetric} (D : RepairedSurgeryFlowData.{u} g₀) |
| 50 | {W : RepairedEventChildWitness D.flow} {T : ℝ} |
| 51 | (P : RepairedComponentPath D.flow T W) |
| 52 | {a b : ℝ} (ha : 0 ≤ a) (hab : a < b) (hb : b ≤ T) |
| 53 | (hJ : Disjoint D.flow.surgery_times (Set.Ioc a b)) |
| 54 | (s : Set.Icc a b) (has : a < s.1) |
| 55 | (hJs : Disjoint D.flow.surgery_times (Set.Ioc a s.1)) |
| 56 | (g : RiemannianMetric 3 |
| 57 | (P.component ⟨s.1, ha.trans s.2.1, s.2.2.trans hb⟩).carrier.carrier) |
| 58 | (hmetric : ∀ y v w, (D.flow.metric s.1).inner |
| 59 | ((P.component ⟨s.1, ha.trans s.2.1, s.2.2.trans hb⟩).inclusion y) |
| 60 | (mfderiv (𝓡 3) (𝓡 3) |
| 61 | (P.component ⟨s.1, ha.trans s.2.1, s.2.2.trans hb⟩).inclusion y v) |
| 62 | (mfderiv (𝓡 3) (𝓡 3) |
| 63 | (P.component ⟨s.1, ha.trans s.2.1, s.2.2.trans hb⟩).inclusion y w) = |
| 64 | g.inner y v w) |
| 65 | (x : (P.component ⟨a, ha, hab.le.trans hb⟩).carrier.carrier) |
| 66 | (v w : TangentSpace (𝓡 3) x) : |
| 67 | let e := P.regular_transport ⟨a, ha, hab.le.trans hb⟩ |
| 68 | ⟨s.1, ha.trans s.2.1, s.2.2.trans hb⟩ has hJs |
| 69 | ((repairedRegularFlow D P ha hab hb hJ).metric s.1).inner x v w = |
| 70 | g.inner (e x) (mfderiv (𝓡 3) (𝓡 3) e x v) (mfderiv (𝓡 3) (𝓡 3) e x w) := by |
| 71 | let aI : Set.Icc (0 : ℝ) T := ⟨a, ha, hab.le.trans hb⟩ |
| 72 | let bI : Set.Icc (0 : ℝ) T := ⟨b, ha.trans hab.le, hb⟩ |
| 73 | let sI : Set.Icc (0 : ℝ) T := ⟨s.1, ha.trans s.2.1, s.2.2.trans hb⟩ |
| 74 | let C₀ := P.component aI |
| 75 | let Cs := P.component sI |
| 76 | let slab := D.flow.regular_slabs a b hab |
| 77 | (fun _u hu => P.time_subset ⟨ha.trans hu.1, hu.2.trans hb⟩) hJ |
| 78 | let e := P.regular_transport aI sI has hJs |
| 79 | have hid : (slab.identify ⟨a, le_rfl, hab.le⟩ : |
| 80 | (D.flow.slice a).carrier → (D.flow.slice a).carrier) = id := |
| 81 | funext slab.initial_identify |
| 82 | have hsymm (z : (D.flow.slice a).carrier) : |
| 83 | (slab.identify ⟨a, le_rfl, hab.le⟩).symm z = z := by |
| 84 | have h := (slab.identify ⟨a, le_rfl, hab.le⟩).apply_symm_apply z |
| 85 | rwa [hid, id_eq] at h |
| 86 | have hmap : Cs.inclusion ∘ e = (slab.identify s) ∘ C₀.inclusion := by |
| 87 | funext z |
| 88 | have h := m67_regular_transport_ambient_in_slab P aI bI hab hJ aI sI has hJs |
| 89 | ⟨le_rfl, hab.le⟩ s.2 z |
| 90 | change Cs.inclusion (e z) = slab.identify s |
| 91 | ((slab.identify ⟨a, le_rfl, hab.le⟩).symm (C₀.inclusion z)) at h |
| 92 | rw [hsymm] at h |
| 93 | exact h |
| 94 | have hderiv := congrArg (fun f : C₀.carrier.carrier → (D.flow.slice s.1).carrier => |
| 95 | (D.flow.metric s.1).inner (f x) |
| 96 | (mfderiv (𝓡 3) (𝓡 3) f x v) (mfderiv (𝓡 3) (𝓡 3) f x w)) hmap |
| 97 | rw [mfderiv_comp x (Cs.inclusion_smooth.mdifferentiable (by simp) (e x)) |
| 98 | (e.contMDiff.mdifferentiable (by simp) x), |
| 99 | mfderiv_comp x ((slab.identify s).contMDiff.mdifferentiable (by simp) (C₀.inclusion x)) |
| 100 | (C₀.inclusion_smooth.mdifferentiable (by simp) x)] at hderiv |
| 101 | change (D.flow.metric s.1).inner (Cs.inclusion (e x)) |
| 102 | (mfderiv (𝓡 3) (𝓡 3) Cs.inclusion (e x) (mfderiv (𝓡 3) (𝓡 3) e x v)) |
| 103 | (mfderiv (𝓡 3) (𝓡 3) Cs.inclusion (e x) (mfderiv (𝓡 3) (𝓡 3) e x w)) = |
| 104 | (D.flow.metric s.1).inner (slab.identify s (C₀.inclusion x)) |
| 105 | (mfderiv (𝓡 3) (𝓡 3) (slab.identify s) (C₀.inclusion x) |
| 106 | (mfderiv (𝓡 3) (𝓡 3) C₀.inclusion x v)) |
| 107 | (mfderiv (𝓡 3) (𝓡 3) (slab.identify s) (C₀.inclusion x) |
| 108 | (mfderiv (𝓡 3) (𝓡 3) C₀.inclusion x w)) at hderiv |
| 109 | rw [hmetric, slab.metric_pullback] at hderiv |
| 110 | exact hderiv.symm |
| 111 | |
| 112 | end PoincareMT |