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.Curvature.Integral.Induction.Fields |
| 2 | import PoincareLib.Geometry.Curvature.Integral.Induction.TangentialTrace |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.Bounds.Ricci |
| 4 | import PoincareLib.Geometry.Riemannian.Measure.Coarea.HypersurfaceSlab |
| 5 | |
| 6 | /-! |
| 7 | # Scalar-curvature estimates on regular slabs |
| 8 | |
| 9 | The scalar Gauss identity and the integrated hypersurface Bochner identity |
| 10 | eliminate normal Ricci curvature. This is the main inequality in Petrunin, |
| 11 | Section 4.5, author manuscript pp. 11--12, before the boundary area estimates. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set MeasureTheory |
| 18 | open Poincare.Geometry.Manifold.RegularLevel |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | namespace PoincareMT.LeviCivitaData |
| 22 | |
| 23 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) M] |
| 25 | [IsManifold (𝓡 (n + 1)) ∞ M] |
| 26 | {g : RiemannianMetric (n + 1) M} |
| 27 | |
| 28 | /-- The positive ambient scalar curvature is controlled by the positive |
| 29 | intrinsic scalar expression and the Bochner difference. -/ |
| 30 | theorem scalarCurvature_posPart_le_levelScalar [T2Space M] |
| 31 | (D : LeviCivitaData g) (f : M → ℝ) (x : M) |
| 32 | (hx : 0 < D.levelQ f x) (K : ℝ) (hK : 0 ≤ K) |
| 33 | (hsec : ∀ v w : TangentSpace (𝓡 (n + 1)) x, |
| 34 | -K ≤ D.sectionalCurvature x v w) : |
| 35 | let L := D.scalarCurvature x - |
| 36 | 2 * D.ricci x (D.levelUnitNormal f x) (D.levelUnitNormal f x) + |
| 37 | D.levelGaussTerm f x |
| 38 | max 0 (D.scalarCurvature x) ≤ 2 * max 0 L + |
| 39 | 2 * ((n + 1 : ℕ) : ℝ) ^ 2 * K - 2 * D.levelBochnerDifference f x := by |
| 40 | have hRic := D.two_mul_ricci_unit_le_scalarCurvature_add x K hK hsec |
| 41 | (D.levelUnitNormal f x) (D.inner_levelUnitNormal_self f x hx) |
| 42 | have hR := D.scalarCurvature_lower_bound_of_sectionalCurvature_lower_bound x K hsec |
| 43 | have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n |
| 44 | have hnK : 0 ≤ (n : ℝ) * K := mul_nonneg hn hK |
| 45 | dsimp only |
| 46 | simp only [Nat.cast_add, Nat.cast_one] at hR ⊢ |
| 47 | have hL := le_max_right 0 (D.scalarCurvature x - |
| 48 | 2 * D.ricci x (D.levelUnitNormal f x) (D.levelUnitNormal f x) + |
| 49 | D.levelGaussTerm f x) |
| 50 | unfold levelBochnerDifference |
| 51 | apply max_le <;> nlinarith |
| 52 | |
| 53 | variable [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 54 | |
| 55 | /-- The positive scalar integral on a compact regular slab is bounded by the |
| 56 | positive level scalar expression, the ambient sectional lower bound and the |
| 57 | two actual induced boundary mean-curvature integrals. -/ |
| 58 | theorem integral_scalarCurvature_posPart_slab_le (D : LeviCivitaData g) |
| 59 | {f : M → ℝ} (hf : ContMDiff (𝓡 (n + 1)) 𝓘(ℝ, ℝ) ∞ f) |
| 60 | {a b : ℝ} (hab : a < b) (hc : IsCompact (f ⁻¹' Icc a b)) |
| 61 | (hreg : ∀ x ∈ f ⁻¹' Icc a b, |
| 62 | mfderiv (𝓡 (n + 1)) 𝓘(ℝ, ℝ) f x ≠ 0) |
| 63 | {K : M → ℝ} (hKc : ContinuousOn K (f ⁻¹' Icc a b)) |
| 64 | (hK : ∀ x ∈ f ⁻¹' Icc a b, 0 ≤ K x) |
| 65 | (hsec : ∀ x ∈ f ⁻¹' Icc a b, ∀ v w : TangentSpace (𝓡 (n + 1)) x, |
| 66 | -K x ≤ D.sectionalCurvature x v w) : |
| 67 | let U := g.regularDomain hf |
| 68 | let L := fun x => D.scalarCurvature x - |
| 69 | 2 * D.ricci x (D.levelUnitNormal f x) (D.levelUnitNormal f x) + |
| 70 | D.levelGaussTerm f x |
| 71 | (∫ x in f ⁻¹' Icc a b, max 0 (D.scalarCurvature x) ∂g.volumeMeasure) ≤ |
| 72 | 2 * (∫ x in f ⁻¹' Icc a b, max 0 (L x) ∂g.volumeMeasure) + |
| 73 | 2 * ((n + 1 : ℕ) : ℝ) ^ 2 * (∫ x in f ⁻¹' Icc a b, K x ∂g.volumeMeasure) + |
| 74 | 2 * (∫ z, D.levelMeanCurvature f (openLevelIncl f U a z) |
| 75 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) a) - |
| 76 | 2 * (∫ z, D.levelMeanCurvature f (openLevelIncl f U b z) |
| 77 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) b) := by |
| 78 | let L := fun x => D.scalarCurvature x - |
| 79 | 2 * D.ricci x (D.levelUnitNormal f x) (D.levelUnitNormal f x) + |
| 80 | D.levelGaussTerm f x |
| 81 | have hq : f ⁻¹' Icc a b ⊆ {x | 0 < D.levelQ f x} := by |
| 82 | intro x hx |
| 83 | have hr := (g.mem_regularDomain_iff hf x).mpr (hreg x hx) |
| 84 | change 0 < Real.sqrt (D.levelQ f x) at hr |
| 85 | exact Real.sqrt_pos.mp hr |
| 86 | have hLc : ContinuousOn L (f ⁻¹' Icc a b) := |
| 87 | (D.continuous_scalarCurvature.continuousOn.sub |
| 88 | ((D.continuousOn_ricci_levelUnitNormal hf).mono hq |>.const_mul 2)).add |
| 89 | ((D.continuousOn_levelGaussTerm hf).mono hq) |
| 90 | have hLi : IntegrableOn (fun x => max 0 (L x)) (f ⁻¹' Icc a b) g.volumeMeasure := |
| 91 | (show ContinuousOn (fun x => max 0 (L x)) (f ⁻¹' Icc a b) from |
| 92 | fun x hx => continuousWithinAt_const.max (hLc x hx)).integrableOn_compact hc |
| 93 | have hRi : IntegrableOn (fun x => max 0 (D.scalarCurvature x)) |
| 94 | (f ⁻¹' Icc a b) g.volumeMeasure := |
| 95 | (continuous_const.max D.continuous_scalarCurvature).continuousOn.integrableOn_compact hc |
| 96 | have hBi : IntegrableOn (D.levelBochnerDifference f) (f ⁻¹' Icc a b) g.volumeMeasure := |
| 97 | ((D.continuousOn_levelBochnerDifference hf).mono hq).integrableOn_compact hc |
| 98 | have hKi := hKc.integrableOn_compact (μ := g.volumeMeasure) hc |
| 99 | have hle := setIntegral_mono_on hRi |
| 100 | (((hLi.const_mul 2).add (hKi.const_mul (2 * ((n + 1 : ℕ) : ℝ) ^ 2))).sub |
| 101 | (hBi.const_mul 2)) (isClosed_Icc.preimage hf.continuous).measurableSet |
| 102 | (fun x hx => D.scalarCurvature_posPart_le_levelScalar f x (hq hx) (K x) |
| 103 | (hK x hx) (hsec x hx)) |
| 104 | change (∫ x in f ⁻¹' Icc a b, max 0 (D.scalarCurvature x) ∂g.volumeMeasure) ≤ |
| 105 | ∫ x in f ⁻¹' Icc a b, (2 * max 0 (L x) + |
| 106 | 2 * ((n + 1 : ℕ) : ℝ) ^ 2 * K x) - 2 * D.levelBochnerDifference f x |
| 107 | ∂g.volumeMeasure at hle |
| 108 | rw [integral_sub (f := fun x => 2 * max 0 (L x) + |
| 109 | 2 * ((n + 1 : ℕ) : ℝ) ^ 2 * K x) ((hLi.const_mul 2).add |
| 110 | (hKi.const_mul (2 * ((n + 1 : ℕ) : ℝ) ^ 2))) (hBi.const_mul 2), |
| 111 | integral_add (hLi.const_mul 2) (hKi.const_mul (2 * ((n + 1 : ℕ) : ℝ) ^ 2)), |
| 112 | integral_const_mul, integral_const_mul, integral_const_mul, |
| 113 | D.integral_hypersurface_bochner_slab hf hab hc hreg] at hle |
| 114 | dsimp only at hle ⊢ |
| 115 | dsimp only [L] at hle |
| 116 | linarith only [hle] |
| 117 | |
| 118 | end PoincareMT.LeviCivitaData |