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.Manifold.Gluing.Smooth |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.Carrier |
| 3 | import PoincareLib.Topology.Gluing.Separation |
| 4 | |
| 5 | /-! |
| 6 | # Flow carriers from smooth chart quotients |
| 7 | |
| 8 | A connected Hausdorff quotient of countably many smooth Euclidean chart |
| 9 | pieces has all the structure of a flow carrier. The carrier retains the |
| 10 | original quotient type, quotient topology, and quotient charted structure. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Topology |
| 16 | open scoped Manifold ContDiff |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace Poincare.Gluing.OverlapSystem |
| 21 | |
| 22 | variable {n : ℕ} {ι : Type u} [Countable ι] |
| 23 | (U : ι → Set (EuclideanSpace ℝ (Fin n))) (hU : ∀ i, IsOpen (U i)) |
| 24 | [∀ i, Nonempty (Piece U i)] |
| 25 | (O : OverlapSystem (fun i => Piece U i)) |
| 26 | (hsmooth : SmoothOverlap U hU O) |
| 27 | (hclosed : ∀ i j, IsClosed {q : Piece U i × Piece U j | |
| 28 | O.Rel ⟨i, q.1⟩ ⟨j, q.2⟩}) |
| 29 | [ConnectedSpace (Quotient O.setoid)] |
| 30 | |
| 31 | /-- Package the actual smooth overlap quotient as a flow carrier. -/ |
| 32 | @[implicit_reducible] |
| 33 | noncomputable def flowCarrier : PoincareMT.FlowCarrier.{u} n := by |
| 34 | let := quotientChartedSpace U hU O |
| 35 | let := quotient_isManifold U hU O hsmooth |
| 36 | let : T2Space (Quotient O.setoid) := O.quotient_t2Space hclosed |
| 37 | let : LocallyCompactSpace (Quotient O.setoid) := |
| 38 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) _ |
| 39 | let : SecondCountableTopology (Quotient O.setoid) := |
| 40 | O.quotient_secondCountableTopology |
| 41 | let : MeasurableSpace (Quotient O.setoid) := borel (Quotient O.setoid) |
| 42 | let : BorelSpace (Quotient O.setoid) := ⟨rfl⟩ |
| 43 | exact |
| 44 | { carrier := Quotient O.setoid |
| 45 | topologicalSpace := inferInstance |
| 46 | measurableSpace := inferInstance |
| 47 | borelSpace := inferInstance |
| 48 | chartedSpace := quotientChartedSpace U hU O |
| 49 | isManifold := inferInstance |
| 50 | t2Space := inferInstance |
| 51 | t3Space := inferInstance |
| 52 | secondCountable := inferInstance |
| 53 | connected := isConnected_univ } |
| 54 | |
| 55 | @[simp] theorem flowCarrier_carrier : |
| 56 | (flowCarrier U hU O hsmooth hclosed).carrier = Quotient O.setoid := rfl |
| 57 | |
| 58 | @[simp] theorem flowCarrier_topologicalSpace : |
| 59 | (flowCarrier U hU O hsmooth hclosed).topologicalSpace = |
| 60 | (inferInstance : TopologicalSpace (Quotient O.setoid)) := rfl |
| 61 | |
| 62 | @[simp] theorem flowCarrier_chartedSpace : |
| 63 | (flowCarrier U hU O hsmooth hclosed).chartedSpace = |
| 64 | quotientChartedSpace U hU O := rfl |
| 65 | |
| 66 | @[simp] theorem flowCarrier_measurableSpace : |
| 67 | (flowCarrier U hU O hsmooth hclosed).measurableSpace = |
| 68 | borel (Quotient O.setoid) := rfl |
| 69 | |
| 70 | theorem flowCarrier_include_isOpenEmbedding (i : ι) : |
| 71 | let C := flowCarrier U hU O hsmooth hclosed |
| 72 | letI : TopologicalSpace C.carrier := C.topologicalSpace |
| 73 | IsOpenEmbedding (O.include i : Piece U i → C.carrier) := |
| 74 | O.include_isOpenEmbedding i |
| 75 | |
| 76 | theorem flowCarrier_include_isLocalDiffeomorph (i : ι) : |
| 77 | let C := flowCarrier U hU O hsmooth hclosed |
| 78 | letI : TopologicalSpace C.carrier := C.topologicalSpace |
| 79 | letI : ChartedSpace (EuclideanSpace ℝ (Fin n)) (Quotient O.setoid) := C.chartedSpace |
| 80 | letI : ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 81 | (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 82 | IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (O.include i : Piece U i → C.carrier) := |
| 83 | include_isLocalDiffeomorph U hU O hsmooth i |
| 84 | |
| 85 | theorem flowCarrier_include_contMDiff (i : ι) : |
| 86 | let C := flowCarrier U hU O hsmooth hclosed |
| 87 | letI : TopologicalSpace C.carrier := C.topologicalSpace |
| 88 | letI : ChartedSpace (EuclideanSpace ℝ (Fin n)) (Quotient O.setoid) := C.chartedSpace |
| 89 | letI : ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 90 | (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 91 | ContMDiff (𝓡 n) (𝓡 n) ∞ (O.include i : Piece U i → C.carrier) := by |
| 92 | let := quotientChartedSpace U hU O |
| 93 | let := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 94 | exact (include_isLocalDiffeomorph U hU O hsmooth i).contMDiff |
| 95 | |
| 96 | end Poincare.Gluing.OverlapSystem |