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.Persistence.SourceNames.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Continuation.RemovalTransport |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Neck.ChartDiameter |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Terminal.TerminalCylinderJets |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Sphere.PhysicalSphereMargin |
| 6 | |
| 7 | /-! |
| 8 | # The actual terminal whole-ball geometry |
| 9 | |
| 10 | The normalized cylinder curvature and birth coefficients give the |
| 11 | whole-ball physical diameter. Closed two-jet proximity to the fixed |
| 12 | standard sphere gives its actual terminal sectional margin. |
| 13 | Morgan--Tian, Claim 16.10, pp. 374-375; M44 derivation 86. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | -- Terminal metric jets retain the nested coefficient slots. |
| 19 | set_option maxSynthPendingDepth 16 |
| 20 | |
| 21 | open Set TopologicalSpace |
| 22 | open scoped Manifold ContDiff Topology ENNReal ContinuousMap |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M44 |
| 27 | |
| 28 | open SpacetimeBounds |
| 29 | |
| 30 | local notation "E" => StandardCapSpace |
| 31 | |
| 32 | noncomputable local instance terminalBallCoefficientNorm : NormedAddCommGroup |
| 33 | (MetricCoefficient 3) := ContinuousLinearMap.toNormedAddCommGroup |
| 34 | |
| 35 | noncomputable local instance terminalBallCoefficientSpace : NormedSpace ℝ |
| 36 | (MetricCoefficient 3) := ContinuousLinearMap.toNormedSpace |
| 37 | |
| 38 | noncomputable local instance terminalBallTwoJetNorm : NormedAddCommGroup |
| 39 | (MetricTwoJet 3) := Prod.normedAddCommGroup |
| 40 | |
| 41 | noncomputable local instance terminalBallTwoJetSpace : NormedSpace ℝ |
| 42 | (MetricTwoJet 3) := Prod.normedSpace |
| 43 | |
| 44 | variable {F : SurgeryFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 45 | {origin scale c : ℝ} {U : Set C.carrier} |
| 46 | |
| 47 | variable (P : M44CapPersistencePredecessors.{u}) (hpinch : SurgeryFlowPinched F) |
| 48 | (e : SurgeryFlowCylinder F C origin scale (Ico 0 c) U) (hU : IsOpen U) |
| 49 | (hT : origin + c / scale ∈ F.surgery_times) |
| 50 | [Nonempty (F.slice (origin + c / scale)).carrier] |
| 51 | (r : ℝ) (hr : r ∈ Ico 0 c) |
| 52 | (hr' : origin + r / scale ∈ Ico (F.event (origin + c / scale) hT).tMinus |
| 53 | (origin + c / scale)) |
| 54 | (f : PartialDiffeomorph (𝓡 3) (𝓡 3) E C.carrier ∞) |
| 55 | {g0 : StandardInitialMetric} {R : ℝ} (hR : 0 < R) |
| 56 | (hsource : f.source = g0.metric.ball 0 R) (htarget : f.target = U) |
| 57 | (hscalar : ∀ x ∈ U, ∃ K : ℝ, ∀ s (hs : s ∈ Ico (0 : ℝ) c), |
| 58 | (F.connection (origin + s / scale)).scalarCurvature (e.forward s hs x) ≤ K) |
| 59 | (G : CylinderRicciFlow e f) |
| 60 | (p : (⟨f.target, f.open_target⟩ : Opens C.carrier)) |
| 61 | |
| 62 | include P hpinch hR hsource htarget hscalar |
| 63 | |
| 64 | /-- Actual terminal whole-ball diameter in physical height units. |
| 65 | Source: Claim 16.10, pp. 374-375; M44 derivation 86. -/ |
| 66 | theorem terminalBirthBallTransport_diameter |
| 67 | {K H Z h : ℝ} (hK : 0 ≤ K) (hcH : c ≤ H) (hZ : 0 < Z) (hh : 0 < h) |
| 68 | (hscale : scale = h⁻¹ ^ 2) |
| 69 | (hcurv : ∀ s ∈ Ico (0 : ℝ) c, ∀ y, (G.flow.connection s).curvatureTensorNorm y ≤ K) |
| 70 | (hbirth : ∀ x ∈ f.source, |
| 71 | ‖(G.flow.metric 0).pullbackCoefficients (targetChart f p) x‖ ≤ Z) |
| 72 | (x y : g0.metric.ball 0 R) : |
| 73 | (F.event (origin + c / scale) hT).limit_metric.edist |
| 74 | (terminalBirthBallTransport P hpinch e hU hT r hr hr' f hsource htarget hscalar x) |
| 75 | (terminalBirthBallTransport P hpinch e hU hT r hr hr' f hsource htarget hscalar y) < |
| 76 | ENNReal.ofReal (h * (2 * Real.sqrt (Real.exp (6 * K * H) * Z) * |
| 77 | M36.radialEuclideanRadius g0 R)) := by |
| 78 | let B := Real.exp (6 * K * H) * Z |
| 79 | have hB : 0 < B := mul_pos (Real.exp_pos _) hZ |
| 80 | apply standard_ball_image_diameter_lt g0 _ hR hh (Real.sqrt_pos.mpr hB) |
| 81 | (terminal_birth_chart_contMDiffOn P hpinch e hU hT r hr hr' |
| 82 | f hsource htarget hscalar) _ x.property y.property |
| 83 | intro z hz v |
| 84 | have hzf : z ∈ f.source := hsource.symm ▸ hz |
| 85 | have hinit : (G.flow.metric 0).pullbackCoefficients (targetChart f p) z v v ≤ |
| 86 | Z * ‖v‖ ^ 2 := by |
| 87 | calc |
| 88 | _ ≤ |(G.flow.metric 0).pullbackCoefficients (targetChart f p) z v v| := le_abs_self _ |
| 89 | _ ≤ ‖(G.flow.metric 0).pullbackCoefficients (targetChart f p) z‖ * ‖v‖ * ‖v‖ := |
| 90 | ((G.flow.metric 0).pullbackCoefficients (targetChart f p) z).le_opNorm₂ v v |
| 91 | _ ≤ Z * ‖v‖ ^ 2 := by |
| 92 | nlinarith only [mul_le_mul_of_nonneg_right (hbirth z hzf) (sq_nonneg ‖v‖)] |
| 93 | have hbound (s : ℝ) (hs : s ∈ Ico (0 : ℝ) c) : |
| 94 | (G.flow.metric s).pullbackCoefficients (targetChart f p) z v v ≤ B * ‖v‖ ^ 2 := by |
| 95 | calc |
| 96 | _ ≤ Real.exp (6 * K * c) * |
| 97 | (G.flow.metric 0).pullbackCoefficients (targetChart f p) z v v := |
| 98 | G.pullback_quadratic_le_initial P hK hcurv p hs z v |
| 99 | _ ≤ Real.exp (6 * K * c) * (Z * ‖v‖ ^ 2) := |
| 100 | mul_le_mul_of_nonneg_left hinit (Real.exp_pos _).le |
| 101 | _ ≤ Real.exp (6 * K * H) * (Z * ‖v‖ ^ 2) := by |
| 102 | apply mul_le_mul_of_nonneg_right _ (mul_nonneg hZ.le (sq_nonneg _)) |
| 103 | exact Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left hcH (by positivity)) |
| 104 | _ = _ := by dsimp [B]; ring |
| 105 | have hterminal := cylinderTerminalChart_quadratic_le P hpinch e hU hT r hr hr' |
| 106 | f (le_of_eq htarget) G p hscalar hzf v hbound |
| 107 | apply hterminal.trans_eq |
| 108 | rw [hscale, inv_pow, inv_inv, mul_pow, Real.sq_sqrt hB.le] |
| 109 | ring |
| 110 | |
| 111 | /-- Actual terminal sphere curvature from a closed normalized |
| 112 | two-jet neighborhood of the model sphere. Source: Claim 16.10, |
| 113 | pp. 374-375; M44 derivation 86. -/ |
| 114 | theorem terminalBirthBallTransport_sphere_sectional |
| 115 | {length : ℝ} {center : E} (N : StandardCylinderPatch length center) |
| 116 | (hball : ∀ z : UnitTwoSphere, |
| 117 | StandardCylinderPatch.sphereMap N z ∈ g0.metric.ball 0 R) |
| 118 | (J : UnitTwoSphere → MetricTwoJet 3) {d k s0 : ℝ} (hs0 : s0 < c) |
| 119 | (hmargin : ∀ z J', ‖J' - J z‖ ≤ d → |
| 120 | (z, J') ∈ sphereSectionalJetRegion (StandardCylinderPatch.sphereMap N) k) |
| 121 | (hnear : ∀ s ∈ Ico (0 : ℝ) c, s0 ≤ s → ∀ z : UnitTwoSphere, |
| 122 | ‖metricTwoJet ((G.flow.metric s).pullbackCoefficients (targetChart f p)) |
| 123 | (StandardCylinderPatch.sphereMap N z) - J z‖ ≤ d) |
| 124 | (z : UnitTwoSphere) (u v : TangentSpace (𝓡 2) z) : |
| 125 | let transport := terminalBirthBallTransport P hpinch e hU hT r hr hr' |
| 126 | f hsource htarget hscalar |
| 127 | let sphere := transport.comp (StandardCylinderPatch.sphereInBall N g0 R hball) |
| 128 | let D := mfderiv (𝓡 2) (𝓡 3) sphere z |
| 129 | 0 < (F.event (origin + c / scale) hT).limit_metric.inner (sphere z) (D u) (D u) * |
| 130 | (F.event (origin + c / scale) hT).limit_metric.inner (sphere z) (D v) (D v) - |
| 131 | ((F.event (origin + c / scale) hT).limit_metric.inner (sphere z) (D u) (D v)) ^ 2 → |
| 132 | k * scale < (F.event (origin + c / scale) hT).limit_connection.sectionalCurvature |
| 133 | (sphere z) (D u) (D v) := by |
| 134 | dsimp only |
| 135 | intro hgram |
| 136 | have hopen : IsOpen (g0.metric.ball 0 R) := by |
| 137 | rw [M36.standard_ball_eq_euclidean g0 hR] |
| 138 | exact Metric.isOpen_ball |
| 139 | apply sectional_lower_of_normalized_pullback_sphereJetRegion |
| 140 | (StandardCylinderPatch.contMDiff_sphere N) _ _ hopen |
| 141 | (terminal_birth_chart_contMDiffOn P hpinch e hU hT r hr hr' |
| 142 | f hsource htarget hscalar) |
| 143 | (fun x hx => terminal_birth_chart_mfderiv_invertible P hpinch e hU hT r hr hr' |
| 144 | f hsource htarget hscalar hx) e.scale_pos (hball z) _ u v hgram |
| 145 | apply hmargin |
| 146 | exact cylinderTerminalChart_twoJet_near_of_tail P hpinch e hU hT r hr hr' |
| 147 | f (le_of_eq htarget) G p hscalar (hsource.symm ▸ hball z) (J z) hs0 |
| 148 | (fun s hs htail => hnear s hs htail z) |
| 149 | |
| 150 | end PoincareMT.M44 |