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.NeckCoordinates |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Neck.NeckMetricComparison |
| 3 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Analysis.GramScaling |
| 4 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Measure.Coordinates.PullbackJacobian |
| 5 | import Mathlib.Geometry.Manifold.MFDeriv.FDeriv |
| 6 | |
| 7 | /-! |
| 8 | Adapted from Mapher `PoincareMT/Proofs/M49/NeckChartJacobian.lean` at |
| 9 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 10 | |
| 11 | # The actual neck-chart Jacobian and its cubic scale |
| 12 | |
| 13 | Morgan-Tian Definitions 2.16 and 2.18, pp. 30-31, and the volume |
| 14 | estimate in Lemma 17.12, p. 410. The actual differential of the |
| 15 | Euclidean neck chart gives exactly the frozen cylinder coefficients. |
| 16 | Normalizing its metric by the inverse square scale extracts the cube |
| 17 | of that scale from the actual M10 volume Jacobian. |
| 18 | -/ |
| 19 | |
| 20 | set_option autoImplicit false |
| 21 | |
| 22 | open Set |
| 23 | open scoped Manifold ContDiff Bundle |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.SurgeryVolume |
| 28 | |
| 29 | variable {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 31 | {g : RiemannianMetric 3 M} |
| 32 | |
| 33 | -- Keep the actual selected tangent pairing through all coordinate identifications. |
| 34 | set_option backward.isDefEq.respectTransparency false in |
| 35 | /-- The actual Euclidean-chart pullback entries equal the literal neck |
| 36 | coefficients (MT Definitions 2.16 and 2.18, pp. 30-31). -/ |
| 37 | theorem epsilonNeckEuclideanChart_pullback_coefficient |
| 38 | (N : EpsilonNeck g) (q : UnitTwoSphere) (x : EuclideanSpace ℝ (Fin 3)) |
| 39 | (hx : x ∈ (epsilonNeckEuclideanChart N q).source) (i j : Fin 3) : |
| 40 | SurgeryVolume.Measure.pullbackMetricForm g (epsilonNeckEuclideanChart N q) x |
| 41 | (EuclideanSpace.basisFun (Fin 3) ℝ i) (EuclideanSpace.basisFun (Fin 3) ℝ j) = |
| 42 | roundCylinderTensorCoefficient (roundCylinderPullback g N.coordinate_map) |
| 43 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) (cylinderCoordinateEquiv x) i j := by |
| 44 | let c := chartAt (EuclideanSpace ℝ (Fin 2)) q |
| 45 | let p := cylinderCoordinateEquiv x |
| 46 | let L1 : EuclideanSpace ℝ (Fin 3) →L[ℝ] EuclideanSpace ℝ (Fin 2) := |
| 47 | (ContinuousLinearMap.fst ℝ (EuclideanSpace ℝ (Fin 2)) ℝ).comp |
| 48 | cylinderCoordinateEquiv.toContinuousLinearMap |
| 49 | let L2 : EuclideanSpace ℝ (Fin 3) →L[ℝ] ℝ := |
| 50 | (ContinuousLinearMap.snd ℝ (EuclideanSpace ℝ (Fin 2)) ℝ).comp |
| 51 | cylinderCoordinateEquiv.toContinuousLinearMap |
| 52 | let F : EuclideanSpace ℝ (Fin 3) → RoundCylinderSpace := |
| 53 | fun y => (c.symm (L1 y), L2 y) |
| 54 | have hx0 : p.1 ∈ c.target ∧ p.2 ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := by |
| 55 | simpa only [epsilonNeckEuclideanChart_source, mem_preimage, mem_prod] using hx |
| 56 | have hL1 : MDifferentiableAt (𝓡 3) (𝓡 2) L1 x := |
| 57 | L1.contDiff.contMDiff.mdifferentiable (n := ∞) (by simp) x |
| 58 | have hL2 : MDifferentiableAt (𝓡 3) 𝓘(ℝ, ℝ) L2 x := |
| 59 | L2.contDiff.contMDiff.mdifferentiable (n := ∞) (by simp) x |
| 60 | have hcs : MDifferentiableAt (𝓡 2) (𝓡 2) c.symm (L1 x) := |
| 61 | (contMDiffOn_chart_symm.contMDiffAt (c.open_target.mem_nhds hx0.1)).mdifferentiableAt |
| 62 | (n := ∞) (by simp) |
| 63 | have hF : MDifferentiableAt (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) F x := |
| 64 | (hcs.comp x hL1).prodMk hL2 |
| 65 | have hN : MDifferentiableAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) N.coordinate_map (F x) := |
| 66 | (N.coordinate_map_smooth.contMDiffAt |
| 67 | ((isOpen_univ.prod isOpen_Ioo).mem_nhds ⟨mem_univ _, hx0.2⟩)).mdifferentiableAt |
| 68 | (by simp) |
| 69 | have hfirst : mfderiv (𝓡 3) (𝓡 2) (fun y => c.symm (L1 y)) x = |
| 70 | (mfderiv (𝓡 2) (𝓡 2) c.symm p.1).comp L1 := by |
| 71 | erw [mfderiv_comp x hcs hL1, mfderiv_eq_fderiv, L1.fderiv] |
| 72 | rfl |
| 73 | have hDF : mfderiv (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) F x = |
| 74 | ((mfderiv (𝓡 2) (𝓡 2) c.symm p.1).comp L1).prod L2 := by |
| 75 | erw [mfderiv_prodMk (hcs.comp x hL1) hL2, hfirst, mfderiv_eq_fderiv, L2.fderiv] |
| 76 | have hD : mfderiv (𝓡 3) (𝓡 3) (epsilonNeckEuclideanChart N q) x = |
| 77 | (mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) N.coordinate_map (F x)).comp |
| 78 | (((mfderiv (𝓡 2) (𝓡 2) c.symm p.1).comp L1).prod L2) := by |
| 79 | change mfderiv (𝓡 3) (𝓡 3) (N.coordinate_map ∘ F) x = _ |
| 80 | rw [mfderiv_comp x hN hF, hDF] |
| 81 | have h1 (k : Fin 3) : L1 (EuclideanSpace.basisFun (Fin 3) ℝ k) = |
| 82 | (roundCylinderCoordinateBasis k).1 := |
| 83 | congrArg Prod.fst (cylinderCoordinateEquiv_basis k) |
| 84 | have h2 (k : Fin 3) : L2 (EuclideanSpace.basisFun (Fin 3) ℝ k) = |
| 85 | (roundCylinderCoordinateBasis k).2 := |
| 86 | congrArg Prod.snd (cylinderCoordinateEquiv_basis k) |
| 87 | have hDeval (k : Fin 3) : |
| 88 | mfderiv (𝓡 3) (𝓡 3) (epsilonNeckEuclideanChart N q) x |
| 89 | (EuclideanSpace.basisFun (Fin 3) ℝ k) = |
| 90 | mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) N.coordinate_map (F x) |
| 91 | (mfderiv (𝓡 2) (𝓡 2) c.symm p.1 (roundCylinderCoordinateBasis k).1, |
| 92 | (roundCylinderCoordinateBasis k).2) := by |
| 93 | rw [hD] |
| 94 | change mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) N.coordinate_map (F x) |
| 95 | (mfderiv (𝓡 2) (𝓡 2) c.symm p.1 (L1 (EuclideanSpace.basisFun (Fin 3) ℝ k)), |
| 96 | L2 (EuclideanSpace.basisFun (Fin 3) ℝ k)) = _ |
| 97 | rw [h1, h2] |
| 98 | simp only [SurgeryVolume.Measure.pullbackMetricForm, ContinuousLinearMap.bilinearComp_apply] |
| 99 | erw [hDeval i, hDeval j] |
| 100 | rfl |
| 101 | |
| 102 | /-- The actual metric-error estimate applies to every displayed pair of |
| 103 | coordinate vectors, including totalized inverse-chart derivatives |
| 104 | (MT Definitions 2.16 and 2.18, pp. 30-31). -/ |
| 105 | theorem epsilonNeck_coefficient_error_le (N : EpsilonNeck g) |
| 106 | (c : OpenPartialHomeomorph UnitTwoSphere (EuclideanSpace ℝ (Fin 2))) |
| 107 | (p : RoundCylinderCoordinates) (hp : p.2 ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹) |
| 108 | (i j : Fin 3) : |
| 109 | |N.scale⁻¹ ^ 2 * roundCylinderTensorCoefficient |
| 110 | (roundCylinderPullback g N.coordinate_map) c p i j - roundCylinderGram 0 c p i j| ≤ |
| 111 | N.epsilon * Real.sqrt (roundCylinderGram 0 c p i i) * |
| 112 | Real.sqrt (roundCylinderGram 0 c p j j) := by |
| 113 | exact epsilonNeck_bilinear_error_le N (c.symm p.1, p.2) hp |
| 114 | (mfderiv (𝓡 2) (𝓡 2) c.symm p.1 (roundCylinderCoordinateBasis i).1, |
| 115 | (roundCylinderCoordinateBasis i).2) |
| 116 | (mfderiv (𝓡 2) (𝓡 2) c.symm p.1 (roundCylinderCoordinateBasis j).1, |
| 117 | (roundCylinderCoordinateBasis j).2) |
| 118 | |
| 119 | /-- Normalizing the actual neck metric by its inverse square scale |
| 120 | extracts precisely the cubic Jacobian factor (MT Lemma 17.12, p. 410, |
| 121 | with corrected scaling). -/ |
| 122 | theorem epsilonNeckEuclideanChart_jacobian_eq |
| 123 | (N : EpsilonNeck g) (q : UnitTwoSphere) (x : EuclideanSpace ℝ (Fin 3)) |
| 124 | (hx : x ∈ (epsilonNeckEuclideanChart N q).source) : |
| 125 | SurgeryVolume.Measure.pullbackJacobian g (epsilonNeckEuclideanChart N q) x = |
| 126 | N.scale ^ 3 * Real.sqrt (Matrix.det (fun i j : Fin 3 => |
| 127 | N.scale⁻¹ ^ 2 * roundCylinderTensorCoefficient |
| 128 | (roundCylinderPullback g N.coordinate_map) |
| 129 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) (cylinderCoordinateEquiv x) i j)) := by |
| 130 | let Q : Matrix (Fin 3) (Fin 3) ℝ := roundCylinderTensorCoefficient |
| 131 | (roundCylinderPullback g N.coordinate_map) |
| 132 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) (cylinderCoordinateEquiv x) |
| 133 | have hQ : (fun i j : Fin 3 => SurgeryVolume.Measure.pullbackMetricForm g |
| 134 | (epsilonNeckEuclideanChart N q) x (EuclideanSpace.basisFun (Fin 3) ℝ i) |
| 135 | (EuclideanSpace.basisFun (Fin 3) ℝ j)) = Q := by |
| 136 | funext i j |
| 137 | exact epsilonNeckEuclideanChart_pullback_coefficient N q x hx i j |
| 138 | rw [SurgeryVolume.Measure.pullbackJacobian, hQ] |
| 139 | change Real.sqrt Q.det = N.scale ^ 3 * Real.sqrt ((N.scale⁻¹ ^ 2) • Q).det |
| 140 | rw [Matrix.sqrt_det_smul_sq Q (inv_nonneg.mpr N.scale_pos.le)] |
| 141 | simp only [Fintype.card_fin, inv_pow] |
| 142 | field_simp [N.scale_pos.ne'] |
| 143 | |
| 144 | end PoincareMT.SurgeryVolume |