Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | import Mathlib.Analysis.Calculus.IteratedDeriv.Defs |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.Comp |
| 3 | |
| 4 | /-! |
| 5 | # Smooth gluing from matching one-sided derivative jets |
| 6 | |
| 7 | If a real-parameter curve is smooth on each closed half-line and all of its |
| 8 | one-sided derivatives agree at the common endpoint, its piecewise glue is |
| 9 | smooth. The derivatives are actual `iteratedDerivWithin` values. No smooth |
| 10 | extension across the endpoint is assumed for either branch. |
| 11 | |
| 12 | This is the gluing step needed after the left endpoint regularity and the |
| 13 | right Taylor--Borel construction in Lemmas 11.5--11.6. It does not construct a |
| 14 | right branch with arbitrary prescribed jets. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | |
| 19 | open Set |
| 20 | open scoped ContDiff |
| 21 | |
| 22 | namespace NavierStokes.EndpointExtension |
| 23 | |
| 24 | /-- Take the left branch through the joining point, and the right branch after it. -/ |
| 25 | def glue {V : Type*} (a : ℝ) (left right : ℝ → V) (x : ℝ) : V := |
| 26 | if x ≤ a then left x else right x |
| 27 | |
| 28 | theorem glue_eq_left {V : Type*} {a x : ℝ} {left right : ℝ → V} (hx : x ≤ a) : |
| 29 | glue a left right x = left x := by |
| 30 | simp only [glue, ite_eq_left hx] |
| 31 | |
| 32 | theorem glue_eq_right {V : Type*} {a x : ℝ} {left right : ℝ → V} (hx : a < x) : |
| 33 | glue a left right x = right x := by |
| 34 | simp only [glue, ite_eq_right (not_le_of_gt hx)] |
| 35 | |
| 36 | /-- Matching endpoint values let the glued function agree with the right |
| 37 | branch on its entire closed half-line, including the joining point. -/ |
| 38 | theorem glue_eqOn_right {V : Type*} {a : ℝ} {left right : ℝ → V} |
| 39 | (hvalue : left a = right a) : EqOn (glue a left right) right (Ici a) := by |
| 40 | intro x hx |
| 41 | by_cases hxa : x ≤ a |
| 42 | · have hEq : x = a := le_antisymm hxa hx |
| 43 | subst x |
| 44 | simpa only [glue, ite_eq_left le_rfl] using hvalue |
| 45 | · simp only [glue, ite_eq_right hxa] |
| 46 | |
| 47 | /-- Gluing preserves a right-hand time-support bound. -/ |
| 48 | theorem glue_vanishes_from {V : Type*} [Zero V] {a b : ℝ} {left right : ℝ → V} |
| 49 | (hab : a ≤ b) (hvalue : left a = right a) |
| 50 | (hzero : ∀ x, b ≤ x → right x = 0) : |
| 51 | ∀ x, b ≤ x → glue a left right x = 0 := by |
| 52 | intro x hx |
| 53 | rw [glue_eqOn_right hvalue (hab.trans hx)] |
| 54 | exact hzero x hx |
| 55 | |
| 56 | section Normed |
| 57 | |
| 58 | variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 59 | |
| 60 | /-- First-order gluing: compatible one-sided derivatives combine into an |
| 61 | ordinary derivative at the join, as well as away from it. -/ |
| 62 | theorem hasDerivAt_glue {a : ℝ} {left right leftDeriv rightDeriv : ℝ → V} |
| 63 | (hleft : ∀ x ≤ a, HasDerivWithinAt left (leftDeriv x) (Iic a) x) |
| 64 | (hright : ∀ x, a ≤ x → HasDerivWithinAt right (rightDeriv x) (Ici a) x) |
| 65 | (hvalue : left a = right a) (hderiv : leftDeriv a = rightDeriv a) (x : ℝ) : |
| 66 | HasDerivAt (glue a left right) (glue a leftDeriv rightDeriv x) x := by |
| 67 | have hL (y : ℝ) (hy : y ≤ a) : |
| 68 | HasDerivWithinAt (glue a left right) (leftDeriv y) (Iic a) y := |
| 69 | (hleft y hy).congr_of_mem (fun z hz => glue_eq_left hz) hy |
| 70 | have hR (y : ℝ) (hy : a ≤ y) : |
| 71 | HasDerivWithinAt (glue a left right) (rightDeriv y) (Ici a) y := |
| 72 | (hright y hy).congr_of_mem (glue_eqOn_right hvalue) hy |
| 73 | rcases lt_trichotomy x a with hlt | heq | hgt |
| 74 | · simpa only [glue, ite_eq_left hlt.le] using (hL x hlt.le).hasDerivAt (Iic_mem_nhds hlt) |
| 75 | · subst x |
| 76 | have hright' : HasDerivWithinAt (glue a left right) (leftDeriv a) (Ici a) a := by |
| 77 | rw [hderiv] |
| 78 | exact hR a le_rfl |
| 79 | have h := (hL a le_rfl).union hright' |
| 80 | simpa only [Iic_union_Ici, hasDerivWithinAt_univ, glue, ite_eq_left le_rfl] using h |
| 81 | · simpa only [glue, ite_eq_right (not_le_of_gt hgt)] using |
| 82 | (hR x hgt.le).hasDerivAt (Ici_mem_nhds hgt) |
| 83 | |
| 84 | /-- Glue the genuine `n`-th derivatives on the two closed half-lines. -/ |
| 85 | def gluedJet (a : ℝ) (left right : ℝ → V) (n : ℕ) : ℝ → V := |
| 86 | glue a (iteratedDerivWithin n left (Iic a)) (iteratedDerivWithin n right (Ici a)) |
| 87 | |
| 88 | /-- Smoothness on each side supplies the next derivative; matching endpoint |
| 89 | jets makes every glued jet ordinarily differentiable across the endpoint. -/ |
| 90 | theorem hasDerivAt_gluedJet {a : ℝ} {left right : ℝ → V} |
| 91 | (hleft : ContDiffOn ℝ ∞ left (Iic a)) |
| 92 | (hright : ContDiffOn ℝ ∞ right (Ici a)) |
| 93 | (hmatch : ∀ n : ℕ, |
| 94 | iteratedDerivWithin n left (Iic a) a = iteratedDerivWithin n right (Ici a) a) |
| 95 | (n : ℕ) (x : ℝ) : |
| 96 | HasDerivAt (gluedJet a left right n) (gluedJet a left right (n + 1) x) x := by |
| 97 | apply hasDerivAt_glue |
| 98 | · intro y hy |
| 99 | have hd := (hleft.differentiableOn_iteratedDerivWithin (m := n) |
| 100 | (ENat.natCast_lt_of_coe_top_le_withTop le_rfl n) |
| 101 | (uniqueDiffOn_Iic a) y hy).hasDerivWithinAt |
| 102 | simpa only [iteratedDerivWithin_succ] using hd |
| 103 | · intro y hy |
| 104 | have hd := (hright.differentiableOn_iteratedDerivWithin (m := n) |
| 105 | (ENat.natCast_lt_of_coe_top_le_withTop le_rfl n) |
| 106 | (uniqueDiffOn_Ici a) y hy).hasDerivWithinAt |
| 107 | simpa only [iteratedDerivWithin_succ] using hd |
| 108 | · exact hmatch n |
| 109 | · exact hmatch (n + 1) |
| 110 | |
| 111 | /-- Every ordinary derivative of the glued function is exactly the appropriate |
| 112 | piecewise one-sided derivative, including at the joining point. -/ |
| 113 | theorem iteratedDeriv_glue {a : ℝ} {left right : ℝ → V} |
| 114 | (hleft : ContDiffOn ℝ ∞ left (Iic a)) |
| 115 | (hright : ContDiffOn ℝ ∞ right (Ici a)) |
| 116 | (hmatch : ∀ n : ℕ, |
| 117 | iteratedDerivWithin n left (Iic a) a = iteratedDerivWithin n right (Ici a) a) |
| 118 | (n : ℕ) : |
| 119 | iteratedDeriv n (glue a left right) = gluedJet a left right n := by |
| 120 | induction n with |
| 121 | | zero => simp only [iteratedDeriv_zero, gluedJet, iteratedDerivWithin_zero] |
| 122 | | succ n ih => |
| 123 | rw [iteratedDeriv_succ, ih] |
| 124 | funext x |
| 125 | exact (hasDerivAt_gluedJet hleft hright hmatch n x).deriv |
| 126 | |
| 127 | /-- Main smooth gluing theorem. The inputs require smoothness only on each |
| 128 | closed half-line and matching actual one-sided jets. -/ |
| 129 | theorem contDiff_glue {a : ℝ} {left right : ℝ → V} |
| 130 | (hleft : ContDiffOn ℝ ∞ left (Iic a)) |
| 131 | (hright : ContDiffOn ℝ ∞ right (Ici a)) |
| 132 | (hmatch : ∀ n : ℕ, |
| 133 | iteratedDerivWithin n left (Iic a) a = iteratedDerivWithin n right (Ici a) a) : |
| 134 | ContDiff ℝ ∞ (glue a left right) := by |
| 135 | apply contDiff_of_differentiable_iteratedDeriv |
| 136 | intro n _ |
| 137 | rw [iteratedDeriv_glue hleft hright hmatch n] |
| 138 | intro x |
| 139 | exact (hasDerivAt_gluedJet hleft hright hmatch n x).differentiableAt |
| 140 | |
| 141 | /-- The smooth glue preserves every prescribed endpoint jet. -/ |
| 142 | theorem iteratedDeriv_glue_at_join {a : ℝ} {left right : ℝ → V} |
| 143 | (hleft : ContDiffOn ℝ ∞ left (Iic a)) |
| 144 | (hright : ContDiffOn ℝ ∞ right (Ici a)) |
| 145 | (hmatch : ∀ n : ℕ, |
| 146 | iteratedDerivWithin n left (Iic a) a = iteratedDerivWithin n right (Ici a) a) |
| 147 | (n : ℕ) : |
| 148 | iteratedDeriv n (glue a left right) a = iteratedDerivWithin n left (Iic a) a := by |
| 149 | rw [iteratedDeriv_glue hleft hright hmatch n] |
| 150 | exact glue_eq_left le_rfl |
| 151 | |
| 152 | /-- Every within-derivative of the zero curve is zero. -/ |
| 153 | theorem iteratedDerivWithin_zero_curve (s : Set ℝ) (n : ℕ) : |
| 154 | iteratedDerivWithin n (fun _ : ℝ => (0 : V)) s = fun _ => 0 := by |
| 155 | induction n with |
| 156 | | zero => simp only [iteratedDerivWithin_zero] |
| 157 | | succ n ih => |
| 158 | funext x |
| 159 | simp only [iteratedDerivWithin_succ, ih, derivWithin_fun_const, Pi.zero_apply] |
| 160 | |
| 161 | /-- An actually constructed extension in the flat case: if all left jets |
| 162 | vanish, extension by zero to the right is smooth. -/ |
| 163 | theorem contDiff_zero_extension {a : ℝ} {left : ℝ → V} |
| 164 | (hleft : ContDiffOn ℝ ∞ left (Iic a)) |
| 165 | (hflat : ∀ n : ℕ, iteratedDerivWithin n left (Iic a) a = 0) : |
| 166 | ContDiff ℝ ∞ (glue a left (fun _ => 0)) := by |
| 167 | apply contDiff_glue hleft contDiffOn_const |
| 168 | intro n |
| 169 | rw [hflat n, iteratedDerivWithin_zero_curve] |
| 170 | |
| 171 | end Normed |
| 172 | |
| 173 | end NavierStokes.EndpointExtension |