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 PoincareLib.Analysis.Parabolic.Interior.CompactRepresentation |
| 2 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.PotentialRealization |
| 3 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.CenteredRealization |
| 4 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.SeparatedEstimate |
| 5 | |
| 6 | /-! |
| 7 | # Spatial derivatives of compact smooth heat potentials |
| 8 | |
| 9 | Compact support bounds all spatial derivatives. Differentiation under the |
| 10 | scaled heat integral therefore gives a direct Hessian realization without |
| 11 | auxiliary Holder constants or measurability hypotheses. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option maxSynthPendingDepth 3 |
| 18 | |
| 19 | open Filter MeasureTheory Set |
| 20 | open scoped ContDiff Topology NNReal |
| 21 | |
| 22 | namespace Poincare.Parabolic.Interior |
| 23 | |
| 24 | variable {V F : Type*} |
| 25 | [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] |
| 26 | [MeasurableSpace V] [BorelSpace V] [Nontrivial V] |
| 27 | [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] |
| 28 | |
| 29 | omit [CompleteSpace F] in |
| 30 | theorem continuous_heatScaled_compactSlice {f : V × ℝ → F} |
| 31 | (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) (t : ℝ) (x : V) : |
| 32 | Continuous (fun s => Kernel.heatScaled (t - s) (compactSlice f hf.continuous hc s) x) := by |
| 33 | apply continuous_iff_continuousAt.mpr |
| 34 | intro s |
| 35 | exact Kernel.tendsto_heatScaled_of_tendsto |
| 36 | (continuous_const.sub continuous_id).continuousAt |
| 37 | (continuous_compactSlice hf hc).continuousAt x |
| 38 | |
| 39 | omit [Nontrivial V] [CompleteSpace F] in |
| 40 | theorem heatDuh_eq_integral_heatScaled {t : ℝ} (ht : 0 < t) |
| 41 | (f : ℝ → BoundedContinuousFunction V F) (x : V) : |
| 42 | Kernel.heatDuh t f x = ∫ s in (0 : ℝ)..t, Kernel.heatScaled (t - s) (f s) x := by |
| 43 | unfold Kernel.heatDuh |
| 44 | apply intervalIntegral.integral_congr_ae |
| 45 | have hne : ∀ᵐ s ∂(volume : Measure ℝ), s ≠ t := by |
| 46 | simp [ae_iff, measure_singleton] |
| 47 | filter_upwards [hne] with s hst |
| 48 | intro hs |
| 49 | rw [uIoc_of_le ht.le] at hs |
| 50 | exact Kernel.heatSup_scaled (sub_pos.mpr (lt_of_le_of_ne hs.2 hst)) (f s) x |
| 51 | |
| 52 | omit [CompleteSpace F] in |
| 53 | theorem hasFDerivAt_heatDuh_compactSlice {f : V × ℝ → F} |
| 54 | (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) {t : ℝ} (ht : 0 < t) (x : V) : |
| 55 | HasFDerivAt (Kernel.heatDuh t (compactSlice f hf.continuous hc)) |
| 56 | (Kernel.heatDuh t (compactSlice (spatialDerivative f) |
| 57 | (contDiff_spatialDerivative hf).continuous (hasCompactSupport_spatialDerivative hc)) x) |
| 58 | x := by |
| 59 | let u := compactSlice f hf.continuous hc |
| 60 | let du := compactSlice (spatialDerivative f) (contDiff_spatialDerivative hf).continuous |
| 61 | (hasCompactSupport_spatialDerivative hc) |
| 62 | obtain ⟨K, hK⟩ := (hasCompactSupport_spatialDerivative hc).exists_bound_of_continuous |
| 63 | (contDiff_spatialDerivative hf).continuous |
| 64 | have hdu (s : ℝ) : ‖du s‖ ≤ max 0 K := by |
| 65 | apply (BoundedContinuousFunction.norm_le (le_max_left 0 K)).mpr |
| 66 | intro y |
| 67 | exact (hK (y, s)).trans (le_max_right 0 K) |
| 68 | have h := intervalIntegral.hasFDerivAt_integral_of_dominated_of_fderiv_le |
| 69 | (F := fun y s => Kernel.heatScaled (t - s) (u s) y) |
| 70 | (F' := fun y s => Kernel.heatScaled (t - s) (du s) y) |
| 71 | (bound := fun _ => max 0 K) (s := (univ : Set V)) (μ := volume) |
| 72 | univ_mem |
| 73 | (Eventually.of_forall fun y => |
| 74 | (continuous_heatScaled_compactSlice hf hc t y).aestronglyMeasurable) |
| 75 | ((continuous_heatScaled_compactSlice hf hc t x).intervalIntegrable 0 t) |
| 76 | (continuous_heatScaled_compactSlice (contDiff_spatialDerivative hf) |
| 77 | (hasCompactSupport_spatialDerivative hc) t x).aestronglyMeasurable |
| 78 | (Eventually.of_forall fun s _ y _ => (Kernel.heatScaled_norm (t - s) (du s) y).trans |
| 79 | (hdu s)) |
| 80 | intervalIntegrable_const |
| 81 | (Eventually.of_forall fun s _ y _ => Kernel.heatScaled_space (t - s) (u s) (du s) |
| 82 | (fun z => hasFDerivAt_spatialSlice (hf.differentiable (by simp)) z s) y) |
| 83 | simpa only [← heatDuh_eq_integral_heatScaled ht, u, du] using h |
| 84 | |
| 85 | omit [CompleteSpace F] in |
| 86 | theorem fderiv_fderiv_heatDuh_compactSlice {f : V × ℝ → F} |
| 87 | (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) {t : ℝ} (ht : 0 < t) (x : V) : |
| 88 | fderiv ℝ (fun y => fderiv ℝ (Kernel.heatDuh t (compactSlice f hf.continuous hc)) y) x = |
| 89 | Kernel.heatDuh t (compactSlice (spatialDerivative (spatialDerivative f)) |
| 90 | (contDiff_spatialDerivative (contDiff_spatialDerivative hf)).continuous |
| 91 | (hasCompactSupport_spatialDerivative (hasCompactSupport_spatialDerivative hc))) x := by |
| 92 | simp only [(hasFDerivAt_heatDuh_compactSlice hf hc ht _).fderiv] |
| 93 | exact (hasFDerivAt_heatDuh_compactSlice (contDiff_spatialDerivative hf) |
| 94 | (hasCompactSupport_spatialDerivative hc) ht x).fderiv |
| 95 | |
| 96 | omit [CompleteSpace F] in |
| 97 | theorem heatSupGradient_eq_heatScaled_derivative {t : ℝ} (ht : 0 < t) |
| 98 | (u : BoundedContinuousFunction V F) (du : BoundedContinuousFunction V (V →L[ℝ] F)) |
| 99 | (hu : ∀ x, HasFDerivAt (u : V → F) (du x) x) (x : V) : |
| 100 | Kernel.heatSupGradient t u x = Kernel.heatScaled t du x := by |
| 101 | have heq : Kernel.heatSup t u = fun y => Kernel.heatScaled t u y := |
| 102 | funext fun y => Kernel.heatSup_scaled ht u y |
| 103 | have h := Kernel.heatSup_hasFDerivAt ht u x |
| 104 | rw [heq] at h |
| 105 | exact h.unique (Kernel.heatScaled_space t u du hu x) |
| 106 | |
| 107 | omit [CompleteSpace F] in |
| 108 | theorem heatSupHessian_eq_heatScaled_derivative {t : ℝ} (ht : 0 < t) |
| 109 | (u : BoundedContinuousFunction V F) (du : BoundedContinuousFunction V (V →L[ℝ] F)) |
| 110 | (ddu : BoundedContinuousFunction V (V →L[ℝ] V →L[ℝ] F)) |
| 111 | (hu : ∀ x, HasFDerivAt (u : V → F) (du x) x) |
| 112 | (hdu : ∀ x, HasFDerivAt (du : V → V →L[ℝ] F) (ddu x) x) (x : V) : |
| 113 | Kernel.heatSupHessian t u x = Kernel.heatScaled t ddu x := by |
| 114 | have heq : Kernel.heatSupGradient t u = fun y => Kernel.heatScaled t du y := |
| 115 | funext fun y => heatSupGradient_eq_heatScaled_derivative ht u du hu y |
| 116 | have h := Kernel.heatSupGradient_hasFDerivAt ht u x |
| 117 | rw [heq] at h |
| 118 | exact h.unique (Kernel.heatScaled_space t du ddu hdu x) |
| 119 | |
| 120 | omit [CompleteSpace F] in |
| 121 | theorem fderiv_fderiv_heatDuh_eq_heatD2Duh {f : V × ℝ → F} |
| 122 | (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) {t : ℝ} (ht : 0 < t) |
| 123 | (x v w : V) : |
| 124 | fderiv ℝ (fun y => fderiv ℝ (Kernel.heatDuh t (compactSlice f hf.continuous hc)) y) |
| 125 | x v w = Kernel.heatD2Duh t w v (fun s y => f (y, s)) x := by |
| 126 | let u := compactSlice f hf.continuous hc |
| 127 | let du := compactSlice (spatialDerivative f) (contDiff_spatialDerivative hf).continuous |
| 128 | (hasCompactSupport_spatialDerivative hc) |
| 129 | let ddu := compactSlice (spatialDerivative (spatialDerivative f)) |
| 130 | (contDiff_spatialDerivative (contDiff_spatialDerivative hf)).continuous |
| 131 | (hasCompactSupport_spatialDerivative (hasCompactSupport_spatialDerivative hc)) |
| 132 | have hcont : Continuous (fun s => Kernel.heatScaled (t - s) (ddu s) x) := |
| 133 | continuous_heatScaled_compactSlice |
| 134 | (contDiff_spatialDerivative (contDiff_spatialDerivative hf)) |
| 135 | (hasCompactSupport_spatialDerivative (hasCompactSupport_spatialDerivative hc)) t x |
| 136 | have hint := hcont.intervalIntegrable (μ := volume) 0 t |
| 137 | rw [fderiv_fderiv_heatDuh_compactSlice hf hc ht, heatDuh_eq_integral_heatScaled ht] |
| 138 | change (∫ s in (0 : ℝ)..t, Kernel.heatScaled (t - s) (ddu s) x) v w = _ |
| 139 | rw [ContinuousLinearMap.intervalIntegral_apply hint v] |
| 140 | rw [ContinuousLinearMap.intervalIntegral_apply |
| 141 | ((hcont.clm_apply continuous_const).intervalIntegrable 0 t) w] |
| 142 | unfold Kernel.heatD2Duh |
| 143 | apply intervalIntegral.integral_congr_ae |
| 144 | have hne : ∀ᵐ s ∂(volume : Measure ℝ), s ≠ t := by |
| 145 | simp [ae_iff, measure_singleton] |
| 146 | filter_upwards [hne] with s hst |
| 147 | intro hs |
| 148 | rw [uIoc_of_le ht.le] at hs |
| 149 | have hpos := sub_pos.mpr (lt_of_le_of_ne hs.2 hst) |
| 150 | rw [← heatSupHessian_eq_heatScaled_derivative hpos (u s) (du s) (ddu s) |
| 151 | (fun y => hasFDerivAt_spatialSlice (hf.differentiable (by simp)) y s) |
| 152 | (fun y => hasFDerivAt_spatialSlice |
| 153 | ((contDiff_spatialDerivative hf).differentiable (by simp)) y s) x, |
| 154 | Kernel.heatSupHessian_apply hpos] |
| 155 | rfl |
| 156 | |
| 157 | /-- A centered estimate for the actual heat residual controls the Hessian. |
| 158 | The regularity constants of the compact smooth solution do not occur in the |
| 159 | numerical bound. -/ |
| 160 | theorem norm_hessian_le_of_centered_heatResidual {f : V × ℝ → F} |
| 161 | (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) |
| 162 | (hzero : ∀ y, f (y, 0) = 0) {t K : ℝ} (ht : 0 < t) |
| 163 | {α : ℝ≥0} (hα0 : 0 < α) (hα1 : α ≤ 1) (x v w : V) |
| 164 | (hsource : ∀ s ∈ Ioo (0 : ℝ) t, ∀ y, |
| 165 | ‖heatResidual f (y, s)‖ ≤ K * ‖y - x‖ ^ (α : ℝ)) : |
| 166 | ‖fderiv ℝ (fun y => fderiv ℝ (fun z => f (z, t)) y) x v w‖ ≤ |
| 167 | (‖v‖ * ‖w‖ * K * Kernel.heatC2Holder (V := V) α) * |
| 168 | ((2 / (α : ℝ)) * t ^ ((α : ℝ) / 2)) := by |
| 169 | have hrep : (fun z => f (z, t)) = Kernel.heatDuh t |
| 170 | (compactSlice (heatResidual f) (contDiff_heatResidual hf).continuous |
| 171 | (hasCompactSupport_heatResidual hc)) := by |
| 172 | funext z |
| 173 | exact (heatDuh_compactSlice_residual hf hc hzero ht z).symm |
| 174 | rw [hrep, fderiv_fderiv_heatDuh_eq_heatD2Duh (contDiff_heatResidual hf) |
| 175 | (hasCompactSupport_heatResidual hc) ht, Kernel.heatD2Duh_comm t w v] |
| 176 | exact Kernel.norm_heatD2Duh_le_of_centered_bound hα0 hα1 ht |
| 177 | (fun s y => heatResidual f (y, s)) x hsource v w |
| 178 | |
| 179 | /-- An early-time cutoff error contributes only a bounded term, while the |
| 180 | coefficient oscillation keeps its small positive power of time. -/ |
| 181 | theorem norm_hessian_le_of_centered_add_time_gap_heatResidual {f : V × ℝ → F} |
| 182 | (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) |
| 183 | (hzero : ∀ y, f (y, 0) = 0) {t K Q δ : ℝ} (ht : 0 < t) |
| 184 | (hK : 0 ≤ K) (hQ : 0 ≤ Q) (hδ : 0 < δ) |
| 185 | {α : ℝ≥0} (hα0 : 0 < α) (hα1 : α ≤ 1) (x v w : V) |
| 186 | (hsource : ∀ s ∈ Ioo (0 : ℝ) t, ∀ y, |
| 187 | ‖heatResidual f (y, s)‖ ≤ K * ‖y - x‖ ^ (α : ℝ) + Q) |
| 188 | (hlate : ∀ s ∈ Ioo (0 : ℝ) t, t - δ < s → ∀ y, |
| 189 | ‖heatResidual f (y, s)‖ ≤ K * ‖y - x‖ ^ (α : ℝ)) : |
| 190 | ‖fderiv ℝ (fun y => fderiv ℝ (fun z => f (z, t)) y) x v w‖ ≤ |
| 191 | (‖v‖ * ‖w‖ * K * Kernel.heatC2Holder (V := V) α) * |
| 192 | ((2 / (α : ℝ)) * t ^ ((α : ℝ) / 2)) + |
| 193 | (‖v‖ * ‖w‖ * Q * δ⁻¹ * Kernel.heatC2 V) * t := by |
| 194 | have hrep : (fun z => f (z, t)) = Kernel.heatDuh t |
| 195 | (compactSlice (heatResidual f) (contDiff_heatResidual hf).continuous |
| 196 | (hasCompactSupport_heatResidual hc)) := by |
| 197 | funext z |
| 198 | exact (heatDuh_compactSlice_residual hf hc hzero ht z).symm |
| 199 | rw [hrep, fderiv_fderiv_heatDuh_eq_heatD2Duh (contDiff_heatResidual hf) |
| 200 | (hasCompactSupport_heatResidual hc) ht, Kernel.heatD2Duh_comm t w v] |
| 201 | unfold Kernel.heatD2Duh Kernel.heatD2Conv |
| 202 | apply Kernel.norm_hessian_potential_le_of_centered_add_time_gap hα0 hα1 hK hQ hδ ht |
| 203 | · intro s hs y |
| 204 | simpa only [sub_sub_cancel_left, norm_neg] using hsource s hs (x - y) |
| 205 | · intro s hs hgap y |
| 206 | simpa only [sub_sub_cancel_left, norm_neg] using hlate s hs hgap (x - y) |
| 207 | |
| 208 | end Poincare.Parabolic.Interior |