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.Operations |
| 2 | import Mathlib.Analysis.Calculus.FDeriv.Equiv |
| 3 | import Mathlib.Analysis.InnerProductSpace.PiL2 |
| 4 | import Mathlib.Tactic.FieldSimp |
| 5 | import Mathlib.Tactic.Positivity |
| 6 | import Mathlib.Tactic.Ring |
| 7 | |
| 8 | /-! |
| 9 | # Spatial rescaling of the heat equation |
| 10 | |
| 11 | Rescaling space by a fixed positive radius leaves time unchanged and divides |
| 12 | the principal coefficients by its square. This reduces a uniform harmonic |
| 13 | coordinate ball to the fixed cylinder used by an interior estimate. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option maxSynthPendingDepth 8 |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open scoped ContDiff |
| 21 | |
| 22 | namespace Poincare.Parabolic |
| 23 | |
| 24 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 25 | |
| 26 | /-- Second derivatives under a scalar change of spatial variables. -/ |
| 27 | lemma fderiv_fderiv_comp_smul (f : E → ℝ) (r : ℝ) (x : E) : |
| 28 | fderiv ℝ (fderiv ℝ (fun y ↦ f (r • y))) x = |
| 29 | r ^ 2 • fderiv ℝ (fderiv ℝ f) (r • x) := by |
| 30 | have h : fderiv ℝ (fun y ↦ f (r • y)) = |
| 31 | r • (fun y ↦ fderiv ℝ f (r • y)) := by |
| 32 | funext y |
| 33 | exact fderiv_comp_smul r |
| 34 | rw [h, fderiv_const_smul_field] |
| 35 | simp only [Pi.smul_apply, fderiv_comp_smul, smul_smul, pow_two] |
| 36 | |
| 37 | /-- A second derivative estimate on the fixed ball returns to the original |
| 38 | spatial scale with the reciprocal square factor. -/ |
| 39 | lemma norm_fderiv_fderiv_le_of_rescaled (f : E → ℝ) {r B : ℝ} (hr : 0 < r) |
| 40 | (hbound : ‖fderiv ℝ (fderiv ℝ (fun y ↦ f (r • y))) 0‖ ≤ B) : |
| 41 | ‖fderiv ℝ (fderiv ℝ f) 0‖ ≤ B / r ^ 2 := by |
| 42 | rw [fderiv_fderiv_comp_smul, smul_zero, norm_smul, Real.norm_eq_abs, |
| 43 | abs_of_nonneg (sq_nonneg _)] at hbound |
| 44 | apply (le_div_iff₀ (sq_pos_of_pos hr)).mpr |
| 45 | simpa only [mul_comm] using hbound |
| 46 | |
| 47 | /-- A positive spatial dilation takes the fixed ball into the corresponding |
| 48 | radius-dependent coordinate ball. -/ |
| 49 | lemma smul_mem_ball (x : E) {r R : ℝ} (hr : 0 < r) (hx : x ∈ Metric.ball 0 R) : |
| 50 | r • x ∈ Metric.ball 0 (r * R) := by |
| 51 | simp only [Metric.mem_ball, dist_zero_right, norm_smul, Real.norm_eq_abs, |
| 52 | abs_of_pos hr] at hx ⊢ |
| 53 | exact mul_lt_mul_of_pos_left hx hr |
| 54 | |
| 55 | /-- The fixed-cylinder rescaling preserves joint smoothness. -/ |
| 56 | lemma contDiffOn_spatially_rescaled {f : E → ℝ → ℝ} {r R : ℝ} (hr : 0 < r) |
| 57 | (hf : ContDiffOn ℝ ∞ (fun z : E × ℝ ↦ f z.1 z.2) |
| 58 | (Metric.ball 0 (r * R) ×ˢ Set.Ioi 0)) : |
| 59 | ContDiffOn ℝ ∞ (fun z : E × ℝ ↦ f (r • z.1) z.2) |
| 60 | (Metric.ball 0 R ×ˢ Set.Ioi 0) := by |
| 61 | have hmap : ContDiffOn ℝ ∞ (fun z : E × ℝ ↦ (r • z.1, z.2)) |
| 62 | (Metric.ball 0 R ×ˢ Set.Ioi 0) := |
| 63 | (contDiffOn_fst.const_smul r).prodMk contDiffOn_snd |
| 64 | exact hf.comp hmap (fun z hz ↦ ⟨smul_mem_ball z.1 hr hz.1, hz.2⟩) |
| 65 | |
| 66 | /-- Spatial rescaling preserves the nondivergence heat equation with the |
| 67 | principal coefficients divided by the radius squared. -/ |
| 68 | lemma hasDerivAt_spatially_rescaled_heat {n : ℕ} |
| 69 | (f : EuclideanSpace ℝ (Fin n) → ℝ → ℝ) |
| 70 | (a : EuclideanSpace ℝ (Fin n) → Fin n → Fin n → ℝ) |
| 71 | {r t : ℝ} (hr : r ≠ 0) (x : EuclideanSpace ℝ (Fin n)) |
| 72 | (hheat : HasDerivAt (fun s ↦ f (r • x) s) |
| 73 | (∑ i, ∑ j, a (r • x) i j * fderiv ℝ (fderiv ℝ (fun y ↦ f y t)) (r • x) |
| 74 | (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 75 | (EuclideanSpace.basisFun (Fin n) ℝ j)) t) : |
| 76 | HasDerivAt (fun s ↦ f (r • x) s) |
| 77 | (∑ i, ∑ j, (a (r • x) i j / r ^ 2) * |
| 78 | fderiv ℝ (fderiv ℝ (fun y ↦ f (r • y) t)) x |
| 79 | (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 80 | (EuclideanSpace.basisFun (Fin n) ℝ j)) t := by |
| 81 | convert hheat using 1 |
| 82 | rw [fderiv_fderiv_comp_smul (fun y ↦ f y t) r x] |
| 83 | apply Finset.sum_congr rfl |
| 84 | intro i _ |
| 85 | apply Finset.sum_congr rfl |
| 86 | intro j _ |
| 87 | simp only [smul_apply, smul_eq_mul] |
| 88 | field_simp |
| 89 | |
| 90 | end Poincare.Parabolic |