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.Small |
| 2 | import PoincareLib.Geometry.Riemannian.Metric.Diffeomorph |
| 3 | import PoincareLib.Geometry.Riemannian.Metric.LocalDiffeomorph |
| 4 | import PoincareLib.Geometry.Riemannian.Connection.Construction |
| 5 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryInvariants |
| 6 | import PoincareLib.Geometry.Riemannian.Measure.Exhaustion |
| 7 | import Mathlib.MeasureTheory.Integral.Bochner.Set |
| 8 | |
| 9 | /-! |
| 10 | # Scalar integrals on universe-zero models |
| 11 | |
| 12 | A connected Riemannian metric supplies second countability. The shrinking |
| 13 | diffeomorphism therefore gives a smooth universe-zero model with the same |
| 14 | sectional curvature, completeness, and scalar-curvature integrals on balls. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set MeasureTheory |
| 22 | open scoped Manifold ContDiff Bundle |
| 23 | |
| 24 | universe u v |
| 25 | |
| 26 | namespace PoincareMT.RiemannianMetric |
| 27 | |
| 28 | section Diffeomorph |
| 29 | |
| 30 | variable {n : ℕ} {M : Type u} {N : Type v} |
| 31 | [TopologicalSpace M] [TopologicalSpace N] [T3Space M] [T3Space N] |
| 32 | [MeasurableSpace M] [BorelSpace M] [MeasurableSpace N] [BorelSpace N] |
| 33 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 34 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 35 | [IsManifold (𝓡 n) ∞ M] [IsManifold (𝓡 n) ∞ N] |
| 36 | (gM : RiemannianMetric n M) (gN : RiemannianMetric n N) |
| 37 | (e : M ≃ₘ⟮𝓡 n, 𝓡 n⟯ N) |
| 38 | (hinner : ∀ (x : M) (v w : TangentSpace (𝓡 n) x), |
| 39 | gM.inner x v w = gN.inner (e x) |
| 40 | (mfderiv (𝓡 n) (𝓡 n) e x v) (mfderiv (𝓡 n) (𝓡 n) e x w)) |
| 41 | |
| 42 | include hinner |
| 43 | |
| 44 | /-- A smooth diffeomorphism preserving the metric preserves intrinsic volume. -/ |
| 45 | theorem measurePreserving_diffeomorph : |
| 46 | MeasurePreserving e gM.volumeMeasure gN.volumeMeasure := by |
| 47 | have hm : Measurable (e : M → N) := e.toHomeomorph.measurable |
| 48 | refine ⟨hm, ?_⟩ |
| 49 | ext s hs |
| 50 | rw [Measure.map_apply hm hs] |
| 51 | have h := volumeMeasure_image_diffeomorph gM gN e hinner (e ⁻¹' s) |
| 52 | have he : Function.Surjective (e : M → N) := e.surjective |
| 53 | rw [Set.image_preimage_eq _ he] at h |
| 54 | exact h.symm |
| 55 | |
| 56 | /-- Ball integrals transport under a metric-preserving diffeomorphism, |
| 57 | including integrands for which the real integral is totalized. -/ |
| 58 | theorem integral_ball_diffeomorph (p : M) (r : ℝ) (h : N → ℝ) : |
| 59 | (∫ x in gM.ball p r, h (e x) ∂gM.volumeMeasure) = |
| 60 | ∫ x in gN.ball (e p) r, h x ∂gN.volumeMeasure := by |
| 61 | have hi := (measurePreserving_diffeomorph gM gN e hinner).setIntegral_image_emb |
| 62 | e.toHomeomorph.measurableEmbedding h (gM.ball p r) |
| 63 | rw [image_ball_diffeomorph gM gN e hinner] at hi |
| 64 | exact hi.symm |
| 65 | |
| 66 | /-- Scalar-curvature ball integrals are invariant under isometric diffeomorphisms |
| 67 | between manifolds in arbitrary universes. -/ |
| 68 | theorem integral_scalarCurvature_ball_diffeomorph |
| 69 | (D : LeviCivitaData gM) (D' : LeviCivitaData gN) (p : M) (r : ℝ) : |
| 70 | (∫ x in gM.ball p r, D.scalarCurvature x ∂gM.volumeMeasure) = |
| 71 | ∫ x in gN.ball (e p) r, D'.scalarCurvature x ∂gN.volumeMeasure := by |
| 72 | have hs : ∀ x : M, D.scalarCurvature x = D'.scalarCurvature (e x) := by |
| 73 | intro x |
| 74 | exact D.scalarCurvature_eq_of_local_isometry D' isOpen_univ |
| 75 | e.contMDiff.contMDiffOn (fun y _ v w => hinner y v w) (mem_univ x) |
| 76 | simp_rw [hs] |
| 77 | exact integral_ball_diffeomorph gM gN e hinner p r D'.scalarCurvature |
| 78 | |
| 79 | omit [T3Space M] [T3Space N] [MeasurableSpace M] [BorelSpace M] |
| 80 | [MeasurableSpace N] [BorelSpace N] in |
| 81 | /-- Sectional-curvature evaluations are invariant under an isometric |
| 82 | diffeomorphism, including linearly dependent tangent pairs. -/ |
| 83 | theorem sectionalCurvature_diffeomorph |
| 84 | (D : LeviCivitaData gM) (D' : LeviCivitaData gN) |
| 85 | (x : M) (v w : TangentSpace (𝓡 n) x) : |
| 86 | D.sectionalCurvature x v w = D'.sectionalCurvature (e x) |
| 87 | (mfderiv (𝓡 n) (𝓡 n) e x v) (mfderiv (𝓡 n) (𝓡 n) e x w) := by |
| 88 | unfold LeviCivitaData.sectionalCurvature |
| 89 | rw [D.curvatureTensor_eq_of_local_isometry D' isOpen_univ |
| 90 | e.contMDiff.contMDiffOn (fun y _ v w => hinner y v w) (mem_univ x)] |
| 91 | rw [hinner x v v, hinner x w w, hinner x v w] |
| 92 | |
| 93 | end Diffeomorph |
| 94 | |
| 95 | section Shrink |
| 96 | |
| 97 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T3Space M] |
| 98 | [SecondCountableTopology M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 99 | [IsManifold (𝓡 n) ∞ M] |
| 100 | |
| 101 | local instance smallCarrier : Small.{0} M := |
| 102 | Poincare.Topology.SecondCountable.small M |
| 103 | |
| 104 | local instance smallChartedSpace : |
| 105 | ChartedSpace (EuclideanSpace ℝ (Fin n)) (Shrink.{0} M) := |
| 106 | Poincare.Manifold.shrinkChartedSpace _ M |
| 107 | |
| 108 | local instance smallIsManifold : IsManifold (𝓡 n) ∞ (Shrink.{0} M) := |
| 109 | Poincare.Manifold.shrinkIsManifold (𝓡 n) M |
| 110 | |
| 111 | local instance smallT3Space : T3Space (Shrink.{0} M) := |
| 112 | (Poincare.Topology.SecondCountable.homeomorphShrink M).t3Space |
| 113 | |
| 114 | /-- The retained metric transported to the universe-zero smooth model. -/ |
| 115 | def shrink (g : RiemannianMetric n M) : RiemannianMetric n (Shrink.{0} M) := |
| 116 | g.pullbackOfLocalDiffeomorph (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm |
| 117 | (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm.isLocalDiffeomorph |
| 118 | |
| 119 | @[simp] theorem shrink_inner (g : RiemannianMetric n M) |
| 120 | (x : Shrink.{0} M) (v w : TangentSpace (𝓡 n) x) : |
| 121 | g.shrink.inner x v w = g.inner ((equivShrink M).symm x) |
| 122 | (mfderiv (𝓡 n) (𝓡 n) (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm x v) |
| 123 | (mfderiv (𝓡 n) (𝓡 n) (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm x w) := |
| 124 | rfl |
| 125 | |
| 126 | /-- Preconnectedness is preserved by the shrinking homeomorphism. -/ |
| 127 | theorem shrink_preconnectedSpace [PreconnectedSpace M] : |
| 128 | PreconnectedSpace (Shrink.{0} M) := |
| 129 | (Poincare.Topology.SecondCountable.homeomorphShrink M).surjective.denseRange.preconnectedSpace |
| 130 | (Poincare.Topology.SecondCountable.homeomorphShrink M).continuous |
| 131 | |
| 132 | @[simp] theorem shrink_edist (g : RiemannianMetric n M) (x y : Shrink.{0} M) : |
| 133 | g.shrink.edist x y = g.edist ((equivShrink M).symm x) ((equivShrink M).symm y) := |
| 134 | edist_diffeomorph g.shrink g (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm |
| 135 | (fun _ _ _ => rfl) x y |
| 136 | |
| 137 | theorem shrink_image_ball (g : RiemannianMetric n M) (x : Shrink.{0} M) (r : ℝ) : |
| 138 | (equivShrink M).symm '' g.shrink.ball x r = |
| 139 | g.ball ((equivShrink M).symm x) r := |
| 140 | image_ball_diffeomorph g.shrink g (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm |
| 141 | (fun _ _ _ => rfl) x r |
| 142 | |
| 143 | @[simp] theorem shrink_metricComplete_iff (g : RiemannianMetric n M) : |
| 144 | MetricComplete g.shrink ↔ MetricComplete g := |
| 145 | metricComplete_iff_diffeomorph g.shrink g |
| 146 | (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm (fun _ _ _ => rfl) |
| 147 | |
| 148 | @[simp] theorem shrink_scalarCurvature (g : RiemannianMetric n M) |
| 149 | (D : LeviCivitaData g) (x : Shrink.{0} M) : |
| 150 | g.shrink.leviCivitaData.scalarCurvature x = D.scalarCurvature ((equivShrink M).symm x) := by |
| 151 | exact g.shrink.leviCivitaData.scalarCurvature_eq_of_local_isometry D isOpen_univ |
| 152 | (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm.contMDiff.contMDiffOn |
| 153 | (fun _ _ _ _ => rfl) (mem_univ x) |
| 154 | |
| 155 | theorem shrink_sectionalCurvature (g : RiemannianMetric n M) |
| 156 | (D : LeviCivitaData g) (x : Shrink.{0} M) (v w : TangentSpace (𝓡 n) x) : |
| 157 | g.shrink.leviCivitaData.sectionalCurvature x v w = |
| 158 | D.sectionalCurvature ((equivShrink M).symm x) |
| 159 | (mfderiv (𝓡 n) (𝓡 n) (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm x v) |
| 160 | (mfderiv (𝓡 n) (𝓡 n) (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm x w) := |
| 161 | sectionalCurvature_diffeomorph g.shrink g |
| 162 | (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm (fun _ _ _ => rfl) |
| 163 | g.shrink.leviCivitaData D x v w |
| 164 | |
| 165 | /-- Every uniform sectional lower bound survives passage to the small model. -/ |
| 166 | theorem shrink_sectionalCurvature_lower_bound (g : RiemannianMetric n M) |
| 167 | (D : LeviCivitaData g) {κ : ℝ} |
| 168 | (hsec : ∀ (x : M) (v w : TangentSpace (𝓡 n) x), κ ≤ D.sectionalCurvature x v w) : |
| 169 | ∀ (x : Shrink.{0} M) (v w : TangentSpace (𝓡 n) x), |
| 170 | κ ≤ g.shrink.leviCivitaData.sectionalCurvature x v w := by |
| 171 | intro x v w |
| 172 | rw [shrink_sectionalCurvature g D] |
| 173 | exact hsec _ _ _ |
| 174 | |
| 175 | section Volume |
| 176 | |
| 177 | variable [MeasurableSpace M] [BorelSpace M] |
| 178 | |
| 179 | local instance smallMeasurableSpace : MeasurableSpace (Shrink.{0} M) := |
| 180 | borel (Shrink.{0} M) |
| 181 | |
| 182 | local instance smallBorelSpace : BorelSpace (Shrink.{0} M) := ⟨rfl⟩ |
| 183 | |
| 184 | /-- Scalar-curvature integrals on corresponding balls agree exactly with |
| 185 | those on the canonical universe-zero model. -/ |
| 186 | theorem shrink_integral_scalarCurvature_ball (g : RiemannianMetric n M) |
| 187 | (D : LeviCivitaData g) (x : Shrink.{0} M) (r : ℝ) : |
| 188 | (∫ y in g.shrink.ball x r, g.shrink.leviCivitaData.scalarCurvature y |
| 189 | ∂g.shrink.volumeMeasure) = |
| 190 | ∫ y in g.ball ((equivShrink M).symm x) r, D.scalarCurvature y ∂g.volumeMeasure := |
| 191 | integral_scalarCurvature_ball_diffeomorph g.shrink g |
| 192 | (Poincare.Manifold.shrinkDiffeomorph (𝓡 n) M).symm (fun _ _ _ => rfl) |
| 193 | g.shrink.leviCivitaData D x r |
| 194 | |
| 195 | end Volume |
| 196 | end Shrink |
| 197 | |
| 198 | end PoincareMT.RiemannianMetric |