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.RadialProfile |
| 2 | |
| 3 | /-! |
| 4 | # The normalized cylindrical plateau |
| 5 | |
| 6 | This is the intermediate-value step in Morgan-Tian Lemma 12.2, |
| 7 | printed pp. 294-295. The arclength profile is exactly round near zero and |
| 8 | exactly constant beyond the cutoff. The plateau can be chosen to have |
| 9 | radius `sqrt 2`, giving scalar curvature one on the cylinder. |
| 10 | See `proof-work/tasks/M34/derivations/radial-profile.md`. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set MeasureTheory |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.M34 |
| 19 | |
| 20 | /-- Exact spherical profile before the cutoff (Lemma 12.2, pp. 294-295). |
| 21 | This includes negative radii so that the round tip has an open neighborhood. -/ |
| 22 | theorem capProfile_eq_round {a r : ℝ} (ha : 0 ≤ a) (hr : r ≤ a) : |
| 23 | capProfile a r = 2 * Real.sin (r / 2) := by |
| 24 | have hd (x : ℝ) : HasDerivAt (fun s : ℝ => 2 * Real.sin (s / 2)) |
| 25 | (Real.cos (x / 2)) x := by |
| 26 | exact (((hasDerivAt_id' x).div_const 2).sin.const_mul 2).congr_deriv (by ring) |
| 27 | calc |
| 28 | capProfile a r = ∫ s in 0..r, Real.cos (s / 2) := by |
| 29 | apply intervalIntegral.integral_congr |
| 30 | intro s hs |
| 31 | exact capSlope_eq_cos (hs.2.trans (max_le ha hr)) |
| 32 | _ = 2 * Real.sin (r / 2) := by |
| 33 | simpa only [zero_div, Real.sin_zero, mul_zero, sub_zero] using |
| 34 | intervalIntegral.integral_eq_sub_of_hasDerivAt (fun x _ => hd x) |
| 35 | ((Real.continuous_cos.comp (continuous_id.div_const 2)).intervalIntegrable 0 r) |
| 36 | |
| 37 | /-- Beyond the cutoff the profile is constant (Lemma 12.2, p. 295). -/ |
| 38 | theorem capProfile_eq_of_ge {a r s : ℝ} |
| 39 | (hr : a + 1 / 2 ≤ r) (hs : a + 1 / 2 ≤ s) : |
| 40 | capProfile a r = capProfile a s := by |
| 41 | have hc := (capSlope_contDiff_right a).continuous |
| 42 | have hz : (∫ x in r..s, capSlope a x) = 0 := by |
| 43 | calc |
| 44 | (∫ x in r..s, capSlope a x) = ∫ _ in r..s, (0 : ℝ) := by |
| 45 | apply intervalIntegral.integral_congr |
| 46 | intro x hx |
| 47 | exact capSlope_eq_zero ((le_min hr hs).trans hx.1) |
| 48 | _ = 0 := by simp |
| 49 | simpa only [capProfile, hz, add_zero] using |
| 50 | intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 51 | (hc.intervalIntegrable 0 r) (hc.intervalIntegrable r s) |
| 52 | |
| 53 | /-- At translation zero the plateau height is at most half a unit. |
| 54 | This supplies the lower endpoint for Lemma 12.2's IVT, p. 295. -/ |
| 55 | theorem capProfile_zero_parameter_le : capProfile 0 Real.pi ≤ 1 / 2 := by |
| 56 | rw [capProfile_eq_of_ge (s := (1 / 2 : ℝ)) (by linarith [Real.pi_gt_three]) |
| 57 | (by norm_num)] |
| 58 | have h := intervalIntegral.integral_mono_on (μ := volume) (a := (0 : ℝ)) (b := 1 / 2) |
| 59 | (by norm_num) ((capSlope_contDiff_right 0).continuous.intervalIntegrable _ _) |
| 60 | (continuous_const.intervalIntegrable _ _) (fun x _ => capSlope_le_one 0 x) |
| 61 | simpa only [capProfile, intervalIntegral.integral_const, sub_zero, smul_eq_mul, |
| 62 | mul_one] using h |
| 63 | |
| 64 | /-- The upper endpoint of the translation interval has a plateau strictly |
| 65 | larger than `sqrt 2` (Lemma 12.2, p. 295, arclength derivation). -/ |
| 66 | theorem sqrt_two_lt_capProfile_half_pi : |
| 67 | Real.sqrt 2 < capProfile (Real.pi / 2) Real.pi := by |
| 68 | have hp : 0 < Real.pi := Real.pi_pos |
| 69 | have hbase : capProfile (Real.pi / 2) (Real.pi / 2) = Real.sqrt 2 := by |
| 70 | rw [capProfile_eq_round (by positivity) le_rfl] |
| 71 | rw [show Real.pi / 2 / 2 = Real.pi / 4 by ring, Real.sin_pi_div_four] |
| 72 | ring |
| 73 | have htail : 0 < ∫ x in (Real.pi / 2)..Real.pi, capSlope (Real.pi / 2) x := by |
| 74 | apply intervalIntegral.integral_pos (by linarith) |
| 75 | (capSlope_contDiff_right (Real.pi / 2)).continuous.continuousOn |
| 76 | · intro x hx |
| 77 | exact capSlope_nonneg le_rfl (by linarith [hx.1]) |
| 78 | · refine ⟨Real.pi / 2, ⟨le_rfl, by linarith⟩, ?_⟩ |
| 79 | rw [capSlope_eq_cos le_rfl] |
| 80 | exact Real.cos_pos_of_mem_Ioo (by constructor <;> linarith) |
| 81 | have hc := (capSlope_contDiff_right (Real.pi / 2)).continuous |
| 82 | have hadd := intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 83 | (hc.intervalIntegrable 0 (Real.pi / 2)) |
| 84 | (hc.intervalIntegrable (Real.pi / 2) Real.pi) |
| 85 | change capProfile (Real.pi / 2) (Real.pi / 2) + _ = |
| 86 | capProfile (Real.pi / 2) Real.pi at hadd |
| 87 | rw [hbase] at hadd |
| 88 | linarith |
| 89 | |
| 90 | /-- A positive cutoff translation gives precisely the normalized cylindrical |
| 91 | radius, as required by Lemma 12.2, pp. 294-295. -/ |
| 92 | theorem exists_capProfile_normalized : |
| 93 | ∃ a ∈ Ioo (0 : ℝ) (Real.pi / 2), capProfile a Real.pi = Real.sqrt 2 := by |
| 94 | have hlo : capProfile 0 Real.pi < Real.sqrt 2 := by |
| 95 | have hs := Real.sq_sqrt (show (0 : ℝ) ≤ 2 by norm_num) |
| 96 | have hn := Real.sqrt_nonneg (2 : ℝ) |
| 97 | nlinarith [capProfile_zero_parameter_le] |
| 98 | have hhi := sqrt_two_lt_capProfile_half_pi |
| 99 | obtain ⟨a, ha, heq⟩ := intermediate_value_Icc (by positivity : (0 : ℝ) ≤ Real.pi / 2) |
| 100 | (capProfile_continuous_parameter Real.pi).continuousOn ⟨hlo.le, hhi.le⟩ |
| 101 | refine ⟨a, ⟨?_, ?_⟩, heq⟩ |
| 102 | · by_contra h |
| 103 | have he : a = 0 := le_antisymm (not_lt.mp h) ha.1 |
| 104 | subst a |
| 105 | exact (ne_of_lt hlo) heq |
| 106 | · by_contra h |
| 107 | have he : a = Real.pi / 2 := le_antisymm ha.2 (not_lt.mp h) |
| 108 | subst a |
| 109 | exact (ne_of_gt hhi) heq |
| 110 | |
| 111 | end PoincareMT.M34 |