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.ChartOperator |
| 2 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.Barrier.Jets |
| 3 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.Barrier.CoefficientBound |
| 4 | |
| 5 | /-! |
| 6 | # Moving bumps for the retained metric Laplacian |
| 7 | |
| 8 | The radial coefficients are contractions of the actual inverse chart metric |
| 9 | and Christoffel drift. Their exact operator identity includes both the center |
| 10 | velocity and the boundary of the zero extension. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology InnerProductSpace |
| 19 | |
| 20 | namespace PoincareMT.RicciFlow.Splitting.MaximumPrinciple |
| 21 | |
| 22 | open Barrier |
| 23 | |
| 24 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | def radialQuadratic (g : RiemannianMetric n M) (p : M) |
| 28 | (y d : EuclideanSpace ℝ (Fin n)) : ℝ := |
| 29 | ∑ i, ⟪d, (chartMetric g p y).inverse (EuclideanSpace.proj i)⟫_ℝ * |
| 30 | ⟪d, EuclideanSpace.basisFun (Fin n) ℝ i⟫_ℝ |
| 31 | |
| 32 | def radialTrace (g : RiemannianMetric n M) (p : M) |
| 33 | (y : EuclideanSpace ℝ (Fin n)) : ℝ := |
| 34 | ∑ i, ⟪EuclideanSpace.basisFun (Fin n) ℝ i, |
| 35 | (chartMetric g p y).inverse (EuclideanSpace.proj i)⟫_ℝ |
| 36 | |
| 37 | def radialDrift (g : RiemannianMetric n M) (p : M) |
| 38 | (y d : EuclideanSpace ℝ (Fin n)) : ℝ := -⟪d, chartDrift g p y⟫_ℝ |
| 39 | |
| 40 | def chartBump (p : M) (rho C a : ℝ) |
| 41 | (gamma : ℝ → EuclideanSpace ℝ (Fin n)) (x : M) (t : ℝ) : ℝ := |
| 42 | movingBump rho C a gamma t (extChartAt (𝓡 n) p x) |
| 43 | |
| 44 | theorem contMDiffOn_chartBump (p : M) (rho C a : ℝ) |
| 45 | (gamma : ℝ → EuclideanSpace ℝ (Fin n)) (t : ℝ) : |
| 46 | ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun x => chartBump p rho C a gamma x t) |
| 47 | (chartAt (EuclideanSpace ℝ (Fin n)) p).source := by |
| 48 | intro x hx |
| 49 | exact ((contMDiffAt_iff_contDiffAt.mpr |
| 50 | (contDiff_movingBump_space rho C a gamma t).contDiffAt).comp x |
| 51 | (contMDiffAt_extChartAt' hx)).contMDiffWithinAt |
| 52 | |
| 53 | omit [IsManifold (𝓡 n) ∞ M] in |
| 54 | theorem hasDerivAt_chartBump (p : M) (rho C a : ℝ) |
| 55 | {gamma : ℝ → EuclideanSpace ℝ (Fin n)} {t : ℝ} |
| 56 | {velocity : EuclideanSpace ℝ (Fin n)} (hg : HasDerivAt gamma velocity t) (x : M) : |
| 57 | HasDerivAt (chartBump p rho C a gamma x) |
| 58 | (timeJet rho C a gamma t (extChartAt (𝓡 n) p x) velocity) t := |
| 59 | hasDerivAt_movingBump_time rho C a hg (extChartAt (𝓡 n) p x) |
| 60 | |
| 61 | private theorem second_fderiv_movingBump (rho C a : ℝ) |
| 62 | (gamma : ℝ → EuclideanSpace ℝ (Fin n)) (t : ℝ) |
| 63 | (y v w : EuclideanSpace ℝ (Fin n)) : |
| 64 | fderiv ℝ (fderiv ℝ (movingBump rho C a gamma t)) y v w = |
| 65 | secondSpaceJet rho C a gamma t y w v := by |
| 66 | have hd : DifferentiableAt ℝ (fderiv ℝ (movingBump rho C a gamma t)) y := |
| 67 | ((contDiff_movingBump_space rho C a gamma t).fderiv_right |
| 68 | (m := ∞) (by simp)).differentiable (by simp) y |
| 69 | have h := fderiv_spaceJet rho C a gamma t y w v |
| 70 | rw [fderiv_clm_apply hd (differentiableAt_const w)] at h |
| 71 | simpa using h |
| 72 | |
| 73 | theorem chartOperator_movingBump (g : RiemannianMetric n M) (p : M) |
| 74 | (rho C a : ℝ) (gamma : ℝ → EuclideanSpace ℝ (Fin n)) (t : ℝ) |
| 75 | (y : EuclideanSpace ℝ (Fin n)) : |
| 76 | chartOperator g p (movingBump rho C a gamma t) y = |
| 77 | Real.exp (-C * (t - a)) * |
| 78 | (4 * profileSecond (ballGap rho (gamma t) y) * |
| 79 | radialQuadratic g p y (y - gamma t) - |
| 80 | 2 * profileFirst (ballGap rho (gamma t) y) * |
| 81 | (radialTrace g p y + radialDrift g p y (y - gamma t))) := by |
| 82 | have hsum : (∑ i, fderiv ℝ (fderiv ℝ (movingBump rho C a gamma t)) y |
| 83 | (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 84 | ((chartMetric g p y).inverse (EuclideanSpace.proj i))) = |
| 85 | Real.exp (-C * (t - a)) * |
| 86 | (4 * profileSecond (ballGap rho (gamma t) y) * |
| 87 | radialQuadratic g p y (y - gamma t) - |
| 88 | 2 * profileFirst (ballGap rho (gamma t) y) * radialTrace g p y) := by |
| 89 | simp only [second_fderiv_movingBump, secondSpaceJet, radialQuadratic, radialTrace, |
| 90 | mul_sub, Finset.mul_sum, ← Finset.sum_sub_distrib] |
| 91 | exact Finset.sum_congr rfl fun i _ => by ring |
| 92 | unfold chartOperator |
| 93 | rw [hsum, fderiv_movingBump] |
| 94 | unfold spaceJet radialDrift |
| 95 | ring |
| 96 | |
| 97 | theorem laplacian_chartBump {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 98 | (p : M) (rho C a : ℝ) (gamma : ℝ → EuclideanSpace ℝ (Fin n)) (t : ℝ) |
| 99 | {x : M} (hx : x ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source) : |
| 100 | D.laplacian (fun z => chartBump p rho C a gamma z t) x = |
| 101 | chartOperator g p (movingBump rho C a gamma t) (extChartAt (𝓡 n) p x) := by |
| 102 | have hxs : x ∈ (extChartAt (𝓡 n) p).source := by simpa only [extChartAt_source] using hx |
| 103 | have hy := (extChartAt (𝓡 n) p).map_source hxs |
| 104 | have hi := (extChartAt (𝓡 n) p).left_inv hxs |
| 105 | have hf := (contMDiffOn_chartBump p rho C a gamma t).contMDiffAt |
| 106 | ((chartAt (EuclideanSpace ℝ (Fin n)) p).open_source.mem_nhds hx) |
| 107 | have hlap := laplacian_in_chart D p hy (by simpa only [hi] using hf) |
| 108 | rw [hi] at hlap |
| 109 | rw [hlap] |
| 110 | apply chartOperator_congr |
| 111 | filter_upwards [extChartAt_target_mem_nhds' hy] with z hz |
| 112 | simp only [Function.comp_apply, chartBump, (extChartAt (𝓡 n) p).right_inv hz] |
| 113 | |
| 114 | theorem chart_heat_residual {g : ℝ → RiemannianMetric n M} |
| 115 | (D : ∀ t, LeviCivitaData (g t)) (p : M) (rho C a : ℝ) |
| 116 | {gamma : ℝ → EuclideanSpace ℝ (Fin n)} {t : ℝ} |
| 117 | {velocity : EuclideanSpace ℝ (Fin n)} (hg : HasDerivAt gamma velocity t) |
| 118 | {x : M} (hx : x ∈ (chartAt (EuclideanSpace ℝ (Fin n)) p).source) : |
| 119 | (D t).laplacian (fun z => chartBump p rho C a gamma z t) x - |
| 120 | deriv (chartBump p rho C a gamma x) t = |
| 121 | Real.exp (-C * (t - a)) * |
| 122 | (C * expNegInvGlue (ballGap rho (gamma t) (extChartAt (𝓡 n) p x)) + |
| 123 | 4 * profileSecond (ballGap rho (gamma t) (extChartAt (𝓡 n) p x)) * |
| 124 | radialQuadratic (g t) p (extChartAt (𝓡 n) p x) (extChartAt (𝓡 n) p x - gamma t) - |
| 125 | 2 * profileFirst (ballGap rho (gamma t) (extChartAt (𝓡 n) p x)) * |
| 126 | (radialTrace (g t) p (extChartAt (𝓡 n) p x) + |
| 127 | radialDrift (g t) p (extChartAt (𝓡 n) p x) (extChartAt (𝓡 n) p x - gamma t) + |
| 128 | ⟪extChartAt (𝓡 n) p x - gamma t, velocity⟫_ℝ)) := by |
| 129 | rw [laplacian_chartBump (D t) p rho C a gamma t hx, |
| 130 | (hasDerivAt_chartBump p rho C a hg x).deriv, chartOperator_movingBump] |
| 131 | unfold timeJet |
| 132 | ring |
| 133 | |
| 134 | end PoincareMT.RicciFlow.Splitting.MaximumPrinciple |