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.Analysis.Normed.Group.Continuity |
| 2 | import Mathlib.Analysis.Normed.Group.Uniform |
| 3 | |
| 4 | /-! |
| 5 | # Joint boundary continuity from a local initial modulus |
| 6 | |
| 7 | A norm estimate against a continuous initial field controls the error |
| 8 | jointly in time and space at the initial boundary. This is the endpoint |
| 9 | continuity step in Morgan-Tian Theorem 12.5, p. 297. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Topology |
| 16 | |
| 17 | /-- A local linear initial modulus gives joint within-continuity at time |
| 18 | zero (Theorem 12.5, p. 297, endpoint calculus). -/ |
| 19 | theorem continuousWithinAt_zero_of_initial_norm_bound |
| 20 | {X F : Type*} [TopologicalSpace X] [NormedAddCommGroup F] |
| 21 | {f : ℝ × X → F} {g : X → F} {T C : ℝ} {x : X} {K : Set X} |
| 22 | (hK : K ∈ 𝓝 x) (hg : ContinuousAt g x) (hzero : f (0, x) = g x) |
| 23 | (hbound : ∀ t ∈ Ico 0 T, ∀ y ∈ K, ‖f (t, y) - g y‖ ≤ C * t) : |
| 24 | ContinuousWithinAt f (Ico 0 T ×ˢ univ) (0, x) := by |
| 25 | have hspace : Tendsto (fun p : ℝ × X => p.2) |
| 26 | (𝓝[Ico 0 T ×ˢ univ] (0, x)) (𝓝 x) := |
| 27 | continuous_snd.continuousAt.tendsto.mono_left nhdsWithin_le_nhds |
| 28 | have htime : Tendsto (fun p : ℝ × X => C * p.1) |
| 29 | (𝓝[Ico 0 T ×ˢ univ] (0, x)) (𝓝 0) := by |
| 30 | have hc : ContinuousAt (fun p : ℝ × X => C * p.1) (0, x) := by fun_prop |
| 31 | simpa only [mul_zero] using hc.tendsto.mono_left nhdsWithin_le_nhds |
| 32 | have hsmall : Tendsto (fun p : ℝ × X => f p - g p.2) |
| 33 | (𝓝[Ico 0 T ×ˢ univ] (0, x)) (𝓝 0) := by |
| 34 | apply squeeze_zero_norm' _ htime |
| 35 | filter_upwards [self_mem_nhdsWithin, hspace.eventually hK] with p hp hpK |
| 36 | exact hbound p.1 hp.1 p.2 hpK |
| 37 | have hbase := hg.tendsto.comp hspace |
| 38 | change Tendsto f (𝓝[Ico 0 T ×ˢ univ] (0, x)) (𝓝 (f (0, x))) |
| 39 | rw [hzero] |
| 40 | simpa only [Function.comp_apply, sub_add_cancel, zero_add] using hsmall.add hbase |