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 Mathlib.MeasureTheory.Integral.DominatedConvergence |
| 2 | |
| 3 | /-! |
| 4 | # Limits of truncated integrable actions |
| 5 | |
| 6 | Continuity of the integral primitive controls a moving upper endpoint |
| 7 | from the left and an interior moving lower endpoint. These are the |
| 8 | unchanged outer terms in Morgan-Tian Proposition 6.30, pp. 118-119. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set Filter MeasureTheory |
| 14 | open scoped Topology intervalIntegral |
| 15 | |
| 16 | namespace PoincareMT.M14 |
| 17 | |
| 18 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | |
| 20 | /-- An integrable action truncated before its final endpoint tends |
| 21 | to its full value, with no endpoint regularity assumption, |
| 22 | Proposition 6.30, pp. 118-119. -/ |
| 23 | theorem tendsto_integral_upper_from_left {F : ℝ → E} {a b k : ℝ} |
| 24 | (hab : a < b) (hF : IntervalIntegrable F volume a b) (hk : 0 < k) : |
| 25 | Tendsto (fun d => ∫ s in a..(b - k * d), F s) |
| 26 | (𝓝[>] (0 : ℝ)) (𝓝 (∫ s in a..b, F s)) := by |
| 27 | have hi : IntegrableOn F (uIcc a b) := by |
| 28 | rw [uIcc_of_le hab.le] |
| 29 | exact (intervalIntegrable_iff_integrableOn_Icc_of_le hab.le).mp hF |
| 30 | have hcont := intervalIntegral.continuousOn_primitive_interval hi |
| 31 | rw [uIcc_of_le hab.le] at hcont |
| 32 | have hmap : Tendsto (fun d : ℝ => b - k * d) (𝓝[>] 0) (𝓝[Icc a b] b) := by |
| 33 | apply tendsto_nhdsWithin_iff.mpr |
| 34 | refine ⟨?_, ?_⟩ |
| 35 | · have h : Continuous (fun d : ℝ => b - k * d) := |
| 36 | continuous_const.sub (continuous_const.mul continuous_id) |
| 37 | simpa only [mul_zero, sub_zero] using |
| 38 | (h.continuousAt (x := 0)).tendsto.mono_left |
| 39 | (show 𝓝[>] (0 : ℝ) ≤ 𝓝 0 from nhdsWithin_le_nhds) |
| 40 | · filter_upwards [Ioo_mem_nhdsGT (div_pos (sub_pos.mpr hab) hk)] with d hd |
| 41 | have hsmall := (lt_div_iff₀ hk).mp hd.2 |
| 42 | exact ⟨by nlinarith, by nlinarith [mul_pos hk hd.1]⟩ |
| 43 | exact (hcont b ⟨hab.le, le_rfl⟩).tendsto.comp hmap |
| 44 | |
| 45 | /-- An integrable action with an interior moving lower endpoint |
| 46 | tends to the original tail action, Proposition 6.30, pp. 118-119. -/ |
| 47 | theorem tendsto_integral_lower_at_interior {F : ℝ → E} {a b c : ℝ} |
| 48 | (hF : IntervalIntegrable F volume a b) (hc : c ∈ Ioo a b) (k : ℝ) : |
| 49 | Tendsto (fun d => ∫ s in (c - k * d)..b, F s) |
| 50 | (𝓝 (0 : ℝ)) (𝓝 (∫ s in c..b, F s)) := by |
| 51 | have hab : a ≤ b := (hc.1.trans hc.2).le |
| 52 | have hi : IntegrableOn F (uIcc a b) := by |
| 53 | rw [uIcc_of_le hab] |
| 54 | exact (intervalIntegrable_iff_integrableOn_Icc_of_le hab).mp hF |
| 55 | have hcont := intervalIntegral.continuousOn_primitive_interval_left hi |
| 56 | rw [uIcc_of_le hab] at hcont |
| 57 | have h := (hcont c (Ioo_subset_Icc_self hc)).continuousAt (Icc_mem_nhds hc.1 hc.2) |
| 58 | have hm : Continuous (fun d : ℝ => c - k * d) := |
| 59 | continuous_const.sub (continuous_const.mul continuous_id) |
| 60 | have hmap : Tendsto (fun d : ℝ => c - k * d) (𝓝 0) (𝓝 c) := by |
| 61 | simpa only [mul_zero, sub_zero] using (hm.continuousAt (x := 0)).tendsto |
| 62 | exact h.tendsto.comp hmap |
| 63 | |
| 64 | end PoincareMT.M14 |