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.CurveShortening.Comparison.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Pullback.MetricHessian |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.WithLp |
| 4 | |
| 5 | /-! |
| 6 | # The actual vector of embedding-coordinate Hessians |
| 7 | |
| 8 | The componentwise frozen Hessian equals the actual vector chart formula. |
| 9 | Its pullback along a smooth spatial map is jointly smooth through the |
| 10 | closed flow interval. MT2007 Claim 19.1, p. 437; |
| 11 | `2026-09-21-embedding-hessian-vector.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u v w |
| 21 | |
| 22 | namespace PoincareMT.M63 |
| 23 | |
| 24 | open Proofs.M09 |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | {ι : Type v} [Fintype ι] |
| 29 | |
| 30 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 31 | local notation "W" => EuclideanSpace ℝ ι |
| 32 | |
| 33 | /-- The literal Euclidean vector of the actual coordinate Hessians for |
| 34 | the supplied connection. MT2007 Claim 19.1, p. 437; embedding Hessian |
| 35 | vector derivation, item 1. -/ |
| 36 | noncomputable def coordinateHessian {g : RiemannianMetric n M} |
| 37 | (D : LeviCivitaData g) (e : M → W) (p : M) |
| 38 | (v w : TangentSpace (𝓡 n) p) : W := |
| 39 | WithLp.toLp 2 (fun i => D.hessian (fun q => e q i) p v w) |
| 40 | |
| 41 | /-- The actual coordinate Hessian vector has the actual second chart |
| 42 | derivative minus the Christoffel correction. MT2007 Claim 19.1, p. 437; |
| 43 | embedding Hessian vector derivation, item 2. -/ |
| 44 | theorem coordinateHessian_eq_chart {g : RiemannianMetric n M} |
| 45 | (D : LeviCivitaData g) {e : M → W} (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 46 | (p q : M) (hq : q ∈ (chartAt E p).source) (u v : E) : |
| 47 | let f : E → W := e ∘ (chartAt E p).symm |
| 48 | coordinateHessian D e q (chartVectorField p u q) (chartVectorField p v q) = |
| 49 | fderiv ℝ (fderiv ℝ f) ((chartAt E p) q) u v - |
| 50 | fderiv ℝ f ((chartAt E p) q) |
| 51 | (coordinateChristoffel (g.pullbackCoefficients (chartAt E p).symm) |
| 52 | ((chartAt E p) q) u v) := by |
| 53 | let c := chartAt E p |
| 54 | let f : E → W := e ∘ c.symm |
| 55 | have hy : c q ∈ c.target := c.map_source hq |
| 56 | have hf : ContDiffOn ℝ ∞ f c.target := |
| 57 | (he.comp_contMDiffOn (contMDiffOn_chart_symm (I := 𝓡 n) (x := p))).contDiffOn |
| 58 | ext i |
| 59 | let L : W →L[ℝ] ℝ := EuclideanSpace.proj i |
| 60 | let A : (E →L[ℝ] W) →L[ℝ] E →L[ℝ] ℝ := ContinuousLinearMap.compL ℝ E W ℝ L |
| 61 | have hei : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun x => e x i) := |
| 62 | L.contDiff.contMDiff.comp he |
| 63 | have hD (y : E) (hy : y ∈ c.target) : |
| 64 | fderiv ℝ (L ∘ f) y = A (fderiv ℝ f y) := |
| 65 | (L.hasFDerivAt.comp y |
| 66 | ((hf.contDiffAt (c.open_target.mem_nhds hy)).differentiableAt (by simp)).hasFDerivAt).fderiv |
| 67 | have hDDf : HasFDerivAt (fderiv ℝ f) (fderiv ℝ (fderiv ℝ f) (c q)) (c q) := |
| 68 | (((hf.contDiffAt (c.open_target.mem_nhds hy)).fderiv_right (m := ∞) |
| 69 | (by simp)).differentiableAt (by simp)).hasFDerivAt |
| 70 | have heq : fderiv ℝ (L ∘ f) =ᶠ[𝓝 (c q)] A ∘ fderiv ℝ f := by |
| 71 | filter_upwards [c.open_target.mem_nhds hy] with y hyt |
| 72 | exact hD y hyt |
| 73 | have hDD : fderiv ℝ (fderiv ℝ (L ∘ f)) (c q) = |
| 74 | A.comp (fderiv ℝ (fderiv ℝ f) (c q)) := |
| 75 | ((A.hasFDerivAt.comp (c q) hDDf).congr_of_eventuallyEq heq).fderiv |
| 76 | have hh := hessian_eq_chart_christoffel D hei p q hq u v |
| 77 | change D.hessian (fun x => e x i) q (chartVectorField p u q) (chartVectorField p v q) = |
| 78 | fderiv ℝ (fderiv ℝ (L ∘ f)) (c q) u v - |
| 79 | fderiv ℝ (L ∘ f) (c q) |
| 80 | (coordinateChristoffel (g.pullbackCoefficients c.symm) (c q) u v) at hh |
| 81 | rw [hD _ hy, hDD] at hh |
| 82 | exact hh |
| 83 | |
| 84 | /-- Actual repeated coordinate Hessians along an arbitrary smooth |
| 85 | spatial map retain joint smoothness through the flow interval. |
| 86 | MT2007 Claim 19.1, p. 437; embedding Hessian vector derivation, item 3. -/ |
| 87 | theorem flow_coordinateHessian_pullback_contDiffOn {a b : ℝ} |
| 88 | (F : RicciFlow n M (Icc a b)) {e : M → W} |
| 89 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 90 | {V : Type w} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 91 | {U : Set V} (hU : IsOpen U) {ρ : V → M} |
| 92 | (hρ : ContMDiffOn 𝓘(ℝ, V) (𝓡 n) ∞ ρ U) : |
| 93 | ContDiffOn ℝ ∞ |
| 94 | (fun z : (ℝ × V) × V => coordinateHessian (F.connection z.1.1) e (ρ z.1.2) |
| 95 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.1.2 z.2) |
| 96 | (mfderiv 𝓘(ℝ, V) (𝓡 n) ρ z.1.2 z.2)) ((Icc a b ×ˢ U) ×ˢ univ) := by |
| 97 | apply (contDiffOn_piLp 2).mpr |
| 98 | intro i |
| 99 | have hei : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun x => e x i) := |
| 100 | (EuclideanSpace.proj i).contDiff.contMDiff.comp he |
| 101 | exact (flow_pullback_metric_hessian_contDiffOn F hU hρ hei).2 |
| 102 | |
| 103 | end PoincareMT.M63 |