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 | /- |
| 2 | Provenance and modification notice (recorded 2026-09-29). |
| 3 | Source: https://github.com/qinz1yang/differential-geometry |
| 4 | DifferentialGeometry/Analysis/Parabolic/Euclidean/HeatKernelPDE.lean |
| 5 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 6 | Changes: Imports, module paths, and namespaces were adapted to the subject-organized PoincareLib library. |
| 7 | License: Apache-2.0. Source licenses and notices are retained under |
| 8 | PoincareConjecture/provenance/2026-09-29/licenses/. |
| 9 | See PoincareConjecture/MODIFICATIONS.md for the reviewed source mapping. |
| 10 | -/ |
| 11 | |
| 12 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.Gaussian |
| 13 | |
| 14 | /-! |
| 15 | # Interior heat kernel: Evolution |
| 16 | |
| 17 | Adapted from Chow--Liao--Qin, HeatKernelPDE.lean, revision |
| 18 | 1b535dd102b94cc42b107cca27059687888f08b3. |
| 19 | Copyright 2026 The DifferentialGeometry contributors. Apache-2.0. |
| 20 | See references/ricci-flow/chow-liao-qin-2026/interior-hessian-reuse.md. |
| 21 | The adaptation changes import paths and namespaces. |
| 22 | -/ |
| 23 | |
| 24 | noncomputable section |
| 25 | |
| 26 | |
| 27 | open Real |
| 28 | open scoped RealInnerProductSpace |
| 29 | |
| 30 | namespace Poincare.Parabolic.Interior.Kernel |
| 31 | |
| 32 | section PointwiseEquation |
| 33 | |
| 34 | variable {V : Type*} |
| 35 | [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] |
| 36 | [Nontrivial V] |
| 37 | |
| 38 | def heatDt (t : ℝ) (x : V) : ℝ := |
| 39 | let r := heatScale t |
| 40 | let n := Module.finrank ℝ V |
| 41 | let z := r⁻¹ • x |
| 42 | (r ^ n)⁻¹ * t⁻¹ * |
| 43 | ((4 : ℝ)⁻¹ * ‖z‖ ^ 2 - (n : ℝ) / 2) * baseHeat z |
| 44 | |
| 45 | omit [Nontrivial V] in |
| 46 | theorem sum_baseD2 (x : V) : |
| 47 | (∑ i : Fin (Module.finrank ℝ V), |
| 48 | baseD2 ((stdOrthonormalBasis ℝ V) i) |
| 49 | ((stdOrthonormalBasis ℝ V) i) x) = |
| 50 | ((4 : ℝ)⁻¹ * ‖x‖ ^ 2 - (Module.finrank ℝ V : ℝ) / 2) * baseHeat x := by |
| 51 | let b := stdOrthonormalBasis ℝ V |
| 52 | change (∑ i : Fin (Module.finrank ℝ V), baseD2 (b i) (b i) x) = _ |
| 53 | unfold baseD2 |
| 54 | rw [← Finset.sum_mul] |
| 55 | simp_rw [b.inner_eq_ite, if_pos] |
| 56 | rw [Finset.sum_sub_distrib] |
| 57 | simp_rw [mul_assoc, ← pow_two] |
| 58 | rw [← Finset.mul_sum, b.sum_sq_inner_left] |
| 59 | simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] |
| 60 | ring |
| 61 | |
| 62 | omit [Nontrivial V] in |
| 63 | theorem heatDt_eq_trace {t : ℝ} (ht : 0 < t) (x : V) : |
| 64 | heatDt t x = |
| 65 | ∑ i : Fin (Module.finrank ℝ V), |
| 66 | heatD2 t ((stdOrthonormalBasis ℝ V) i) |
| 67 | ((stdOrthonormalBasis ℝ V) i) x := by |
| 68 | have hr : heatScale t ≠ 0 := (heatScale_pos ht).ne' |
| 69 | have hsquare : heatScale t ^ 2 = t := by |
| 70 | simpa [heatScale] using Real.sq_sqrt ht.le |
| 71 | have hscale : (heatScale t)⁻¹ * (heatScale t)⁻¹ = t⁻¹ := by |
| 72 | field_simp [hr, ht.ne'] |
| 73 | nlinarith [hsquare] |
| 74 | simp only [heatD2] |
| 75 | rw [← Finset.mul_sum, sum_baseD2] |
| 76 | unfold heatDt |
| 77 | rw [← hscale] |
| 78 | ring |
| 79 | |
| 80 | theorem heatKernel_time {t : ℝ} (ht : 0 < t) (x : V) : |
| 81 | HasDerivAt (fun s : ℝ => heatKernel s x) (heatDt t x) t := by |
| 82 | let n := Module.finrank ℝ V |
| 83 | let r := heatScale t |
| 84 | let z := r⁻¹ • x |
| 85 | have hr : 0 < r := by |
| 86 | simpa only [r] using heatScale_pos ht |
| 87 | have hrsq : r ^ 2 = t := by |
| 88 | simpa only [r, heatScale] using Real.sq_sqrt ht.le |
| 89 | have hn : 0 < n := by |
| 90 | simpa only [n] using (Module.finrank_pos : 0 < Module.finrank ℝ V) |
| 91 | have hscale : HasDerivAt heatScale (1 / (2 * r)) t := by |
| 92 | change HasDerivAt (fun s : ℝ => Real.sqrt s) (1 / (2 * Real.sqrt t)) t |
| 93 | exact Real.hasDerivAt_sqrt ht.ne' |
| 94 | have hcoeff0 := (hscale.fun_pow n).inv (pow_ne_zero n hr.ne') |
| 95 | change HasDerivAt (fun s : ℝ => ((heatScale s) ^ n)⁻¹) |
| 96 | (-((n : ℝ) * r ^ (n - 1) * (1 / (2 * r))) / (r ^ n) ^ 2) t at hcoeff0 |
| 97 | have hcoeff : |
| 98 | HasDerivAt (fun s : ℝ => ((heatScale s) ^ n)⁻¹) |
| 99 | (-((n : ℝ) / (2 * t)) * (r ^ n)⁻¹) t := by |
| 100 | convert hcoeff0 using 1 |
| 101 | rw [← hrsq] |
| 102 | obtain ⟨m, hm⟩ := Nat.exists_eq_succ_of_ne_zero hn.ne' |
| 103 | rw [hm] |
| 104 | simp only [Nat.cast_succ, Nat.succ_sub_one, pow_succ] |
| 105 | field_simp [hr.ne'] |
| 106 | have hz0 := (hscale.inv hr.ne').smul_const x |
| 107 | change HasDerivAt (fun s : ℝ => (heatScale s)⁻¹ • x) |
| 108 | ((-(1 / (2 * r)) / r ^ 2) • x) t at hz0 |
| 109 | have hz : HasDerivAt (fun s : ℝ => (heatScale s)⁻¹ • x) |
| 110 | ((-(2 * t)⁻¹) • z) t := by |
| 111 | convert hz0 using 1 |
| 112 | simp only [z, smul_smul] |
| 113 | congr 1 |
| 114 | rw [← hrsq] |
| 115 | field_simp [hr.ne'] |
| 116 | have hbase : HasDerivAt (fun s : ℝ => baseHeat ((heatScale s)⁻¹ • x)) |
| 117 | (baseD1Map z ((-(2 * t)⁻¹) • z)) t := by |
| 118 | exact (baseHeat_hasFDeriv z).comp_hasDerivAt t hz |
| 119 | have hprod := hcoeff.mul hbase |
| 120 | have hder : |
| 121 | -((n : ℝ) / (2 * t)) * (r ^ n)⁻¹ * baseHeat z + |
| 122 | (r ^ n)⁻¹ * baseD1Map z ((-(2 * t)⁻¹) • z) = heatDt t x := by |
| 123 | unfold heatDt |
| 124 | simp only [n, r, z, baseD1Map, smul_apply, |
| 125 | innerSL_apply_apply, real_inner_smul_right, real_inner_self_eq_norm_sq, |
| 126 | smul_eq_mul] |
| 127 | field_simp [ht.ne'] |
| 128 | ring |
| 129 | change HasDerivAt |
| 130 | ((fun s : ℝ => ((heatScale s) ^ n)⁻¹) * |
| 131 | fun s => baseHeat ((heatScale s)⁻¹ • x)) (heatDt t x) t |
| 132 | rw [← hder] |
| 133 | exact hprod |
| 134 | |
| 135 | theorem heatKernel_heatEq {t : ℝ} (ht : 0 < t) (x : V) : |
| 136 | HasDerivAt (fun s : ℝ => heatKernel s x) |
| 137 | (∑ i : Fin (Module.finrank ℝ V), |
| 138 | heatD2 t ((stdOrthonormalBasis ℝ V) i) |
| 139 | ((stdOrthonormalBasis ℝ V) i) x) t := by |
| 140 | rw [← heatDt_eq_trace ht x] |
| 141 | exact heatKernel_time ht x |
| 142 | |
| 143 | end PointwiseEquation |
| 144 | |
| 145 | end Poincare.Parabolic.Interior.Kernel |