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.Noncollapse.Assembly.PositiveComponents.PositiveBoxLines |
| 2 | import Mathlib.Topology.UnitInterval |
| 3 | |
| 4 | /-! |
| 5 | # Positive ancestry along spatially moving regular paths |
| 6 | |
| 7 | Morgan--Tian p. 393. Open images of connected spatial box components |
| 8 | cover the actual history. A finite subdivision of a chronological path |
| 9 | composes the physical component implications in those same boxes. |
| 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.Proofs.M46 |
| 20 | |
| 21 | /-- The physical positive-component predicate on an actual history point. |
| 22 | The quantified time proof has no geometric content and is proof-irrelevant. -/ |
| 23 | def HistoryPositive {G : GeneralizedRicciFlowData.{u}} {F : SurgeryFlowData.{u}} |
| 24 | (H : M33RegularHistoryRealization G F) (p : G.point) : Prop := |
| 25 | ∀ ht : p.1 ∈ G.interval, SurgeryPositiveComponentAt F p.1 (H.forward p.1 ht p.2) |
| 26 | |
| 27 | /-- An actual flow box restricted to one connected spatial component. -/ |
| 28 | def componentBoxImage (G : GeneralizedRicciFlowData.{u}) |
| 29 | (i : Σ q : G.box_index, (G.box q).carrier.carrier) : Set G.point := |
| 30 | (fun p : (G.box i.1).interval × (G.box i.1).carrier.carrier => |
| 31 | (⟨p.1.1, (G.box i.1).forward p.1.1 p.1.2 p.2⟩ : G.point)) '' |
| 32 | (univ ×ˢ connectedComponent i.2) |
| 33 | |
| 34 | /-- Connected-component box images are open in the supplied topology. -/ |
| 35 | theorem componentBoxImage_isOpen (G : GeneralizedRicciFlowData.{u}) |
| 36 | (i : Σ q : G.box_index, (G.box q).carrier.carrier) : |
| 37 | IsOpen (componentBoxImage G i) := by |
| 38 | let : LocallyConnectedSpace (G.box i.1).carrier.carrier := |
| 39 | ChartedSpace.locallyConnectedSpace (EuclideanSpace ℝ (Fin 3)) _ |
| 40 | exact (G.box_openEmbedding i.1).isOpenMap _ |
| 41 | (isOpen_univ.prod isOpen_connectedComponent) |
| 42 | |
| 43 | /-- The original atlas covers by these open connected-component images. -/ |
| 44 | theorem componentBoxImage_cover (G : GeneralizedRicciFlowData.{u}) : |
| 45 | (univ : Set G.point) ⊆ ⋃ i, componentBoxImage G i := by |
| 46 | intro p _ |
| 47 | obtain ⟨q, ht, x, hx⟩ := G.box_covers p.1 p.2 |
| 48 | apply mem_iUnion.mpr |
| 49 | refine ⟨⟨q, x⟩, ⟨(⟨p.1, ht⟩, x), ⟨mem_univ _, mem_connectedComponent⟩, ?_⟩⟩ |
| 50 | exact congrArg (fun z => (⟨p.1, z⟩ : G.point)) hx |
| 51 | |
| 52 | /-- Positivity propagates between ordered points in the same component |
| 53 | box; their spatial coordinates may differ. -/ |
| 54 | theorem historyPositive_of_mem_componentBox |
| 55 | {G : GeneralizedRicciFlowData.{u}} {F : SurgeryFlowData.{u}} |
| 56 | (H : M33RegularHistoryRealization G F) |
| 57 | (i : Σ q : G.box_index, (G.box q).carrier.carrier) |
| 58 | {p r : G.point} (hp : p ∈ componentBoxImage G i) |
| 59 | (hr : r ∈ componentBoxImage G i) (hpr : p.1 ≤ r.1) |
| 60 | (hpos : HistoryPositive H p) : HistoryPositive H r := by |
| 61 | obtain ⟨⟨s, x⟩, ⟨_, hx⟩, rfl⟩ := hp |
| 62 | obtain ⟨⟨t, y⟩, ⟨_, hy⟩, rfl⟩ := hr |
| 63 | have hxy : y ∈ connectedComponent x := by |
| 64 | simpa only [connectedComponent_eq hx] using hy |
| 65 | intro ht |
| 66 | exact positive_component_history_box_connected H i.1 hxy s.2 t.2 hpr |
| 67 | (hpos (m33BoxIntervalSubset G i.1 s.2)) |
| 68 | |
| 69 | /-- Every continuous chronological path in the actual regular history |
| 70 | carries the positive-component predicate forward, p. 393. -/ |
| 71 | theorem historyPositive_along_path |
| 72 | {G : GeneralizedRicciFlowData.{u}} {F : SurgeryFlowData.{u}} |
| 73 | (H : M33RegularHistoryRealization G F) {a b : ℝ} (hab : a ≤ b) |
| 74 | (γ : ℝ → G.point) (hγ : ContinuousOn γ (Icc a b)) |
| 75 | (hclock : MonotoneOn (fun s => (γ s).1) (Icc a b)) |
| 76 | (hstart : HistoryPositive H (γ a)) : HistoryPositive H (γ b) := by |
| 77 | let c : (Σ q : G.box_index, (G.box q).carrier.carrier) → Set (Icc a b) := |
| 78 | fun i => (fun s : Icc a b => γ s.1) ⁻¹' componentBoxImage G i |
| 79 | have hc : ∀ i, IsOpen (c i) := fun i => |
| 80 | (componentBoxImage_isOpen G i).preimage (continuousOn_iff_continuous_domRestrict.mp hγ) |
| 81 | have hcover : univ ⊆ ⋃ i, c i := by |
| 82 | intro s _ |
| 83 | obtain ⟨i, hi⟩ := mem_iUnion.mp (componentBoxImage_cover G (mem_univ (γ s.1))) |
| 84 | exact mem_iUnion.mpr ⟨i, hi⟩ |
| 85 | obtain ⟨t, ht0, hmono, ⟨m, hm⟩, hsub⟩ := |
| 86 | exists_monotone_Icc_subset_open_cover_Icc hab hc hcover |
| 87 | have hind : ∀ n : ℕ, HistoryPositive H (γ (t n).1) := by |
| 88 | intro n |
| 89 | induction n with |
| 90 | | zero => simpa only [ht0] using hstart |
| 91 | | succ n ih => |
| 92 | obtain ⟨i, hi⟩ := hsub n |
| 93 | have hle : t n ≤ t (n + 1) := hmono (Nat.le_succ n) |
| 94 | exact historyPositive_of_mem_componentBox H i |
| 95 | (hi ⟨le_rfl, hle⟩) (hi ⟨hle, le_rfl⟩) |
| 96 | (hclock (t n).2 (t (n + 1)).2 hle) ih |
| 97 | simpa only [hm m le_rfl] using hind m |
| 98 | |
| 99 | end PoincareMT.Proofs.M46 |