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.Analysis.Calculus.ContDiff.Comp |
| 3 | import Mathlib.Analysis.Normed.Operator.NormedSpace |
| 4 | |
| 5 | /-! |
| 6 | # Uniform actual partial derivative bounds |
| 7 | |
| 8 | Compact support and C2 regularity give globally bounded and Lipschitz |
| 9 | first partial derivatives, uniformly in the parameter. |
| 10 | MT2007 Claim 19.1, p. 437; |
| 11 | `2026-09-21-compact-partial-derivative-bounds.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | namespace PoincareMT.M63 |
| 17 | |
| 18 | /-- The actual second-factor partial derivative of a compactly supported |
| 19 | C2 map has uniform bounds and is Lipschitz in that factor. MT2007 |
| 20 | Claim 19.1, p. 437; compact partial derivative derivation. The normed |
| 21 | spaces have independent universes and need not be complete. -/ |
| 22 | theorem exists_uniform_partial_derivative_bounds |
| 23 | {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 24 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 25 | [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 26 | {f : E × F → G} (hf : ContDiff ℝ 2 f) (hc : HasCompactSupport f) : |
| 27 | let f1 := fun p z => (fderiv ℝ f (p, z)).comp (ContinuousLinearMap.inr ℝ E F) |
| 28 | Continuous (Function.uncurry f1) ∧ ∃ A B : NNReal, |
| 29 | (∀ p z, HasFDerivAt (fun y => f (p, y)) (f1 p z) z ∧ ‖f1 p z‖ ≤ A) ∧ |
| 30 | ∀ p, LipschitzWith B (f1 p) := by |
| 31 | let I := ContinuousLinearMap.inr ℝ E F |
| 32 | have hI : ‖I‖ ≤ 1 := ContinuousLinearMap.norm_inr_le_one ℝ E F |
| 33 | have hdf : ContDiff ℝ 1 (fderiv ℝ f) := hf.fderiv_right (by norm_num) |
| 34 | obtain ⟨C, hC⟩ := (hc.fderiv ℝ).exists_bound_of_continuous hdf.continuous |
| 35 | obtain ⟨B, hB⟩ := ContDiff.lipschitzWith_of_hasCompactSupport (hc.fderiv ℝ) hdf (by norm_num) |
| 36 | let A : NNReal := ⟨max C 0, le_max_right _ _⟩ |
| 37 | refine ⟨hdf.continuous.clm_comp continuous_const, A, B, ?_, ?_⟩ |
| 38 | · intro p z |
| 39 | refine ⟨?_, ?_⟩ |
| 40 | · have hprod : (0 : F →L[ℝ] E).prod (ContinuousLinearMap.id ℝ F) = I := by |
| 41 | ext y <;> rfl |
| 42 | simpa only [Function.comp_def, hprod] using |
| 43 | (hf.differentiable (by norm_num) (p, z)).hasFDerivAt.comp z |
| 44 | ((hasFDerivAt_const p z).prodMk (hasFDerivAt_id z)) |
| 45 | · calc |
| 46 | ‖(fderiv ℝ f (p, z)).comp I‖ ≤ ‖fderiv ℝ f (p, z)‖ * ‖I‖ := |
| 47 | (fderiv ℝ f (p, z)).opNorm_comp_le I |
| 48 | _ ≤ ‖fderiv ℝ f (p, z)‖ := by simpa using mul_le_mul_of_nonneg_left hI (norm_nonneg _) |
| 49 | _ ≤ (A : ℝ) := (hC (p, z)).trans (le_max_left _ _) |
| 50 | · intro p |
| 51 | apply LipschitzWith.of_dist_le_mul |
| 52 | intro z w |
| 53 | have hdist : dist (p, z) (p, w) = dist z w := by |
| 54 | change max (dist p p) (dist z w) = dist z w |
| 55 | simp only [dist_self, max_eq_right dist_nonneg] |
| 56 | rw [dist_eq_norm, ← ContinuousLinearMap.sub_comp] |
| 57 | calc |
| 58 | _ ≤ ‖fderiv ℝ f (p, z) - fderiv ℝ f (p, w)‖ * ‖I‖ := |
| 59 | (fderiv ℝ f (p, z) - fderiv ℝ f (p, w)).opNorm_comp_le I |
| 60 | _ ≤ ‖fderiv ℝ f (p, z) - fderiv ℝ f (p, w)‖ := by |
| 61 | simpa using mul_le_mul_of_nonneg_left hI (norm_nonneg _) |
| 62 | _ ≤ (B : ℝ) * dist z w := by |
| 63 | simpa only [hdist, dist_eq_norm] using hB.dist_le_mul (p, z) (p, w) |
| 64 | |
| 65 | end PoincareMT.M63 |