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.Compactness.GeometricLimit.Overlap.SourceMetric |
| 2 | import PoincareLib.Geometry.Riemannian.Metric.Gluing.Construction |
| 3 | |
| 4 | /-! |
| 5 | # Coefficients of the constructed quotient metric |
| 6 | |
| 7 | The actual quotient metric, pulled back through a canonical chart inclusion, |
| 8 | has exactly the corresponding piece metric's bilinear coefficients. Thus |
| 9 | coefficient identities supplied by the coordinate-limit construction pass to |
| 10 | the quotient metric without an additional identification assumption. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Poincare.Gluing |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | namespace PoincareMT.ChartDistance |
| 20 | |
| 21 | variable {ι : Type*} {n : ℕ} |
| 22 | (U : ι → Set (EuclideanSpace ℝ (Fin n))) (hU : ∀ i, IsOpen (U i)) |
| 23 | [∀ i, Nonempty (Piece U i)] |
| 24 | |
| 25 | private theorem mfderiv_canonicalSubtypeInverse (i : ι) (x : Piece U i) : |
| 26 | letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 27 | letI := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 n) (n := ∞) |
| 28 | mfderiv (𝓡 n) (𝓡 n) |
| 29 | (hU i).isOpenEmbedding_subtypeVal.toOpenPartialHomeomorph.symm |
| 30 | (x : EuclideanSpace ℝ (Fin n)) = |
| 31 | ContinuousLinearMap.id ℝ (EuclideanSpace ℝ (Fin n)) := by |
| 32 | let := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 33 | let := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 n) (n := ∞) |
| 34 | have hc : ⇑(extChartAt (𝓡 n) x) = |
| 35 | (Subtype.val : Piece U i → EuclideanSpace ℝ (Fin n)) := rfl |
| 36 | have hi : ⇑(extChartAt (𝓡 n) x).symm = |
| 37 | (hU i).isOpenEmbedding_subtypeVal.toOpenPartialHomeomorph.symm := rfl |
| 38 | have hd := mfderivWithin_range_extChartAt_symm (I := 𝓡 n) (x := x) |
| 39 | rw [ModelWithCorners.range_eq_univ, mfderivWithin_univ, hc, hi] at hd |
| 40 | exact hd |
| 41 | |
| 42 | /-- Canonical ambient parametrization preserves the derivative of a piece map. -/ |
| 43 | theorem mfderiv_chartParametrization |
| 44 | {M : Type*} [TopologicalSpace M] |
| 45 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 46 | {i : ι} {e : Piece U i → M} (x : Piece U i) |
| 47 | (he : letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 48 | ContMDiffAt (𝓡 n) (𝓡 n) ∞ e x) : |
| 49 | letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 50 | mfderiv (𝓡 n) (𝓡 n) (chartParametrization U hU e) |
| 51 | (x : EuclideanSpace ℝ (Fin n)) = mfderiv (𝓡 n) (𝓡 n) e x := by |
| 52 | let := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 53 | let := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 n) (n := ∞) |
| 54 | let r := (hU i).isOpenEmbedding_subtypeVal.toOpenPartialHomeomorph.symm |
| 55 | have hr : r (x : EuclideanSpace ℝ (Fin n)) = x := |
| 56 | Topology.IsOpenEmbedding.toOpenPartialHomeomorph_left_inv |
| 57 | (Subtype.val : Piece U i → EuclideanSpace ℝ (Fin n)) |
| 58 | (hU i).isOpenEmbedding_subtypeVal |
| 59 | have hrs : ContMDiffAt (𝓡 n) (𝓡 n) ∞ r (x : EuclideanSpace ℝ (Fin n)) := |
| 60 | (contMDiffOn_isOpenEmbedding_symm (I := 𝓡 n) (n := ∞) |
| 61 | (hU i).isOpenEmbedding_subtypeVal).contMDiffAt |
| 62 | ((hU i).isOpenEmbedding_subtypeVal.isOpen_range.mem_nhds ⟨x, rfl⟩) |
| 63 | have he' : ContMDiffAt (𝓡 n) (𝓡 n) ∞ e (r (x : EuclideanSpace ℝ (Fin n))) := by |
| 64 | rw [hr] |
| 65 | exact he |
| 66 | have hd := mfderiv_comp (x : EuclideanSpace ℝ (Fin n)) |
| 67 | (he'.mdifferentiableAt (by simp)) (hrs.mdifferentiableAt (by simp)) |
| 68 | have hdr : mfderiv (𝓡 n) (𝓡 n) r (x : EuclideanSpace ℝ (Fin n)) = |
| 69 | ContinuousLinearMap.id ℝ (EuclideanSpace ℝ (Fin n)) := |
| 70 | mfderiv_canonicalSubtypeInverse U hU i x |
| 71 | rw [hr, hdr] at hd |
| 72 | ext v |
| 73 | exact congrArg (fun A => A v) hd |
| 74 | |
| 75 | variable (O : OverlapSystem (fun i => Piece U i)) (hs : SmoothOverlap U hU O) |
| 76 | (g : ∀ i, CanonicalMetric U hU i) (hg : CompatibleMetrics U hU O g) |
| 77 | |
| 78 | /-- The quotient metric in a canonical piece parametrization is the piece metric. -/ |
| 79 | theorem quotientMetric_pullbackCoefficients (i : ι) (x : Piece U i) : |
| 80 | letI : ∀ j, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U j) := |
| 81 | fun j => (hU j).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 82 | letI : ∀ j, IsManifold (𝓡 n) ∞ (Piece U j) := |
| 83 | fun j => (hU j).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 84 | letI := quotientChartedSpace U hU O |
| 85 | letI := quotient_isManifold U hU O hs |
| 86 | (quotientMetric U hU O hs g hg).pullbackCoefficients |
| 87 | (chartParametrization U hU (O.include i)) (x : EuclideanSpace ℝ (Fin n)) = |
| 88 | (g i).inner x := by |
| 89 | let : ∀ j, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U j) := |
| 90 | fun j => (hU j).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 91 | let : ∀ j, IsManifold (𝓡 n) ∞ (Piece U j) := |
| 92 | fun j => (hU j).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 93 | let := quotientChartedSpace U hU O |
| 94 | let := quotient_isManifold U hU O hs |
| 95 | have hd := mfderiv_chartParametrization U hU x |
| 96 | ((include_isLocalDiffeomorph U hU O hs i).contMDiff x) |
| 97 | ext v w |
| 98 | change (quotientMetric U hU O hs g hg).inner |
| 99 | (chartParametrization U hU (O.include i) x) |
| 100 | (mfderiv (𝓡 n) (𝓡 n) (chartParametrization U hU (O.include i)) x v) |
| 101 | (mfderiv (𝓡 n) (𝓡 n) (chartParametrization U hU (O.include i)) x w) = |
| 102 | (g i).inner x v w |
| 103 | rw [chartParametrization_apply, hd] |
| 104 | exact (quotientMetric_preserves U hU O hs g hg i x v w).symm |
| 105 | |
| 106 | /-- Piece coefficient identities identify the constructed quotient's coefficients. -/ |
| 107 | theorem quotientMetric_pullbackCoefficients_eqOn |
| 108 | (B : ι → EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 109 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 110 | (hB : letI : ∀ j, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U j) := |
| 111 | fun j => (hU j).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 112 | letI : ∀ j, IsManifold (𝓡 n) ∞ (Piece U j) := |
| 113 | fun j => (hU j).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 114 | ∀ j (x : Piece U j) v w, (g j).inner x v w = B j x v w) |
| 115 | (i : ι) : |
| 116 | letI := quotientChartedSpace U hU O |
| 117 | letI := quotient_isManifold U hU O hs |
| 118 | EqOn ((quotientMetric U hU O hs g hg).pullbackCoefficients |
| 119 | (chartParametrization U hU (O.include i))) (B i) (U i) := by |
| 120 | let : ∀ j, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U j) := |
| 121 | fun j => (hU j).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 122 | let : ∀ j, IsManifold (𝓡 n) ∞ (Piece U j) := |
| 123 | fun j => (hU j).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 124 | let := quotientChartedSpace U hU O |
| 125 | let := quotient_isManifold U hU O hs |
| 126 | intro x hx |
| 127 | rw [quotientMetric_pullbackCoefficients U hU O hs g hg i ⟨x, hx⟩] |
| 128 | ext v w |
| 129 | exact hB i ⟨x, hx⟩ v w |
| 130 | |
| 131 | /-- The constructed quotient family has the supplied spacetime chart coefficients. -/ |
| 132 | theorem quotientMetric_family_pullbackCoefficients_eqOn |
| 133 | (gFamily : ∀ i, ℝ → CanonicalMetric U hU i) |
| 134 | (hcompat : ∀ t, CompatibleMetrics U hU O (fun i => gFamily i t)) |
| 135 | {J : Set ℝ} |
| 136 | (B : ι → ℝ × EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 137 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 138 | (hB : letI : ∀ j, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U j) := |
| 139 | fun j => (hU j).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 140 | letI : ∀ j, IsManifold (𝓡 n) ∞ (Piece U j) := |
| 141 | fun j => (hU j).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 142 | ∀ t ∈ J, ∀ j (x : Piece U j) v w, (gFamily j t).inner x v w = B j (t, x) v w) |
| 143 | (i : ι) : |
| 144 | letI := quotientChartedSpace U hU O |
| 145 | letI := quotient_isManifold U hU O hs |
| 146 | EqOn (fun p : ℝ × EuclideanSpace ℝ (Fin n) => |
| 147 | (quotientMetric U hU O hs (fun j => gFamily j p.1) (hcompat p.1)).pullbackCoefficients |
| 148 | (chartParametrization U hU (O.include i)) p.2) (B i) (J ×ˢ U i) := by |
| 149 | let : ∀ j, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U j) := |
| 150 | fun j => (hU j).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 151 | let : ∀ j, IsManifold (𝓡 n) ∞ (Piece U j) := |
| 152 | fun j => (hU j).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 153 | let := quotientChartedSpace U hU O |
| 154 | let := quotient_isManifold U hU O hs |
| 155 | intro p hp |
| 156 | exact quotientMetric_pullbackCoefficients_eqOn U hU O hs |
| 157 | (fun j => gFamily j p.1) (hcompat p.1) (fun j x => B j (p.1, x)) |
| 158 | (hB p.1 hp.1) i hp.2 |
| 159 | |
| 160 | end PoincareMT.ChartDistance |