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.Complex.CoveringMap |
| 2 | import Mathlib.Analysis.Convex.Contractible |
| 3 | import Mathlib.Topology.Homotopy.Lifting |
| 4 | |
| 5 | /-! |
| 6 | # Smooth lifts through the complex exponential |
| 7 | |
| 8 | A continuous logarithm of a smooth nonvanishing function is smooth. On a |
| 9 | real vector space the covering-space lifting theorem supplies such a |
| 10 | logarithm with a prescribed value at one point. This is the lifting step |
| 11 | in Smale, Diffeomorphisms of the 2-sphere (1959), Lemma 1, p. 622. |
| 12 | -/ |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace Poincare.Complex |
| 18 | |
| 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | |
| 21 | /-- A continuous lift through the exponential inherits real smoothness. -/ |
| 22 | theorem contDiff_of_exp_comp {n : WithTop ℕ∞} {f L : E → ℂ} |
| 23 | (hf : ContDiff ℝ n f) (hL : Continuous L) |
| 24 | (hlift : ∀ x, Complex.exp (L x) = f x) : ContDiff ℝ n L := by |
| 25 | rw [contDiff_iff_contDiffAt] |
| 26 | intro x |
| 27 | have hlog : ContDiffAt ℝ n |
| 28 | (fun y => Complex.log (f y / f x) + L x) x := by |
| 29 | have hfx : f x ≠ 0 := hlift x ▸ Complex.exp_ne_zero (L x) |
| 30 | have hslit : f x / f x ∈ Complex.slitPlane := by |
| 31 | simp [div_self hfx] |
| 32 | have hc : ContDiffAt ℝ n Complex.log (f x / f x) := |
| 33 | (Complex.contDiffAt_log hslit).restrict_scalars ℝ |
| 34 | exact (hc.comp x (hf.contDiffAt.div_const (f x))).add contDiffAt_const |
| 35 | apply hlog.congr_of_eventuallyEq |
| 36 | have hsmall : ∀ᶠ y in 𝓝 x, |
| 37 | -Real.pi < (L y - L x).im ∧ (L y - L x).im < Real.pi := by |
| 38 | have hc : Continuous (fun y => (L y - L x).im) := by fun_prop |
| 39 | exact hc.continuousAt (Ioo_mem_nhds (by simpa using Real.pi_pos) |
| 40 | (by simpa using Real.pi_pos)) |
| 41 | filter_upwards [hsmall] with y hy |
| 42 | rw [← hlift y, ← hlift x, ← Complex.exp_sub, |
| 43 | Complex.log_exp hy.1 hy.2.le, sub_add_cancel] |
| 44 | |
| 45 | /-- A smooth nonvanishing function on a real normed vector space has a |
| 46 | smooth logarithm with any compatible prescribed value at one point. -/ |
| 47 | theorem exists_contDiff_logarithm {n : WithTop ℕ∞} {f : E → ℂ} |
| 48 | (hf : ContDiff ℝ n f) (hne : ∀ x, f x ≠ 0) |
| 49 | (x₀ : E) (z₀ : ℂ) (h₀ : Complex.exp z₀ = f x₀) : |
| 50 | ∃ L : E → ℂ, ContDiff ℝ n L ∧ L x₀ = z₀ ∧ |
| 51 | ∀ x, Complex.exp (L x) = f x := by |
| 52 | obtain ⟨L, ⟨hL₀, hL⟩, _⟩ := |
| 53 | Complex.isCoveringMapOn_exp.existsUnique_continuousMap_lifts |
| 54 | ⟨f, hf.continuous⟩ h₀ (by simpa using hne) |
| 55 | have hlift (x : E) : Complex.exp (L x) = f x := congrFun hL x |
| 56 | exact ⟨L, contDiff_of_exp_comp hf L.continuous hlift, hL₀, hlift⟩ |
| 57 | |
| 58 | /-- The logarithm normalized to zero is zero on a preconnected set where |
| 59 | the original function equals one. -/ |
| 60 | theorem exists_contDiff_logarithm_eq_zero {n : WithTop ℕ∞} {f : E → ℂ} |
| 61 | (hf : ContDiff ℝ n f) (hne : ∀ x, f x ≠ 0) |
| 62 | {U : Set E} (hU : IsPreconnected U) (hUne : U.Nonempty) |
| 63 | (hfix : ∀ x ∈ U, f x = 1) : |
| 64 | ∃ L : E → ℂ, ContDiff ℝ n L ∧ (∀ x, Complex.exp (L x) = f x) ∧ |
| 65 | ∀ x ∈ U, L x = 0 := by |
| 66 | obtain ⟨x₀, hx₀⟩ := hUne |
| 67 | obtain ⟨L, hL, hL₀, hlift⟩ := exists_contDiff_logarithm hf hne x₀ 0 |
| 68 | (by simpa using (hfix x₀ hx₀).symm) |
| 69 | refine ⟨L, hL, hlift, ?_⟩ |
| 70 | intro x hx |
| 71 | exact Complex.isCoveringMap_exp.eqOn_of_comp_eqOn hU |
| 72 | hL.continuous.continuousOn continuousOn_const |
| 73 | (fun y hy => Subtype.ext (by simpa [hlift] using hfix y hy)) hx₀ hL₀ hx |
| 74 | |
| 75 | end Poincare.Complex |