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.Existence.InitialMetric.Plateau |
| 2 | import Mathlib.Analysis.Convex.Deriv |
| 3 | |
| 4 | /-! |
| 5 | # Shape bounds for the standard cap profile |
| 6 | |
| 7 | These are the arclength versions of the profile inequalities in |
| 8 | Morgan-Tian Lemma 12.2, printed pp. 294-295. All sign and concavity |
| 9 | claims are restricted to nonnegative radii. In particular, the later |
| 10 | curvature formulas may divide by the profile only at positive radii. |
| 11 | See `proof-work/tasks/M34/derivations/radial-profile.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set MeasureTheory |
| 17 | open scoped ContDiff Topology |
| 18 | |
| 19 | namespace PoincareMT.M34 |
| 20 | |
| 21 | /-- The cap is round to first order at its tip (Lemma 12.2, p. 294). -/ |
| 22 | theorem capSlope_zero {a : ℝ} (ha : 0 ≤ a) : capSlope a 0 = 1 := by |
| 23 | rw [capSlope_eq_cos ha, zero_div, Real.cos_zero] |
| 24 | |
| 25 | /-- Away from zero the radial speed is strictly less than one |
| 26 | (Lemma 12.2, pp. 294-295, arclength derivation). -/ |
| 27 | theorem capSlope_lt_one {a r : ℝ} (ha : a ≤ Real.pi / 2) (hr : 0 < r) : |
| 28 | capSlope a r < 1 := by |
| 29 | by_cases h : a + 1 / 2 ≤ r |
| 30 | · rw [capSlope_eq_zero h] |
| 31 | norm_num |
| 32 | · have hrpi : r < Real.pi := by linarith [Real.pi_gt_three] |
| 33 | have hc : 0 ≤ Real.cos (r / 2) := |
| 34 | Real.cos_nonneg_of_mem_Icc (by constructor <;> linarith [Real.pi_pos]) |
| 35 | calc |
| 36 | capSlope a r ≤ Real.cos (r / 2) * 1 := |
| 37 | mul_le_mul_of_nonneg_left (capCutoff_le_one _) hc |
| 38 | _ < 1 := by |
| 39 | simpa only [mul_one, Real.cos_zero] using |
| 40 | Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (by rfl) |
| 41 | (by linarith) (by linarith) |
| 42 | |
| 43 | /-- The second derivative is nonpositive, including at zero. |
| 44 | Smoothness and the unique derivative on the half-line justify the |
| 45 | one-sided monotonicity argument (Lemma 12.2, pp. 294-295). -/ |
| 46 | theorem capSlope_deriv_nonpos {a r : ℝ} (ha : a ≤ Real.pi / 2) (hr : 0 ≤ r) : |
| 47 | deriv (capSlope a) r ≤ 0 := by |
| 48 | have hd := (capSlope_contDiff_right a).differentiable (by simp) |
| 49 | rw [← hd.differentiableAt.derivWithin (uniqueDiffOn_Ici 0 r hr)] |
| 50 | exact (capSlope_antitoneOn ha).derivWithin_nonpos |
| 51 | |
| 52 | /-- The profile is nondecreasing on nonnegative radii |
| 53 | (Lemma 12.2, pp. 294-295). -/ |
| 54 | theorem capProfile_monotoneOn {a : ℝ} (ha : a ≤ Real.pi / 2) : |
| 55 | MonotoneOn (capProfile a) (Ici 0) := by |
| 56 | apply monotoneOn_of_deriv_nonneg (convex_Ici 0) |
| 57 | (capProfile_contDiff a).continuous.continuousOn |
| 58 | ((capProfile_contDiff a).differentiable (by simp)).differentiableOn |
| 59 | intro r hr |
| 60 | rw [capProfile_deriv] |
| 61 | exact capSlope_nonneg ha (interior_subset hr) |
| 62 | |
| 63 | /-- Concavity on the geometric half-line is the curvature sign condition |
| 64 | in Lemma 12.2, pp. 294-295. -/ |
| 65 | theorem capProfile_concaveOn {a : ℝ} (ha : a ≤ Real.pi / 2) : |
| 66 | ConcaveOn ℝ (Ici 0) (capProfile a) := by |
| 67 | apply AntitoneOn.concaveOn_of_deriv (convex_Ici 0) |
| 68 | (capProfile_contDiff a).continuous.continuousOn |
| 69 | ((capProfile_contDiff a).differentiable (by simp)).differentiableOn |
| 70 | rw [capProfile_deriv] |
| 71 | exact (capSlope_antitoneOn ha).mono interior_subset |
| 72 | |
| 73 | /-- Positivity of the profile away from the tip, before any curvature |
| 74 | expression uses its reciprocal (Lemma 12.2, p. 295). -/ |
| 75 | theorem capProfile_pos {a r : ℝ} (ha : 0 ≤ a) (hapi : a ≤ Real.pi / 2) |
| 76 | (hr : 0 < r) : 0 < capProfile a r := by |
| 77 | apply intervalIntegral.integral_pos hr (capSlope_contDiff_right a).continuous.continuousOn |
| 78 | · intro x hx |
| 79 | exact capSlope_nonneg hapi hx.1.le |
| 80 | · exact ⟨0, ⟨le_rfl, hr.le⟩, by rw [capSlope_zero ha]; norm_num⟩ |
| 81 | |
| 82 | /-- Radial speed at most one bounds the angular radius by arclength |
| 83 | (Lemma 12.2, pp. 294-295). -/ |
| 84 | theorem capProfile_le_radius (a : ℝ) {r : ℝ} (hr : 0 ≤ r) : capProfile a r ≤ r := by |
| 85 | have h := intervalIntegral.integral_mono_on (μ := volume) hr |
| 86 | ((capSlope_contDiff_right a).continuous.intervalIntegrable 0 r) |
| 87 | (continuous_const.intervalIntegrable 0 r) (fun x _ => capSlope_le_one a x) |
| 88 | simpa only [capProfile, intervalIntegral.integral_const, sub_zero, smul_eq_mul, |
| 89 | mul_one] using h |
| 90 | |
| 91 | /-- The normalized cap has exactly cylindrical radius beyond its cutoff |
| 92 | (Lemma 12.2, p. 295). -/ |
| 93 | theorem capProfile_eq_sqrt_two {a r : ℝ} (ha : a ≤ Real.pi / 2) |
| 94 | (hn : capProfile a Real.pi = Real.sqrt 2) (hr : a + 1 / 2 ≤ r) : |
| 95 | capProfile a r = Real.sqrt 2 := by |
| 96 | rw [capProfile_eq_of_ge (s := Real.pi) hr (by linarith [Real.pi_gt_three]), hn] |
| 97 | |
| 98 | /-- The profile never exceeds its normalized cylindrical radius |
| 99 | (Lemma 12.2, p. 295). -/ |
| 100 | theorem capProfile_le_sqrt_two {a r : ℝ} (ha : a ≤ Real.pi / 2) |
| 101 | (hn : capProfile a Real.pi = Real.sqrt 2) (hr : 0 ≤ r) : |
| 102 | capProfile a r ≤ Real.sqrt 2 := by |
| 103 | by_cases h : a + 1 / 2 ≤ r |
| 104 | · exact (capProfile_eq_sqrt_two ha hn h).le |
| 105 | · rw [← hn] |
| 106 | exact capProfile_monotoneOn ha hr Real.pi_pos.le (by linarith [Real.pi_gt_three]) |
| 107 | |
| 108 | end PoincareMT.M34 |