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.Manifold.PartitionOfUnity.CompactSupport |
| 2 | |
| 3 | /-! |
| 4 | # Finite nested cutoffs |
| 5 | |
| 6 | A compact set covered by open sets admits finitely many inner bumps and outer |
| 7 | cutoffs. Some inner bump is identically one near each point of the compact set; |
| 8 | the corresponding outer cutoff is one near the entire inner support. These |
| 9 | cutoffs allow local smooth functions to be extended before taking smooth minima. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | universe u v |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T3Space M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | /-- Finite nested cutoffs subordinate to an open cover, with inner cores |
| 25 | covering a neighborhood of the given compact set. -/ |
| 26 | theorem exists_finite_nested_contMDiff_cutoffs {K : Set M} (hK : IsCompact K) |
| 27 | {α : Type v} (U : α → Set M) (hU : ∀ i, IsOpen (U i)) |
| 28 | (hcover : K ⊆ ⋃ i, U i) : |
| 29 | ∃ N : ℕ, ∃ c : Fin N → α, ∃ ψ θ : Fin N → M → ℝ, |
| 30 | (∀ i, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (ψ i)) ∧ |
| 31 | (∀ i, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (θ i)) ∧ |
| 32 | (∀ i, HasCompactSupport (ψ i)) ∧ (∀ i, HasCompactSupport (θ i)) ∧ |
| 33 | (∀ i x, 0 ≤ ψ i x ∧ ψ i x ≤ 1) ∧ |
| 34 | (∀ i x, 0 ≤ θ i x ∧ θ i x ≤ 1) ∧ |
| 35 | (∀ i, tsupport (θ i) ⊆ U (c i)) ∧ |
| 36 | (∀ i x, x ∈ tsupport (ψ i) → θ i =ᶠ[𝓝 x] 1) ∧ |
| 37 | ∀ x ∈ K, ∃ i, ψ i =ᶠ[𝓝 x] 1 := by |
| 38 | classical |
| 39 | have hex (x : K) : ∃ i, (x : M) ∈ U i := mem_iUnion.mp (hcover x.property) |
| 40 | choose c hc using hex |
| 41 | have hb (x : K) : ∃ b : SmoothBumpFunction (𝓡 n) (x : M), |
| 42 | tsupport b ⊆ U (c x) := by |
| 43 | obtain ⟨b, -, hb⟩ := (SmoothBumpFunction.nhds_basis_tsupport (I := 𝓡 n) |
| 44 | (x : M)).mem_iff.mp ((hU (c x)).mem_nhds (hc x)) |
| 45 | exact ⟨b, hb⟩ |
| 46 | choose b hb using hb |
| 47 | have hθ (x : K) := exists_contMDiff_cutoff_of_isCompact (n := n) |
| 48 | (b x).hasCompactSupport (hU (c x)) (hb x) |
| 49 | choose θ hθsmooth hθcompact hθsupport hθbounds hθone using hθ |
| 50 | let W : K → Set M := fun x => interior {y | b x y = 1} |
| 51 | have hW (x : K) : (x : M) ∈ W x := |
| 52 | mem_interior_iff_mem_nhds.mpr (b x).eventuallyEq_one |
| 53 | obtain ⟨s, hs⟩ := hK.elim_finite_subcover W (fun _ => isOpen_interior) |
| 54 | (fun x hx => mem_iUnion.mpr ⟨⟨x, hx⟩, hW ⟨x, hx⟩⟩) |
| 55 | let e := (Fintype.equivFin s).symm |
| 56 | refine ⟨Fintype.card s, fun i => c (e i).val, |
| 57 | fun i => b (e i).val, fun i => θ (e i).val, |
| 58 | fun i => (b (e i).val).contMDiff, fun i => hθsmooth (e i).val, |
| 59 | fun i => (b (e i).val).hasCompactSupport, fun i => hθcompact (e i).val, |
| 60 | fun i x => ⟨(b (e i).val).nonneg, (b (e i).val).le_one⟩, |
| 61 | fun i => hθbounds (e i).val, fun i => hθsupport (e i).val, |
| 62 | fun i => hθone (e i).val, ?_⟩ |
| 63 | intro x hx |
| 64 | obtain ⟨i, hi, hxi⟩ := mem_iUnion₂.mp (hs hx) |
| 65 | refine ⟨e.symm ⟨i, hi⟩, ?_⟩ |
| 66 | change ∀ᶠ y in 𝓝 x, b (e (e.symm ⟨i, hi⟩)).val y = 1 |
| 67 | have hei : (e (e.symm ⟨i, hi⟩)).val = i := |
| 68 | congrArg Subtype.val (e.apply_symm_apply ⟨i, hi⟩) |
| 69 | rw [hei] |
| 70 | exact mem_interior_iff_mem_nhds.mp hxi |
| 71 | |
| 72 | omit [T3Space M] [IsManifold (𝓡 n) ∞ M] in |
| 73 | /-- Multiplication by a supported cutoff extends a function smooth only on an |
| 74 | open set to a globally smooth function. -/ |
| 75 | theorem contMDiff_cutoff_mul {U : Set M} (hU : IsOpen U) |
| 76 | {θ f : M → ℝ} (hθ : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ θ) |
| 77 | (hf : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ f U) (hθU : tsupport θ ⊆ U) : |
| 78 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun x => θ x * f x) := by |
| 79 | intro x |
| 80 | by_cases hx : x ∈ tsupport θ |
| 81 | · exact hθ.contMDiffAt.mul (hf.contMDiffAt (hU.mem_nhds (hθU hx))) |
| 82 | · apply (contMDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq |
| 83 | filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hx] with y hy |
| 84 | simp only [Pi.zero_apply] at hy |
| 85 | simp only [hy, zero_mul] |
| 86 | |
| 87 | omit [T3Space M] [IsManifold (𝓡 n) ∞ M] in |
| 88 | /-- A cutoff extension agrees locally with the original function wherever the |
| 89 | cutoff is one. The constant background can be chosen above a reference function. -/ |
| 90 | theorem contMDiff_cutoff_extension {U : Set M} (hU : IsOpen U) |
| 91 | {θ f : M → ℝ} (hθ : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ θ) |
| 92 | (hf : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ f U) (hθU : tsupport θ ⊆ U) |
| 93 | (Q : ℝ) : |
| 94 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun x => θ x * f x + (1 - θ x) * Q) := |
| 95 | (contMDiff_cutoff_mul hU hθ hf hθU).add |
| 96 | ((contMDiff_const.sub hθ).mul contMDiff_const) |
| 97 | |
| 98 | end PoincareMT |