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.Volume.Surgery.Neck.RoundCylinderGram |
| 2 | import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace |
| 3 | import Mathlib.Geometry.Manifold.MFDeriv.FDeriv |
| 4 | import Mathlib.Analysis.Calculus.ContDiff.Comp |
| 5 | |
| 6 | /-! |
| 7 | Adapted from Mapher `PoincareMT/Proofs/M49/CylinderDensity.lean` at |
| 8 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 9 | |
| 10 | # Continuity of the actual cylinder density coefficients |
| 11 | |
| 12 | Morgan-Tian Definitions 2.16 and 2.18, pp. 30-31. The literal model |
| 13 | Gram matrix is independent of the line coordinate and continuous on |
| 14 | each actual sphere chart target. These facts support the fixed-patch |
| 15 | volume estimate in Lemma 17.12, p. 410. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Manifold ContDiff Topology |
| 22 | |
| 23 | namespace PoincareMT.SurgeryVolume |
| 24 | |
| 25 | /-- The model coefficients have no line-coordinate dependence |
| 26 | (MT Definition 2.18, p. 31). -/ |
| 27 | theorem roundCylinderGram_eq_zero_line (u : ℝ) |
| 28 | (c : OpenPartialHomeomorph UnitTwoSphere (EuclideanSpace ℝ (Fin 2))) |
| 29 | (p : RoundCylinderCoordinates) : |
| 30 | roundCylinderGram u c p = roundCylinderGram u c (p.1, 0) := rfl |
| 31 | |
| 32 | -- Tangent-space fibers use the same vector operations as their model spaces. |
| 33 | set_option backward.isDefEq.respectTransparency false in |
| 34 | /-- Actual model coefficients are continuous on the open sphere-chart |
| 35 | target (MT Definitions 2.16 and 2.18, pp. 30-31). -/ |
| 36 | theorem continuousAt_roundCylinderGram (u : ℝ) (q : UnitTwoSphere) |
| 37 | {p : RoundCylinderCoordinates} |
| 38 | (hp : p.1 ∈ (chartAt (EuclideanSpace ℝ (Fin 2)) q).target) : |
| 39 | ContinuousAt (fun x => roundCylinderGram u |
| 40 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) x) p := by |
| 41 | let c := chartAt (EuclideanSpace ℝ (Fin 2)) q |
| 42 | let F : EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 3) := |
| 43 | fun x => (c.symm x).1 |
| 44 | let : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin 3)) = 2 + 1) := |
| 45 | ⟨by simp⟩ |
| 46 | have hs : ContMDiff (𝓡 2) (𝓡 3) ∞ (fun x : UnitTwoSphere => x.1) := |
| 47 | contMDiff_coe_sphere |
| 48 | have hc : ContMDiffOn (𝓡 2) (𝓡 2) ∞ c.symm c.target := |
| 49 | contMDiffOn_chart_symm |
| 50 | have hF : ContDiffOn ℝ ∞ F c.target := |
| 51 | (hs.comp_contMDiffOn hc).contDiffOn |
| 52 | have hDF : ContinuousAt (fderiv ℝ F) p.1 := |
| 53 | ((hF p.1 hp).contDiffAt (c.open_target.mem_nhds hp)).continuousAt_fderiv |
| 54 | (by simp) |
| 55 | have hchain (x : EuclideanSpace ℝ (Fin 2)) (hx : x ∈ c.target) : |
| 56 | fderiv ℝ F x = |
| 57 | (mfderiv (𝓡 2) (𝓡 3) (fun y : UnitTwoSphere => y.1) (c.symm x)).comp |
| 58 | (mfderiv (𝓡 2) (𝓡 2) c.symm x) := by |
| 59 | rw [← mfderiv_eq_fderiv] |
| 60 | exact mfderiv_comp x (hs.mdifferentiable (by simp) (c.symm x)) |
| 61 | ((hc.contMDiffAt (c.open_target.mem_nhds hx)).mdifferentiableAt (by simp)) |
| 62 | apply continuousAt_pi.2 |
| 63 | intro i |
| 64 | apply continuousAt_pi.2 |
| 65 | intro j |
| 66 | have hlocal : ∀ᶠ x : RoundCylinderCoordinates in 𝓝 p, x.1 ∈ c.target := |
| 67 | continuousAt_fst (c.open_target.mem_nhds hp) |
| 68 | have hentry : (fun x : RoundCylinderCoordinates => roundCylinderGram u c x i j) =ᶠ[𝓝 p] |
| 69 | (fun x => 2 * (1 - u) * inner ℝ |
| 70 | (fderiv ℝ F x.1 (roundCylinderCoordinateBasis i).1) |
| 71 | (fderiv ℝ F x.1 (roundCylinderCoordinateBasis j).1) + |
| 72 | (roundCylinderCoordinateBasis i).2 * (roundCylinderCoordinateBasis j).2) := by |
| 73 | filter_upwards [hlocal] with x hx |
| 74 | rw [hchain x.1 hx] |
| 75 | rfl |
| 76 | apply ContinuousAt.congr_of_eventuallyEq _ hentry |
| 77 | exact (continuousAt_const.mul |
| 78 | (((hDF.comp continuousAt_fst).clm_apply continuousAt_const).inner |
| 79 | ((hDF.comp continuousAt_fst).clm_apply continuousAt_const))).add continuousAt_const |
| 80 | |
| 81 | end PoincareMT.SurgeryVolume |