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.MeanValue |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.Operations |
| 3 | import Mathlib.Topology.ContinuousMap.Compact |
| 4 | import Mathlib.Topology.CompactOpen |
| 5 | |
| 6 | /-! |
| 7 | # Jointly smooth functions as smooth families on a compact set |
| 8 | |
| 9 | This generalizes `SmoothPathFamily` from a compact real interval to any |
| 10 | compact subset of a real normed space. The Fréchet derivative in the |
| 11 | supremum norm is proved by a uniform mean-value remainder estimate. |
| 12 | -/ |
| 13 | |
| 14 | namespace NavierStokes.CompactSmoothFamily |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open Set Filter Function Metric Asymptotics |
| 19 | open scoped Topology ContDiff |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | variable {P Z E : Type u} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 24 | [NormedAddCommGroup Z] [NormedSpace ℝ Z] |
| 25 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 26 | |
| 27 | /-- The actual slice when continuous, with a zero fallback outside the domain |
| 28 | where the hypotheses guarantee continuity. -/ |
| 29 | noncomputable def family (K : Set Z) (F : P × Z → E) (p : P) : C(K, E) := by |
| 30 | classical |
| 31 | exact if h : Continuous (fun z : K => F (p, z)) then ⟨_, h⟩ else 0 |
| 32 | |
| 33 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedSpace ℝ Z] [NormedSpace ℝ E] in |
| 34 | theorem family_apply (K : Set Z) (F : P × Z → E) (p : P) |
| 35 | (hp : Continuous (fun z : K => F (p, z))) (z : K) : |
| 36 | family K F p z = F (p, z) := by |
| 37 | simp only [family, dite_eq_left hp, ContinuousMap.coe_mk] |
| 38 | |
| 39 | omit [NormedSpace ℝ P] [NormedSpace ℝ Z] [NormedSpace ℝ E] in |
| 40 | theorem slice_continuous {K : Set Z} {U : Set P} {F : P × Z → E} |
| 41 | (hF : ContinuousOn F (U ×ˢ K)) {p : P} (hp : p ∈ U) : |
| 42 | Continuous (fun z : K => F (p, z)) := |
| 43 | hF.comp_continuous (continuous_const.prodMk continuous_subtype_val) |
| 44 | (fun z => ⟨hp, z.2⟩) |
| 45 | |
| 46 | omit [NormedSpace ℝ P] [NormedSpace ℝ Z] [NormedSpace ℝ E] in |
| 47 | theorem continuousOn_family {K : Set Z} [CompactSpace K] {U : Set P} {F : P × Z → E} |
| 48 | (hF : ContinuousOn F (U ×ˢ K)) : ContinuousOn (family K F) U := by |
| 49 | apply continuousOn_iff_continuous_domRestrict.mpr |
| 50 | apply ContinuousMap.continuous_of_continuous_uncurry |
| 51 | have hc : Continuous (fun z : U × K => F (z.1, z.2)) := |
| 52 | hF.comp_continuous |
| 53 | ((continuous_subtype_val.comp continuous_fst).prodMk |
| 54 | (continuous_subtype_val.comp continuous_snd)) |
| 55 | (fun z => ⟨z.1.2, z.2.2⟩) |
| 56 | convert! hc using 1 |
| 57 | funext z |
| 58 | exact family_apply K F z.1 (slice_continuous hF z.1.2) z.2 |
| 59 | |
| 60 | noncomputable def flipLinear (K : Set Z) : |
| 61 | C(K, P →L[ℝ] E) →ₗ[ℝ] P →ₗ[ℝ] C(K, E) where |
| 62 | toFun g := { |
| 63 | toFun := fun v => ⟨fun z => g z v, g.continuous.clm_apply continuous_const⟩ |
| 64 | map_add' := by intros; ext z; exact map_add (g z) _ _ |
| 65 | map_smul' := by intros; ext z; exact map_smul (g z) _ _ } |
| 66 | map_add' := by intros; ext v z; rfl |
| 67 | map_smul' := by intros; ext v z; rfl |
| 68 | |
| 69 | omit [NormedSpace ℝ Z] in |
| 70 | theorem norm_flipLinear_le (K : Set Z) [CompactSpace K] |
| 71 | (g : C(K, P →L[ℝ] E)) (v : P) : ‖flipLinear K g v‖ ≤ ‖g‖ * ‖v‖ := by |
| 72 | apply (ContinuousMap.norm_le (flipLinear K g v) |
| 73 | (mul_nonneg (norm_nonneg g) (norm_nonneg v))).mpr |
| 74 | intro z |
| 75 | exact ((g z).le_opNorm v).trans |
| 76 | (mul_le_mul_of_nonneg_right (g.norm_coe_le_norm z) (norm_nonneg v)) |
| 77 | |
| 78 | noncomputable def flipCLM (K : Set Z) [CompactSpace K] : |
| 79 | C(K, P →L[ℝ] E) →L[ℝ] P →L[ℝ] C(K, E) := |
| 80 | (flipLinear (P := P) (E := E) K).mkContinuous₂ |
| 81 | (𝕜 := ℝ) (𝕜₂ := ℝ) (𝕜₃ := ℝ) 1 |
| 82 | (fun (g : C(K, P →L[ℝ] E)) (v : P) => by |
| 83 | simpa only [one_mul] using norm_flipLinear_le K g v) |
| 84 | |
| 85 | omit [NormedSpace ℝ Z] in |
| 86 | theorem flipCLM_apply (K : Set Z) [CompactSpace K] |
| 87 | (g : C(K, P →L[ℝ] E)) (v : P) (z : K) : |
| 88 | flipCLM (P := P) (E := E) K g v z = g z v := rfl |
| 89 | |
| 90 | omit [NormedSpace ℝ Z] in |
| 91 | /-- Actual slice derivatives and their joint continuity give the Fréchet |
| 92 | derivative of the compact-family map in the supremum norm. -/ |
| 93 | theorem hasFDerivAt_family (K : Set Z) [CompactSpace K] {U : Set P} (hU : IsOpen U) |
| 94 | (F : P × Z → E) (G : P × Z → P →L[ℝ] E) |
| 95 | (hF : ContinuousOn F (U ×ˢ K)) (hG : ContinuousOn G (U ×ˢ K)) |
| 96 | (hderiv : ∀ p ∈ U, ∀ z : K, HasFDerivAt (fun q => F (q, z)) (G (p, z)) p) |
| 97 | {p : P} (hp : p ∈ U) : |
| 98 | HasFDerivAt (family K F) (flipCLM (P := P) (E := E) K (family K G p)) p := by |
| 99 | rw [hasFDerivAt_iff_isLittleO_nhds_zero] |
| 100 | apply isLittleO_iff.mpr |
| 101 | intro ε hε |
| 102 | have hgc : ContinuousAt (family K G) p := |
| 103 | (continuousOn_family hG).continuousAt (hU.mem_nhds hp) |
| 104 | have hsmall : ∀ᶠ q in 𝓝 p, ‖family K G q - family K G p‖ < ε := by |
| 105 | simpa only [dist_eq_norm] using (Metric.tendsto_nhds.mp hgc ε hε) |
| 106 | have hnear : ∀ᶠ q in 𝓝 p, q ∈ U := hU.mem_nhds hp |
| 107 | obtain ⟨δ, hδ, hδmem⟩ := Metric.eventually_nhds_iff.mp (hnear.and hsmall) |
| 108 | filter_upwards [Metric.ball_mem_nhds (0 : P) hδ] with v hv |
| 109 | have hv' : p + v ∈ ball p δ := by |
| 110 | simpa only [mem_ball, dist_eq_norm, add_sub_cancel_left, sub_zero] using hv |
| 111 | have hq := (hδmem hv').1 |
| 112 | apply (ContinuousMap.norm_le _ (mul_nonneg hε.le (norm_nonneg v))).mpr |
| 113 | intro z |
| 114 | simp only [ContinuousMap.sub_apply, flipCLM_apply, |
| 115 | family_apply K F (p + v) (slice_continuous hF hq), |
| 116 | family_apply K F p (slice_continuous hF hp), |
| 117 | family_apply K G p (slice_continuous hG hp)] |
| 118 | have hd : ∀ q ∈ ball p δ, |
| 119 | HasFDerivWithinAt (fun q => F (q, z) - G (p, z) q) |
| 120 | (G (q, z) - G (p, z)) (ball p δ) q := by |
| 121 | intro q hq' |
| 122 | exact ((hderiv q (hδmem hq').1 z).sub (G (p, z)).hasFDerivAt).hasFDerivWithinAt |
| 123 | have hb : ∀ q ∈ ball p δ, ‖G (q, z) - G (p, z)‖ ≤ ε := by |
| 124 | intro q hq' |
| 125 | have hcontq := slice_continuous hG (hδmem hq').1 |
| 126 | have hcontp := slice_continuous hG hp |
| 127 | calc |
| 128 | _ = ‖(family K G q - family K G p : C(K, P →L[ℝ] E)) z‖ := by |
| 129 | simp only [ContinuousMap.sub_apply, family_apply K G q hcontq, |
| 130 | family_apply K G p hcontp] |
| 131 | _ ≤ ‖family K G q - family K G p‖ := ContinuousMap.norm_coe_le_norm _ z |
| 132 | _ ≤ ε := (hδmem hq').2.le |
| 133 | have hmean := (convex_ball p δ).norm_image_sub_le_of_norm_hasFDerivWithin_le |
| 134 | hd hb (mem_ball_self hδ) hv' |
| 135 | have heq : F (p + v, z) - F (p, z) - G (p, z) v = |
| 136 | (F (p + v, z) - G (p, z) (p + v)) - (F (p, z) - G (p, z) p) := by |
| 137 | rw [map_add] |
| 138 | abel |
| 139 | rw [heq] |
| 140 | simpa only [add_sub_cancel_left] using hmean |
| 141 | |
| 142 | noncomputable def parameterDerivative (F : P × Z → E) (z : P × Z) : P →L[ℝ] E := |
| 143 | (fderiv ℝ F z).comp (ContinuousLinearMap.inl ℝ P Z) |
| 144 | |
| 145 | /-- Every finite joint differentiability order lifts to the compact-family space. -/ |
| 146 | theorem contDiffOn_family_nat (K : Set Z) [CompactSpace K] (U : Set P) (V : Set Z) |
| 147 | (hU : IsOpen U) (hV : IsOpen V) (hK : K ⊆ V) (n : ℕ) : |
| 148 | ∀ {W : Type u} [NormedAddCommGroup W] [NormedSpace ℝ W] (F : P × Z → W), |
| 149 | ContDiffOn ℝ n F (U ×ˢ V) → ContDiffOn ℝ n (family K F) U := by |
| 150 | induction n with |
| 151 | | zero => |
| 152 | intro W _ _ F hF |
| 153 | exact contDiffOn_zero.mpr (continuousOn_family |
| 154 | (hF.continuousOn.mono (Set.prod_mono Subset.rfl hK))) |
| 155 | | succ n ih => |
| 156 | intro W _ _ F hF |
| 157 | have hFs : ContDiffOn ℝ ((n : WithTop ℕ∞) + 1) F (U ×ˢ V) := by |
| 158 | simpa only [Nat.cast_add, Nat.cast_one] using hF |
| 159 | have hdata := (contDiffOn_succ_iff_fderiv_of_isOpen (hU.prod hV)).mp hFs |
| 160 | have hD : ContDiffOn ℝ n (parameterDerivative F) (U ×ˢ V) := |
| 161 | hdata.2.2.clm_comp contDiffOn_const |
| 162 | have hFc : ContinuousOn F (U ×ˢ K) := |
| 163 | hF.continuousOn.mono (Set.prod_mono Subset.rfl hK) |
| 164 | have hDc : ContinuousOn (parameterDerivative F) (U ×ˢ K) := |
| 165 | hD.continuousOn.mono (Set.prod_mono Subset.rfl hK) |
| 166 | have hd : ∀ p ∈ U, HasFDerivAt (family K F) |
| 167 | (flipCLM (P := P) (E := W) K (family K (parameterDerivative F) p)) p := by |
| 168 | intro p hp |
| 169 | apply hasFDerivAt_family K hU F (parameterDerivative F) hFc hDc _ hp |
| 170 | intro q hq z |
| 171 | have hDF := (hdata.1 (q, (z : Z)) ⟨hq, hK z.2⟩).differentiableAt |
| 172 | ((hU.prod hV).mem_nhds ⟨hq, hK z.2⟩) |
| 173 | exact hDF.hasFDerivAt.comp q (hasFDerivAt_prodMk_left q (z : Z)) |
| 174 | have hfamilyD := ih (parameterDerivative F) hD |
| 175 | let L : C(K, P →L[ℝ] W) →L[ℝ] P →L[ℝ] C(K, W) := flipCLM K |
| 176 | have hL : ContDiff ℝ (n : WithTop ℕ∞) L := |
| 177 | ContinuousLinearMap.contDiff (𝕜 := ℝ) (n := n) |
| 178 | (E := C(K, P →L[ℝ] W)) (F := P →L[ℝ] C(K, W)) L |
| 179 | have hflip : ContDiffOn ℝ n |
| 180 | (fun p => flipCLM (P := P) (E := W) K (family K (parameterDerivative F) p)) U := |
| 181 | hL.comp_contDiffOn hfamilyD |
| 182 | have hresult : ContDiffOn ℝ ((n : WithTop ℕ∞) + 1) (family K F) U := by |
| 183 | apply (contDiffOn_succ_iff_hasFDerivWithinAt_of_uniqueDiffOn hU.uniqueDiffOn).mpr |
| 184 | refine ⟨?_, _, hflip, fun p hp => (hd p hp).hasFDerivWithinAt⟩ |
| 185 | intro hω |
| 186 | exact (WithTop.coe_ne_top hω).elim |
| 187 | simpa only [Nat.cast_add, Nat.cast_one] using hresult |
| 188 | |
| 189 | /-- Joint smoothness near the compact set gives smoothness in the supremum norm. -/ |
| 190 | theorem contDiffOn_family_of_joint (K : Set Z) [CompactSpace K] (U : Set P) (V : Set Z) |
| 191 | (hU : IsOpen U) (hV : IsOpen V) (hK : K ⊆ V) |
| 192 | (F : P × Z → E) (hF : ContDiffOn ℝ ∞ F (U ×ˢ V)) : |
| 193 | ContDiffOn ℝ ∞ (family K F) U := by |
| 194 | apply contDiffOn_infty.mpr |
| 195 | intro n |
| 196 | exact contDiffOn_family_nat K U V hU hV hK n F |
| 197 | (hF.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl n)) |
| 198 | |
| 199 | /-- Evaluating an actual compact-family jet gives the genuine parameter jet |
| 200 | of the original fixed-point slice. -/ |
| 201 | theorem iteratedFDeriv_family_apply (K : Set Z) [CompactSpace K] (U : Set P) (V : Set Z) |
| 202 | (hU : IsOpen U) (hV : IsOpen V) (hK : K ⊆ V) |
| 203 | (F : P × Z → E) (hF : ContDiffOn ℝ ∞ F (U ×ˢ V)) |
| 204 | {p : P} (hp : p ∈ U) (k : ℕ) (v : Fin k → P) (z : K) : |
| 205 | (iteratedFDeriv ℝ k (family K F) p v) z = |
| 206 | iteratedFDeriv ℝ k (fun q => F (q, z)) p v := by |
| 207 | let ev : C(K, E) →L[ℝ] E := ContinuousMap.evalCLM ℝ z |
| 208 | have hfamily := contDiffOn_family_of_joint K U V hU hV hK F hF |
| 209 | have hcomp := ev.iteratedFDerivWithin_comp_left (hfamily p hp) hU.uniqueDiffOn hp |
| 210 | (ENat.natCast_le_of_coe_top_le_withTop le_rfl k) |
| 211 | have hsame : EqOn (ev ∘ family K F) (fun q => F (q, z)) U := by |
| 212 | intro q hq |
| 213 | exact family_apply K F q |
| 214 | (slice_continuous (hF.continuousOn.mono (Set.prod_mono Subset.rfl hK)) hq) z |
| 215 | have heq := iteratedFDerivWithin_congr (𝕜 := ℝ) hsame hp k |
| 216 | have hv := congrArg (fun L : P [×k]→L[ℝ] E => L v) (hcomp.symm.trans heq) |
| 217 | change (iteratedFDerivWithin ℝ k (family K F) U p v) z = |
| 218 | iteratedFDerivWithin ℝ k (fun q => F (q, z)) U p v at hv |
| 219 | simpa only [iteratedFDerivWithin_of_isOpen k hU hp] using hv |
| 220 | |
| 221 | omit [NormedSpace ℝ P] [NormedSpace ℝ Z] [NormedSpace ℝ E] in |
| 222 | theorem family_apply_of_joint (K : Set Z) {U : Set P} {V : Set Z} |
| 223 | (hK : K ⊆ V) (F : P × Z → E) (hF : ContinuousOn F (U ×ˢ V)) |
| 224 | {p : P} (hp : p ∈ U) (z : K) : family K F p z = F (p, z) := |
| 225 | family_apply K F p (slice_continuous (hF.mono (Set.prod_mono Subset.rfl hK)) hp) z |
| 226 | |
| 227 | /-- An arbitrary open neighborhood of `U × K` suffices; a fixed product |
| 228 | neighborhood is extracted locally at each parameter using compactness. -/ |
| 229 | theorem contDiffOn_family_of_neighborhood (K : Set Z) [CompactSpace K] |
| 230 | (U : Set P) (W : Set (P × Z)) (hW : IsOpen W) (hUK : U ×ˢ K ⊆ W) |
| 231 | (F : P × Z → E) (hF : ContDiffOn ℝ ∞ F W) : |
| 232 | ContDiffOn ℝ ∞ (family K F) U := by |
| 233 | intro p hp |
| 234 | have hKc : IsCompact K := isCompact_iff_compactSpace.mpr inferInstance |
| 235 | have hs : ({p} : Set P) ×ˢ K ⊆ W := by |
| 236 | rintro ⟨q, z⟩ ⟨hq, hz⟩ |
| 237 | have hqp : q = p := by simpa only [mem_singleton_iff] using hq |
| 238 | subst q |
| 239 | exact hUK ⟨hp, hz⟩ |
| 240 | obtain ⟨U', V', hU', hV', hpU, hKV, hsub⟩ := |
| 241 | generalized_tube_lemma isCompact_singleton hKc hW hs |
| 242 | have hp' : p ∈ U' := hpU (by simp) |
| 243 | have hlocal := contDiffOn_family_of_joint K U' V' hU' hV' hKV F (hF.mono hsub) |
| 244 | exact (hlocal.contDiffAt (hU'.mem_nhds hp')).contDiffWithinAt |
| 245 | |
| 246 | theorem iteratedFDeriv_family_apply_of_neighborhood (K : Set Z) [CompactSpace K] |
| 247 | (U : Set P) (W : Set (P × Z)) (hW : IsOpen W) (hUK : U ×ˢ K ⊆ W) |
| 248 | (F : P × Z → E) (hF : ContDiffOn ℝ ∞ F W) |
| 249 | {p : P} (hp : p ∈ U) (k : ℕ) (v : Fin k → P) (z : K) : |
| 250 | (iteratedFDeriv ℝ k (family K F) p v) z = |
| 251 | iteratedFDeriv ℝ k (fun q => F (q, z)) p v := by |
| 252 | have hKc : IsCompact K := isCompact_iff_compactSpace.mpr inferInstance |
| 253 | have hs : ({p} : Set P) ×ˢ K ⊆ W := by |
| 254 | rintro ⟨q, z⟩ ⟨hq, hz⟩ |
| 255 | have hqp : q = p := by simpa only [mem_singleton_iff] using hq |
| 256 | subst q |
| 257 | exact hUK ⟨hp, hz⟩ |
| 258 | obtain ⟨U', V', hU', hV', hpU, hKV, hsub⟩ := |
| 259 | generalized_tube_lemma isCompact_singleton hKc hW hs |
| 260 | exact iteratedFDeriv_family_apply K U' V' hU' hV' hKV F (hF.mono hsub) |
| 261 | (hpU (by simp)) k v z |
| 262 | |
| 263 | end |
| 264 | |
| 265 | end NavierStokes.CompactSmoothFamily |