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.SectionalIntegral |
| 2 | import PoincareLib.Geometry.Curvature.Integral.Induction.Fields |
| 3 | import PoincareLib.Geometry.Riemannian.Connection.Construction |
| 4 | |
| 5 | /-! |
| 6 | # Weighted scalar estimates on proper regular levels |
| 7 | |
| 8 | Scalar Gauss transport supplies continuity and integrability for the actual |
| 9 | induced scalar curvature. The reciprocal speed bound and the integrated |
| 10 | sectional error then convert the lower-dimensional scalar estimate into the |
| 11 | weighted bound in Petrunin, Section 4.5, Intermediate inequality, author |
| 12 | manuscript pp. 10--11. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open Poincare.Geometry.Manifold.RegularLevel |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | namespace PoincareMT.LeviCivitaData |
| 23 | |
| 24 | variable {m : ℕ} {M : Type*} [TopologicalSpace M] |
| 25 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin (m + 2))) M] |
| 27 | [IsManifold (𝓡 (m + 2)) ∞ M] |
| 28 | {g : RiemannianMetric (m + 2) M} |
| 29 | |
| 30 | /-- On a proper regular level, the lower speed bound controls the weighted |
| 31 | positive scalar integral of the canonical induced Levi-Civita connection. -/ |
| 32 | theorem integral_regularLevel_scalarCurvature_posPart_div_speed_le |
| 33 | (D : LeviCivitaData g) |
| 34 | {f : M → ℝ} (hf : ContMDiff (𝓡 (m + 2)) 𝓘(ℝ, ℝ) ∞ f) |
| 35 | {I : Set ℝ} (hI : IsOpen I) |
| 36 | (hproper : IsProperMap (I.restrictPreimage f)) |
| 37 | (hreg : ∀ x, f x ∈ I → mfderiv (𝓡 (m + 2)) 𝓘(ℝ, ℝ) f x ≠ 0) |
| 38 | {t α : ℝ} (ht : t ∈ I) (hα : 0 < α) |
| 39 | (hspeed : ∀ x, f x = t → 1 / α ≤ g.tangentNorm x (g.gradient f x)) : |
| 40 | let U := g.regularDomain hf |
| 41 | letI : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin (m + 2))) = m + 2) := |
| 42 | ⟨finrank_euclideanSpace_fin⟩ |
| 43 | letI := openLevelSetChartedSpace hf U (g.regularDomain_regular hf) (m + 1) t |
| 44 | letI := isManifold_openLevelSet hf U (g.regularDomain_regular hf) (m + 1) t |
| 45 | let DL := (RiemannianMetric.regularLevelMetric |
| 46 | hf U (g.regularDomain_regular hf) t g).leviCivitaData |
| 47 | (∫ z, max 0 (DL.scalarCurvature z) / |
| 48 | g.tangentNorm (openLevelIncl f U t z) (g.gradient f (openLevelIncl f U t z)) |
| 49 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t) ≤ |
| 50 | α * (∫ z, max 0 (DL.scalarCurvature z) |
| 51 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t) := by |
| 52 | let U := g.regularDomain hf |
| 53 | letI : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin (m + 2))) = m + 2) := |
| 54 | ⟨finrank_euclideanSpace_fin⟩ |
| 55 | letI := openLevelSetChartedSpace hf U (g.regularDomain_regular hf) (m + 1) t |
| 56 | letI := isManifold_openLevelSet hf U (g.regularDomain_regular hf) (m + 1) t |
| 57 | let DL := (RiemannianMetric.regularLevelMetric |
| 58 | hf U (g.regularDomain_regular hf) t g).leviCivitaData |
| 59 | let S := fun x => D.scalarCurvature x - |
| 60 | 2 * D.ricci x (D.levelUnitNormal f x) (D.levelUnitNormal f x) + D.levelGaussTerm f x |
| 61 | have hUq : (U : Set M) ⊆ {x | 0 < D.levelQ f x} := by |
| 62 | intro x hx |
| 63 | exact Real.sqrt_pos.mp hx |
| 64 | have hSc : ContinuousOn S U := |
| 65 | (D.continuous_scalarCurvature.continuousOn.sub |
| 66 | ((D.continuousOn_ricci_levelUnitNormal hf).mono hUq |>.const_mul 2)).add |
| 67 | ((D.continuousOn_levelGaussTerm hf).mono hUq) |
| 68 | have hSpos : ContinuousOn (fun x => max 0 (S x)) U := |
| 69 | (continuousOn_const (c := (0 : ℝ))).sup hSc |
| 70 | have hSquot : ContinuousOn |
| 71 | (fun x => max 0 (S x) / g.tangentNorm x (g.gradient f x)) U := |
| 72 | hSpos.div (g.continuous_tangentNorm_gradient hf).continuousOn |
| 73 | (fun _ hx => ne_of_gt hx) |
| 74 | have hiS := integrable_regularLevelVolume_of_isProperMap hf hI hproper hreg ht hSpos |
| 75 | have hiW := integrable_regularLevelVolume_of_isProperMap hf hI hproper hreg ht hSquot |
| 76 | dsimp only [Function.comp_def] at hiS hiW |
| 77 | have hbound := integral_mono hiW (hiS.const_mul α) (fun z => by |
| 78 | have hs : 0 < g.tangentNorm (openLevelIncl f U t z) |
| 79 | (g.gradient f (openLevelIncl f U t z)) := z.1.2 |
| 80 | have hslow := (div_le_iff₀ hα).mp (hspeed (openLevelIncl f U t z) z.2) |
| 81 | have hinv : 1 / g.tangentNorm (openLevelIncl f U t z) |
| 82 | (g.gradient f (openLevelIncl f U t z)) ≤ α := |
| 83 | (div_le_iff₀ hs).mpr (by nlinarith only [hslow]) |
| 84 | calc |
| 85 | _ = max 0 (S (openLevelIncl f U t z)) * |
| 86 | (1 / g.tangentNorm (openLevelIncl f U t z) |
| 87 | (g.gradient f (openLevelIncl f U t z))) := by ring |
| 88 | _ ≤ max 0 (S (openLevelIncl f U t z)) * α := |
| 89 | mul_le_mul_of_nonneg_left hinv (le_max_left _ _) |
| 90 | _ = _ := mul_comm _ _) |
| 91 | rw [integral_const_mul] at hbound |
| 92 | have hscalar (z : openLevelSet f U t) : DL.scalarCurvature z = S (openLevelIncl f U t z) := |
| 93 | D.regularLevel_scalarCurvature_gauss g hf U (g.regularDomain_regular hf) t DL z |
| 94 | change (∫ z, max 0 (DL.scalarCurvature z) / |
| 95 | g.tangentNorm (openLevelIncl f U t z) (g.gradient f (openLevelIncl f U t z)) |
| 96 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t) ≤ |
| 97 | α * (∫ z, max 0 (DL.scalarCurvature z) |
| 98 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t) |
| 99 | simp_rw [hscalar] |
| 100 | exact hbound |
| 101 | |
| 102 | /-- The remaining lower-dimensional induction premise is the unweighted |
| 103 | positive scalar estimate for the actual induced metric. The geometric |
| 104 | error and reciprocal speed are controlled by the proved regular-level results. -/ |
| 105 | theorem integral_regularLevel_scalarCurvature_posPart_le_of_induction |
| 106 | (D : LeviCivitaData g) |
| 107 | {f : M → ℝ} (hf : ContMDiff (𝓡 (m + 2)) 𝓘(ℝ, ℝ) ∞ f) |
| 108 | {I : Set ℝ} (hI : IsOpen I) |
| 109 | (hproper : IsProperMap (I.restrictPreimage f)) |
| 110 | (hreg : ∀ x, f x ∈ I → mfderiv (𝓡 (m + 2)) 𝓘(ℝ, ℝ) f x ≠ 0) |
| 111 | {t α β C : ℝ} (ht : t ∈ I) (hα : 0 < α) (hβ : 0 ≤ β) (hC : 0 ≤ C) |
| 112 | {K : M → ℝ} (hKc : ContinuousOn K (g.regularDomain hf)) |
| 113 | (hhess : ∀ x, f x = t → ∀ v : TangentSpace (𝓡 (m + 2)) x, |
| 114 | g.inner x (D.gradient f x) v = 0 → |
| 115 | D.hessian f x v v / Real.sqrt (D.levelQ f x) ≤ β * g.inner x v v) |
| 116 | (hspeed : ∀ x, f x = t → |
| 117 | 1 / α ≤ g.tangentNorm x (g.gradient f x) ∧ |
| 118 | g.tangentNorm x (g.gradient f x) ≤ 1) : |
| 119 | let U := g.regularDomain hf |
| 120 | letI : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin (m + 2))) = m + 2) := |
| 121 | ⟨finrank_euclideanSpace_fin⟩ |
| 122 | letI := openLevelSetChartedSpace hf U (g.regularDomain_regular hf) (m + 1) t |
| 123 | letI := isManifold_openLevelSet hf U (g.regularDomain_regular hf) (m + 1) t |
| 124 | let DL := (RiemannianMetric.regularLevelMetric |
| 125 | hf U (g.regularDomain_regular hf) t g).leviCivitaData |
| 126 | ((∫ z, max 0 (DL.scalarCurvature z) |
| 127 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t) ≤ |
| 128 | C * (1 + ∫ z, D.levelSectionalError f K β (openLevelIncl f U t z) |
| 129 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t)) → |
| 130 | (∫ z, max 0 (DL.scalarCurvature z) / |
| 131 | g.tangentNorm (openLevelIncl f U t z) (g.gradient f (openLevelIncl f U t z)) |
| 132 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t) ≤ |
| 133 | α * C * (1 + (∫ z, K (openLevelIncl f U t z) |
| 134 | ∂g.regularLevelVolume hf U (g.regularDomain_regular hf) t) + |
| 135 | ((m + 1 : ℕ) : ℝ) * (1 + α) * β ^ 2 * g.regularLevelArea hf t - |
| 136 | β * deriv (g.regularLevelArea hf) t) := by |
| 137 | dsimp only |
| 138 | intro hind |
| 139 | have hweight := D.integral_regularLevel_scalarCurvature_posPart_div_speed_le |
| 140 | hf hI hproper hreg ht hα (fun x hx => (hspeed x hx).1) |
| 141 | have herror := D.integral_levelSectionalError_le |
| 142 | hf hI hproper hreg ht hα hβ hKc hhess hspeed |
| 143 | have hind' := mul_le_mul_of_nonneg_left hind hα.le |
| 144 | have herror' := mul_le_mul_of_nonneg_left (add_le_add_left herror 1) |
| 145 | (mul_nonneg hα.le hC) |
| 146 | dsimp only at hweight |
| 147 | nlinarith only [hweight, hind', herror'] |
| 148 | |
| 149 | end PoincareMT.LeviCivitaData |