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.Splitting.MaximumPrinciple.LowerContacts |
| 2 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.Barrier.Subsolution |
| 3 | |
| 4 | noncomputable section |
| 5 | open Set Filter |
| 6 | open scoped ContDiff Manifold Topology InnerProductSpace |
| 7 | |
| 8 | namespace PoincareMT.RicciFlow.Splitting.MaximumPrinciple |
| 9 | |
| 10 | open Barrier |
| 11 | |
| 12 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] |
| 13 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 14 | |
| 15 | /-- **Math.** An initial seed dominates a positive compact bump at its moving endpoint. -/ |
| 16 | theorem positive_at_chart_endpoint |
| 17 | {D : Set M} (hD : IsCompact D) (α : M) |
| 18 | (hchart : D ⊆ (chartAt (EuclideanSpace ℝ (Fin n)) α).source) |
| 19 | {g : ℝ → RiemannianMetric n M} |
| 20 | (conn : ∀ t, LeviCivitaData (g t)) {a b : ℝ} (hab : a < b) |
| 21 | {rho lam Lam H₀ ε : ℝ} |
| 22 | (hrho : 0 < rho) (hlam : 0 < lam) (hLam : lam ≤ Lam) |
| 23 | (hH₀ : 0 ≤ H₀) (hε : 0 < ε) |
| 24 | {gamma : ℝ → EuclideanSpace ℝ (Fin n)} (hg : ContDiff ℝ ∞ gamma) |
| 25 | {v : M → ℝ → ℝ} |
| 26 | (hv : ContinuousOn (fun z : M × ℝ => v z.1 z.2) (D ×ˢ Icc a b)) |
| 27 | (hvs : HeatLowerContacts conn (interior D) (Ioo a b) v) |
| 28 | (hbounds : ∀ x ∈ interior D, ∀ t ∈ Ioo a b, |
| 29 | 0 < ballGap rho (gamma t) (extChartAt (𝓡 n) α x) → |
| 30 | lam * ‖extChartAt (𝓡 n) α x - gamma t‖ ^ 2 ≤ |
| 31 | radialQuadratic (g t) α (extChartAt (𝓡 n) α x) (extChartAt (𝓡 n) α x - gamma t) ∧ |
| 32 | radialQuadratic (g t) α (extChartAt (𝓡 n) α x) (extChartAt (𝓡 n) α x - gamma t) ≤ |
| 33 | Lam * ‖extChartAt (𝓡 n) α x - gamma t‖ ^ 2 ∧ |
| 34 | radialTrace (g t) α (extChartAt (𝓡 n) α x) + |
| 35 | radialDrift (g t) α (extChartAt (𝓡 n) α x) (extChartAt (𝓡 n) α x - gamma t) + |
| 36 | ⟪extChartAt (𝓡 n) α x - gamma t, deriv gamma t⟫_ℝ ≤ H₀) |
| 37 | (hinit : ∀ x ∈ D, 0 ≤ v x a) |
| 38 | (hseed : ∀ x ∈ D, ‖extChartAt (𝓡 n) α x - gamma a‖ < rho → ε ≤ v x a) |
| 39 | (hlateral : ∀ x ∈ D, x ∉ interior D → ∀ t ∈ Icc a b, 0 ≤ v x t) |
| 40 | (hsupport : ∀ x ∈ D, x ∉ interior D → ∀ t ∈ Icc a b, |
| 41 | rho ≤ ‖extChartAt (𝓡 n) α x - gamma t‖) |
| 42 | {q : M} (hq : q ∈ D) (hend : extChartAt (𝓡 n) α q = gamma b) : |
| 43 | 0 < v q b := by |
| 44 | let C := dampingConstant rho lam Lam H₀ |
| 45 | let w := chartBump α rho C a gamma |
| 46 | have hgd : ∀ t, HasDerivAt gamma (deriv gamma t) t := fun t => |
| 47 | ((hg.differentiable (by simp)).differentiableAt (x := t)).hasDerivAt |
| 48 | have hcoord : ContinuousOn (fun z : M × ℝ => (z.2, extChartAt (𝓡 n) α z.1)) |
| 49 | (D ×ˢ Icc a b) := by |
| 50 | apply ContinuousOn.prodMk continuous_snd.continuousOn |
| 51 | exact (continuousOn_extChartAt α).comp continuous_fst.continuousOn |
| 52 | (fun z hz => by simpa only [extChartAt_source] using hchart hz.1) |
| 53 | have hw : ContinuousOn (fun z : M × ℝ => w z.1 z.2) (D ×ˢ Icc a b) := |
| 54 | (contDiff_movingBump rho C a hg).continuous.comp_continuousOn hcoord |
| 55 | have hws : ∀ t, ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun x => w x t) (interior D) := |
| 56 | fun t => (contMDiffOn_chartBump α rho C a gamma t).mono |
| 57 | (interior_subset.trans hchart) |
| 58 | have hwd : ∀ x t, HasDerivAt (w x) |
| 59 | (timeJet rho C a gamma t (extChartAt (𝓡 n) α x) (deriv gamma t)) t := |
| 60 | fun x t => hasDerivAt_chartBump α rho C a (hgd t) x |
| 61 | have hcompare := comparison_on_Icc hD conn hab |
| 62 | (u := fun x t => ε * w x t) |
| 63 | (ut := fun x t => ε * timeJet rho C a gamma t (extChartAt (𝓡 n) α x) (deriv gamma t)) |
| 64 | (continuousOn_const.mul hw) hv |
| 65 | (fun t _ => contMDiffOn_const.mul (hws t)) |
| 66 | (fun x _ t _ => (hwd x t).const_mul ε) |
| 67 | (fun x hx t ht => by |
| 68 | rw [(conn t).laplacian_const_mul] |
| 69 | have h := chartBump_subsolution conn α a hrho hlam hLam hH₀ |
| 70 | (hgd t) (hchart (interior_subset hx)) (hbounds x hx t ht) |
| 71 | rw [(hwd x t).deriv] at h |
| 72 | exact mul_le_mul_of_nonneg_left h hε.le) |
| 73 | hvs |
| 74 | (fun x hx => by |
| 75 | by_cases hdist : ‖extChartAt (𝓡 n) α x - gamma a‖ < rho |
| 76 | · have hwle : w x a ≤ 1 := by |
| 77 | simpa [w, chartBump, movingBump] using |
| 78 | profile_le_one (ballGap rho (gamma a) (extChartAt (𝓡 n) α x)) |
| 79 | exact (mul_le_of_le_one_right hε.le hwle).trans (hseed x hx hdist) |
| 80 | · have hz : w x a = 0 := movingBump_eq_zero C a gamma a hrho.le (le_of_not_gt hdist) |
| 81 | simpa only [hz, mul_zero] using hinit x hx) |
| 82 | (fun x hx hn t ht => by |
| 83 | have hz : w x t = 0 := movingBump_eq_zero C a gamma t hrho.le (hsupport x hx hn t ht) |
| 84 | simpa only [hz, mul_zero] using hlateral x hx hn t ht) |
| 85 | have hpos : 0 < ε * w q b := by |
| 86 | apply mul_pos hε |
| 87 | change 0 < movingBump rho C a gamma b (extChartAt (𝓡 n) α q) |
| 88 | rw [hend] |
| 89 | exact movingBump_center_pos C a gamma b hrho |
| 90 | exact hpos.trans_le (hcompare q hq b ⟨hab.le, le_rfl⟩) |
| 91 | |
| 92 | end PoincareMT.RicciFlow.Splitting.MaximumPrinciple |
| 93 | |
| 94 |