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.ReducedGeometry.ReducedVolume.Metric.Hessian.LaplacianLinearity |
| 2 | import Mathlib.Geometry.Manifold.PartitionOfUnity |
| 3 | import Mathlib.MeasureTheory.Integral.Bochner.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Finite assembly of local weak scalar comparisons |
| 7 | |
| 8 | Morgan-Tian Theorem 7.13, pp. 162-164. Nonnegative smooth partitions |
| 9 | of unity split a compact test into finitely many subordinate tests. |
| 10 | Linearity of the literal Laplacian assembles both the integrability |
| 11 | and the sign without any local finiteness assumption on the measure. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set MeasureTheory |
| 17 | open scoped Manifold ContDiff BigOperators |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedVolume |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | [T3Space M] [SecondCountableTopology M] [MeasurableSpace M] |
| 26 | {g : RiemannianMetric n M} |
| 27 | |
| 28 | /-- Locally established weak comparisons give the full compact-test comparison. -/ |
| 29 | theorem weak_comparison_of_local (D : LeviCivitaData g) (μ : Measure M) (u H : M → ℝ) |
| 30 | (hlocal : ∀ q : M, ∃ U : Set M, IsOpen U ∧ q ∈ U ∧ |
| 31 | ∀ ψ : M → ℝ, ContMDiff (𝓡 n) (𝓘(ℝ, ℝ)) ∞ ψ → HasCompactSupport ψ → |
| 32 | tsupport ψ ⊆ U → (∀ x, 0 ≤ ψ x) → |
| 33 | Integrable (fun x ↦ ψ x * H x - u x * D.laplacian ψ x) μ ∧ |
| 34 | 0 ≤ ∫ x, ψ x * H x - u x * D.laplacian ψ x ∂μ) |
| 35 | (φ : M → ℝ) (hφ : ContMDiff (𝓡 n) (𝓘(ℝ, ℝ)) ∞ φ) |
| 36 | (hc : HasCompactSupport φ) (hpos : ∀ x, 0 ≤ φ x) : |
| 37 | Integrable (fun x ↦ φ x * H x - u x * D.laplacian φ x) μ ∧ |
| 38 | 0 ≤ ∫ x, φ x * H x - u x * D.laplacian φ x ∂μ := by |
| 39 | classical |
| 40 | let : LocallyCompactSpace M := Manifold.locallyCompact_of_finiteDimensional (𝓡 n) |
| 41 | choose U hU hq hweak using hlocal |
| 42 | obtain ⟨s, hs⟩ := hc.elim_finite_subcover U hU |
| 43 | (fun q _ ↦ mem_iUnion.mpr ⟨q, hq q⟩) |
| 44 | obtain ⟨θ, hθ⟩ := SmoothPartitionOfUnity.exists_isSubordinate (𝓡 n) |
| 45 | (isClosed_tsupport φ) (fun i : s ↦ U i) (fun i ↦ hU i) (by |
| 46 | intro q hq |
| 47 | obtain ⟨i, hi, hqi⟩ := mem_iUnion₂.mp (hs hq) |
| 48 | exact mem_iUnion.mpr ⟨⟨i, hi⟩, hqi⟩) |
| 49 | let ψ : s → M → ℝ := fun i x ↦ θ i x * φ x |
| 50 | have hψ (i : s) : ContMDiff (𝓡 n) (𝓘(ℝ, ℝ)) ∞ (ψ i) := |
| 51 | (θ i).contMDiff.mul hφ |
| 52 | have htest (i : s) := hweak i (ψ i) (hψ i) (show HasCompactSupport (ψ i) from hc.mul_left) |
| 53 | (tsupport_mul_subset_left.trans (hθ i)) (fun x ↦ mul_nonneg (θ.nonneg i x) (hpos x)) |
| 54 | have hsum (x : M) : (∑ i : s, ψ i x) = φ x := by |
| 55 | by_cases hx : x ∈ tsupport φ |
| 56 | · simp only [ψ, ← Finset.sum_mul, ← finsum_eq_sum_of_fintype, θ.sum_eq_one hx, one_mul] |
| 57 | · simp only [ψ, image_eq_zero_of_notMem_tsupport hx, mul_zero, Finset.sum_const_zero] |
| 58 | have hfun : (fun x ↦ ∑ i : s, ψ i x) = φ := funext hsum |
| 59 | have hlap (x : M) : D.laplacian φ x = ∑ i : s, D.laplacian (ψ i) x := by |
| 60 | rw [← hfun] |
| 61 | exact laplacian_finsetSum_scalar D Finset.univ ψ |
| 62 | (fun i _ ↦ (hψ i).of_le (by decide : (2 : ℕ∞ω) ≤ ∞)) x |
| 63 | have heq (x : M) : φ x * H x - u x * D.laplacian φ x = |
| 64 | ∑ i : s, (ψ i x * H x - u x * D.laplacian (ψ i) x) := by |
| 65 | rw [Finset.sum_sub_distrib, ← Finset.sum_mul, ← Finset.mul_sum, hsum, hlap] |
| 66 | constructor |
| 67 | · simpa only [← heq] using integrable_finsetSum Finset.univ (fun i _ ↦ (htest i).1) |
| 68 | · simp_rw [heq] |
| 69 | rw [integral_finsetSum Finset.univ (fun i _ ↦ (htest i).1)] |
| 70 | exact Finset.sum_nonneg (fun i _ ↦ (htest i).2) |
| 71 | |
| 72 | end PoincareMT.ReducedVolume |