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.Surgery.StandardCap.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.ProductChartMetric |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.RoundProductRicci |
| 4 | |
| 5 | /-! |
| 6 | # The actual sphere-line metric and its time equation in fixed coordinates |
| 7 | |
| 8 | The frozen product identification is fixed in time. Its genuine pullback |
| 9 | metric therefore satisfies the actual Ricci-flow equation in the full |
| 10 | Euclidean cylinder chart, including the one-sided terminal time derivative. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | namespace PoincareMT.M35 |
| 20 | |
| 21 | local notation "V" => EuclideanSpace ℝ (Fin 3) |
| 22 | local notation "E2" => EuclideanSpace ℝ (Fin 2) |
| 23 | local notation "Ip" => ModelWithCorners.prod (𝓡 2) 𝓘(ℝ, ℝ) |
| 24 | |
| 25 | variable {M : Type*} [TopologicalSpace M] [ChartedSpace V M] |
| 26 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 27 | [T2Space M] [T3Space M] [SecondCountableTopology M] [ConnectedSpace M] |
| 28 | {K : AncientKappaSolution 3 M} |
| 29 | |
| 30 | /-- The actual product identification composed with the full cylinder |
| 31 | chart is smooth at every Euclidean point. -/ |
| 32 | theorem sphereLineChart_contMDiff (N : M27SphereLineFlowCertificate K) |
| 33 | (q : UnitTwoSphere) : ContMDiff (𝓡 3) (𝓡 3) ∞ |
| 34 | (N.identification ∘ cylinderChart q) := |
| 35 | N.identification.contMDiff.comp (cylinderChart_contMDiff q) |
| 36 | |
| 37 | /-- The same fixed chart has an actual invertible differential everywhere. -/ |
| 38 | theorem sphereLineChart_invertible (N : M27SphereLineFlowCertificate K) |
| 39 | (q : UnitTwoSphere) (x : V) : |
| 40 | (mfderiv (𝓡 3) (𝓡 3) (N.identification ∘ cylinderChart q) x).IsInvertible := by |
| 41 | have hN := N.identification.isLocalDiffeomorph |
| 42 | have hNi : (mfderiv Ip (𝓡 3) N.identification (cylinderChart q x)).IsInvertible := |
| 43 | ⟨hN.mfderivToContinuousLinearEquiv (by simp) _, rfl⟩ |
| 44 | rw [mfderiv_comp x (N.identification.contMDiff.mdifferentiable (by simp) _) |
| 45 | ((cylinderChart_contMDiff q).mdifferentiable (by simp) x)] |
| 46 | exact hNi.comp (cylinderChart_mfderiv_invertible q x) |
| 47 | |
| 48 | /-- The actual sphere-line pullback metric in the full fixed cylinder chart. -/ |
| 49 | noncomputable def sphereLineChartMetric (N : M27SphereLineFlowCertificate K) |
| 50 | (t : ℝ) (q : UnitTwoSphere) : RiemannianMetric 3 V := |
| 51 | RiemannianMetric.ofEuclideanCoefficients |
| 52 | ((K.flow.metric t).pullbackCoefficients (N.identification ∘ cylinderChart q)) |
| 53 | (contDiff_iff_contDiffAt.mpr fun x => |
| 54 | (K.flow.metric t).contDiffAt_pullbackCoefficients (sphereLineChart_contMDiff N q x)) |
| 55 | (fun x u v => (K.flow.metric t).symm (N.identification (cylinderChart q x)) |
| 56 | (mfderiv (𝓡 3) (𝓡 3) (N.identification ∘ cylinderChart q) x u) |
| 57 | (mfderiv (𝓡 3) (𝓡 3) (N.identification ∘ cylinderChart q) x v)) |
| 58 | (fun x v hv => (K.flow.metric t).pos (N.identification (cylinderChart q x)) |
| 59 | (mfderiv (𝓡 3) (𝓡 3) (N.identification ∘ cylinderChart q) x v) |
| 60 | (fun hz => hv ((sphereLineChart_invertible N q x).injective |
| 61 | (hz.trans (map_zero (mfderiv (𝓡 3) (𝓡 3) |
| 62 | (N.identification ∘ cylinderChart q) x)).symm)))) |
| 63 | |
| 64 | /-- Its actual native Levi-Civita connection. -/ |
| 65 | noncomputable def sphereLineChartConnection (N : M27SphereLineFlowCertificate K) |
| 66 | (t : ℝ) (q : UnitTwoSphere) : LeviCivitaData (sphereLineChartMetric N t q) := |
| 67 | (sphereLineChartMetric N t q).euclideanLeviCivitaData |
| 68 | |
| 69 | /-- The frozen metric transport gives the exact horizontal-plus-line form. -/ |
| 70 | theorem sphereLineChartMetric_product (N : M27SphereLineFlowCertificate K) |
| 71 | (t : ℝ) (ht : t ≤ 0) (q : UnitTwoSphere) (x u v : V) : |
| 72 | (sphereLineChartMetric N t q).inner x u v = |
| 73 | (m27SphereChartMetric N.sphere t q).inner (cylinderCoordinateEquiv x).1 |
| 74 | (cylinderCoordinateEquiv u).1 (cylinderCoordinateEquiv v).1 + |
| 75 | (cylinderCoordinateEquiv u).2 * (cylinderCoordinateEquiv v).2 := by |
| 76 | change (K.flow.metric t).inner (N.identification (cylinderChart q x)) |
| 77 | (mfderiv (𝓡 3) (𝓡 3) (N.identification ∘ cylinderChart q) x u) |
| 78 | (mfderiv (𝓡 3) (𝓡 3) (N.identification ∘ cylinderChart q) x v) = _ |
| 79 | rw [mfderiv_comp_apply x (N.identification.contMDiff.mdifferentiable (by simp) _) |
| 80 | ((cylinderChart_contMDiff q).mdifferentiable (by simp) x), |
| 81 | mfderiv_comp_apply x (N.identification.contMDiff.mdifferentiable (by simp) _) |
| 82 | ((cylinderChart_contMDiff q).mdifferentiable (by simp) x), N.metric_transport t ht] |
| 83 | rw [M27RoundSphereFamily.productInner, mfderiv_cylinderChart, mfderiv_cylinderChart] |
| 84 | rfl |
| 85 | |
| 86 | /-- The genuine pullback metric inherits the actual one-sided Ricci-flow |
| 87 | time equation from the supplied ancient flow. -/ |
| 88 | theorem sphereLineChartMetric_hasDerivWithinAt (N : M27SphereLineFlowCertificate K) |
| 89 | (t : ℝ) (ht : t ≤ 0) (q : UnitTwoSphere) (x u v : V) : |
| 90 | HasDerivWithinAt (fun s => (sphereLineChartMetric N s q).inner x u v) |
| 91 | (-2 * (sphereLineChartConnection N t q).ricci x u v) (Iic 0) t := by |
| 92 | let f := N.identification ∘ cylinderChart q |
| 93 | have hmetric : ∀ᶠ y in 𝓝 x, ∀ a b : V, |
| 94 | (sphereLineChartMetric N t q).inner y a b = (K.flow.metric t).inner (f y) |
| 95 | (mfderiv (𝓡 3) (𝓡 3) f y a) (mfderiv (𝓡 3) (𝓡 3) f y b) := |
| 96 | Eventually.of_forall fun _ _ _ => rfl |
| 97 | have hricci := (sphereLineChartConnection N t q).ricci_eq_pullback_euclidean |
| 98 | (K.flow.connection t) (sphereLineChart_contMDiff N q x) |
| 99 | (Eventually.of_forall (sphereLineChart_invertible N q)) hmetric u v |
| 100 | rw [hricci] |
| 101 | exact K.flow.equation t ht (f x) |
| 102 | (mfderiv (𝓡 3) (𝓡 3) f x u) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 103 | |
| 104 | end PoincareMT.M35 |