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.Cap.CapComparisonVolume |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Measure.CompleteBallVolume |
| 3 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Analysis.GramDensity |
| 4 | |
| 5 | /-! |
| 6 | Adapted from Mapher `PoincareMT/Proofs/M49/LocalCapVolume.lean` at |
| 7 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 8 | |
| 9 | # A uniform cubic bound for the actual closed local cap |
| 10 | |
| 11 | Morgan-Tian Theorem 13.2, pp. 332-333, and Lemma 13.4, pp. 333-334, |
| 12 | place the closed surgery cap in the comparison image of a fixed model |
| 13 | ball. Its finite model volume gives the h-cubed upper bound required in |
| 14 | Lemma 17.12, p. 410. The two cap parametrizations remain distinct. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set MeasureTheory |
| 20 | open scoped Manifold ContDiff Bundle ENNReal |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.SurgeryVolume |
| 25 | |
| 26 | /-- The actual closed local cap lies in a comparison image and obeys its |
| 27 | cubic bound (MT Theorem 13.2, p. 333; Lemma 13.4, pp. 333-334). -/ |
| 28 | theorem metricSurgeryResult_cap_volume_le |
| 29 | {g₀ : StandardInitialMetric} {K : MetricSurgeryConstants} |
| 30 | {S : GeneralizedSliceCarrier.{u}} {g : RiemannianMetric 3 S.carrier} |
| 31 | {I : MetricSurgeryInput K g} (R : MetricSurgeryResult g₀ I) |
| 32 | {eta : ℝ} (heta : 0 < eta) (heta₁ : eta < 1) |
| 33 | (hgap : g₀.cylindrical_end.radius + 5 < eta⁻¹) |
| 34 | (hmat : ∀ A : Matrix (Fin 3) (Fin 3) ℝ, |
| 35 | (∀ i j, |A i j - if i = j then 1 else 0| ≤ eta) → |
| 36 | (1 / 2 : ℝ) ≤ Real.sqrt A.det ∧ Real.sqrt A.det ≤ 2) |
| 37 | (heps : I.neck.epsilon ≤ K.comparison_delta eta) : |
| 38 | calibratedMetricVolume R.metric |
| 39 | (closure (R.cap_map '' g₀.metric.ball 0 (g₀.cylindrical_end.radius + 4))) ≤ |
| 40 | ENNReal.ofReal (2 * I.neck.scale ^ 3) * |
| 41 | calibratedMetricVolume g₀.metric (g₀.metric.ball 0 eta⁻¹) := by |
| 42 | obtain ⟨C⟩ := R.standard_close eta heta heps |
| 43 | have hcontain : closure (R.cap_map '' |
| 44 | g₀.metric.ball 0 (g₀.cylindrical_end.radius + 4)) ⊆ |
| 45 | C.map '' g₀.metric.ball 0 eta⁻¹ := |
| 46 | (closure_mono R.cap_outer_ball).trans |
| 47 | ((closure_metric_ball_subset_ball R.metric R.tip |
| 48 | (mul_pos I.neck.scale_pos (inv_pos.mpr heta)) |
| 49 | (mul_lt_mul_of_pos_left hgap I.neck.scale_pos)).trans C.image_contains) |
| 50 | exact (measure_mono hcontain).trans |
| 51 | (surgeryCapClose_volume_image_le C heta₁ hmat |
| 52 | (isOpen_metric_ball g₀.metric 0 eta⁻¹).measurableSet subset_rfl) |
| 53 | |
| 54 | -- Reconcile the classical matrix tolerance with the concrete Fin 3 matrix instance. |
| 55 | set_option backward.isDefEq.respectTransparency false in |
| 56 | /-- One model-dependent constant and calibrated cutoff bound every actual |
| 57 | local cap by length cubed (MT Lemma 17.12, p. 410, using Theorem 13.2, p. 333). -/ |
| 58 | theorem exists_uniform_local_cap_volume_bound (g₀ : StandardInitialMetric) : |
| 59 | ∃ Ccap : ℝ, 0 < Ccap ∧ ∀ K : MetricSurgeryConstants, |
| 60 | ∃ d : ℝ, 0 < d ∧ d ≤ K.delta₀ ∧ |
| 61 | ∀ (S : GeneralizedSliceCarrier.{u}) (g : RiemannianMetric 3 S.carrier) |
| 62 | (I : MetricSurgeryInput K g) (R : MetricSurgeryResult g₀ I), |
| 63 | I.neck.epsilon ≤ d → |
| 64 | calibratedMetricVolume R.metric |
| 65 | (closure (R.cap_map '' |
| 66 | g₀.metric.ball 0 (g₀.cylindrical_end.radius + 4))) ≤ |
| 67 | ENNReal.ofReal (Ccap * I.neck.scale ^ 3) := by |
| 68 | obtain ⟨e, he, hmatrix⟩ := Matrix.exists_pos_entrywise_sqrt_det_bounds (Fin 3) |
| 69 | let eta : ℝ := min e (min (1 / 2) (g₀.cylindrical_end.radius + 6)⁻¹) |
| 70 | have hrad : 0 < g₀.cylindrical_end.radius + 6 := by |
| 71 | linarith [g₀.cylindrical_end.radius_pos] |
| 72 | have heta : 0 < eta := lt_min he (lt_min (by norm_num) (inv_pos.mpr hrad)) |
| 73 | have heta₁ : eta < 1 := |
| 74 | ((min_le_right e _).trans (min_le_left _ _)).trans_lt (by norm_num) |
| 75 | have hsmall : eta ≤ (g₀.cylindrical_end.radius + 6)⁻¹ := |
| 76 | (min_le_right e _).trans (min_le_right _ _) |
| 77 | have hlarge : g₀.cylindrical_end.radius + 6 ≤ eta⁻¹ := by |
| 78 | simpa only [inv_inv] using |
| 79 | (inv_le_inv₀ (inv_pos.mpr hrad) heta).mpr hsmall |
| 80 | have hgap : g₀.cylindrical_end.radius + 5 < eta⁻¹ := by linarith |
| 81 | have hmat : ∀ A : Matrix (Fin 3) (Fin 3) ℝ, |
| 82 | (∀ i j, |A i j - if i = j then 1 else 0| ≤ eta) → |
| 83 | (1 / 2 : ℝ) ≤ Real.sqrt A.det ∧ Real.sqrt A.det ≤ 2 := by |
| 84 | intro A hA |
| 85 | have hc := hmatrix A (fun i j => by |
| 86 | have heA := (hA i j).trans (min_le_left e _) |
| 87 | by_cases hij : i = j |
| 88 | · simpa only [if_pos hij] using heA |
| 89 | · simpa only [if_neg hij] using heA) |
| 90 | have hdec : (fun i j : Fin 3 => Classical.propDecidable (i = j)) = |
| 91 | (inferInstance : DecidableEq (Fin 3)) := Subsingleton.elim _ _ |
| 92 | have hdet := congrArg (fun d : DecidableEq (Fin 3) => |
| 93 | @Matrix.det (Fin 3) d (Fin.fintype 3) ℝ Real.commRing A) hdec |
| 94 | rw [hdet] at hc |
| 95 | exact hc |
| 96 | let V := calibratedMetricVolume g₀.metric (g₀.metric.ball 0 eta⁻¹) |
| 97 | have hV : V ≠ ⊤ := (calibratedMetricVolume_ball_lt_top |
| 98 | g₀.metric g₀.complete 0 eta⁻¹).ne |
| 99 | refine ⟨2 * V.toReal + 1, by positivity, ?_⟩ |
| 100 | intro K |
| 101 | refine ⟨min K.delta₀ (K.comparison_delta eta), |
| 102 | lt_min K.delta₀_pos (K.comparison_delta_pos eta heta), min_le_left _ _, ?_⟩ |
| 103 | intro S g I R heps |
| 104 | have hh := I.neck.scale_pos |
| 105 | have hbound := metricSurgeryResult_cap_volume_le R heta heta₁ hgap hmat |
| 106 | (heps.trans (min_le_right _ _)) |
| 107 | apply hbound.trans |
| 108 | change ENNReal.ofReal (2 * I.neck.scale ^ 3) * V ≤ _ |
| 109 | calc |
| 110 | _ = ENNReal.ofReal (2 * I.neck.scale ^ 3 * V.toReal) := by |
| 111 | rw [ENNReal.ofReal_mul (by positivity : 0 ≤ 2 * I.neck.scale ^ 3), |
| 112 | ENNReal.ofReal_toReal hV] |
| 113 | _ ≤ _ := ENNReal.ofReal_le_ofReal (by nlinarith [pow_nonneg hh.le 3]) |
| 114 | |
| 115 | end PoincareMT.SurgeryVolume |