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/DuhamelRepresentation.lean |
| 5 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 6 | Changes: Imports, module paths, and namespaces were adapted to the subject-organized PoincareLib library. The local file extracts a subset of the upstream development. |
| 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.FrozenEvolution |
| 13 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.LowerDerivatives |
| 14 | |
| 15 | /-! |
| 16 | # Duhamel identity with zero initial data |
| 17 | |
| 18 | Adapted from Chow--Liao--Qin, DuhamelRepresentation.lean, revision |
| 19 | 1b535dd102b94cc42b107cca27059687888f08b3. |
| 20 | Copyright 2026 The DifferentialGeometry contributors. Apache-2.0. |
| 21 | See references/ricci-flow/chow-liao-qin-2026/interior-hessian-reuse.md. |
| 22 | The adaptation changes import paths and namespaces. |
| 23 | -/ |
| 24 | |
| 25 | noncomputable section |
| 26 | |
| 27 | |
| 28 | open Asymptotics Filter Matrix MeasureTheory Real Set |
| 29 | open scoped NNReal RealInnerProductSpace Topology |
| 30 | |
| 31 | namespace Poincare.Parabolic.Interior.Kernel |
| 32 | |
| 33 | |
| 34 | variable {V F : Type*} |
| 35 | [NormedAddCommGroup V] [InnerProductSpace Real V] [FiniteDimensional Real V] |
| 36 | [MeasurableSpace V] [BorelSpace V] [Nontrivial V] |
| 37 | [NormedAddCommGroup F] [NormedSpace Real F] [CompleteSpace F] |
| 38 | |
| 39 | omit [CompleteSpace F] in |
| 40 | theorem heatScaled_integrable (t : Real) |
| 41 | (u : BoundedContinuousFunction V F) (x : V) : |
| 42 | Integrable (fun z : V ↦ baseHeat z • u (x - heatScale t • z)) := by |
| 43 | refine ((baseHeat_int (V := V)).norm.mul_const ‖u‖).mono' ?_ ?_ |
| 44 | · apply Continuous.aestronglyMeasurable |
| 45 | unfold baseHeat heatScale |
| 46 | fun_prop |
| 47 | · filter_upwards with z |
| 48 | rw [norm_smul] |
| 49 | exact mul_le_mul_of_nonneg_left (u.norm_coe_le_norm _) (norm_nonneg _) |
| 50 | |
| 51 | omit [CompleteSpace F] in |
| 52 | theorem heatScaled_add |
| 53 | (t : Real) (u v : BoundedContinuousFunction V F) (x : V) : |
| 54 | heatScaled t (u + v) x = heatScaled t u x + heatScaled t v x := by |
| 55 | unfold heatScaled |
| 56 | rw [← integral_add (heatScaled_integrable t u x) |
| 57 | (heatScaled_integrable t v x)] |
| 58 | apply integral_congr_ae |
| 59 | filter_upwards with z |
| 60 | change baseHeat z • (u (x - heatScale t • z) + |
| 61 | v (x - heatScale t • z)) = _ |
| 62 | rw [smul_add] |
| 63 | |
| 64 | omit [CompleteSpace F] in |
| 65 | theorem heatScaled_sub |
| 66 | (t : Real) (u v : BoundedContinuousFunction V F) (x : V) : |
| 67 | heatScaled t (u - v) x = heatScaled t u x - heatScaled t v x := by |
| 68 | unfold heatScaled |
| 69 | rw [← integral_sub (heatScaled_integrable t u x) |
| 70 | (heatScaled_integrable t v x)] |
| 71 | apply integral_congr_ae |
| 72 | filter_upwards with z |
| 73 | change baseHeat z • (u (x - heatScale t • z) - |
| 74 | v (x - heatScale t • z)) = _ |
| 75 | rw [smul_sub] |
| 76 | |
| 77 | omit [Nontrivial V] [CompleteSpace F] in |
| 78 | theorem heatScaled_smul |
| 79 | (t c : Real) (u : BoundedContinuousFunction V F) (x : V) : |
| 80 | heatScaled t (c • u) x = c • heatScaled t u x := by |
| 81 | unfold heatScaled |
| 82 | rw [← integral_smul] |
| 83 | apply integral_congr_ae |
| 84 | filter_upwards with z |
| 85 | change baseHeat z • (c • u (x - heatScale t • z)) = |
| 86 | c • (baseHeat z • u (x - heatScale t • z)) |
| 87 | exact smul_comm _ _ _ |
| 88 | |
| 89 | omit [Nontrivial V] [CompleteSpace F] in |
| 90 | @[simp] |
| 91 | theorem heatScaled_zero_bcf |
| 92 | (t : Real) (x : V) : |
| 93 | heatScaled t (0 : BoundedContinuousFunction V F) x = 0 := by |
| 94 | have h := heatScaled_smul t 0 |
| 95 | (0 : BoundedContinuousFunction V F) x |
| 96 | simpa only [zero_smul] using h |
| 97 | |
| 98 | omit [CompleteSpace F] in |
| 99 | theorem tendsto_heatScaled_of_tendsto |
| 100 | {A : Type*} {l : Filter A} {q : A → Real} {q₀ : Real} |
| 101 | {u : A → BoundedContinuousFunction V F} |
| 102 | {u₀ : BoundedContinuousFunction V F} |
| 103 | (hq : Tendsto q l (nhds q₀)) (hu : Tendsto u l (nhds u₀)) (x : V) : |
| 104 | Tendsto (fun a ↦ heatScaled (q a) (u a) x) l |
| 105 | (nhds (heatScaled q₀ u₀ x)) := by |
| 106 | have hdiff : Tendsto (fun a ↦ u a - u₀) l (nhds 0) := by |
| 107 | simpa only [sub_self] using hu.sub |
| 108 | (tendsto_const_nhds : Tendsto (fun _ : A ↦ u₀) l (nhds u₀)) |
| 109 | have hnorm : Tendsto (fun a ↦ ‖u a - u₀‖) l (nhds 0) := by |
| 110 | simpa only [norm_zero] using hdiff.norm |
| 111 | have hscaledNorm : Tendsto |
| 112 | (fun a ↦ ‖heatScaled (q a) (u a - u₀) x‖) l (nhds 0) := by |
| 113 | exact squeeze_zero' (Eventually.of_forall fun a ↦ norm_nonneg _) |
| 114 | (Eventually.of_forall fun a ↦ heatScaled_norm _ _ _) hnorm |
| 115 | have hscaledZero : Tendsto |
| 116 | (fun a ↦ heatScaled (q a) (u a - u₀) x) l (nhds 0) := |
| 117 | tendsto_zero_iff_norm_tendsto_zero.mpr hscaledNorm |
| 118 | have hfixed : Tendsto (fun a ↦ heatScaled (q a) u₀ x) l |
| 119 | (nhds (heatScaled q₀ u₀ x)) := |
| 120 | (heatScaled_cont u₀ x).tendsto q₀ |>.comp hq |
| 121 | convert hscaledZero.add hfixed using 1 |
| 122 | · funext a |
| 123 | rw [← heatScaled_add] |
| 124 | congr 2 |
| 125 | abel |
| 126 | · simp only [zero_add] |
| 127 | |
| 128 | omit [CompleteSpace F] in |
| 129 | theorem heatScaled_sub_time_hasDerivAt |
| 130 | {t s : Real} (hst : s < t) |
| 131 | (u dtU : Real → BoundedContinuousFunction V F) |
| 132 | (du : Real → BoundedContinuousFunction V (V →L[Real] F)) |
| 133 | (d2u : Real → |
| 134 | BoundedContinuousFunction V (V →L[Real] V →L[Real] F)) |
| 135 | (huTime : HasDerivAt u (dtU s) s) |
| 136 | (hu : ∀ x, HasFDerivAt (u s : V → F) (du s x) x) |
| 137 | (hdu : ∀ x, HasFDerivAt |
| 138 | (du s : V → V →L[Real] F) (d2u s x) x) |
| 139 | (x : V) : |
| 140 | HasDerivAt (fun r ↦ heatScaled (t - r) (u r) x) |
| 141 | (heatScaled (t - s) (dtU s) x - |
| 142 | heatScaled (t - s) (coreLap (d2u s)) x) s := by |
| 143 | let q : Real → Real := fun r ↦ t - r |
| 144 | let R : Real → BoundedContinuousFunction V F := fun r ↦ |
| 145 | u r - u s - (r - s) • dtU s |
| 146 | let D : Real → F := fun r ↦ |
| 147 | heatScaled (q r) (dtU s) x - heatScaled (q s) (dtU s) x |
| 148 | have hq : HasDerivAt q (-1) s := by |
| 149 | have hraw := (hasDerivAt_const s t).sub (hasDerivAt_id s) |
| 150 | refine (hraw.congr_of_eventuallyEq (Eventually.of_forall fun r ↦ ?_)).congr_deriv ?_ |
| 151 | · rfl |
| 152 | · ring |
| 153 | have htime : HasDerivAt |
| 154 | (fun r ↦ heatScaled (q r) (u s) x) |
| 155 | (-heatScaled (q s) (coreLap (d2u s)) x) s := by |
| 156 | have hpositive : HasDerivAt |
| 157 | (fun z ↦ heatScaled z (u s) x) |
| 158 | (heatScaled (q s) (coreLap (d2u s)) x) (q s) := by |
| 159 | have hraw := heatSup_time (sub_pos.mpr hst) |
| 160 | (u s) (du s) (d2u s) hu hdu x |
| 161 | have heq : (fun z ↦ heatScaled z (u s) x) =ᶠ[nhds (q s)] |
| 162 | fun z ↦ heatSup z (u s) x := by |
| 163 | filter_upwards [Ioi_mem_nhds (sub_pos.mpr hst)] with z hz |
| 164 | exact (heatSup_scaled hz (u s) x).symm |
| 165 | have hconverted := hraw.congr_of_eventuallyEq heq |
| 166 | exact hconverted.congr_deriv |
| 167 | (heatSup_scaled (sub_pos.mpr hst) (coreLap (d2u s)) x) |
| 168 | have hraw := hpositive.scomp s hq |
| 169 | refine (hraw.congr_of_eventuallyEq (Eventually.of_forall fun r ↦ ?_)).congr_deriv ?_ |
| 170 | · rfl |
| 171 | · simp only [neg_one_smul] |
| 172 | have hR : R =o[nhds s] fun r ↦ r - s := by |
| 173 | simpa only [R] using huTime.isLittleO |
| 174 | have hscaledR : (fun r ↦ heatScaled (q r) (R r) x) =o[nhds s] |
| 175 | fun r ↦ r - s := by |
| 176 | apply (IsBigO.of_bound' (Eventually.of_forall fun r ↦ |
| 177 | heatScaled_norm (q r) (R r) x)).trans_isLittleO hR |
| 178 | have hDlim : Tendsto D (nhds s) (nhds 0) := by |
| 179 | have hqTend : Tendsto q (nhds s) (nhds (q s)) := hq.continuousAt |
| 180 | have hheat := (heatScaled_cont (dtU s) x).tendsto (q s) |>.comp hqTend |
| 181 | convert hheat.sub_const (heatScaled (q s) (dtU s) x) using 1 |
| 182 | · rfl |
| 183 | · simp only [sub_self] |
| 184 | have hDo : D =o[nhds s] fun _ ↦ (1 : Real) := |
| 185 | (isLittleO_one_iff Real).mpr hDlim |
| 186 | have hcross : (fun r ↦ (r - s) • D r) =o[nhds s] |
| 187 | fun r ↦ r - s := by |
| 188 | simpa only [smul_eq_mul, mul_one] using |
| 189 | (isBigO_refl (fun r ↦ r - s) (nhds s)).smul_isLittleO hDo |
| 190 | apply HasDerivAt.of_isLittleO |
| 191 | have hsum := htime.isLittleO.add (hscaledR.add hcross) |
| 192 | apply hsum.congr' |
| 193 | · apply Eventually.of_forall |
| 194 | intro r |
| 195 | have hRscaled : heatScaled (q r) (R r) x = |
| 196 | heatScaled (q r) (u r) x - heatScaled (q r) (u s) x - |
| 197 | (r - s) • heatScaled (q r) (dtU s) x := by |
| 198 | dsimp only [R] |
| 199 | rw [heatScaled_sub, heatScaled_sub, heatScaled_smul] |
| 200 | change |
| 201 | heatScaled (q r) (u s) x - heatScaled (q s) (u s) x - |
| 202 | (r - s) • (-heatScaled (q s) (coreLap (d2u s)) x) + |
| 203 | (heatScaled (q r) (R r) x + (r - s) • D r) = |
| 204 | heatScaled (t - r) (u r) x - heatScaled (t - s) (u s) x - |
| 205 | (r - s) • (heatScaled (t - s) (dtU s) x - |
| 206 | heatScaled (t - s) (coreLap (d2u s)) x) |
| 207 | rw [hRscaled] |
| 208 | dsimp only [D, q] |
| 209 | simp only [smul_sub, smul_neg] |
| 210 | abel |
| 211 | · exact Eventually.of_forall fun _ ↦ rfl |
| 212 | |
| 213 | theorem heatDuh_eq_of_zero_initial |
| 214 | {t : Real} (ht : 0 < t) |
| 215 | (u dtU : Real → BoundedContinuousFunction V F) |
| 216 | (du : Real → BoundedContinuousFunction V (V →L[Real] F)) |
| 217 | (d2u : Real → |
| 218 | BoundedContinuousFunction V (V →L[Real] V →L[Real] F)) |
| 219 | (huTime : ∀ s ∈ Ioo (0 : Real) t, HasDerivAt u (dtU s) s) |
| 220 | (hu : ∀ s ∈ Ioo (0 : Real) t, ∀ x, |
| 221 | HasFDerivAt (u s : V → F) (du s x) x) |
| 222 | (hdu : ∀ s ∈ Ioo (0 : Real) t, ∀ x, |
| 223 | HasFDerivAt (du s : V → V →L[Real] F) (d2u s x) x) |
| 224 | (huCont : Continuous u) (hu0 : u 0 = 0) |
| 225 | (x : V) |
| 226 | (hint : IntervalIntegrable |
| 227 | (fun s ↦ heatScaled (t - s) (dtU s - coreLap (d2u s)) x) |
| 228 | volume 0 t) : |
| 229 | heatDuh t (fun s ↦ dtU s - coreLap (d2u s)) x = u t x := by |
| 230 | let source : Real → BoundedContinuousFunction V F := |
| 231 | fun s ↦ dtU s - coreLap (d2u s) |
| 232 | let w : Real → F := fun s ↦ heatScaled (t - s) (u s) x |
| 233 | have hwderiv : ∀ s ∈ Ioo (0 : Real) t, |
| 234 | HasDerivAt w (heatScaled (t - s) (source s) x) s := by |
| 235 | intro s hs |
| 236 | have h := heatScaled_sub_time_hasDerivAt hs.2 u dtU du d2u |
| 237 | (huTime s hs) (hu s hs) (hdu s hs) x |
| 238 | simpa only [w, source, heatScaled_sub] using h |
| 239 | have hleft : Tendsto w (nhdsWithin 0 (Ioi 0)) (nhds 0) := by |
| 240 | have hq : Tendsto (fun s : Real ↦ t - s) (nhdsWithin 0 (Ioi 0)) |
| 241 | (nhds t) := by |
| 242 | have hc : ContinuousAt (fun s : Real ↦ t - s) 0 := |
| 243 | continuousAt_const.sub continuousAt_id |
| 244 | simpa only [sub_zero] using hc.tendsto.mono_left nhdsWithin_le_nhds |
| 245 | have huT : Tendsto u (nhdsWithin 0 (Ioi 0)) (nhds (u 0)) := |
| 246 | huCont.continuousAt.tendsto.mono_left nhdsWithin_le_nhds |
| 247 | have h := tendsto_heatScaled_of_tendsto hq huT x |
| 248 | simpa only [w, hu0, heatScaled_zero_bcf] using h |
| 249 | have hright : Tendsto w (nhdsWithin t (Iio t)) (nhds (u t x)) := by |
| 250 | have hq : Tendsto (fun s : Real ↦ t - s) (nhdsWithin t (Iio t)) |
| 251 | (nhds 0) := by |
| 252 | have hc : ContinuousAt (fun s : Real ↦ t - s) t := |
| 253 | continuousAt_const.sub continuousAt_id |
| 254 | simpa only [sub_self] using hc.tendsto.mono_left nhdsWithin_le_nhds |
| 255 | have huT : Tendsto u (nhdsWithin t (Iio t)) (nhds (u t)) := |
| 256 | huCont.continuousAt.tendsto.mono_left nhdsWithin_le_nhds |
| 257 | have h := tendsto_heatScaled_of_tendsto hq huT x |
| 258 | simpa only [w, heatScaled_zero] using h |
| 259 | have hftc := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_tendsto |
| 260 | ht hwderiv (by simpa only [source] using hint) hleft hright |
| 261 | unfold heatDuh |
| 262 | rw [show (∫ s : Real in 0..t, heatSup (t - s) (source s) x) = |
| 263 | ∫ s : Real in 0..t, heatScaled (t - s) (source s) x by |
| 264 | apply intervalIntegral.integral_congr_ae |
| 265 | have hne : ∀ᵐ s ∂(volume : Measure Real), s ≠ t := by |
| 266 | simp [ae_iff, measure_singleton] |
| 267 | filter_upwards [hne] with s hst |
| 268 | intro hs |
| 269 | rw [uIoc_of_le ht.le] at hs |
| 270 | exact heatSup_scaled (sub_pos.mpr (lt_of_le_of_ne hs.2 hst)) |
| 271 | (source s) x] |
| 272 | simpa only [source, sub_zero] using hftc |
| 273 | |
| 274 | end Poincare.Parabolic.Interior.Kernel |