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.Riemannian.ScalarOperators.Laplacian.Harmonic |
| 2 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Divergence.Pullback |
| 3 | import PoincareLib.Geometry.Riemannian.Metric.LocalExtension |
| 4 | |
| 5 | /-! |
| 6 | # The retained Laplacian in a fixed chart |
| 7 | |
| 8 | The actual pulled-back metric and its Christoffel contraction give the |
| 9 | coordinate operator. A local Euclidean realization is used only in the proof |
| 10 | and imposes no additional metric or operator hypothesis. |
| 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 Bundle InnerProductSpace |
| 19 | |
| 20 | namespace PoincareMT.RicciFlow.Splitting.MaximumPrinciple |
| 21 | |
| 22 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | def chartMetric (g : RiemannianMetric n M) (p : M) := |
| 26 | g.pullbackCoefficients (extChartAt (𝓡 n) p).symm |
| 27 | |
| 28 | def chartDrift (g : RiemannianMetric n M) (p : M) |
| 29 | (y : EuclideanSpace ℝ (Fin n)) : EuclideanSpace ℝ (Fin n) := |
| 30 | ∑ i, CoordinateExponential.christoffelBilinear (chartMetric g p) y |
| 31 | (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 32 | ((chartMetric g p y).inverse (EuclideanSpace.proj i)) |
| 33 | |
| 34 | def chartOperator (g : RiemannianMetric n M) (p : M) |
| 35 | (f : EuclideanSpace ℝ (Fin n) → ℝ) (y : EuclideanSpace ℝ (Fin n)) : ℝ := |
| 36 | (∑ i, fderiv ℝ (fderiv ℝ f) y (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 37 | ((chartMetric g p y).inverse (EuclideanSpace.proj i))) - |
| 38 | fderiv ℝ f y (chartDrift g p y) |
| 39 | |
| 40 | /-- The fixed-chart expression agrees with the canonical retained Laplacian. -/ |
| 41 | theorem laplacian_in_chart {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 42 | {f : M → ℝ} (p : M) {y : EuclideanSpace ℝ (Fin n)} |
| 43 | (hy : y ∈ (extChartAt (𝓡 n) p).target) |
| 44 | (hf : ContMDiffAt (𝓡 n) 𝓘(ℝ, ℝ) ∞ f ((extChartAt (𝓡 n) p).symm y)) : |
| 45 | D.laplacian f ((extChartAt (𝓡 n) p).symm y) = |
| 46 | chartOperator g p (f ∘ (extChartAt (𝓡 n) p).symm) y := by |
| 47 | let c := extChartAt (𝓡 n) p |
| 48 | have hc (x : EuclideanSpace ℝ (Fin n)) (hx : x ∈ c.target) : |
| 49 | ContMDiffAt (𝓡 n) (𝓡 n) ∞ c.symm x := |
| 50 | (contMDiffWithinAt_extChartAt_symm_target (n := ∞) p hx).contMDiffAt |
| 51 | (extChartAt_target_mem_nhds' hx) |
| 52 | have hi (x : EuclideanSpace ℝ (Fin n)) (hx : x ∈ c.target) : |
| 53 | (mfderiv (𝓡 n) (𝓡 n) c.symm x).IsInvertible := by |
| 54 | simpa only [ModelWithCorners.range_eq_univ, mfderivWithin_univ] using |
| 55 | isInvertible_mfderivWithin_extChartAt_symm hx |
| 56 | obtain ⟨gE, DE, V, hVo, hyV, _, hE⟩ := |
| 57 | RiemannianMetric.exists_local_realization (isOpen_extChartAt_target p) hy |
| 58 | (g.pullbackCoefficients c.symm) (g.contDiffOn_chartCoefficients p) |
| 59 | (fun x _ v w => g.symm _ _ _) |
| 60 | (fun x hx v hv => by |
| 61 | apply g.pos (c.symm x) |
| 62 | intro hz |
| 63 | apply hv |
| 64 | apply (hi x hx).injective |
| 65 | rw [map_zero] |
| 66 | exact hz) |
| 67 | have heq : gE.euclideanCoefficients =ᶠ[𝓝 y] chartMetric g p := by |
| 68 | filter_upwards [hVo.mem_nhds hyV] with x hx |
| 69 | exact hE x hx |
| 70 | have hinv : ∀ᶠ x in 𝓝 y, (mfderiv (𝓡 n) (𝓡 n) c.symm x).IsInvertible := |
| 71 | Filter.mem_of_superset (extChartAt_target_mem_nhds' hy) hi |
| 72 | have hmetric : ∀ᶠ x in 𝓝 y, ∀ v w : EuclideanSpace ℝ (Fin n), |
| 73 | gE.inner x v w = g.inner (c.symm x) |
| 74 | (mfderiv (𝓡 n) (𝓡 n) c.symm x v) |
| 75 | (mfderiv (𝓡 n) (𝓡 n) c.symm x w) := by |
| 76 | filter_upwards [heq] with x hx v w |
| 77 | exact congrArg (fun B => B v w) hx |
| 78 | have hΓ : CoordinateExponential.christoffelBilinear gE.euclideanCoefficients y = |
| 79 | CoordinateExponential.christoffelBilinear (chartMetric g p) y := by |
| 80 | simp only [CoordinateExponential.christoffelBilinear, heq.self_of_nhds, heq.fderiv_eq] |
| 81 | rw [← DE.laplacian_comp_of_metric_pullback D (hc y hy) hinv hmetric hf, |
| 82 | DE.laplacian_eq_sum_fderiv_sub_christoffel |
| 83 | (contMDiffAt_iff_contDiffAt.mp (hf.comp y (hc y hy))), hΓ] |
| 84 | change (∑ i, fderiv ℝ (fderiv ℝ (f ∘ c.symm)) y |
| 85 | (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 86 | ((gE.euclideanCoefficients y).inverse (EuclideanSpace.proj i))) - |
| 87 | fderiv ℝ (f ∘ c.symm) y (∑ i, |
| 88 | CoordinateExponential.christoffelBilinear (chartMetric g p) y |
| 89 | (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 90 | ((gE.euclideanCoefficients y).inverse (EuclideanSpace.proj i))) = _ |
| 91 | rw [heq.self_of_nhds] |
| 92 | rfl |
| 93 | |
| 94 | theorem chartOperator_congr (g : RiemannianMetric n M) (p : M) |
| 95 | {f h : EuclideanSpace ℝ (Fin n) → ℝ} {y : EuclideanSpace ℝ (Fin n)} |
| 96 | (he : f =ᶠ[𝓝 y] h) : chartOperator g p f y = chartOperator g p h y := by |
| 97 | unfold chartOperator |
| 98 | rw [he.fderiv_eq, he.fderiv.fderiv_eq] |
| 99 | |
| 100 | end PoincareMT.RicciFlow.Splitting.MaximumPrinciple |