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.MeanValue |
| 2 | import Mathlib.Analysis.Asymptotics.Lemmas |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.Comp |
| 4 | import Mathlib.Analysis.Calculus.Deriv.Prod |
| 5 | import Mathlib.Analysis.Normed.Group.Bounded |
| 6 | import Mathlib.Topology.ContinuousMap.Bounded.Normed |
| 7 | |
| 8 | /-! |
| 9 | # Differentiation of bounded continuous time slices |
| 10 | |
| 11 | A uniform second time derivative bound gives a uniform Taylor remainder. |
| 12 | Consequently pointwise time differentiation lifts to differentiation in the |
| 13 | supremum norm. This is used for smooth localized heat solutions. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Asymptotics Filter Set |
| 19 | open scoped Topology ContDiff |
| 20 | |
| 21 | namespace Poincare.Parabolic.Interior |
| 22 | |
| 23 | variable {V F : Type*} [TopologicalSpace V] |
| 24 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 25 | |
| 26 | /-- A bounded second time derivative makes the pointwise derivative a |
| 27 | derivative of the curve in the supremum norm. -/ |
| 28 | theorem hasDerivAt_bcf_of_bounded_second_derivative |
| 29 | (u du : ℝ → BoundedContinuousFunction V F) (ddu : ℝ → V → F) |
| 30 | {K : ℝ} (hK : 0 ≤ K) |
| 31 | (hu : ∀ t x, HasDerivAt (fun s => u s x) (du t x) t) |
| 32 | (hdu : ∀ t x, HasDerivAt (fun s => du s x) (ddu t x) t) |
| 33 | (hb : ∀ t x, ‖ddu t x‖ ≤ K) (t : ℝ) : |
| 34 | HasDerivAt u (du t) t := by |
| 35 | have hLip (s r : ℝ) (x : V) : ‖du s x - du r x‖ ≤ K * ‖s - r‖ := by |
| 36 | exact (convex_univ : Convex ℝ (univ : Set ℝ)).norm_image_sub_le_of_norm_hasDerivWithin_le |
| 37 | (fun q _ => (hdu q x).hasDerivWithinAt) (fun q _ => hb q x) (mem_univ r) (mem_univ s) |
| 38 | have hrem (s : ℝ) : ‖u s - u t - (s - t) • du t‖ ≤ K * ‖s - t‖ ^ 2 := by |
| 39 | apply (BoundedContinuousFunction.norm_le (by positivity)).mpr |
| 40 | intro x |
| 41 | change ‖u s x - u t x - (s - t) • du t x‖ ≤ _ |
| 42 | have hd (r : ℝ) : HasDerivAt |
| 43 | (fun q => u q x - u t x - (q - t) • du t x) (du r x - du t x) r := by |
| 44 | have h := ((hu r x).sub_const (u t x)).sub |
| 45 | (((hasDerivAt_id r).sub_const t).smul_const (du t x)) |
| 46 | convert h using 1 <;> simp |
| 47 | funext q |
| 48 | rfl |
| 49 | have h := (convex_segment t s).norm_image_sub_le_of_norm_hasDerivWithin_le |
| 50 | (fun r _ => (hd r).hasDerivWithinAt) |
| 51 | (fun r hr => (hLip r t x).trans (mul_le_mul_of_nonneg_left |
| 52 | (norm_sub_le_of_mem_segment hr) hK)) |
| 53 | (left_mem_segment ℝ t s) (right_mem_segment ℝ t s) |
| 54 | simpa [pow_two, mul_assoc] using h |
| 55 | apply HasDerivAt.of_isLittleO |
| 56 | have hbig : (fun s => u s - u t - (s - t) • du t) =O[𝓝 t] |
| 57 | (fun s => ‖s - t‖ ^ 2) := by |
| 58 | apply IsBigO.of_bound K |
| 59 | filter_upwards with s |
| 60 | simpa only [norm_pow, norm_norm] using hrem s |
| 61 | exact hbig.trans_isLittleO (isLittleO_pow_sub_sub t (by norm_num : 1 < (2 : ℕ))) |
| 62 | |
| 63 | section CompactSupport |
| 64 | |
| 65 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 66 | |
| 67 | /-- The time slice of a continuous compactly supported space-time function, |
| 68 | viewed in the supremum norm. -/ |
| 69 | noncomputable def compactSlice (f : E × ℝ → F) (hf : Continuous f) |
| 70 | (hc : HasCompactSupport f) (t : ℝ) : BoundedContinuousFunction E F := |
| 71 | BoundedContinuousFunction.ofNormedAddCommGroup (fun x => f (x, t)) |
| 72 | (hf.comp (continuous_id.prodMk continuous_const)) |
| 73 | (hc.exists_bound_of_continuous hf).choose |
| 74 | (fun x => (hc.exists_bound_of_continuous hf).choose_spec (x, t)) |
| 75 | |
| 76 | omit [NormedSpace ℝ F] [NormedSpace ℝ E] in |
| 77 | @[simp] |
| 78 | theorem compactSlice_apply (f : E × ℝ → F) (hf : Continuous f) |
| 79 | (hc : HasCompactSupport f) (t : ℝ) (x : E) : |
| 80 | compactSlice f hf hc t x = f (x, t) := rfl |
| 81 | |
| 82 | /-- Differentiation in the time direction of a space-time function. -/ |
| 83 | noncomputable def timeDerivative (f : E × ℝ → F) (p : E × ℝ) : F := |
| 84 | fderiv ℝ f p (0, 1) |
| 85 | |
| 86 | theorem contDiff_timeDerivative {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) : |
| 87 | ContDiff ℝ ∞ (timeDerivative f) := by |
| 88 | exact (hf.fderiv_right (by simp)).clm_apply contDiff_const |
| 89 | |
| 90 | theorem hasCompactSupport_timeDerivative {f : E × ℝ → F} |
| 91 | (hf : HasCompactSupport f) : HasCompactSupport (timeDerivative f) := |
| 92 | hf.fderiv_apply ℝ (0, 1) |
| 93 | |
| 94 | theorem hasDerivAt_timeSlice {f : E × ℝ → F} (hf : Differentiable ℝ f) |
| 95 | (x : E) (t : ℝ) : |
| 96 | HasDerivAt (fun s => f (x, s)) (timeDerivative f (x, t)) t := by |
| 97 | exact (hf (x, t)).hasFDerivAt.comp_hasDerivAt t |
| 98 | ((hasDerivAt_const t x).prodMk (hasDerivAt_id t)) |
| 99 | |
| 100 | /-- A compactly supported smooth space-time function is differentiable as a |
| 101 | curve of bounded continuous spatial functions. Compactness supplies the |
| 102 | uniform bound needed for the Taylor remainder. -/ |
| 103 | theorem hasDerivAt_compactSlice {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) |
| 104 | (hc : HasCompactSupport f) (t : ℝ) : |
| 105 | HasDerivAt (compactSlice f hf.continuous hc) |
| 106 | (compactSlice (timeDerivative f) (contDiff_timeDerivative hf).continuous |
| 107 | (hasCompactSupport_timeDerivative hc) t) t := by |
| 108 | have hdt := contDiff_timeDerivative hf |
| 109 | have hdtt := contDiff_timeDerivative hdt |
| 110 | have hct := hasCompactSupport_timeDerivative hc |
| 111 | obtain ⟨K, hK⟩ := (hasCompactSupport_timeDerivative hct).exists_bound_of_continuous |
| 112 | hdtt.continuous |
| 113 | apply hasDerivAt_bcf_of_bounded_second_derivative |
| 114 | (ddu := fun s x => timeDerivative (timeDerivative f) (x, s)) |
| 115 | (hK := le_max_left 0 K) |
| 116 | · intro s x |
| 117 | exact hasDerivAt_timeSlice (hf.differentiable (by simp)) x s |
| 118 | · intro s x |
| 119 | exact hasDerivAt_timeSlice (hdt.differentiable (by simp)) x s |
| 120 | · intro s x |
| 121 | exact (hK (x, s)).trans (le_max_right 0 K) |
| 122 | |
| 123 | theorem continuous_compactSlice {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) |
| 124 | (hc : HasCompactSupport f) : Continuous (compactSlice f hf.continuous hc) := |
| 125 | continuous_iff_continuousAt.mpr fun t => (hasDerivAt_compactSlice hf hc t).continuousAt |
| 126 | |
| 127 | /-- The spatial differential of a space-time function. -/ |
| 128 | noncomputable def spatialDerivative (f : E × ℝ → F) (p : E × ℝ) : E →L[ℝ] F := |
| 129 | (fderiv ℝ f p).comp (ContinuousLinearMap.inl ℝ E ℝ) |
| 130 | |
| 131 | theorem contDiff_spatialDerivative {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) : |
| 132 | ContDiff ℝ ∞ (spatialDerivative f) := by |
| 133 | exact (hf.fderiv_right (by simp)).clm_comp contDiff_const |
| 134 | |
| 135 | theorem hasCompactSupport_spatialDerivative {f : E × ℝ → F} |
| 136 | (hf : HasCompactSupport f) : HasCompactSupport (spatialDerivative f) := by |
| 137 | exact (hf.fderiv ℝ).comp_left (g := fun L => L.comp (ContinuousLinearMap.inl ℝ E ℝ)) |
| 138 | (by ext; simp) |
| 139 | |
| 140 | theorem hasFDerivAt_spatialSlice {f : E × ℝ → F} (hf : Differentiable ℝ f) |
| 141 | (x : E) (t : ℝ) : |
| 142 | HasFDerivAt (fun y => f (y, t)) (spatialDerivative f (x, t)) x := by |
| 143 | exact (hf (x, t)).hasFDerivAt.comp x (hasFDerivAt_prodMk_left x t) |
| 144 | |
| 145 | theorem fderiv_spatialSlice {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) |
| 146 | (x : E) (t : ℝ) : |
| 147 | fderiv ℝ (fun y => f (y, t)) x = spatialDerivative f (x, t) := |
| 148 | (hasFDerivAt_spatialSlice (hf.differentiable (by simp)) x t).fderiv |
| 149 | |
| 150 | theorem fderiv_fderiv_spatialSlice {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) |
| 151 | (x : E) (t : ℝ) : |
| 152 | fderiv ℝ (fun y => fderiv ℝ (fun z => f (z, t)) y) x = |
| 153 | spatialDerivative (spatialDerivative f) (x, t) := by |
| 154 | simp only [fderiv_spatialSlice hf] |
| 155 | exact fderiv_spatialSlice (contDiff_spatialDerivative hf) x t |
| 156 | |
| 157 | end CompactSupport |
| 158 | |
| 159 | end Poincare.Parabolic.Interior |