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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.CapTopology.AmbientCompression |
| 3 | |
| 4 | /-! |
| 5 | # Quantitative margins on an actual compressed cap recut |
| 6 | |
| 7 | This file is the consumer boundary between the actual ambient compression and |
| 8 | the finite metric-jet/confinement producers. Every quantitative field is |
| 9 | indexed by the literal recut carrier. The packet therefore does not infer an |
| 10 | `EpsilonNeck` or a target `CapCertificate` from topology alone. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.CapCertificate |
| 21 | |
| 22 | variable {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 24 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 25 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 26 | |
| 27 | /-- The literal carrier of the `k`-th compressed cap. -/ |
| 28 | def recutTarget (N : CapCertificate g) (delta : ℕ → ℝ) (k : ℕ) : Set M := |
| 29 | N.closed_core ∪ N.end_neck.region (-N.epsilon⁻¹) |
| 30 | (N.epsilon⁻¹ - delta k) |
| 31 | |
| 32 | /-- Actual quantitative witnesses on one compressed carrier. |
| 33 | |
| 34 | The strict inequalities are inputs from finite metric-jet transfer and |
| 35 | normalized-ball confinement. They are stated on `V` itself, so this record |
| 36 | cannot silently refer to a different target carrier. -/ |
| 37 | structure QuantitativeCapRecutMargins (N : CapCertificate g) (V : Set M) where |
| 38 | cap_constant : ℝ |
| 39 | cap_constant_pos : 0 < cap_constant |
| 40 | cap_constant_gt_old : N.cap_constant < cap_constant |
| 41 | scalar_pos : ∀ x ∈ V, 0 < N.connection.scalarCurvature x |
| 42 | intrinsic_diameter_bound : intrinsicDiameter g V < |
| 43 | ENNReal.ofReal (cap_constant * scalarCurvatureSupOn g N.connection V |
| 44 | ^ (-1 / 2 : ℝ)) |
| 45 | scalar_ratio : ∃ bound : ℝ, bound < cap_constant ∧ |
| 46 | ∀ x ∈ V, ∀ y ∈ V, |
| 47 | N.connection.scalarCurvature y ≤ bound * N.connection.scalarCurvature x |
| 48 | volume_bound : calibratedMetricVolume g V < |
| 49 | ENNReal.ofReal cap_constant * |
| 50 | ENNReal.ofReal (scalarCurvatureSupOn g N.connection V |
| 51 | ^ (-3 / 2 : ℝ)) |
| 52 | core_radius : M → ℝ |
| 53 | core_radius_pos : ∀ y ∈ N.core, 0 < core_radius y |
| 54 | core_radius_eq : ∀ y ∈ N.core, |
| 55 | scalarCurvatureSupOn g N.connection (g.ball y (core_radius y)) = |
| 56 | (core_radius y)⁻¹ ^ 2 |
| 57 | core_ball_subset : ∀ y ∈ N.core, |
| 58 | closure (g.ball y (core_radius y)) ⊆ V |
| 59 | core_ball_compact : ∀ y ∈ N.core, |
| 60 | IsCompact (closure (g.ball y (core_radius y))) |
| 61 | core_ball_volume_lower : ∃ bound : ℝ, cap_constant⁻¹ < bound ∧ |
| 62 | ∀ y ∈ N.core, ENNReal.ofReal (bound * core_radius y ^ 3) ≤ |
| 63 | calibratedMetricVolume g (g.ball y (core_radius y)) |
| 64 | gradient_bound : ∃ bound : ℝ, bound < cap_constant ∧ ∀ x ∈ V, |
| 65 | scalarGradientNorm g N.connection x ≤ |
| 66 | bound * (N.connection.scalarCurvature x) ^ (3 / 2 : ℝ) |
| 67 | laplacian_bound : ∃ bound : ℝ, bound < cap_constant ∧ ∀ x ∈ V, |
| 68 | |N.connection.laplacian N.connection.scalarCurvature x + |
| 69 | 2 * N.connection.ricciNormSq x| ≤ |
| 70 | bound * (N.connection.scalarCurvature x) ^ 2 |
| 71 | |
| 72 | omit [T2Space M] in |
| 73 | /-- Build all inherited quantitative fields from one old cap. |
| 74 | |
| 75 | The target diameter, calibrated-volume bound and confinement of every old |
| 76 | normalized core ball are supplied to this low-level constructor. The |
| 77 | volume input is derived from the old cap in `RecutVolume`. Scalar positivity, |
| 78 | the ratio, gradient and Laplacian witnesses, the exact radius equation, ball |
| 79 | compactness and the old lower-volume witness are restricted concretely from |
| 80 | `N`; the target constant is the explicit slack enlargement |
| 81 | `N.cap_constant + 1`. -/ |
| 82 | theorem exists_quantitative_cap_recut_margins_of_old_cap |
| 83 | (N : CapCertificate g) {V : Set M} |
| 84 | (hV : V ⊆ N.carrier) |
| 85 | (hdiam : intrinsicDiameter g V < |
| 86 | ENNReal.ofReal ((N.cap_constant + 1) * |
| 87 | scalarCurvatureSupOn g N.connection V ^ (-1 / 2 : ℝ))) |
| 88 | (hvol : calibratedMetricVolume g V < |
| 89 | ENNReal.ofReal (N.cap_constant + 1) * |
| 90 | ENNReal.ofReal (scalarCurvatureSupOn g N.connection V |
| 91 | ^ (-3 / 2 : ℝ))) |
| 92 | (hball : ∀ y ∈ N.core, |
| 93 | closure (g.ball y (N.core_radius y)) ⊆ V) : |
| 94 | Nonempty (QuantitativeCapRecutMargins N V) := by |
| 95 | let C : ℝ := N.cap_constant + 1 |
| 96 | have hCpos : 0 < C := by |
| 97 | dsimp [C] |
| 98 | linarith [N.cap_constant_pos] |
| 99 | have hCold : N.cap_constant < C := by |
| 100 | dsimp [C] |
| 101 | linarith |
| 102 | obtain ⟨ratioBound, hratioBound, hratio⟩ := N.scalar_ratio |
| 103 | obtain ⟨gradientBound, hgradientBound, hgradient⟩ := N.gradient_bound |
| 104 | obtain ⟨laplacianBound, hlaplacianBound, hlaplacian⟩ := N.laplacian_bound |
| 105 | obtain ⟨volumeBound, hvolumeBound, hvolume⟩ := N.core_ball_volume_lower |
| 106 | have hCinverse : C⁻¹ ≤ N.cap_constant⁻¹ := |
| 107 | inv_anti₀ N.cap_constant_pos hCold.le |
| 108 | refine ⟨{ |
| 109 | cap_constant := C |
| 110 | cap_constant_pos := hCpos |
| 111 | cap_constant_gt_old := hCold |
| 112 | scalar_pos := fun x hx => N.scalar_pos x (hV hx) |
| 113 | intrinsic_diameter_bound := by simpa [C] using hdiam |
| 114 | scalar_ratio := ⟨ratioBound, hratioBound.trans hCold, ?_⟩ |
| 115 | volume_bound := by simpa [C] using hvol |
| 116 | core_radius := N.core_radius |
| 117 | core_radius_pos := N.core_radius_pos |
| 118 | core_radius_eq := N.core_radius_eq |
| 119 | core_ball_subset := fun y hy => (hball y hy) |
| 120 | core_ball_compact := N.core_ball_compact |
| 121 | core_ball_volume_lower := |
| 122 | ⟨volumeBound, hCinverse.trans_lt hvolumeBound, hvolume⟩ |
| 123 | gradient_bound := |
| 124 | ⟨gradientBound, hgradientBound.trans hCold, fun x hx => |
| 125 | hgradient x (hV hx)⟩ |
| 126 | laplacian_bound := |
| 127 | ⟨laplacianBound, hlaplacianBound.trans hCold, fun x hx => |
| 128 | hlaplacian x (hV hx)⟩ }⟩ |
| 129 | intro x hx y hy |
| 130 | exact hratio x (hV hx) y (hV hy) |
| 131 | |
| 132 | /-- The actual compression and quantitative margins at one index. |
| 133 | |
| 134 | The packet records the old cap's retained topology and model data, together |
| 135 | with the supplied target-carrier margins and their explicit positive slack. |
| 136 | It intentionally stops before supplying target end/boundary necks. -/ |
| 137 | structure QuantitativeCapRecutPacket (N : CapCertificate g) |
| 138 | (delta : ℕ → ℝ) (k : ℕ) |
| 139 | (Q : QuantitativeCapRecutMargins N (recutTarget N delta k)) where |
| 140 | recut : PartialDiffeomorph (𝓡 3) (𝓡 3) M M ∞ |
| 141 | source_eq : recut.source = N.carrier |
| 142 | target_eq : recut.target = recutTarget N delta k |
| 143 | compact_capture : IsCompact (closure recut.target) |
| 144 | capture_inside : closure recut.target ⊆ N.carrier |
| 145 | fixed_core : ∀ x ∈ N.closed_core, recut x = x |
| 146 | fixed_center : recut N.end_neck.center = N.end_neck.center |
| 147 | end_formula : ∀ x ∈ N.end_neck.carrier, |
| 148 | recut x = N.end_neck.coordinate_map |
| 149 | ((N.end_neck.coordinate_inverse x).1, |
| 150 | (N.end_neck.coordinate_inverse x).2 - delta k * |
| 151 | CapRecut.axialCutoff N.epsilon⁻¹ (inv_pos.mpr N.epsilon_pos) |
| 152 | (N.end_neck.coordinate_inverse x).2) |
| 153 | model_transfer : Nonempty |
| 154 | (CapModelEquivalence N.model_kind N.puncture recut.target) |
| 155 | target_epsilon : ℝ |
| 156 | target_epsilon_eq : target_epsilon = N.epsilon |
| 157 | target_closed_core : Set M |
| 158 | target_closed_core_eq : target_closed_core = N.closed_core |
| 159 | target_core : Set M |
| 160 | target_core_eq : target_core = N.core |
| 161 | target_connection : LeviCivitaData g |
| 162 | target_connection_eq : target_connection = N.connection |
| 163 | target_puncture : RealProjectiveThree |
| 164 | target_puncture_eq : target_puncture = N.puncture |
| 165 | target_model_kind : CapModelKind |
| 166 | target_model_kind_eq : target_model_kind = N.model_kind |
| 167 | cap_constant : ℝ |
| 168 | cap_constant_eq : cap_constant = Q.cap_constant |
| 169 | cap_constant_slack : ℝ |
| 170 | cap_constant_slack_eq : cap_constant_slack = |
| 171 | Q.cap_constant - N.cap_constant |
| 172 | cap_constant_slack_pos : 0 < cap_constant_slack |
| 173 | margins : QuantitativeCapRecutMargins N (recutTarget N delta k) |
| 174 | |
| 175 | /-- Actual compressed recuts with explicit quantitative margins. |
| 176 | |
| 177 | The margin producer is eventual and is indexed by `recutTarget`; the theorem |
| 178 | only packages it with the independently constructed ambient compression and |
| 179 | same-universe model transport. -/ |
| 180 | theorem eventually_exists_quantitative_cap_recut |
| 181 | (N : CapCertificate g) {delta : ℕ → ℝ} |
| 182 | (hdelta : Tendsto delta atTop (𝓝 0)) |
| 183 | (hdelta_pos : ∀ᶠ k in atTop, 0 < delta k) |
| 184 | (hmargin : ∀ᶠ k in atTop, |
| 185 | Nonempty (QuantitativeCapRecutMargins N (recutTarget N delta k))) : |
| 186 | ∀ᶠ k in atTop, |
| 187 | ∃ Q : QuantitativeCapRecutMargins N (recutTarget N delta k), |
| 188 | Nonempty (QuantitativeCapRecutPacket N delta k Q) := by |
| 189 | have hrecuts := N.eventually_exists_smooth_precompact_recut hdelta hdelta_pos |
| 190 | filter_upwards [hrecuts, hmargin] with k hrecut hQ |
| 191 | obtain ⟨e, hsource, htarget, hcompact, hins, hcore, hcenter, hformula, hmodel⟩ := hrecut |
| 192 | obtain ⟨Q⟩ := hQ |
| 193 | have htarget' : e.target = recutTarget N delta k := by |
| 194 | simpa only [recutTarget] using htarget |
| 195 | refine ⟨Q, ⟨{ |
| 196 | recut := e |
| 197 | source_eq := hsource |
| 198 | target_eq := htarget' |
| 199 | compact_capture := hcompact |
| 200 | capture_inside := hins |
| 201 | fixed_core := hcore |
| 202 | fixed_center := hcenter |
| 203 | end_formula := hformula |
| 204 | model_transfer := hmodel |
| 205 | target_epsilon := N.epsilon |
| 206 | target_epsilon_eq := rfl |
| 207 | target_closed_core := N.closed_core |
| 208 | target_closed_core_eq := rfl |
| 209 | target_core := N.core |
| 210 | target_core_eq := rfl |
| 211 | target_connection := N.connection |
| 212 | target_connection_eq := rfl |
| 213 | target_puncture := N.puncture |
| 214 | target_puncture_eq := rfl |
| 215 | target_model_kind := N.model_kind |
| 216 | target_model_kind_eq := rfl |
| 217 | cap_constant := Q.cap_constant |
| 218 | cap_constant_eq := rfl |
| 219 | cap_constant_slack := Q.cap_constant - N.cap_constant |
| 220 | cap_constant_slack_eq := rfl |
| 221 | cap_constant_slack_pos := sub_pos.mpr Q.cap_constant_gt_old |
| 222 | margins := Q }⟩⟩ |
| 223 | |
| 224 | end PoincareMT.CapCertificate |