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.Calculus.ContDiff.RCLike |
| 2 | import Mathlib.Topology.Algebra.MetricSpace.Lipschitz |
| 3 | |
| 4 | /-! |
| 5 | # Lipschitz bounds on compact subsets of a product domain |
| 6 | |
| 7 | The first domain factor is convex and the second is open. Local convex |
| 8 | neighborhoods and compactness give a single bound for all pairs in any |
| 9 | compact subset. MT2007 Claim 19.1, p. 437; |
| 10 | `2026-09-21-compact-product-lipschitz.md`. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter Metric |
| 16 | open scoped Topology |
| 17 | |
| 18 | namespace PoincareMT.M63 |
| 19 | |
| 20 | /-- A C1 map on a convex times open product is Lipschitz on every compact |
| 21 | subset, without convexity of that compact subset. MT2007 Claim 19.1, |
| 22 | p. 437; compact-product Lipschitz derivation. -/ |
| 23 | theorem exists_lipschitzOnWith_compact_product |
| 24 | {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 25 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 26 | [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 27 | {J : Set E} (hJ : Convex ℝ J) {U : Set F} (hU : IsOpen U) |
| 28 | {f : E × F → G} (hf : ContDiffOn ℝ 1 f (J ×ˢ U)) |
| 29 | {K : Set (E × F)} (hK : IsCompact K) (hKU : K ⊆ J ×ˢ U) : |
| 30 | ∃ L : NNReal, LipschitzOnWith L f K := by |
| 31 | apply LocallyLipschitzOn.exists_lipschitzOnWith_of_compact hK |
| 32 | intro p hp |
| 33 | obtain ⟨ε, hε, hball⟩ := Metric.isOpen_iff.mp hU p.2 (hKU hp).2 |
| 34 | let D := J ×ˢ ball p.2 ε |
| 35 | have hDsub : D ⊆ J ×ˢ U := fun _ hx => ⟨hx.1, hball hx.2⟩ |
| 36 | have hpD : p ∈ D := ⟨(hKU hp).1, mem_ball_self hε⟩ |
| 37 | obtain ⟨L, N, hN, hLip⟩ := (hf.mono hDsub p hpD).exists_lipschitzOnWith |
| 38 | (hJ.prod (convex_ball p.2 ε)) |
| 39 | have hDK : D ∈ 𝓝[K] p := by |
| 40 | filter_upwards [self_mem_nhdsWithin, |
| 41 | mem_nhdsWithin_of_mem_nhds (continuous_snd.tendsto p (ball_mem_nhds p.2 hε))] |
| 42 | with q hq hqball |
| 43 | exact ⟨(hKU hq).1, hqball⟩ |
| 44 | exact ⟨L, N, (nhdsWithin_le_of_mem hDK) hN, hLip⟩ |
| 45 | |
| 46 | end PoincareMT.M63 |