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.PacketNormalizedPrimary |
| 2 | import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas |
| 3 | |
| 4 | /-! |
| 5 | The oriented orthonormal frame built from the actual normalized primary. |
| 6 | Its angular-velocity entries are derived from the physical ODEs and agree |
| 7 | with the `frameSkew` matrix used in the source propagation estimates. |
| 8 | -/ |
| 9 | |
| 10 | noncomputable section |
| 11 | |
| 12 | |
| 13 | namespace EulerPacketMovingFrame |
| 14 | |
| 15 | open EulerSmoothLimit EulerPacketCrossProduct EulerPacketNormalizedPrimary |
| 16 | InnerProductSpace ContinuousLinearMap Matrix WithLp |
| 17 | |
| 18 | def crossBilinear : Space →L[ℝ] Space →L[ℝ] Space := |
| 19 | ({ toFun := crossLeft |
| 20 | map_add' a b := by |
| 21 | apply ContinuousLinearMap.ext |
| 22 | intro x |
| 23 | simp [crossLeft_apply, cross, map_add] |
| 24 | map_smul' r a := by |
| 25 | apply ContinuousLinearMap.ext |
| 26 | intro x |
| 27 | simp [crossLeft_apply, cross, map_smul] } : Space →ₗ[ℝ] (Space →L[ℝ] Space)).mkContinuous 1 |
| 28 | (fun a => by |
| 29 | change ‖crossLeft a‖ ≤ 1*‖a‖ |
| 30 | simpa only [one_mul] using crossLeft_norm_le a) |
| 31 | |
| 32 | theorem crossBilinear_apply (a b : Space) : crossBilinear a b = cross a b := rfl |
| 33 | |
| 34 | theorem cross_hasDerivAt {p q : ℝ → Space} {p' q' : Space} {t : ℝ} |
| 35 | (hp : HasDerivAt p p' t) (hq : HasDerivAt q q' t) : |
| 36 | HasDerivAt (fun s => cross (p s) (q s)) (cross p' (q t) + cross (p t) q') t := by |
| 37 | have h := (crossBilinear.hasFDerivAt.comp_hasDerivAt t hp).clm_apply hq |
| 38 | simpa only [Function.comp_def, crossBilinear_apply] using h |
| 39 | |
| 40 | theorem cross_hasDerivWithinAt {p q : ℝ → Space} {p' q' : Space} {t : ℝ} {S : Set ℝ} |
| 41 | (hp : HasDerivWithinAt p p' S t) (hq : HasDerivWithinAt q q' S t) : |
| 42 | HasDerivWithinAt (fun s => cross (p s) (q s)) (cross p' (q t) + cross (p t) q') S t := by |
| 43 | have h := (crossBilinear.hasFDerivAt.comp_hasDerivWithinAt t hp).clm_apply hq |
| 44 | simpa only [Function.comp_def, crossBilinear_apply] using h |
| 45 | |
| 46 | theorem inner_cross_first (p q : Space) : ⟪p,cross p q⟫_ℝ = 0 := by |
| 47 | rw [← dot_eq_inner] |
| 48 | exact dot_self_cross (ofLp p) (ofLp q) |
| 49 | |
| 50 | theorem inner_cross_second (p q : Space) : ⟪q,cross p q⟫_ℝ = 0 := by |
| 51 | rw [← dot_eq_inner] |
| 52 | exact dot_cross_self (ofLp p) (ofLp q) |
| 53 | |
| 54 | theorem inner_cross_cross (p q r s : Space) : |
| 55 | ⟪cross p q,cross r s⟫_ℝ = ⟪p,r⟫_ℝ*⟪q,s⟫_ℝ - ⟪p,s⟫_ℝ*⟪q,r⟫_ℝ := by |
| 56 | simp only [← dot_eq_inner, cross] |
| 57 | exact cross_dot_cross (ofLp p) (ofLp q) (ofLp r) (ofLp s) |
| 58 | |
| 59 | theorem inner_cross_exchange_first (p q r : Space) : |
| 60 | ⟪p,cross q r⟫_ℝ = -⟪q,cross p r⟫_ℝ := by |
| 61 | simp only [← dot_eq_inner, cross] |
| 62 | rw [triple_product_permutation, ← cross_anticomm (ofLp p) (ofLp r), dotProduct_neg] |
| 63 | |
| 64 | theorem inner_cross_exchange_last (p q r : Space) : |
| 65 | ⟪p,cross q r⟫_ℝ = -⟪r,cross q p⟫_ℝ := by |
| 66 | simp only [← dot_eq_inner, cross] |
| 67 | rw [triple_product_permutation, triple_product_permutation (ofLp q) (ofLp r) (ofLp p), |
| 68 | ← cross_anticomm (ofLp q) (ofLp p), dotProduct_neg] |
| 69 | |
| 70 | def frame (p q : Space) : Fin 3 → Space := ![p, q, cross p q] |
| 71 | |
| 72 | def frameRate (B : Space →L[ℝ] Space) (p q : Space) : Fin 3 → Space := |
| 73 | ![rayRate B p, velocityRate B p q, |
| 74 | cross (rayRate B p) q + cross p (velocityRate B p q)] |
| 75 | |
| 76 | def frameMatrix (B : Space →L[ℝ] Space) (p q : Space) (i j : Fin 3) : ℝ := |
| 77 | ⟪frame p q i, B (frame p q j)⟫_ℝ |
| 78 | |
| 79 | theorem frame_orthonormal (p q : Space) |
| 80 | (hp : ⟪p,p⟫_ℝ = 1) (hq : ⟪q,q⟫_ℝ = 1) (hpq : ⟪p,q⟫_ℝ = 0) : |
| 81 | Orthonormal ℝ (frame p q) := by |
| 82 | have hqp : ⟪q,p⟫_ℝ = 0 := (real_inner_comm _ _).trans hpq |
| 83 | have hnp : ⟪cross p q,p⟫_ℝ = 0 := (real_inner_comm _ _).trans (inner_cross_first p q) |
| 84 | have hnq : ⟪cross p q,q⟫_ℝ = 0 := (real_inner_comm _ _).trans (inner_cross_second p q) |
| 85 | have hnn : ⟪cross p q,cross p q⟫_ℝ = 1 := by |
| 86 | rw [inner_cross_cross, hp, hq, hpq, hqp] |
| 87 | norm_num |
| 88 | apply orthonormal_iff_ite.mpr |
| 89 | intro i j |
| 90 | fin_cases i <;> fin_cases j <;> dsimp [frame] |
| 91 | · exact hp |
| 92 | · exact hpq |
| 93 | · exact inner_cross_first p q |
| 94 | · exact hqp |
| 95 | · exact hq |
| 96 | · exact inner_cross_second p q |
| 97 | · exact hnp |
| 98 | · exact hnq |
| 99 | · exact hnn |
| 100 | |
| 101 | def frameBasis (p q : Space) |
| 102 | (hp : ⟪p,p⟫_ℝ = 1) (hq : ⟪q,q⟫_ℝ = 1) (hpq : ⟪p,q⟫_ℝ = 0) : |
| 103 | OrthonormalBasis (Fin 3) ℝ Space := |
| 104 | OrthonormalBasis.mk (frame_orthonormal p q hp hq hpq) |
| 105 | ((frame_orthonormal p q hp hq hpq).linearIndependent.span_eq_top_of_card_eq_finrank' |
| 106 | (by simp [Space])).ge |
| 107 | |
| 108 | theorem frameBasis_apply (p q : Space) |
| 109 | (hp : ⟪p,p⟫_ℝ = 1) (hq : ⟪q,q⟫_ℝ = 1) (hpq : ⟪p,q⟫_ℝ = 0) (i : Fin 3) : |
| 110 | frameBasis p q hp hq hpq i = frame p q i := by |
| 111 | simp only [frameBasis, OrthonormalBasis.coe_mk] |
| 112 | |
| 113 | /-- All nine entries of the actual frame rate, including their signs. -/ |
| 114 | theorem frameRate_skew (B : Space →L[ℝ] Space) (p q : Space) |
| 115 | (hp : ⟪p,p⟫_ℝ = 1) (hq : ⟪q,q⟫_ℝ = 1) (hpq : ⟪p,q⟫_ℝ = 0) : |
| 116 | ∀ i j, ⟪frame p q i, frameRate B p q j⟫_ℝ = |
| 117 | EulerPacketRay.frameSkew (frameMatrix B p q) i j := by |
| 118 | let n := cross p q |
| 119 | have hqp : ⟪q,p⟫_ℝ = 0 := (real_inner_comm _ _).trans hpq |
| 120 | have hpn : ⟪p,n⟫_ℝ = 0 := inner_cross_first p q |
| 121 | have hqn : ⟪q,n⟫_ℝ = 0 := inner_cross_second p q |
| 122 | have hnp : ⟪n,p⟫_ℝ = 0 := (real_inner_comm _ _).trans hpn |
| 123 | have hnq : ⟪n,q⟫_ℝ = 0 := (real_inner_comm _ _).trans hqn |
| 124 | have hpp : ⟪p,rayRate B p⟫_ℝ = 0 := by |
| 125 | simp only [rayRate, inner_add_right, inner_neg_right, real_inner_smul_right, |
| 126 | adjoint_inner_right, hp, mul_one] |
| 127 | rw [real_inner_comm p (B p)] |
| 128 | ring |
| 129 | have hqp' : ⟪q,rayRate B p⟫_ℝ = -⟪p,B q⟫_ℝ := by |
| 130 | simp only [rayRate, inner_add_right, inner_neg_right, real_inner_smul_right, |
| 131 | adjoint_inner_right, hqp, mul_zero, add_zero] |
| 132 | rw [real_inner_comm p (B q)] |
| 133 | have hnp' : ⟪n,rayRate B p⟫_ℝ = -⟪p,B n⟫_ℝ := by |
| 134 | simp only [rayRate, inner_add_right, inner_neg_right, real_inner_smul_right, |
| 135 | adjoint_inner_right, hnp, mul_zero, add_zero] |
| 136 | rw [real_inner_comm p (B n)] |
| 137 | have hpq' : ⟪p,velocityRate B p q⟫_ℝ = ⟪p,B q⟫_ℝ := by |
| 138 | simp only [velocityRate, inner_add_right, inner_neg_right, real_inner_smul_right, |
| 139 | hp, hpq, mul_one, mul_zero, add_zero] |
| 140 | ring |
| 141 | have hqq : ⟪q,velocityRate B p q⟫_ℝ = 0 := by |
| 142 | simp only [velocityRate, inner_add_right, inner_neg_right, real_inner_smul_right, |
| 143 | hq, hqp, mul_one, mul_zero, add_zero] |
| 144 | ring |
| 145 | have hnq' : ⟪n,velocityRate B p q⟫_ℝ = -⟪n,B q⟫_ℝ := by |
| 146 | simp only [velocityRate, inner_add_right, inner_neg_right, real_inner_smul_right, |
| 147 | hnp, hnq, mul_zero, add_zero] |
| 148 | have hpn' : ⟪p,cross (rayRate B p) q + cross p (velocityRate B p q)⟫_ℝ = ⟪p,B n⟫_ℝ := by |
| 149 | rw [inner_add_right, inner_cross_first, add_zero, inner_cross_exchange_first] |
| 150 | rw [real_inner_comm n (rayRate B p), hnp', neg_neg] |
| 151 | have hqn' : ⟪q,cross (rayRate B p) q + cross p (velocityRate B p q)⟫_ℝ = ⟪n,B q⟫_ℝ := by |
| 152 | rw [inner_add_right, inner_cross_second, zero_add, inner_cross_exchange_last] |
| 153 | rw [real_inner_comm n (velocityRate B p q), hnq', neg_neg] |
| 154 | have hnn : ⟪n,cross (rayRate B p) q + cross p (velocityRate B p q)⟫_ℝ = 0 := by |
| 155 | change ⟪cross p q,cross (rayRate B p) q + cross p (velocityRate B p q)⟫_ℝ = _ |
| 156 | rw [inner_add_right, inner_cross_cross, inner_cross_cross, hpp, hqq, hpq, hqp] |
| 157 | ring |
| 158 | intro i j |
| 159 | fin_cases i <;> fin_cases j <;> |
| 160 | dsimp [frame, frameRate, frameMatrix, EulerPacketRay.frameSkew] |
| 161 | · exact hpp |
| 162 | · exact hpq' |
| 163 | · exact hpn' |
| 164 | · exact hqp' |
| 165 | · exact hqq |
| 166 | · exact hqn' |
| 167 | · exact hnp' |
| 168 | · exact hnq' |
| 169 | · exact hnn |
| 170 | |
| 171 | def normalizedFrame (m v : ℝ → Space) (t : ℝ) : Fin 3 → Space := frame (unit (m t)) (unit (v t)) |
| 172 | |
| 173 | theorem normalizedFrame_hasDerivAt (B : Space →L[ℝ] Space) {m v : ℝ → Space} {t : ℝ} |
| 174 | (hm : HasDerivAt m (-B.adjoint (m t)) t) |
| 175 | (hv : HasDerivAt v (-B (v t) + (2*⟪m t,B (v t)⟫_ℝ / ‖m t‖^2) • m t) t) |
| 176 | (hm0 : m t ≠ 0) (hv0 : v t ≠ 0) (hmv : ⟪m t,v t⟫_ℝ = 0) (i : Fin 3) : |
| 177 | HasDerivAt (fun s => normalizedFrame m v s i) |
| 178 | (frameRate B (unit (m t)) (unit (v t)) i) t := by |
| 179 | have hp := normalized_ray_hasDerivAt B hm hm0 |
| 180 | have hq := normalized_velocity_hasDerivAt B hv hv0 hmv |
| 181 | fin_cases i |
| 182 | · exact hp |
| 183 | · exact hq |
| 184 | · exact cross_hasDerivAt hp hq |
| 185 | |
| 186 | theorem normalizedFrame_hasDerivWithinAt (B : Space →L[ℝ] Space) |
| 187 | {m v : ℝ → Space} {t : ℝ} {S : Set ℝ} |
| 188 | (hm : HasDerivWithinAt m (-B.adjoint (m t)) S t) |
| 189 | (hv : HasDerivWithinAt v (-B (v t) + (2*⟪m t,B (v t)⟫_ℝ / ‖m t‖^2) • m t) S t) |
| 190 | (hm0 : m t ≠ 0) (hv0 : v t ≠ 0) (hmv : ⟪m t,v t⟫_ℝ = 0) (i : Fin 3) : |
| 191 | HasDerivWithinAt (fun s => normalizedFrame m v s i) |
| 192 | (frameRate B (unit (m t)) (unit (v t)) i) S t := by |
| 193 | have hp := normalized_ray_hasDerivWithinAt B hm hm0 |
| 194 | have hq := normalized_velocity_hasDerivWithinAt B hv hv0 hmv |
| 195 | fin_cases i |
| 196 | · exact hp |
| 197 | · exact hq |
| 198 | · exact cross_hasDerivWithinAt hp hq |
| 199 | |
| 200 | /-- The source skew matrix is now identified with the derivative of the |
| 201 | actual normalized ray/velocity frame. -/ |
| 202 | theorem normalizedFrame_skew (B : Space →L[ℝ] Space) {m v : ℝ → Space} {t : ℝ} |
| 203 | (hm : HasDerivAt m (-B.adjoint (m t)) t) |
| 204 | (hv : HasDerivAt v (-B (v t) + (2*⟪m t,B (v t)⟫_ℝ / ‖m t‖^2) • m t) t) |
| 205 | (hm0 : m t ≠ 0) (hv0 : v t ≠ 0) (hmv : ⟪m t,v t⟫_ℝ = 0) (i j : Fin 3) : |
| 206 | ⟪normalizedFrame m v t i, deriv (fun s => normalizedFrame m v s j) t⟫_ℝ = |
| 207 | EulerPacketRay.frameSkew (frameMatrix B (unit (m t)) (unit (v t))) i j := by |
| 208 | rw [(normalizedFrame_hasDerivAt B hm hv hm0 hv0 hmv j).deriv] |
| 209 | exact frameRate_skew B (unit (m t)) (unit (v t)) |
| 210 | (unit_inner_self hm0) (unit_inner_self hv0) (unit_inner_zero hmv) i j |
| 211 | |
| 212 | end EulerPacketMovingFrame |