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.Analysis.Smoothing.SemiconcaveSmoothing |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.WeakInequality.Operator.WeightedOperatorBound |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.WeakInequality.Operator.WeightedOperatorLimit |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.WeakInequality.Operator.WeightedTestIntegrable |
| 5 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Analysis.Integration.UniformIntegralLimit |
| 6 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Analysis.Integration.UpperIntegralLimit |
| 7 | |
| 8 | /-! |
| 9 | # Local weak comparison from semiconcavity and regular germs |
| 10 | |
| 11 | Morgan-Tian Claim 7.22 and Corollary 7.24, pp. 161-163. |
| 12 | Smooth convolution gives a common upper operator bound. The Green |
| 13 | identity transfers uniform convergence to integral convergence, and |
| 14 | upper truncation passes the regular-point comparison to the limit. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Filter Metric MeasureTheory |
| 20 | open scoped ContDiff Topology |
| 21 | |
| 22 | namespace PoincareMT.ReducedVolume |
| 23 | |
| 24 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 25 | [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] |
| 26 | {μ : Measure E} [Measure.IsAddHaarMeasure μ] |
| 27 | |
| 28 | noncomputable local instance weakComparisonBilinearNormedAddCommGroup : |
| 29 | NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup |
| 30 | |
| 31 | noncomputable local instance weakComparisonBilinearNormedSpace : |
| 32 | NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace |
| 33 | |
| 34 | /-- An almost-everywhere upper bound at regular germs gives the local weak test comparison. -/ |
| 35 | theorem integral_weighted_comparison_of_semiconcave {ι : Type*} [Fintype ι] |
| 36 | (b : OrthonormalBasis ι ℝ E) {B : E → E →L[ℝ] E →L[ℝ] ℝ} {ρ u H ψ : E → ℝ} |
| 37 | {x₀ : E} {r K S : ℝ} (hr : 0 < r) (hK : 0 ≤ K) (hS : 0 ≤ S) |
| 38 | (hu : ContinuousOn u (ball x₀ (4 * r))) |
| 39 | (hconc : ConcaveOn ℝ (ball x₀ (4 * r)) (fun x ↦ u x - euclideanQuadratic K x)) |
| 40 | (hB : ContDiffOn ℝ 1 B (ball x₀ r)) (hρ : ContDiffOn ℝ 1 ρ (ball x₀ r)) |
| 41 | (hi : ∀ x ∈ ball x₀ r, (B x).IsInvertible) |
| 42 | (hsym : ∀ x ∈ ball x₀ r, ∀ v w, B x v w = B x w v) |
| 43 | (hframe : ∀ x ∈ ball x₀ r, ∃ C : E ≃L[ℝ] E, ∀ v w, B x (C v) (C w) = inner ℝ v w) |
| 44 | (hcoeff : ∀ x ∈ ball x₀ r, ‖fderiv ℝ B x‖ ≤ S ∧ ‖(B x).inverse‖ ≤ S ∧ |
| 45 | 0 ≤ ρ x ∧ ρ x ≤ S ∧ ‖fderiv ℝ ρ x‖ ≤ S) |
| 46 | (hregular : ∀ᵐ x ∂μ, x ∈ ball x₀ r → ContDiffAt ℝ 2 u x ∧ |
| 47 | LinearMap.trace ℝ E (fderiv ℝ (weightedMetricDual B ρ u) x).toLinearMap ≤ H x) |
| 48 | (hψ : ContDiff ℝ 2 ψ) (hc : HasCompactSupport ψ) (hs : tsupport ψ ⊆ ball x₀ r) |
| 49 | (hpos : ∀ x, 0 ≤ ψ x) (hH : Integrable (fun x ↦ ψ x * H x) μ) : |
| 50 | Integrable (fun x ↦ u x * LinearMap.trace ℝ E |
| 51 | (fderiv ℝ (weightedMetricDual B ρ ψ) x).toLinearMap) μ ∧ |
| 52 | (∫ x, u x * LinearMap.trace ℝ E |
| 53 | (fderiv ℝ (weightedMetricDual B ρ ψ) x).toLinearMap ∂μ) ≤ ∫ x, ψ x * H x ∂μ := by |
| 54 | obtain ⟨f, ε, G, hG, hε, _, hf, herr, hgrad, hhess, hjets⟩ := |
| 55 | exists_semiconcave_smoothing (μ := μ) hr hK hu hconc |
| 56 | have hf2 (j : ℕ) : ContDiff ℝ 2 (f j) := (hf j).of_le (by decide : (2 : ℕ∞ω) ≤ ∞) |
| 57 | have hsmall : ball x₀ r ⊆ ball x₀ (4 * r) := ball_subset_ball (by linarith) |
| 58 | have htest := integrable_mul_trace_weighted_test (μ := μ) b isOpen_ball hB hρ hi |
| 59 | (hu.mono hsmall) hψ hc hs |
| 60 | have hgreen (j : ℕ) := integral_weighted_green (μ := μ) b isOpen_ball hB hρ hi hsym |
| 61 | (hf2 j).contDiffOn hψ hc hs |
| 62 | let v := fun x ↦ LinearMap.trace ℝ E (fderiv ℝ (weightedMetricDual B ρ ψ) x).toLinearMap |
| 63 | let a := fun j x ↦ ψ x * LinearMap.trace ℝ E |
| 64 | (fderiv ℝ (weightedMetricDual B ρ (f j)) x).toLinearMap |
| 65 | let C := S * (Fintype.card ι : ℝ) * (K + S * S * G) * S + S * S * G |
| 66 | have hsup : tsupport v ⊆ tsupport ψ := |
| 67 | (tsupport_trace_fderiv_subset _).trans (tsupport_weightedMetricDual_subset B ρ ψ) |
| 68 | have hint : Tendsto (fun j ↦ ∫ x, a j x ∂μ) atTop (𝓝 (∫ x, u x * v x ∂μ)) := by |
| 69 | have ht := tendsto_integral_mul_of_uniform_error htest.1 htest.2 |
| 70 | (fun j ↦ (hgreen j).1) hε |
| 71 | (fun j x hx ↦ herr j x (hs (hsup (subset_tsupport v hx)))) |
| 72 | simpa only [(hgreen _).2.2] using ht |
| 73 | refine ⟨htest.2, integral_limit_le_of_ae_upper_bound |
| 74 | (fun j ↦ (hgreen j).2.1) hH |
| 75 | ((hψ.continuous.integrable_of_hasCompactSupport hc).mul_const C) ?_ ?_ hint⟩ |
| 76 | · intro j |
| 77 | exact Eventually.of_forall (fun x ↦ by |
| 78 | by_cases hx : x ∈ tsupport ψ |
| 79 | · have hxU := hs hx |
| 80 | obtain ⟨A, hA⟩ := hframe x hxU |
| 81 | obtain ⟨hDB, hI, hρ0, hρS, hdρ⟩ := hcoeff x hxU |
| 82 | have hbound := trace_weightedMetricDual_le b |
| 83 | (hB.contDiffAt (isOpen_ball.mem_nhds hxU)) |
| 84 | ((hρ.contDiffAt (isOpen_ball.mem_nhds hxU)).differentiableAt one_ne_zero) |
| 85 | (hf2 j).contDiffAt (hi x hxU) A hA hK hS hS hG hS hS |
| 86 | hDB hI (hgrad j x hxU) hρ0 hρS hdρ (hhess j x hxU) |
| 87 | exact mul_le_mul_of_nonneg_left hbound (hpos x) |
| 88 | · simp only [image_eq_zero_of_notMem_tsupport hx, zero_mul, le_refl]) |
| 89 | · filter_upwards [hregular] with x hx |
| 90 | by_cases hxs : x ∈ tsupport ψ |
| 91 | · have hxU := hs hxs |
| 92 | obtain ⟨hux, huxH⟩ := hx hxU |
| 93 | obtain ⟨A, hA⟩ := hframe x hxU |
| 94 | have hlim := trace_weightedMetricDual_tendsto b |
| 95 | (hB.contDiffAt (isOpen_ball.mem_nhds hxU)) |
| 96 | ((hρ.contDiffAt (isOpen_ball.mem_nhds hxU)).differentiableAt one_ne_zero) |
| 97 | hux (fun j ↦ (hf2 j).contDiffAt) (hi x hxU) A hA |
| 98 | (hjets x hxU hux).1 (hjets x hxU hux).2 |
| 99 | exact ⟨_, tendsto_const_nhds.mul hlim, |
| 100 | mul_le_mul_of_nonneg_left huxH (hpos x)⟩ |
| 101 | · refine ⟨0, ?_, ?_⟩ <;> |
| 102 | simp only [image_eq_zero_of_notMem_tsupport hxs, zero_mul, le_refl, |
| 103 | tendsto_const_nhds] |
| 104 | |
| 105 | end PoincareMT.ReducedVolume |