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.Curvature.Calculus |
| 2 | import PoincareLib.Geometry.RicciFlow.Connection.Regularity |
| 3 | import PoincareLib.Geometry.Manifold.ContDiff.TimeDerivative |
| 4 | import PoincareLib.Geometry.RicciFlow.Curvature.Theory |
| 5 | import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace |
| 6 | import Mathlib.Geometry.Manifold.Algebra.Structures |
| 7 | |
| 8 | /-! Joint spacetime regularity of Ricci evaluated on smooth local fields. -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | open Bundle Filter Set |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.RicciFlow |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | {J : Set ℝ} |
| 23 | |
| 24 | /-- The Ricci tensor evaluated on locally smooth spatial fields is smooth on spacetime. |
| 25 | |
| 26 | The time derivative is supplied by the Ricci-flow equation. Since the equation is |
| 27 | stated with a within derivative, the interior-time hypothesis is used to obtain an |
| 28 | ordinary derivative before applying the mixed-derivative regularity bridge. |
| 29 | -/ |
| 30 | theorem contMDiffAt_ricci_fields |
| 31 | (F : RicciFlow n M J) {t : ℝ} (ht : t ∈ interior J) {x : M} |
| 32 | {X Y : (y : M) → TangentSpace (𝓡 n) y} |
| 33 | (hX : ContMDiffAt (𝓡 n) |
| 34 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X) x) |
| 35 | (hY : ContMDiffAt (𝓡 n) |
| 36 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Y) x) : |
| 37 | ContMDiffAt (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, ℝ) ∞ |
| 38 | (fun p : ℝ × M => |
| 39 | (F.connection p.1).ricci p.2 (X p.2) (Y p.2)) (t, x) := by |
| 40 | have hmetric := F.contMDiffAt_inner_fields ht hX hY |
| 41 | have hderiv := Poincare.Manifold.contMDiffAt_deriv_time hmetric |
| 42 | have heq : |
| 43 | (fun p : ℝ × M => deriv (fun s => |
| 44 | (F.metric s).inner p.2 (X p.2) (Y p.2)) p.1) =ᶠ[𝓝 (t, x)] |
| 45 | (fun p : ℝ × M => -2 * |
| 46 | (F.connection p.1).ricci p.2 (X p.2) (Y p.2)) := by |
| 47 | have htime : ∀ᶠ s in 𝓝 t, s ∈ interior J := |
| 48 | isOpen_interior.mem_nhds ht |
| 49 | have hprod : ∀ᶠ p : ℝ × M in 𝓝 (t, x), p.1 ∈ interior J := by |
| 50 | filter_upwards [(continuousAt_fst : ContinuousAt Prod.fst (t, x)).eventually htime] |
| 51 | with p hp |
| 52 | exact hp |
| 53 | filter_upwards [hprod] with p hp |
| 54 | exact (F.equation p.1 (interior_subset hp) p.2 (X p.2) (Y p.2)).hasDerivAt |
| 55 | (mem_interior_iff_mem_nhds.mp hp) |>.deriv |
| 56 | have heq' : |
| 57 | (fun p : ℝ × M => deriv (fun s => |
| 58 | (F.metric (s, p.2).1).inner (s, p.2).2 (X (s, p.2).2) (Y (s, p.2).2)) p.1) =ᶠ[𝓝 (t, x)] |
| 59 | (fun p : ℝ × M => -2 * |
| 60 | (F.connection p.1).ricci p.2 (X p.2) (Y p.2)) := by |
| 61 | simpa only [Prod.fst, Prod.snd] using heq |
| 62 | have hderiv' := hderiv.congr_of_eventuallyEq heq'.symm |
| 63 | have hscale := hderiv'.div_const (-2 : ℝ) |
| 64 | convert hscale using 1 <;> ext p <;> ring |
| 65 | |
| 66 | /- The curvature-theory Ricci evolution can be differentiated in a spatial |
| 67 | direction after the preceding spacetime regularity bridge. -/ |
| 68 | theorem hasDerivAt_mvfderiv_ricci_fields |
| 69 | (hC : RicciFlowCurvatureCalculus.{u}) |
| 70 | (F : RicciFlow n M J) {t : ℝ} (ht : t ∈ interior J) {x : M} |
| 71 | {X Y : (y : M) → TangentSpace (𝓡 n) y} |
| 72 | (hX : ContMDiffAt (𝓡 n) |
| 73 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X) x) |
| 74 | (hY : ContMDiffAt (𝓡 n) |
| 75 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Y) x) |
| 76 | (v : TangentSpace (𝓡 n) x) : |
| 77 | HasDerivAt (fun s => mvfderiv (𝓡 n) |
| 78 | (fun y => (F.connection s).ricci y (X y) (Y y)) x v) |
| 79 | (mvfderiv (𝓡 n) (fun y => |
| 80 | (F.connection t).tensorLaplacian (F.connection t).ricciEvaluation y |
| 81 | ![X y, Y y] + (F.connection t).ricciReaction y (X y) (Y y)) x v) t := by |
| 82 | apply Poincare.Manifold.hasDerivAt_mvfderiv_time |
| 83 | (contMDiffAt_ricci_fields F ht hX hY) |
| 84 | · intro y |
| 85 | exact (hC.ricci_evolution n M J F t (interior_subset ht) y (X y) (Y y)).hasDerivAt |
| 86 | (mem_interior_iff_mem_nhds.mp ht) |
| 87 | |
| 88 | end PoincareMT.RicciFlow |