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.CanonicalInduction.Terminal.Germs.TerminalGermsEndpoint |
| 2 | import Mathlib.Analysis.Normed.Group.Continuity |
| 3 | |
| 4 | /-! |
| 5 | # Joint continuity of the included endpoint jets |
| 6 | |
| 7 | The same spatially uniform source bound passes to the actual pointwise |
| 8 | limits and then gives joint endpoint continuity. Source: MT Theorem 5.11 |
| 9 | and Proposition 5.14, pp. 89-91; |
| 10 | derivations/terminal-germs-closed-jets.md, Stage A5b1. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Topology |
| 17 | |
| 18 | namespace PoincareMT.M47 |
| 19 | |
| 20 | /-- Closed pointwise limits preserve one error constant for the entire |
| 21 | spatial buffer, even when the source index threshold depends on the point. -/ |
| 22 | theorem terminalGerms_uniform_endpoint_bound |
| 23 | {X F : Type*} [NormedAddCommGroup F] |
| 24 | {U : Set X} {a C : ℝ} (f : ℕ → ℝ × X → F) |
| 25 | (B0 : X → F) (Bminus : ℝ × X → F) |
| 26 | (hzero : ∀ x ∈ U, Tendsto (fun k => f k (0, x)) atTop (𝓝 (B0 x))) |
| 27 | (hminus : ∀ t ∈ Ioo a 0, ∀ x ∈ U, |
| 28 | Tendsto (fun k => f k (t, x)) atTop (𝓝 (Bminus (t, x)))) |
| 29 | (hbound : ∀ t ∈ Ioo a 0, ∀ x ∈ U, |
| 30 | ∀ᶠ k in atTop, ‖f k (t, x) - f k (0, x)‖ ≤ C * |t|) : |
| 31 | ∀ t ∈ Ioo a 0, ∀ x ∈ U, ‖Bminus (t, x) - B0 x‖ ≤ C * |t| := by |
| 32 | intro t ht x hx |
| 33 | exact le_of_tendsto (((hminus t ht x hx).sub (hzero x hx)).norm) (hbound t ht x hx) |
| 34 | |
| 35 | /-- The actual gluing to the terminal spatial field is jointly continuous |
| 36 | within the included time slab at zero. -/ |
| 37 | theorem terminalGerms_joint_endpoint_continuity |
| 38 | {X F : Type*} [TopologicalSpace X] [NormedAddCommGroup F] |
| 39 | {U : Set X} {a C : ℝ} (B0 : X → F) (Bminus : ℝ × X → F) (x0 : X) |
| 40 | (hB0 : ContinuousWithinAt B0 U x0) |
| 41 | (hbound : ∀ t ∈ Ioo a 0, ∀ x ∈ U, ‖Bminus (t, x) - B0 x‖ ≤ C * |t|) : |
| 42 | ContinuousWithinAt |
| 43 | (fun p : ℝ × X => if p.1 < 0 then Bminus p else B0 p.2) |
| 44 | (Ioc a 0 ×ˢ U) (0, x0) := by |
| 45 | let G : ℝ × X → F := fun p => if p.1 < 0 then Bminus p else B0 p.2 |
| 46 | let l := 𝓝[Ioc a 0 ×ˢ U] (0, x0) |
| 47 | have hfirst : Tendsto (fun p : ℝ × X => p.1) l (𝓝 0) := |
| 48 | (continuous_fst.tendsto (0, x0)).mono_left inf_le_left |
| 49 | have hsecond : Tendsto (fun p : ℝ × X => p.2) l (𝓝[U] x0) := by |
| 50 | dsimp [l] |
| 51 | rw [nhdsWithin_prod_eq] |
| 52 | exact tendsto_snd |
| 53 | have hterminal : Tendsto (fun p : ℝ × X => B0 p.2) l (𝓝 (B0 x0)) := |
| 54 | Tendsto.comp hB0 hsecond |
| 55 | have hupper : Tendsto (fun p : ℝ × X => C * |p.1| + ‖B0 p.2 - B0 x0‖) |
| 56 | l (𝓝 0) := by |
| 57 | simpa using ((tendsto_const_nhds : Tendsto (fun _ : ℝ × X => C) l (𝓝 C)).mul |
| 58 | hfirst.abs).add ((hterminal.sub |
| 59 | (tendsto_const_nhds : Tendsto (fun _ : ℝ × X => B0 x0) l (𝓝 (B0 x0)))).norm) |
| 60 | have hG0 : G (0, x0) = B0 x0 := by simp [G] |
| 61 | change Tendsto G l (𝓝 (G (0, x0))) |
| 62 | rw [hG0, tendsto_iff_norm_sub_tendsto_zero] |
| 63 | apply squeeze_zero' (Eventually.of_forall fun _ => norm_nonneg _) ?_ hupper |
| 64 | filter_upwards [self_mem_nhdsWithin] with p hp |
| 65 | have hpoint : ‖G p - B0 p.2‖ ≤ C * |p.1| := by |
| 66 | by_cases ht : p.1 < 0 |
| 67 | · simpa only [G, if_pos ht] using hbound p.1 ⟨hp.1.1, ht⟩ p.2 hp.2 |
| 68 | · have ht0 : p.1 = 0 := le_antisymm hp.1.2 (le_of_not_gt ht) |
| 69 | simp only [G, if_neg ht, sub_self, norm_zero, ht0, abs_zero, mul_zero, le_refl] |
| 70 | exact (norm_sub_le_norm_sub_add_norm_sub (G p) (B0 p.2) (B0 x0)).trans |
| 71 | (add_le_add hpoint le_rfl) |
| 72 | |
| 73 | end PoincareMT.M47 |