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.Spacetime.Realization.Slice.Topology |
| 2 | import PoincareLib.Geometry.Spacetime.Slice |
| 3 | |
| 4 | /-! |
| 5 | # Topological comparison of supplied labels with the literal slices |
| 6 | -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Topology |
| 12 | open scoped Manifold ContDiff Topology |
| 13 | |
| 14 | open PoincareMT |
| 15 | |
| 16 | namespace Poincare.Spacetime.Realization |
| 17 | |
| 18 | variable {n : ℕ} {X : Type*} [TopologicalSpace X] |
| 19 | {time : X → ℝ} {t : ℝ} |
| 20 | |
| 21 | def sliceLabelMap (L : SpacetimeSliceLabel n X time t) (x : L.carrier) : |
| 22 | spacetimeSlice time t := ⟨L.toSpacetime x, L.time_eq x⟩ |
| 23 | |
| 24 | theorem sliceLabelMap_embedding (L : SpacetimeSliceLabel n X time t) : |
| 25 | IsEmbedding (sliceLabelMap L) := |
| 26 | IsEmbedding.subtypeVal.of_comp_iff.mp L.embedding |
| 27 | |
| 28 | theorem sliceLabelMap_surjective (L : SpacetimeSliceLabel n X time t) : |
| 29 | Function.Surjective (sliceLabelMap L) := by |
| 30 | intro p |
| 31 | obtain ⟨x, hx⟩ := L.range_eq.symm ▸ (show p.val ∈ {p | time p = t} from p.property) |
| 32 | exact ⟨x, Subtype.ext hx⟩ |
| 33 | |
| 34 | noncomputable def sliceLabelHomeomorph (L : SpacetimeSliceLabel n X time t) : |
| 35 | L.carrier ≃ₜ spacetimeSlice time t := |
| 36 | (Equiv.ofBijective (sliceLabelMap L) |
| 37 | ⟨(sliceLabelMap_embedding L).injective, sliceLabelMap_surjective L⟩).toHomeomorphOfIsInducing |
| 38 | (sliceLabelMap_embedding L).isInducing |
| 39 | |
| 40 | theorem sliceLabelHomeomorph_apply (L : SpacetimeSliceLabel n X time t) (x : L.carrier) : |
| 41 | sliceLabelHomeomorph L x = sliceLabelMap L x := rfl |
| 42 | |
| 43 | noncomputable def labelBoxHomeomorph (A : AdaptedMetricAtlas n X) |
| 44 | (L : SpacetimeSliceLabeling A) (b : A.box_index) (t : ℝ) |
| 45 | (ht : t ∈ (A.box b).interval.domain) : |
| 46 | OpenPartialHomeomorph (A.box b).spatial (L.slice t).carrier := |
| 47 | (sliceHomeomorph (A.box b) t ht).trans |
| 48 | (sliceLabelHomeomorph (L.slice t)).symm.toOpenPartialHomeomorph |
| 49 | |
| 50 | theorem labelBoxHomeomorph_apply (A : AdaptedMetricAtlas n X) |
| 51 | (L : SpacetimeSliceLabeling A) (b : A.box_index) (t : ℝ) |
| 52 | (ht : t ∈ (A.box b).interval.domain) (x : (A.box b).spatial) : |
| 53 | labelBoxHomeomorph A L b t ht x = L.boxMap b t ht x := by |
| 54 | apply (sliceLabelHomeomorph (L.slice t)).injective |
| 55 | change sliceLabelHomeomorph (L.slice t) |
| 56 | ((sliceLabelHomeomorph (L.slice t)).symm (sliceBoxMap (A.box b) t ht x)) = _ |
| 57 | rw [Homeomorph.apply_symm_apply] |
| 58 | exact Subtype.ext (L.boxMap_eq b t ht x).symm |
| 59 | |
| 60 | theorem labelBoxHomeomorph_source (A : AdaptedMetricAtlas n X) |
| 61 | (L : SpacetimeSliceLabeling A) (b : A.box_index) (t : ℝ) |
| 62 | (ht : t ∈ (A.box b).interval.domain) : (labelBoxHomeomorph A L b t ht).source = univ := by |
| 63 | simp [labelBoxHomeomorph, sliceHomeomorph_source] |
| 64 | |
| 65 | theorem labelBox_targets_cover (A : AdaptedMetricAtlas n X) |
| 66 | (L : SpacetimeSliceLabeling A) (t : ℝ) (p : (L.slice t).carrier) : |
| 67 | ∃ b : {b : A.box_index // t ∈ (A.box b).interval.domain}, |
| 68 | p ∈ (labelBoxHomeomorph A L b.val t b.property).target := by |
| 69 | obtain ⟨b, hb⟩ := slice_targets_cover A t (sliceLabelHomeomorph (L.slice t) p) |
| 70 | exact ⟨b, ⟨mem_univ p, hb⟩⟩ |
| 71 | |
| 72 | end Poincare.Spacetime.Realization |