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.Analysis.Parabolic.Maximum.CompactDomain |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Shift |
| 3 | |
| 4 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/CompactSlabParabolic.lean`, |
| 5 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under |
| 6 | `references/ricci-flow/mapher/curvature/`. -/ |
| 7 | |
| 8 | /-! |
| 9 | # Compact-domain comparison on an arbitrary closed time slab |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | open Set Topology Filter |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.RicciFlowAnalysis |
| 20 | |
| 21 | theorem compact_subset_min_velocity_nonnegative_Icc |
| 22 | {M : Type u} [TopologicalSpace M] {C : Set M} (hC : IsCompact C) |
| 23 | {a b K : ℝ} (hab : a < b) (f v : ℝ → M → ℝ) |
| 24 | (hf : ContinuousOn (Function.uncurry f) (Icc a b ×ˢ C)) |
| 25 | (hderiv : ∀ t ∈ Icc a b, ∀ x ∈ C, |
| 26 | HasDerivWithinAt (fun s ↦ f s x) (v t x) (Icc a b) t) |
| 27 | (hmin : ∀ t ∈ Ioc a b, ∀ x ∈ C, |
| 28 | (∀ y ∈ C, f t x ≤ f t y) → f t x < 0 → -K * f t x ≤ v t x) |
| 29 | (hinit : ∀ x ∈ C, 0 ≤ f a x) : |
| 30 | ∀ t ∈ Icc a b, ∀ x ∈ C, 0 ≤ f t x := by |
| 31 | have hshift : MapsTo (fun s : ℝ ↦ a + s) (Icc 0 (b - a)) (Icc a b) := by |
| 32 | intro s hs |
| 33 | constructor <;> linarith [hs.1, hs.2] |
| 34 | have hc : ContinuousOn (fun p : ℝ × M ↦ f (a + p.1) p.2) |
| 35 | (Icc 0 (b - a) ×ˢ C) := |
| 36 | hf.comp ((continuous_const.add continuous_fst).prodMk continuous_snd).continuousOn |
| 37 | (fun p hp ↦ ⟨hshift hp.1, hp.2⟩) |
| 38 | have hd : ∀ s ∈ Icc 0 (b - a), ∀ x ∈ C, |
| 39 | HasDerivWithinAt (fun r ↦ f (a + r) x) (v (a + s) x) (Icc 0 (b - a)) s := by |
| 40 | intro s hs x hx |
| 41 | have ha : HasDerivWithinAt (fun r : ℝ ↦ a + r) 1 (Icc 0 (b - a)) s := by |
| 42 | simpa only [id_eq] using ((hasDerivAt_id s).const_add a).hasDerivWithinAt |
| 43 | simpa only [Function.comp_def, mul_one] using |
| 44 | (hderiv (a + s) (hshift hs) x hx).comp s ha hshift |
| 45 | have hm : ∀ s ∈ Ioc 0 (b - a), ∀ x ∈ C, |
| 46 | (∀ y ∈ C, f (a + s) x ≤ f (a + s) y) → f (a + s) x < 0 → |
| 47 | -K * f (a + s) x ≤ v (a + s) x := by |
| 48 | intro s hs x hx hminx hneg |
| 49 | apply hmin (a + s) (by constructor <;> linarith [hs.1, hs.2]) x hx hminx hneg |
| 50 | have hi : ∀ x ∈ C, 0 ≤ f (a + 0) x := by simpa only [add_zero] using hinit |
| 51 | have h := compact_subset_min_velocity_nonnegative hC (K := K) (sub_pos.mpr hab) |
| 52 | (fun s x ↦ f (a + s) x) (fun s x ↦ v (a + s) x) hc hd hm hi |
| 53 | intro t ht x hx |
| 54 | have ht' : t - a ∈ Icc 0 (b - a) := by constructor <;> linarith [ht.1, ht.2] |
| 55 | have he : a + (t - a) = t := by ring |
| 56 | simpa only [he] using h (t - a) ht' x hx |
| 57 | |
| 58 | theorem ricciFlow_compactDomain_supersolution_nonnegative_Icc |
| 59 | {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 60 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 61 | {J : Set ℝ} {a b K : ℝ} (hab : a < b) (F : RicciFlow n M J) |
| 62 | (_hJ : Icc a b ⊆ J) |
| 63 | {U C : Set M} (hU : IsOpen U) (hC : IsCompact C) (hCU : C ⊆ U) |
| 64 | (f v : ℝ → M → ℝ) |
| 65 | (hf : ContinuousOn (Function.uncurry f) (Icc a b ×ˢ C)) |
| 66 | (hderiv : ∀ t ∈ Icc a b, ∀ x ∈ C, |
| 67 | HasDerivWithinAt (fun s ↦ f s x) (v t x) (Icc a b) t) |
| 68 | (hinit : ∀ x ∈ C, 0 ≤ f a x) |
| 69 | (hsmooth : ∀ t ∈ Icc a b, ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ (f t) U) |
| 70 | (hboundary : ∀ t ∈ Icc a b, ∀ x ∈ C \ interior C, 0 ≤ f t x) |
| 71 | (hevol : ∀ t ∈ Ioc a b, ∀ x ∈ interior C, |
| 72 | (F.connection t).laplacian (f t) x - K * f t x ≤ v t x) : |
| 73 | ∀ t ∈ Icc a b, ∀ x ∈ C, 0 ≤ f t x := by |
| 74 | apply compact_subset_min_velocity_nonnegative_Icc hC (K := K) hab f v hf hderiv _ hinit |
| 75 | intro t ht x hx hmin hneg |
| 76 | have hxint : x ∈ interior C := by |
| 77 | by_contra hn |
| 78 | exact (not_lt_of_ge (hboundary t ⟨ht.1.le, ht.2⟩ x ⟨hx, hn⟩)) hneg |
| 79 | have hlocal : IsLocalMin (f t) x := by |
| 80 | filter_upwards [mem_interior_iff_mem_nhds.mp hxint] with y hy |
| 81 | exact hmin y hy |
| 82 | have hlap := (F.connection t).laplacian_nonneg_of_isLocalMinAt |
| 83 | ((hsmooth t ⟨ht.1.le, ht.2⟩).contMDiffAt (hU.mem_nhds (hCU hx))) hlocal |
| 84 | have hv := hevol t ht x hxint |
| 85 | linarith |
| 86 | |
| 87 | end PoincareMT.RicciFlowAnalysis |