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.Geometry.Manifold.PartitionOfUnity |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.Operations |
| 3 | |
| 4 | /-! |
| 5 | # State extension around a compact image on the actual time set |
| 6 | |
| 7 | A state-only smooth cutoff preserves the entire closed-time field |
| 8 | near a compact state image. MT2007 Claim 19.1, p. 437, and Lemma 19.6, |
| 9 | pp. 441-442; `2026-09-22-closed-time-open-state-substitution.md`, statement 1. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Topology Manifold ContDiff |
| 16 | |
| 17 | universe u v |
| 18 | |
| 19 | namespace PoincareMT.M63 |
| 20 | |
| 21 | variable {E : Type u} {F : Type v} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 23 | |
| 24 | /-- A smooth field on an actual time set extends in state near any |
| 25 | compact state image, without extending time. MT2007 Claim 19.1, |
| 26 | p. 437; closed-time open-state substitution derivation, statement 1. -/ |
| 27 | theorem exists_closedTime_compact_state_extension {C : Set ℝ} {K U : Set E} |
| 28 | (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) |
| 29 | (f : ℝ × E → F) (hf : ContDiffOn ℝ ∞ f (C ×ˢ U)) : |
| 30 | ∃ g : ℝ × E → F, ContDiffOn ℝ ∞ g (C ×ˢ univ) ∧ |
| 31 | ∃ O : Set E, IsOpen O ∧ K ⊆ O ∧ O ⊆ U ∧ EqOn g f (C ×ˢ O) := by |
| 32 | obtain ⟨K', hK', hKK', hK'U⟩ := exists_compact_between hK hU hKU |
| 33 | have hd : Disjoint (interior K')ᶜ K := |
| 34 | disjoint_left.mpr (fun x hx hxK => hx (hKK' hxK)) |
| 35 | obtain ⟨eta, hzero, hone, _⟩ := exists_contMDiffMap_zero_one_nhds_of_isClosed 𝓘(ℝ, E) |
| 36 | isOpen_interior.isClosed_compl hK.isClosed hd (n := (⊤ : ℕ∞)) |
| 37 | have heta : ContDiff ℝ ∞ (eta : E → ℝ) := eta.contMDiff.contDiff |
| 38 | let g : ℝ × E → F := fun z => eta z.2 • f z |
| 39 | have hlocal : ContDiffOn ℝ ∞ g (C ×ˢ U) := |
| 40 | (heta.comp contDiff_snd).contDiffOn.smul hf |
| 41 | have hg : ContDiffOn ℝ ∞ g (C ×ˢ univ) := by |
| 42 | intro z hz |
| 43 | by_cases hx : z.2 ∈ U |
| 44 | · apply (hlocal z ⟨hz.1, hx⟩).mono_of_mem_nhdsWithin |
| 45 | have hN : (univ : Set ℝ) ×ˢ U ∈ 𝓝 z := |
| 46 | (isOpen_univ.prod hU).mem_nhds ⟨mem_univ _, hx⟩ |
| 47 | filter_upwards [self_mem_nhdsWithin, mem_nhdsWithin_of_mem_nhds hN] with y hy hyU |
| 48 | exact ⟨hy.1, hyU.2⟩ |
| 49 | · have hxK' : z.2 ∈ (interior K')ᶜ := fun h => hx (hK'U (interior_subset h)) |
| 50 | have hzero' : g =ᶠ[𝓝 z] fun _ => (0 : F) := by |
| 51 | filter_upwards [continuousAt_snd.tendsto.eventually |
| 52 | (hzero.filter_mono (nhds_le_nhdsSet hxK'))] with y hy |
| 53 | change eta y.2 • f y = 0 |
| 54 | rw [hy, zero_smul] |
| 55 | exact (contDiffAt_const.congr_of_eventuallyEq hzero').contDiffWithinAt |
| 56 | obtain ⟨O, hO, hKO, hOone⟩ := mem_nhdsSet_iff_exists.mp hone |
| 57 | refine ⟨g, hg, O ∩ U, hO.inter hU, fun x hx => ⟨hKO hx, hKU hx⟩, |
| 58 | inter_subset_right, ?_⟩ |
| 59 | intro z hz |
| 60 | change eta z.2 • f z = f z |
| 61 | rw [hOone hz.2.1, one_smul] |
| 62 | |
| 63 | end PoincareMT.M63 |