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 Euler.PacketCrossProduct |
| 2 | import Mathlib.Analysis.InnerProductSpace.Calculus |
| 3 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 4 | |
| 5 | /-! |
| 6 | Differentiating the actual normalized ray and primary velocity. The rates |
| 7 | are derived from the physical ODEs; no normalized-frame equation is assumed. |
| 8 | -/ |
| 9 | |
| 10 | noncomputable section |
| 11 | |
| 12 | |
| 13 | namespace EulerPacketNormalizedPrimary |
| 14 | |
| 15 | open InnerProductSpace ContinuousLinearMap |
| 16 | |
| 17 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 18 | |
| 19 | def unit (x : E) : E := ‖x‖⁻¹ • x |
| 20 | |
| 21 | theorem unit_norm {x : E} (hx : x ≠ 0) : ‖unit x‖ = 1 := by |
| 22 | rw [unit, norm_smul, norm_inv, Real.norm_of_nonneg (norm_nonneg _), inv_mul_cancel₀] |
| 23 | exact norm_ne_zero_iff.mpr hx |
| 24 | |
| 25 | theorem unit_inner_self {x : E} (hx : x ≠ 0) : ⟪unit x, unit x⟫_ℝ = 1 := by |
| 26 | rw [real_inner_self_eq_norm_sq, unit_norm hx] |
| 27 | norm_num |
| 28 | |
| 29 | theorem unit_inner_zero {x y : E} (hxy : ⟪x,y⟫_ℝ = 0) : ⟪unit x, unit y⟫_ℝ = 0 := by |
| 30 | simp only [unit, real_inner_smul_left, real_inner_smul_right, hxy, mul_zero] |
| 31 | |
| 32 | theorem norm_hasDerivAt {f : ℝ → E} {f' : E} {t : ℝ} |
| 33 | (hf : HasDerivAt f f' t) (hft : f t ≠ 0) : |
| 34 | HasDerivAt (fun s => ‖f s‖) (⟪f t,f'⟫_ℝ / ‖f t‖) t := by |
| 35 | have hn := norm_ne_zero_iff.mpr hft |
| 36 | have hh := hf.norm_sq.sqrt (pow_ne_zero 2 hn) |
| 37 | have he : (fun s => Real.sqrt (‖f s‖^2)) = (fun s => ‖f s‖) := by |
| 38 | funext s |
| 39 | exact Real.sqrt_sq (norm_nonneg _) |
| 40 | rw [he, Real.sqrt_sq (norm_nonneg _)] at hh |
| 41 | convert hh using 1 |
| 42 | field_simp |
| 43 | |
| 44 | theorem unit_hasDerivAt {f : ℝ → E} {f' : E} {t : ℝ} |
| 45 | (hf : HasDerivAt f f' t) (hft : f t ≠ 0) : |
| 46 | HasDerivAt (fun s => unit (f s)) |
| 47 | (‖f t‖⁻¹ • f' - (⟪f t,f'⟫_ℝ / ‖f t‖^3) • f t) t := by |
| 48 | have hn := norm_ne_zero_iff.mpr hft |
| 49 | have h := ((norm_hasDerivAt hf hft).inv hn).smul hf |
| 50 | have he : -(⟪f t,f'⟫_ℝ / ‖f t‖) / ‖f t‖^2 = -(⟪f t,f'⟫_ℝ / ‖f t‖^3) := by |
| 51 | field_simp |
| 52 | change HasDerivAt (fun s => unit (f s)) |
| 53 | (‖f t‖⁻¹ • f' + (-(⟪f t,f'⟫_ℝ / ‖f t‖) / ‖f t‖^2) • f t) t at h |
| 54 | rw [he] at h |
| 55 | simpa only [neg_smul, sub_eq_add_neg, add_comm] using h |
| 56 | |
| 57 | theorem norm_hasDerivWithinAt {f : ℝ → E} {f' : E} {t : ℝ} {S : Set ℝ} |
| 58 | (hf : HasDerivWithinAt f f' S t) (hft : f t ≠ 0) : |
| 59 | HasDerivWithinAt (fun s => ‖f s‖) (⟪f t,f'⟫_ℝ / ‖f t‖) S t := by |
| 60 | have hn := norm_ne_zero_iff.mpr hft |
| 61 | have hh := hf.norm_sq.sqrt (pow_ne_zero 2 hn) |
| 62 | have he : (fun s => Real.sqrt (‖f s‖^2)) = (fun s => ‖f s‖) := by |
| 63 | funext s |
| 64 | exact Real.sqrt_sq (norm_nonneg _) |
| 65 | rw [he, Real.sqrt_sq (norm_nonneg _)] at hh |
| 66 | convert hh using 1 |
| 67 | field_simp |
| 68 | |
| 69 | theorem unit_hasDerivWithinAt {f : ℝ → E} {f' : E} {t : ℝ} {S : Set ℝ} |
| 70 | (hf : HasDerivWithinAt f f' S t) (hft : f t ≠ 0) : |
| 71 | HasDerivWithinAt (fun s => unit (f s)) |
| 72 | (‖f t‖⁻¹ • f' - (⟪f t,f'⟫_ℝ / ‖f t‖^3) • f t) S t := by |
| 73 | have hn := norm_ne_zero_iff.mpr hft |
| 74 | have h := ((norm_hasDerivWithinAt hf hft).inv hn).smul hf |
| 75 | have he : -(⟪f t,f'⟫_ℝ / ‖f t‖) / ‖f t‖^2 = -(⟪f t,f'⟫_ℝ / ‖f t‖^3) := by |
| 76 | field_simp |
| 77 | change HasDerivWithinAt (fun s => unit (f s)) |
| 78 | (‖f t‖⁻¹ • f' + (-(⟪f t,f'⟫_ℝ / ‖f t‖) / ‖f t‖^2) • f t) S t at h |
| 79 | rw [he] at h |
| 80 | simpa only [neg_smul, sub_eq_add_neg, add_comm] using h |
| 81 | |
| 82 | variable [CompleteSpace E] |
| 83 | |
| 84 | def rayRate (B : E →L[ℝ] E) (p : E) : E := -B.adjoint p + ⟪p,B p⟫_ℝ • p |
| 85 | |
| 86 | def velocityRate (B : E →L[ℝ] E) (p q : E) : E := |
| 87 | -B q + (2*⟪p,B q⟫_ℝ) • p + ⟪q,B q⟫_ℝ • q |
| 88 | |
| 89 | theorem normalized_ray_hasDerivAt (B : E →L[ℝ] E) {m : ℝ → E} {t : ℝ} |
| 90 | (hm : HasDerivAt m (-B.adjoint (m t)) t) (hm0 : m t ≠ 0) : |
| 91 | HasDerivAt (fun s => unit (m s)) (rayRate B (unit (m t))) t := by |
| 92 | have h := unit_hasDerivAt hm hm0 |
| 93 | convert h using 1 |
| 94 | unfold rayRate unit |
| 95 | rw [inner_neg_right, adjoint_inner_right, real_inner_comm (m t) (B (m t))] |
| 96 | simp only [map_smul, real_inner_smul_left, real_inner_smul_right, smul_smul, |
| 97 | div_eq_mul_inv, neg_mul, neg_smul, smul_neg] |
| 98 | module |
| 99 | |
| 100 | omit [CompleteSpace E] in |
| 101 | theorem normalized_velocity_hasDerivAt (B : E →L[ℝ] E) {m v : ℝ → E} {t : ℝ} |
| 102 | (hv : HasDerivAt v (-B (v t) + (2*⟪m t,B (v t)⟫_ℝ / ‖m t‖^2) • m t) t) |
| 103 | (hv0 : v t ≠ 0) (hmv : ⟪m t,v t⟫_ℝ = 0) : |
| 104 | HasDerivAt (fun s => unit (v s)) (velocityRate B (unit (m t)) (unit (v t))) t := by |
| 105 | have h := unit_hasDerivAt hv hv0 |
| 106 | have hvm : ⟪v t,m t⟫_ℝ = 0 := (real_inner_comm _ _).trans hmv |
| 107 | convert h using 1 |
| 108 | unfold velocityRate unit |
| 109 | simp only [inner_add_right, inner_neg_right, real_inner_smul_right, hvm, mul_zero, |
| 110 | add_zero, map_smul, real_inner_smul_left, smul_smul, smul_add, div_eq_mul_inv, |
| 111 | neg_mul, neg_smul, smul_neg] |
| 112 | module |
| 113 | |
| 114 | theorem normalized_ray_hasDerivWithinAt (B : E →L[ℝ] E) {m : ℝ → E} {t : ℝ} {S : Set ℝ} |
| 115 | (hm : HasDerivWithinAt m (-B.adjoint (m t)) S t) (hm0 : m t ≠ 0) : |
| 116 | HasDerivWithinAt (fun s => unit (m s)) (rayRate B (unit (m t))) S t := by |
| 117 | have h := unit_hasDerivWithinAt hm hm0 |
| 118 | convert h using 1 |
| 119 | unfold rayRate unit |
| 120 | rw [inner_neg_right, adjoint_inner_right, real_inner_comm (m t) (B (m t))] |
| 121 | simp only [map_smul, real_inner_smul_left, real_inner_smul_right, smul_smul, |
| 122 | div_eq_mul_inv, neg_mul, neg_smul, smul_neg] |
| 123 | module |
| 124 | |
| 125 | omit [CompleteSpace E] in |
| 126 | theorem normalized_velocity_hasDerivWithinAt (B : E →L[ℝ] E) |
| 127 | {m v : ℝ → E} {t : ℝ} {S : Set ℝ} |
| 128 | (hv : HasDerivWithinAt v (-B (v t) + (2*⟪m t,B (v t)⟫_ℝ / ‖m t‖^2) • m t) S t) |
| 129 | (hv0 : v t ≠ 0) (hmv : ⟪m t,v t⟫_ℝ = 0) : |
| 130 | HasDerivWithinAt (fun s => unit (v s)) (velocityRate B (unit (m t)) (unit (v t))) S t := by |
| 131 | have h := unit_hasDerivWithinAt hv hv0 |
| 132 | have hvm : ⟪v t,m t⟫_ℝ = 0 := (real_inner_comm _ _).trans hmv |
| 133 | convert h using 1 |
| 134 | unfold velocityRate unit |
| 135 | simp only [inner_add_right, inner_neg_right, real_inner_smul_right, hvm, mul_zero, |
| 136 | add_zero, map_smul, real_inner_smul_left, smul_smul, smul_add, div_eq_mul_inv, |
| 137 | neg_mul, neg_smul, smul_neg] |
| 138 | module |
| 139 | |
| 140 | end EulerPacketNormalizedPrimary |