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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Analysis.Calculus.Diffeomorphism.Perturbation |
| 3 | import Mathlib.Topology.UniformSpace.HeineCantor |
| 4 | |
| 5 | /-! |
| 6 | # Small compactly supported displacement families |
| 7 | |
| 8 | Hirsch, Differential Topology, Chapter 8, Section 1, Theorem 1.3 and proof, |
| 9 | pp. 179-180. This is the finite-displacement implementation of its compact |
| 10 | ambient extension step. Joint smoothness, a fixed compact support, and |
| 11 | zero displacement at the base time produce the small derivative estimate; |
| 12 | the checked M07 perturbation theorem then constructs the ambient maps. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped ContDiff Topology NNReal |
| 19 | |
| 20 | namespace PoincareMT.M28 |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 23 | |
| 24 | /-- Compact support promotes the local parameter limit of the spatial |
| 25 | derivative to a global small-displacement diffeomorphism (Hirsch 8.1.3, |
| 26 | pp. 179-180, in the finite-displacement implementation). -/ |
| 27 | theorem eventually_exists_smooth_homeomorph_of_compact_displacement |
| 28 | {D : ℝ × E → E} (hD : ContDiff ℝ ∞ D) |
| 29 | {K : Set E} (hK : IsCompact K) |
| 30 | (hsupport : ∀ t : ℝ, tsupport (fun x => D (t, x)) ⊆ K) |
| 31 | {t₀ : ℝ} (hzero : ∀ x : E, D (t₀, x) = 0) : |
| 32 | ∀ᶠ t in 𝓝 t₀, ∃ e : E ≃ₜ E, |
| 33 | (e : E → E) = (fun x => x + D (t, x)) ∧ |
| 34 | ContDiff ℝ ∞ e ∧ ContDiff ℝ ∞ e.symm ∧ |
| 35 | ∀ x : E, x ∉ K → e x = x := by |
| 36 | have hsection (t : ℝ) : ContDiff ℝ ∞ (fun x : E => D (t, x)) := |
| 37 | hD.comp (contDiff_const.prodMk contDiff_id) |
| 38 | have hjoint : ContDiff ℝ ∞ |
| 39 | (fun p : (ℝ × E) × E => D (p.1.1, p.2)) := |
| 40 | hD.comp (contDiff_fst.fst.prodMk contDiff_snd) |
| 41 | have hderiv : Continuous |
| 42 | (fun p : ℝ × E => fderiv ℝ (fun x => D (p.1, x)) p.2) := |
| 43 | (hjoint.fderiv (n := ∞) contDiff_snd (by simp)).continuous |
| 44 | have hderiv_zero (x : E) : fderiv ℝ (fun y => D (t₀, y)) x = 0 := by |
| 45 | have hz : (fun y => D (t₀, y)) = (fun _ : E => (0 : E)) := funext hzero |
| 46 | rw [hz, fderiv_const_apply] |
| 47 | obtain ⟨V, hV, hclose⟩ := hK.mem_uniformity_of_prod |
| 48 | (f := fun t x => fderiv ℝ (fun y => D (t, y)) x) |
| 49 | (s := (univ : Set ℝ)) hderiv.continuousOn (mem_univ t₀) |
| 50 | (Metric.dist_mem_uniformity (by norm_num : (0 : ℝ) < 1 / 2)) |
| 51 | have hV' : V ∈ 𝓝 t₀ := by simpa only [nhdsWithin_univ] using hV |
| 52 | filter_upwards [hV'] with t ht |
| 53 | have hsmall (x : E) : ‖fderiv ℝ (fun y => D (t, y)) x‖ ≤ (1 / 2 : ℝ) := by |
| 54 | by_cases hx : x ∈ K |
| 55 | · have hbound := hclose t ht x hx |
| 56 | change dist (fderiv ℝ (fun y => D (t, y)) x) |
| 57 | (fderiv ℝ (fun y => D (t₀, y)) x) < (1 / 2 : ℝ) at hbound |
| 58 | rw [hderiv_zero, dist_zero_right] at hbound |
| 59 | exact hbound.le |
| 60 | · rw [fderiv_of_notMem_tsupport ℝ (f := fun y => D (t, y)) |
| 61 | (fun h => hx (hsupport t h)), norm_zero] |
| 62 | norm_num |
| 63 | have hf : ContDiff ℝ ∞ (fun x : E => x + D (t, x)) := |
| 64 | contDiff_id.add (hsection t) |
| 65 | have hfclose (x : E) : |
| 66 | ‖fderiv ℝ (fun y : E => y + D (t, y)) x - ContinuousLinearMap.id ℝ E‖ ≤ |
| 67 | (1 / 2 : ℝ≥0) := by |
| 68 | have hd : fderiv ℝ (fun y : E => y + D (t, y)) x = |
| 69 | ContinuousLinearMap.id ℝ E + fderiv ℝ (fun y => D (t, y)) x := |
| 70 | ((hasFDerivAt_id x).add |
| 71 | (((hsection t).differentiable (by simp) x).hasFDerivAt)).fderiv |
| 72 | rw [hd, add_sub_cancel_left] |
| 73 | simpa using hsmall x |
| 74 | obtain ⟨e, he, hes, hei⟩ := |
| 75 | Poincare.Analysis.Calculus.exists_smooth_homeomorph_of_fderiv_close_id |
| 76 | hf (by norm_num : (1 / 2 : ℝ≥0) < 1) hfclose |
| 77 | refine ⟨e, he, hes, hei, ?_⟩ |
| 78 | intro x hx |
| 79 | have hz : D (t, x) = 0 := |
| 80 | image_eq_zero_of_notMem_tsupport (f := fun y => D (t, y)) |
| 81 | (fun h => hx (hsupport t h)) |
| 82 | change (e : E → E) x = x |
| 83 | rw [he] |
| 84 | change x + D (t, x) = x |
| 85 | rw [hz, add_zero] |
| 86 | |
| 87 | end PoincareMT.M28 |