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.Deriv.Add |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Mul |
| 3 | import Mathlib.Topology.Order.OrderClosed |
| 4 | |
| 5 | /-! |
| 6 | An explicit extension converts one-sided derivatives on a nondegenerate |
| 7 | closed time interval into ordinary derivatives there. It uses affine tails |
| 8 | whose slopes are the actual endpoint derivatives. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | |
| 14 | namespace EulerClosedIntervalDerivativeExtension |
| 15 | |
| 16 | open Set Filter |
| 17 | |
| 18 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | |
| 20 | def affineExtension (f : ℝ → E) (g₀ gT : E) (T t : ℝ) : E := |
| 21 | if t < 0 then f 0 + t • g₀ else if T < t then f T + (t-T) • gT else f t |
| 22 | |
| 23 | theorem affineExtension_eq {f : ℝ → E} {g₀ gT : E} {T t : ℝ} |
| 24 | (ht : t ∈ Icc 0 T) : affineExtension f g₀ gT T t = f t := by |
| 25 | simp only [affineExtension, not_lt.mpr ht.1, not_lt.mpr ht.2, ite_false] |
| 26 | |
| 27 | theorem affineExtension_eq_left {f : ℝ → E} {g₀ gT : E} {T t : ℝ} |
| 28 | (hT : 0 ≤ T) (ht : t ≤ 0) : affineExtension f g₀ gT T t = f 0+t • g₀ := by |
| 29 | rcases ht.eq_or_lt with rfl | ht |
| 30 | · simp [affineExtension, not_lt.mpr hT] |
| 31 | · simp only [affineExtension, ht, ite_true] |
| 32 | |
| 33 | theorem affineExtension_eq_right {f : ℝ → E} {g₀ gT : E} {T t : ℝ} |
| 34 | (hT : 0 ≤ T) (ht : T ≤ t) : affineExtension f g₀ gT T t = f T+(t-T) • gT := by |
| 35 | rcases ht.eq_or_lt with rfl | ht |
| 36 | · simp [affineExtension, not_lt.mpr hT] |
| 37 | · simp only [affineExtension, not_lt.mpr (hT.trans ht.le), ht, ite_false, ite_true] |
| 38 | |
| 39 | /-- No continuity of the derivative is needed: the matching endpoint slopes |
| 40 | and the one-sided derivative suffice. -/ |
| 41 | theorem affineExtension_hasDerivAt {f g : ℝ → E} {T t : ℝ} |
| 42 | (hT : 0 < T) (ht : t ∈ Icc 0 T) |
| 43 | (hf : HasDerivWithinAt f (g t) (Icc 0 T) t) : |
| 44 | HasDerivAt (affineExtension f (g 0) (g T) T) (g t) t := by |
| 45 | have hwithin : HasDerivWithinAt (affineExtension f (g 0) (g T) T) (g t) (Icc 0 T) t := |
| 46 | hf.congr_of_mem (fun _ hs => affineExtension_eq hs) ht |
| 47 | by_cases ht0 : t = 0 |
| 48 | · subst t |
| 49 | have hleft : HasDerivAt (fun s : ℝ => f 0+s • g 0) (g 0) 0 := by |
| 50 | simpa only [one_smul, id_eq] using ((hasDerivAt_id (0:ℝ)).smul_const (g 0)).const_add (f 0) |
| 51 | have hl := hleft.hasDerivWithinAt.congr_of_mem |
| 52 | (fun s (hs : s ∈ Iic (0:ℝ)) => affineExtension_eq_left (gT := g T) hT.le hs) self_mem_Iic |
| 53 | have hr := hwithin.mono_of_mem_nhdsWithin (Icc_mem_nhdsGE hT) |
| 54 | simpa only [Iic_union_Ici, hasDerivWithinAt_univ] using hl.union hr |
| 55 | · by_cases htT : t = T |
| 56 | · subst t |
| 57 | have hright : HasDerivAt (fun s : ℝ => f T+(s-T) • g T) (g T) T := by |
| 58 | simpa only [one_smul, id_eq] using (((hasDerivAt_id T).sub_const T).smul_const (g T)).const_add (f T) |
| 59 | have hr := hright.hasDerivWithinAt.congr_of_mem |
| 60 | (fun s (hs : s ∈ Ici T) => affineExtension_eq_right (g₀ := g 0) hT.le hs) self_mem_Ici |
| 61 | have hl := hwithin.mono_of_mem_nhdsWithin (Icc_mem_nhdsLE hT) |
| 62 | simpa only [Iic_union_Ici, hasDerivWithinAt_univ] using hl.union hr |
| 63 | · exact hwithin.hasDerivAt (Icc_mem_nhds (lt_of_le_of_ne ht.1 (Ne.symm ht0)) |
| 64 | (lt_of_le_of_ne ht.2 htT)) |
| 65 | |
| 66 | theorem exists_extension {f g : ℝ → E} {T : ℝ} (hT : 0 < T) |
| 67 | (hf : ∀ t ∈ Icc 0 T, HasDerivWithinAt f (g t) (Icc 0 T) t) : |
| 68 | ∃ F : ℝ → E, EqOn F f (Icc 0 T) ∧ |
| 69 | ∀ t ∈ Icc 0 T, HasDerivAt F (g t) t := by |
| 70 | refine ⟨affineExtension f (g 0) (g T) T, fun _ ht => affineExtension_eq ht, ?_⟩ |
| 71 | intro t ht |
| 72 | exact affineExtension_hasDerivAt hT ht (hf t ht) |
| 73 | |
| 74 | end EulerClosedIntervalDerivativeExtension |