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.ReducedGeometry.ReducedLength.Coordinates.CenteredCoordinateDifferential |
| 2 | |
| 3 | /-! |
| 4 | # The frozen Hessian in the centered chart |
| 5 | |
| 6 | The inner directional derivative agrees near the center with an actual |
| 7 | smooth coordinate derivative. Differentiating that germ retains the |
| 8 | connection correction in the frozen Hessian. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | open Filter |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 26 | |
| 27 | set_option backward.isDefEq.respectTransparency false in |
| 28 | theorem hessian_centeredCoordinates {g : RiemannianMetric n M} |
| 29 | (D : LeviCivitaData g) (f : M → ℝ) (p : M) |
| 30 | (hf : ContMDiffOn (𝓡 n) (𝓘(ℝ, ℝ)) ∞ f (chartAt E p).source) |
| 31 | (U V : TangentSpace (𝓡 n) p) : |
| 32 | let φ : E → ℝ := fun y ↦ f ((chartAt E p).symm y) |
| 33 | D.hessian f p U V = fderiv ℝ (fun y ↦ fderiv ℝ φ y V) ((chartAt E p) p) U - |
| 34 | fderiv ℝ φ ((chartAt E p) p) (D.connection (chartVectorField p V) p U) := by |
| 35 | let φ : E → ℝ := fun y ↦ f ((chartAt E p).symm y) |
| 36 | let ψ : E → ℝ := fun y ↦ fderiv ℝ φ y V |
| 37 | have hφ : ContDiffOn ℝ ∞ φ (chartAt E p).target := |
| 38 | (hf.comp contMDiffOn_chart_symm (fun y hy ↦ (chartAt E p).map_target hy)).contDiffOn |
| 39 | have hψ : ContDiffOn ℝ ∞ ψ (chartAt E p).target := |
| 40 | (hφ.fderiv_of_isOpen (chartAt E p).open_target (by simp)).clm_apply contDiffOn_const |
| 41 | have hp : (chartAt E p) p ∈ (chartAt E p).target := |
| 42 | (chartAt E p).map_source (mem_chart_source E p) |
| 43 | have heq : f =ᶠ[𝓝 p] (fun q ↦ φ ((chartAt E p) q)) := by |
| 44 | filter_upwards [(chartAt E p).open_source.mem_nhds (mem_chart_source E p)] with q hq |
| 45 | exact congrArg f ((chartAt E p).left_inv hq).symm |
| 46 | have hinner : (fun q ↦ mvfderiv (𝓡 n) f q (chartVectorField p V q)) =ᶠ[𝓝 p] |
| 47 | (fun q ↦ ψ ((chartAt E p) q)) := by |
| 48 | filter_upwards [(chartAt E p).open_source.mem_nhds (mem_chart_source E p)] with q hq |
| 49 | have hdiff : MDifferentiableAt (𝓡 n) (𝓘(ℝ, ℝ)) f |
| 50 | ((chartAt E p).symm ((chartAt E p) q)) := by |
| 51 | rw [(chartAt E p).left_inv hq] |
| 52 | exact (hf.contMDiffAt ((chartAt E p).open_source.mem_nhds hq)).mdifferentiableAt (by simp) |
| 53 | have h := mvfderiv_chartVectorField p f ((chartAt E p) q) V |
| 54 | ((chartAt E p).map_source hq) hdiff |
| 55 | convert! h using 1 |
| 56 | rw [(chartAt E p).left_inv hq] |
| 57 | have hfirst := mvfderiv_centeredChart_of_eventuallyEq p |
| 58 | (fun q ↦ mvfderiv (𝓡 n) f q (chartVectorField p V q)) ψ |
| 59 | ((hψ.contDiffAt ((chartAt E p).open_target.mem_nhds hp)).differentiableAt (by simp)) hinner U |
| 60 | have hsecond := mvfderiv_centeredChart_of_eventuallyEq p f φ |
| 61 | ((hφ.contDiffAt ((chartAt E p).open_target.mem_nhds hp)).differentiableAt (by simp)) heq |
| 62 | (D.connection (chartVectorField p V) p U) |
| 63 | rw [hessian_centeredChart, LeviCivitaData.hessianOnFields, chartVectorField_self, |
| 64 | hfirst, hsecond] |
| 65 | |
| 66 | end PoincareMT.ReducedLength |