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.Riemannian.Curvature.LocalIsometryInvariants |
| 2 | import PoincareLib.Geometry.Riemannian.Measure.Isometry |
| 3 | import PoincareLib.Geometry.Riemannian.Metric.Induced.Equivalence |
| 4 | |
| 5 | /-! |
| 6 | # Scalar integrals under metric-preserving smooth equivalences |
| 7 | |
| 8 | Scalar invariance and intrinsic volume transport preserve arbitrary functions |
| 9 | of scalar curvature, including positive parts and totalized integrals. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | open Set MeasureTheory |
| 15 | open scoped Manifold ContDiff |
| 16 | namespace PoincareMT.LeviCivitaData |
| 17 | variable {n : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 18 | [T3Space M] [T3Space N] |
| 19 | [MeasurableSpace M] [BorelSpace M] [MeasurableSpace N] [BorelSpace N] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 22 | [IsManifold (𝓡 n) ∞ M] [IsManifold (𝓡 n) ∞ N] |
| 23 | {g : RiemannianMetric n M} {h : RiemannianMetric n N} |
| 24 | /-- Metric-preserving diffeomorphisms preserve every totalized integral of a |
| 25 | function of scalar curvature. -/ |
| 26 | theorem integral_scalarCurvature_eq_of_diffeomorph |
| 27 | (D : LeviCivitaData g) (D' : LeviCivitaData h) |
| 28 | (e : M ≃ₘ⟮𝓡 n, 𝓡 n⟯ N) |
| 29 | (hmetric : ∀ (x : M) (v w : TangentSpace (𝓡 n) x), |
| 30 | g.inner x v w = h.inner (e x) |
| 31 | (mfderiv (𝓡 n) (𝓡 n) e x v) (mfderiv (𝓡 n) (𝓡 n) e x w)) |
| 32 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (Ψ : ℝ → E) : |
| 33 | (∫ x, Ψ (D.scalarCurvature x) ∂g.volumeMeasure) = |
| 34 | ∫ y, Ψ (D'.scalarCurvature y) ∂h.volumeMeasure := by |
| 35 | calc |
| 36 | _ = ∫ x, Ψ (D'.scalarCurvature (e x)) ∂g.volumeMeasure := by |
| 37 | apply integral_congr_ae |
| 38 | exact Filter.Eventually.of_forall fun x => |
| 39 | congrArg Ψ (D.scalarCurvature_eq_of_local_isometry D' isOpen_univ |
| 40 | e.contMDiff.contMDiffOn (fun x _ => hmetric x) (mem_univ x)) |
| 41 | _ = _ := g.integral_comp_equiv_volumeMeasure h e.toEquiv |
| 42 | (g.edist_eq_of_diffeomorph_metric_pullback h e hmetric) (fun y => Ψ (D'.scalarCurvature y)) |
| 43 | end PoincareMT.LeviCivitaData |
| 44 |