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.Blowup.Construction.Generalized.BoxCylinder |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.Transitions |
| 3 | |
| 4 | /-! |
| 5 | # Spatial regularity of selected singleton worldlines |
| 6 | |
| 7 | Morgan--Tian Definition 3.38, p. 61, and Corollary 11.3, p. 269. |
| 8 | Meeting-line uniqueness identifies nearby spatial maps with a composition of |
| 9 | box maps. Smoothness and nonsingularity therefore propagate along a connected |
| 10 | time interval, without any regularity assumption on the choice of singleton |
| 11 | cylinders. See the M30 derivation `spatial-regularity.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u v |
| 20 | |
| 21 | namespace PoincareMT.M30 |
| 22 | |
| 23 | /-- A box forward map has bijective differential by its exact metric |
| 24 | pullback identity (Definition 3.38, p. 61). -/ |
| 25 | theorem box_forward_mfderiv_bijective (F : GeneralizedRicciFlowData.{u}) |
| 26 | (b : F.box_index) (t : ℝ) (ht : t ∈ (F.box b).interval) |
| 27 | (x : (F.box b).carrier.carrier) : |
| 28 | Function.Bijective (mfderiv (𝓡 3) (𝓡 3) ((F.box b).forward t ht) x) := |
| 29 | ((F.box b).flow.metric t).mfderiv_bijective_of_pullback_eq (F.metric t) x |
| 30 | ((F.box b).metric_pullback t ht x) |
| 31 | |
| 32 | /-- A box inverse is smooth and nonsingular on the actual forward range; |
| 33 | its total values outside that range are unused (Definition 3.38, p. 61). -/ |
| 34 | theorem box_inverse_regular (F : GeneralizedRicciFlowData.{u}) |
| 35 | (b : F.box_index) (t : ℝ) (ht : t ∈ (F.box b).interval) |
| 36 | (x : (F.slice t).carrier) (hx : x ∈ range ((F.box b).forward t ht)) : |
| 37 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ ((F.box b).inverse t ht) x ∧ |
| 38 | Function.Bijective (mfderiv (𝓡 3) (𝓡 3) ((F.box b).inverse t ht) x) := by |
| 39 | have hi := ((F.box b).inverse_smooth t ht).contMDiffAt |
| 40 | (((F.box b).forward_openEmbedding t ht).isOpen_range.mem_nhds hx) |
| 41 | refine ⟨hi, ?_⟩ |
| 42 | obtain ⟨y, rfl⟩ := hx |
| 43 | have hf := ((F.box b).forward_smooth t ht).contMDiffAt (x := y) |
| 44 | have heq : (F.box b).inverse t ht ∘ (F.box b).forward t ht = id := |
| 45 | funext ((F.box b).left_inverse t ht) |
| 46 | have hcomp := mfderiv_comp y (hi.mdifferentiableAt (by simp)) |
| 47 | (hf.mdifferentiableAt (by simp)) |
| 48 | rw [heq, mfderiv_id] at hcomp |
| 49 | apply (Function.Bijective.of_comp_iff _ (box_forward_mfderiv_bijective F b t ht y)).mp |
| 50 | change Function.Bijective |
| 51 | ((mfderiv (𝓡 3) (𝓡 3) ((F.box b).inverse t ht) |
| 52 | ((F.box b).forward t ht y)).comp |
| 53 | (mfderiv (𝓡 3) (𝓡 3) ((F.box b).forward t ht) y)) |
| 54 | rw [← hcomp] |
| 55 | exact Function.bijective_id |
| 56 | |
| 57 | namespace Cylinder |
| 58 | |
| 59 | variable {F : GeneralizedRicciFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 60 | {origin scale : ℝ} {I : Set ℝ} |
| 61 | {M : Type v} [TopologicalSpace M] |
| 62 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 63 | {p : M → C.carrier} |
| 64 | |
| 65 | /-- Spatial smoothness and nonsingularity transfer between two times of one |
| 66 | box along an arbitrary selected singleton family (Corollary 11.3, p. 269). -/ |
| 67 | theorem regularAt_of_meeting_box |
| 68 | (e : ∀ a : M, GeneralizedFlowCylinder F C origin scale I {p a}) |
| 69 | (hI : I.OrdConnected) {a : M} {s t : ℝ} (hs : s ∈ I) (ht : t ∈ I) |
| 70 | (b : F.box_index) (hbs : origin + s / scale ∈ (F.box b).interval) |
| 71 | (hbt : origin + t / scale ∈ (F.box b).interval) |
| 72 | (ha : (e a).forward s hs (p a) ∈ range ((F.box b).forward _ hbs)) |
| 73 | (hreg : ContMDiffAt (𝓡 3) (𝓡 3) ∞ (fun z => (e z).forward s hs (p z)) a ∧ |
| 74 | Function.Bijective |
| 75 | (mfderiv (𝓡 3) (𝓡 3) (fun z => (e z).forward s hs (p z)) a)) : |
| 76 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ (fun z => (e z).forward t ht (p z)) a ∧ |
| 77 | Function.Bijective |
| 78 | (mfderiv (𝓡 3) (𝓡 3) (fun z => (e z).forward t ht (p z)) a) := by |
| 79 | let fs := fun z : M => (e z).forward s hs (p z) |
| 80 | let ft := fun z : M => (e z).forward t ht (p z) |
| 81 | let ib := (F.box b).inverse (origin + s / scale) hbs |
| 82 | let fb := (F.box b).forward (origin + t / scale) hbt |
| 83 | have hnear : ∀ᶠ z in 𝓝 a, fs z ∈ range ((F.box b).forward _ hbs) := |
| 84 | hreg.1.continuousAt.preimage_mem_nhds |
| 85 | (((F.box b).forward_openEmbedding _ hbs).isOpen_range.mem_nhds ha) |
| 86 | have heq : ft =ᶠ[𝓝 a] fb ∘ (ib ∘ fs) := by |
| 87 | filter_upwards [hnear] with z hz |
| 88 | exact forward_eq_box_on_overlap (e z) hI (mem_singleton (p z)) b (ib (fs z)) |
| 89 | hs hbs (((F.box b).right_inverse _ hbs hz).symm) t ht hbt |
| 90 | have hi := box_inverse_regular F b _ hbs (fs a) ha |
| 91 | have hinner : ContMDiffAt (𝓡 3) (𝓡 3) ∞ (ib ∘ fs) a := hi.1.comp a hreg.1 |
| 92 | have houter : ContMDiffAt (𝓡 3) (𝓡 3) ∞ fb (ib (fs a)) := |
| 93 | ((F.box b).forward_smooth _ hbt).contMDiffAt |
| 94 | have hinner_bij : Function.Bijective (mfderiv (𝓡 3) (𝓡 3) (ib ∘ fs) a) := by |
| 95 | rw [mfderiv_comp a (hi.1.mdifferentiableAt (by simp)) |
| 96 | (hreg.1.mdifferentiableAt (by simp))] |
| 97 | exact hi.2.comp hreg.2 |
| 98 | refine ⟨(houter.comp a hinner).congr_of_eventuallyEq heq, ?_⟩ |
| 99 | change Function.Bijective (mfderiv (𝓡 3) (𝓡 3) ft a) |
| 100 | rw [heq.mfderiv_eq, mfderiv_comp a (houter.mdifferentiableAt (by simp)) |
| 101 | (hinner.mdifferentiableAt (by simp))] |
| 102 | exact (box_forward_mfderiv_bijective F b _ hbt _).comp hinner_bij |
| 103 | |
| 104 | /-- Initial spatial smoothness and nonsingularity propagate over the whole |
| 105 | connected common interval of the chosen singleton cylinders, including its |
| 106 | endpoints (Definition 3.38, p. 61; Corollary 11.3, p. 269). -/ |
| 107 | theorem regularAt_of_initial |
| 108 | (e : ∀ a : M, GeneralizedFlowCylinder F C origin scale I {p a}) |
| 109 | (hI : I.OrdConnected) (a : M) {s₀ : ℝ} (hs₀ : s₀ ∈ I) |
| 110 | (hinit : ContMDiffAt (𝓡 3) (𝓡 3) ∞ (fun z => (e z).forward s₀ hs₀ (p z)) a ∧ |
| 111 | Function.Bijective |
| 112 | (mfderiv (𝓡 3) (𝓡 3) (fun z => (e z).forward s₀ hs₀ (p z)) a)) : |
| 113 | ∀ t (ht : t ∈ I), |
| 114 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ (fun z => (e z).forward t ht (p z)) a ∧ |
| 115 | Function.Bijective |
| 116 | (mfderiv (𝓡 3) (𝓡 3) (fun z => (e z).forward t ht (p z)) a) := by |
| 117 | let P : I → Prop := fun t => |
| 118 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ (fun z => (e z).forward t.1 t.2 (p z)) a ∧ |
| 119 | Function.Bijective |
| 120 | (mfderiv (𝓡 3) (𝓡 3) (fun z => (e z).forward t.1 t.2 (p z)) a) |
| 121 | have hlocal (s : I) : ∀ᶠ t in 𝓝 s, (P s ↔ P t) ∧ (P t ↔ P s) := by |
| 122 | obtain ⟨b, y, delta, hdelta, hb⟩ := |
| 123 | (e a).vertical_compatibility s.1 s.2 (p a) (mem_singleton (p a)) |
| 124 | obtain ⟨hbs, hse⟩ := hb s.1 s.2 (by simpa using hdelta) |
| 125 | have hnear : {t : I | |t.1 - s.1| < delta} ∈ 𝓝 s := by |
| 126 | apply (isOpen_lt (continuous_subtype_val.sub continuous_const).abs |
| 127 | continuous_const).mem_nhds |
| 128 | simpa using hdelta |
| 129 | filter_upwards [hnear] with t ht |
| 130 | obtain ⟨hbt, hte⟩ := hb t.1 t.2 ht |
| 131 | have hequiv : P s ↔ P t := |
| 132 | ⟨fun hs => regularAt_of_meeting_box e hI s.2 t.2 b hbs hbt ⟨y, hse.symm⟩ hs, |
| 133 | fun ht => regularAt_of_meeting_box e hI t.2 s.2 b hbt hbs ⟨y, hte.symm⟩ ht⟩ |
| 134 | exact ⟨hequiv, hequiv.symm⟩ |
| 135 | let : PreconnectedSpace I := Subtype.preconnectedSpace hI.isPreconnected |
| 136 | intro t ht |
| 137 | exact (PreconnectedSpace.induction₂' (fun s t => P s ↔ P t) hlocal |
| 138 | ⟨fun _ _ _ hs ht => hs.trans ht⟩ (⟨s₀, hs₀⟩ : I) ⟨t, ht⟩).mp hinit |
| 139 | |
| 140 | end Cylinder |
| 141 | |
| 142 | end PoincareMT.M30 |