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.MetricDualDerivative |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Analysis.Integration.SupportedCalculus |
| 3 | |
| 4 | /-! |
| 5 | # Density-weighted metric duals with local support |
| 6 | |
| 7 | The field used in chart divergence is explicit in the bilinear metric, |
| 8 | its scalar volume density and the scalar differential. A compactly |
| 9 | supported scalar test gives a compactly supported globally C1 field |
| 10 | even when the metric is smooth only on the containing chart. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.ReducedVolume |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 21 | |
| 22 | /-- The actual density times the metric dual of a scalar differential in coordinates. -/ |
| 23 | noncomputable def weightedMetricDual (B : E → E →L[ℝ] E →L[ℝ] ℝ) |
| 24 | (ρ f : E → ℝ) (x : E) : E := |
| 25 | ρ x • (B x).inverse (fderiv ℝ f x) |
| 26 | |
| 27 | /-- Local C1 metric and density data and a C2 scalar give a C1 weighted dual. -/ |
| 28 | theorem weightedMetricDual_contDiffAt |
| 29 | {B : E → E →L[ℝ] E →L[ℝ] ℝ} {ρ f : E → ℝ} {x : E} |
| 30 | (hB : ContDiffAt ℝ 1 B x) (hρ : ContDiffAt ℝ 1 ρ x) |
| 31 | (hf : ContDiffAt ℝ 2 f x) (hi : (B x).IsInvertible) : |
| 32 | ContDiffAt ℝ 1 (weightedMetricDual B ρ f) x := |
| 33 | hρ.smul (metricDual_contDiffAt hB hf hi) |
| 34 | |
| 35 | omit [CompleteSpace E] in |
| 36 | /-- The weighted dual is supported in the closed support of the scalar. -/ |
| 37 | theorem tsupport_weightedMetricDual_subset |
| 38 | (B : E → E →L[ℝ] E →L[ℝ] ℝ) (ρ f : E → ℝ) : |
| 39 | tsupport (weightedMetricDual B ρ f) ⊆ tsupport f := by |
| 40 | apply closure_minimal _ (isClosed_tsupport f) |
| 41 | intro x hx |
| 42 | by_contra hnot |
| 43 | apply hx |
| 44 | simp only [weightedMetricDual, fderiv_of_notMem_tsupport ℝ hnot, map_zero, smul_zero] |
| 45 | |
| 46 | /-- A supported C2 scalar test has a globally C1 weighted metric dual. -/ |
| 47 | theorem weightedMetricDual_contDiff_of_tsupport_subset |
| 48 | {B : E → E →L[ℝ] E →L[ℝ] ℝ} {ρ f : E → ℝ} {U : Set E} |
| 49 | (hU : IsOpen U) (hB : ContDiffOn ℝ 1 B U) (hρ : ContDiffOn ℝ 1 ρ U) |
| 50 | (hf : ContDiffOn ℝ 2 f U) (hi : ∀ x ∈ U, (B x).IsInvertible) |
| 51 | (hs : tsupport f ⊆ U) : |
| 52 | ContDiff ℝ 1 (weightedMetricDual B ρ f) := by |
| 53 | apply contDiff_of_contDiffOn_of_tsupport_subset hU _ |
| 54 | ((tsupport_weightedMetricDual_subset B ρ f).trans hs) |
| 55 | intro x hx |
| 56 | exact (weightedMetricDual_contDiffAt (hB.contDiffAt (hU.mem_nhds hx)) |
| 57 | (hρ.contDiffAt (hU.mem_nhds hx)) (hf.contDiffAt (hU.mem_nhds hx)) |
| 58 | (hi x hx)).contDiffWithinAt |
| 59 | |
| 60 | omit [CompleteSpace E] in |
| 61 | /-- Compact support is preserved by the weighted metric dual. -/ |
| 62 | theorem weightedMetricDual_hasCompactSupport |
| 63 | (B : E → E →L[ℝ] E →L[ℝ] ℝ) (ρ : E → ℝ) {f : E → ℝ} |
| 64 | (hf : HasCompactSupport f) : HasCompactSupport (weightedMetricDual B ρ f) := |
| 65 | hf.of_isClosed_subset (isClosed_tsupport _) (tsupport_weightedMetricDual_subset B ρ f) |
| 66 | |
| 67 | end PoincareMT.ReducedVolume |