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 NavierStokes.StressActivation |
| 2 | |
| 3 | /-! |
| 4 | # Bounds for a shrinking activation ramp |
| 5 | |
| 6 | The clock `u = y / T` keeps the cutoff fixed while the width tends to zero. |
| 7 | All error factors below are actual transformed integrals and are smooth at |
| 8 | `T = 0`. Compactness therefore gives width-uniform parameter-jet estimates. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | namespace NavierStokes.ActivationBounds |
| 14 | |
| 15 | open Set Filter MeasureTheory Metric ProfileHistories StressActivation |
| 16 | open scoped Topology ContDiff |
| 17 | |
| 18 | section ParameterFactor |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 21 | |
| 22 | noncomputable def parameterCoefficient (B : E × Point → ℝ) (q : (E × ℝ) × ℝ) : ℝ := |
| 23 | B (q.1.1, (q.2, q.1.2)) / stepDenominator 1 q.2 |
| 24 | |
| 25 | noncomputable def parameterFactor (B : E × Point → ℝ) (q : E × Point) : ℝ := |
| 26 | q.2.1 ^ 2 * stepDenominator 1 q.2.1 * |
| 27 | ParametricFlatFactor.factor 1 0 (parameterCoefficient B) ((q.1, q.2.2), q.2.1) |
| 28 | |
| 29 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] in |
| 30 | theorem parameterFactor_eq (B : E × Point → ℝ) (q : E) (p : Point) : |
| 31 | parameterFactor B (q, p) = primitiveFactor 1 (fun z => B (q, z)) p := by |
| 32 | simp only [parameterFactor, primitiveFactor, one_pow] |
| 33 | rfl |
| 34 | |
| 35 | theorem parameterFactor_smooth {S : Set E} (hS : IsOpen S) {J : Set ℝ} (hJ : IsOpen J) |
| 36 | {B : E × Point → ℝ} (hB : ContDiffOn ℝ ∞ B (S ×ˢ (univ ×ˢ J))) : |
| 37 | ContDiffOn ℝ ∞ (parameterFactor B) (S ×ˢ (univ ×ˢ J)) := by |
| 38 | have hb : ContDiffOn ℝ ∞ (parameterCoefficient B) ((S ×ˢ J) ×ˢ (univ : Set ℝ)) := |
| 39 | (hB.comp (contDiff_fst.fst.prodMk (contDiff_snd.prodMk contDiff_fst.snd)).contDiffOn |
| 40 | (fun _ hp => ⟨hp.1.1, mem_univ _, hp.1.2⟩)).div |
| 41 | ((stepDenominator_smooth 1).comp contDiff_snd).contDiffOn |
| 42 | (fun q _ => (stepDenominator_pos 1 q.2).ne') |
| 43 | have hf := flatFactor_local (by norm_num : (0 : ℝ) < 1) 0 (hS.prod hJ) hb |
| 44 | exact ((contDiff_snd.fst.pow 2).mul |
| 45 | ((stepDenominator_smooth 1).comp contDiff_snd.fst)).contDiffOn.mul |
| 46 | (hf.comp ((contDiff_fst.prodMk contDiff_snd.snd).prodMk contDiff_snd.fst).contDiffOn |
| 47 | (fun _ hp => ⟨⟨hp.1, hp.2.2⟩, mem_univ _⟩)) |
| 48 | |
| 49 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] in |
| 50 | @[simp] theorem parameterFactor_zero (B : E × Point → ℝ) (q : E) (η : ℝ) : |
| 51 | parameterFactor B (q, (0, η)) = 0 := by simp [parameterFactor] |
| 52 | |
| 53 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] in |
| 54 | theorem parameterFactor_identity (B : E × Point → ℝ) (q : E) (κ : ℝ) (p : Point) : |
| 55 | weightedPrimitive 1 κ (fun z => B (q, z)) p = |
| 56 | p.1 * activation 1 κ p.1 * parameterFactor B (q, p) := by |
| 57 | rw [parameterFactor_eq] |
| 58 | exact weightedPrimitive_factorization (by norm_num) κ _ p |
| 59 | |
| 60 | omit [FiniteDimensional ℝ E] in |
| 61 | /-- A compact family bounds genuine parameter derivatives, with no restriction |
| 62 | on the number of auxiliary parameters. -/ |
| 63 | theorem compact_parameter_jet_bound {S Q : Set E} (hS : IsOpen S) (hQ : IsCompact Q) |
| 64 | (hQS : Q ⊆ S) {J K : Set ℝ} (hJ : IsOpen J) (hK : IsCompact K) (hKJ : K ⊆ J) |
| 65 | {H : E × Point → ℝ} (hH : ContDiffOn ℝ ∞ H (S ×ˢ (univ ×ˢ J))) (n : ℕ) : |
| 66 | ∃ M : ℝ, 0 ≤ M ∧ ∀ q ∈ Q, ∀ u ∈ Icc (0 : ℝ) 1, ∀ η ∈ K, |
| 67 | |iteratedDeriv n (fun ξ => H (q, (u, ξ))) η| ≤ M := by |
| 68 | have hc : ContinuousOn |
| 69 | (fun z : E × Point => iteratedFDeriv ℝ n (fun ξ => H (z.1, (z.2.1, ξ))) z.2.2) |
| 70 | (S ×ˢ (univ ×ˢ J)) := by |
| 71 | intro z hz |
| 72 | have hp : ContDiffAt ℝ ∞ (fun w : (E × ℝ) × ℝ => H (w.1.1, (w.1.2, w.2))) |
| 73 | ((z.1, z.2.1), z.2.2) := |
| 74 | (hH.contDiffAt ((hS.prod (isOpen_univ.prod hJ)).mem_nhds hz)).comp _ |
| 75 | (contDiffAt_fst.fst.prodMk (contDiffAt_fst.snd.prodMk contDiffAt_snd)) |
| 76 | have hd := ParametricFlatFactor.contDiffAt_partial_iteratedFDeriv |
| 77 | (fun (v : E × ℝ) ξ => H (v.1, (v.2, ξ))) n (z.1, z.2.1) z.2.2 hp |
| 78 | exact ((hd.comp z ((contDiffAt_fst.prodMk contDiffAt_snd.fst).prodMk |
| 79 | contDiffAt_snd.snd)).continuousAt).continuousWithinAt |
| 80 | obtain ⟨M, hM⟩ := (hQ.prod (isCompact_Icc.prod hK)).exists_bound_of_continuousOn |
| 81 | (hc.mono (fun z hz => ⟨hQS hz.1, mem_univ _, hKJ hz.2.2⟩)) |
| 82 | refine ⟨max M 0, le_max_right _ _, ?_⟩ |
| 83 | intro q hq u hu η hη |
| 84 | have hb := hM (q, (u, η)) ⟨hq, hu, hη⟩ |
| 85 | rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv, Real.norm_eq_abs] at hb |
| 86 | exact hb.trans (le_max_left _ _) |
| 87 | |
| 88 | end ParameterFactor |
| 89 | |
| 90 | abbrev ScaledPoint := (ℝ × ℝ) × Point |
| 91 | |
| 92 | noncomputable def scaledDomain (J : Set ℝ) : Set ScaledPoint := univ ×ˢ (univ ×ˢ J) |
| 93 | |
| 94 | theorem scaledDomain_open {J : Set ℝ} (hJ : IsOpen J) : IsOpen (scaledDomain J) := |
| 95 | isOpen_univ.prod (isOpen_univ.prod hJ) |
| 96 | |
| 97 | /-- The auxiliary parameters are `(κ,T)` and the point is `(u,η)`. -/ |
| 98 | noncomputable def rescale (F : Field) (q : ScaledPoint) : ℝ := |
| 99 | F (q.1.2 * q.2.1, q.2.2) |
| 100 | |
| 101 | theorem rescale_smooth {J : Set ℝ} (hJ : IsOpen J) {F : Field} |
| 102 | (hF : ContDiffOn ℝ ∞ F (logDomain J hJ).carrier) : |
| 103 | ContDiffOn ℝ ∞ (rescale F) (scaledDomain J) := |
| 104 | hF.comp ((contDiff_fst.snd.mul contDiff_snd.fst).prodMk contDiff_snd.snd).contDiffOn |
| 105 | (fun _ hp => ⟨mem_univ _, hp.2.2⟩) |
| 106 | |
| 107 | noncomputable def scaledDistance (q : ScaledPoint) : ℝ := |
| 108 | q.1.2 * q.2.1 * activation 1 q.1.1 q.2.1 |
| 109 | |
| 110 | theorem scaledDistance_smooth : ContDiff ℝ ∞ scaledDistance := by |
| 111 | exact (contDiff_fst.snd.mul contDiff_snd.fst).mul |
| 112 | ((contDiff_const.sub contDiff_fst.fst).mul |
| 113 | (OutgoingSchedule.sigma_contDiff.comp (contDiff_snd.fst.div_const 1))) |
| 114 | |
| 115 | theorem activation_scaled {T : ℝ} (hT : T ≠ 0) (κ u : ℝ) : |
| 116 | activation T κ (T * u) = activation 1 κ u := by |
| 117 | simp [activation, mul_div_cancel_left₀ u hT] |
| 118 | |
| 119 | theorem primitive_rescaled (T : ℝ) (F : Field) (u η : ℝ) : |
| 120 | primitive F (T * u, η) = T * primitive (fun p => F (T * p.1, p.2)) (u, η) := by |
| 121 | have ha : ProfileHistories.average F (T * u, η) = |
| 122 | ProfileHistories.average (fun p => F (T * p.1, p.2)) (u, η) := by |
| 123 | unfold ProfileHistories.average |
| 124 | apply intervalIntegral.integral_congr |
| 125 | intro v _ |
| 126 | dsimp only |
| 127 | congr 1 |
| 128 | ring_nf |
| 129 | rw [primitive_eq_mul_average, primitive_eq_mul_average] |
| 130 | dsimp only |
| 131 | rw [ha] |
| 132 | ring |
| 133 | |
| 134 | theorem weightedPrimitive_rescaled {T : ℝ} (hT : T ≠ 0) (κ : ℝ) (B : Field) (u η : ℝ) : |
| 135 | weightedPrimitive T κ B (T * u, η) = |
| 136 | T * weightedPrimitive 1 κ (fun p => B (T * p.1, p.2)) (u, η) := by |
| 137 | unfold weightedPrimitive |
| 138 | rw [primitive_rescaled] |
| 139 | congr 1 |
| 140 | congr 1 |
| 141 | funext p |
| 142 | dsimp only [weightedField] |
| 143 | rw [activation_scaled hT] |
| 144 | |
| 145 | noncomputable def primitiveErrorFactor (B : Field) : ScaledPoint → ℝ := |
| 146 | parameterFactor (rescale B) |
| 147 | |
| 148 | theorem primitiveErrorFactor_smooth {J : Set ℝ} (hJ : IsOpen J) {B : Field} |
| 149 | (hB : ContDiffOn ℝ ∞ B (logDomain J hJ).carrier) : |
| 150 | ContDiffOn ℝ ∞ (primitiveErrorFactor B) (scaledDomain J) := |
| 151 | parameterFactor_smooth isOpen_univ hJ (rescale_smooth hJ hB) |
| 152 | |
| 153 | theorem weightedPrimitive_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ : ℝ) (B : Field) (u η : ℝ) : |
| 154 | weightedPrimitive T κ B (T * u, η) = |
| 155 | scaledDistance ((κ, T), (u, η)) * primitiveErrorFactor B ((κ, T), (u, η)) := by |
| 156 | rw [weightedPrimitive_rescaled hT] |
| 157 | change T * weightedPrimitive 1 κ (fun p => rescale B ((κ, T), p)) (u, η) = _ |
| 158 | rw [parameterFactor_identity] |
| 159 | dsimp only [scaledDistance, primitiveErrorFactor] |
| 160 | ring |
| 161 | |
| 162 | noncomputable def controlledErrorFactor (F : Field) : ScaledPoint → ℝ := |
| 163 | fun q => -primitiveErrorFactor (radialPartial F) q |
| 164 | |
| 165 | theorem controlledErrorFactor_smooth {J : Set ℝ} (hJ : IsOpen J) {F : Field} |
| 166 | (hF : ContDiffOn ℝ ∞ F (logDomain J hJ).carrier) : |
| 167 | ContDiffOn ℝ ∞ (controlledErrorFactor F) (scaledDomain J) := |
| 168 | (primitiveErrorFactor_smooth hJ (radialPartial_smooth (logDomain J hJ) hF)).neg |
| 169 | |
| 170 | theorem controlled_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ : ℝ) |
| 171 | {J : Set ℝ} (hJ : IsOpen J) {F : Field} |
| 172 | (hF : ContDiffOn ℝ ∞ F (logDomain J hJ).carrier) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 173 | controlled T κ F (T * u, η) - F (T * u, η) = |
| 174 | scaledDistance ((κ, T), (u, η)) * controlledErrorFactor F ((κ, T), (u, η)) := by |
| 175 | rw [controlled_sub T κ hJ hF _ hη, weightedPrimitive_scaled_factor hT] |
| 176 | dsimp only [controlledErrorFactor] |
| 177 | ring |
| 178 | |
| 179 | noncomputable def controlledValue (F : Field) (q : ScaledPoint) : ℝ := |
| 180 | rescale F q + scaledDistance q * controlledErrorFactor F q |
| 181 | |
| 182 | theorem controlledValue_smooth {J : Set ℝ} (hJ : IsOpen J) {F : Field} |
| 183 | (hF : ContDiffOn ℝ ∞ F (logDomain J hJ).carrier) : |
| 184 | ContDiffOn ℝ ∞ (controlledValue F) (scaledDomain J) := |
| 185 | (rescale_smooth hJ hF).add (scaledDistance_smooth.contDiffOn.mul (controlledErrorFactor_smooth hJ hF)) |
| 186 | |
| 187 | theorem controlledValue_eq {T : ℝ} (hT : T ≠ 0) (κ : ℝ) |
| 188 | {J : Set ℝ} (hJ : IsOpen J) {F : Field} |
| 189 | (hF : ContDiffOn ℝ ∞ F (logDomain J hJ).carrier) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 190 | controlledValue F ((κ, T), (u, η)) = controlled T κ F (T * u, η) := by |
| 191 | have h := controlled_scaled_factor hT κ hJ hF u hη |
| 192 | dsimp only [controlledValue, rescale] |
| 193 | linarith |
| 194 | |
| 195 | noncomputable def angularValue (L : Field) : ScaledPoint → ℝ := |
| 196 | fun q => Real.exp (controlledValue L q) |
| 197 | |
| 198 | noncomputable def relativeErrorFactor (L : Field) (q : ScaledPoint) : ℝ := |
| 199 | controlledErrorFactor L q * meanExp (scaledDistance q * controlledErrorFactor L q) |
| 200 | |
| 201 | theorem relativeErrorFactor_smooth {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 202 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) : |
| 203 | ContDiffOn ℝ ∞ (relativeErrorFactor L) (scaledDomain J) := |
| 204 | (controlledErrorFactor_smooth hJ hL).mul |
| 205 | (meanExp_smooth.comp_contDiffOn (scaledDistance_smooth.contDiffOn.mul |
| 206 | (controlledErrorFactor_smooth hJ hL))) |
| 207 | |
| 208 | theorem angular_relative_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ : ℝ) |
| 209 | {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 210 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 211 | activatedAngular T κ L (T * u, η) / referenceAngular L (T * u, η) - 1 = |
| 212 | scaledDistance ((κ, T), (u, η)) * relativeErrorFactor L ((κ, T), (u, η)) := by |
| 213 | rw [activatedAngular, referenceAngular, ← Real.exp_sub, controlled_scaled_factor hT κ hJ hL u hη, |
| 214 | exp_sub_one] |
| 215 | dsimp only [relativeErrorFactor] |
| 216 | ring |
| 217 | |
| 218 | noncomputable def angularErrorFactor (L : Field) (q : ScaledPoint) : ℝ := |
| 219 | Real.exp (rescale L q) * relativeErrorFactor L q |
| 220 | |
| 221 | theorem angularErrorFactor_smooth {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 222 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) : |
| 223 | ContDiffOn ℝ ∞ (angularErrorFactor L) (scaledDomain J) := |
| 224 | (rescale_smooth hJ hL).exp.mul (relativeErrorFactor_smooth hJ hL) |
| 225 | |
| 226 | theorem angular_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ : ℝ) |
| 227 | {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 228 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 229 | activatedAngular T κ L (T * u, η) - referenceAngular L (T * u, η) = |
| 230 | scaledDistance ((κ, T), (u, η)) * angularErrorFactor L ((κ, T), (u, η)) := by |
| 231 | have hn : referenceAngular L (T * u, η) ≠ 0 := (Real.exp_pos _).ne' |
| 232 | calc |
| 233 | _ = referenceAngular L (T * u, η) * |
| 234 | (activatedAngular T κ L (T * u, η) / referenceAngular L (T * u, η) - 1) := by |
| 235 | field_simp |
| 236 | _ = _ := by |
| 237 | rw [angular_relative_scaled_factor hT κ hJ hL u hη] |
| 238 | dsimp only [angularErrorFactor, referenceAngular, rescale] |
| 239 | ring |
| 240 | |
| 241 | /-- A smooth fixed-clock factor gives one constant for every positive ramp |
| 242 | width up to `T0`, including widths arbitrarily close to zero. -/ |
| 243 | theorem width_uniform_jet_bound {J K : Set ℝ} (hJ : IsOpen J) (hK : IsCompact K) |
| 244 | (hKJ : K ⊆ J) {H : ScaledPoint → ℝ} |
| 245 | (hH : ContDiffOn ℝ ∞ H (scaledDomain J)) |
| 246 | {E : ℝ → ℝ → ℝ → ℝ → ℝ} |
| 247 | (hE : ∀ κ T, 0 < T → ∀ u η, η ∈ J → |
| 248 | E κ T (T * u) η = scaledDistance ((κ, T), (u, η)) * H ((κ, T), (u, η))) |
| 249 | (T0 : ℝ) (n : ℕ) : |
| 250 | ∃ M : ℝ, 0 ≤ M ∧ ∀ T ∈ Ioc (0 : ℝ) T0, ∀ κ ∈ Icc (0 : ℝ) 1, |
| 251 | ∀ y ∈ Icc (0 : ℝ) T, ∀ η ∈ K, |
| 252 | |iteratedDeriv n (E κ T y) η| ≤ M * y * activation T κ y := by |
| 253 | obtain ⟨M, hM, hb⟩ := compact_parameter_jet_bound isOpen_univ |
| 254 | (isCompact_Icc.prod isCompact_Icc) |
| 255 | (subset_univ (Icc (0 : ℝ) 1 ×ˢ Icc (0 : ℝ) T0)) hJ hK hKJ hH n |
| 256 | refine ⟨M, hM, ?_⟩ |
| 257 | intro T hT κ hκ y hy η hη |
| 258 | let u := y / T |
| 259 | have hu : u ∈ Icc (0 : ℝ) 1 := |
| 260 | ⟨div_nonneg hy.1 hT.1.le, (div_le_one hT.1).2 hy.2⟩ |
| 261 | have hTu : T * u = y := by dsimp only [u]; field_simp [hT.1.ne'] |
| 262 | have hs : scaledDistance ((κ, T), (u, η)) = y * activation T κ y := by |
| 263 | dsimp only [scaledDistance] |
| 264 | rw [← activation_scaled hT.1.ne' κ u, hTu] |
| 265 | have heq : E κ T y =ᶠ[𝓝 η] |
| 266 | (fun ξ => scaledDistance ((κ, T), (u, η)) * H ((κ, T), (u, ξ))) := by |
| 267 | filter_upwards [hJ.mem_nhds (hKJ hη)] with ξ hξ |
| 268 | rw [← hTu] |
| 269 | exact hE κ T hT.1 u ξ hξ |
| 270 | rw [heq.iteratedDeriv_eq n] |
| 271 | have hh : ContDiffAt ℝ ∞ (fun ξ => H ((κ, T), (u, ξ))) η := |
| 272 | (hH.contDiffAt ((scaledDomain_open hJ).mem_nhds |
| 273 | ⟨mem_univ _, mem_univ _, hKJ hη⟩)).comp η |
| 274 | (contDiffAt_const.prodMk (contDiffAt_const.prodMk contDiffAt_id)) |
| 275 | rw [iteratedDeriv_const_mul (n := n) _ (hh.of_le (WithTop.coe_le_coe.mpr le_top)), |
| 276 | abs_mul, hs, abs_of_nonneg (mul_nonneg hy.1 (activation_nonneg T κ y hκ.2))] |
| 277 | have hm := mul_le_mul_of_nonneg_left |
| 278 | (hb (κ, T) ⟨hκ, hT.1.le, hT.2⟩ u hu η hη) |
| 279 | (mul_nonneg hy.1 (activation_nonneg T κ y hκ.2)) |
| 280 | nlinarith |
| 281 | |
| 282 | /-! ## Width-uniform factors for the actual five histories -/ |
| 283 | |
| 284 | noncomputable def densityErrorFactor (X0 : ℝ) (L U : Field) |
| 285 | (r : HistoryRow) (q : ScaledPoint) : ℝ := |
| 286 | let x := radius X0 (q.1.2 * q.2.1) |
| 287 | let df := angularErrorFactor L q |
| 288 | let du := controlledErrorFactor U q |
| 289 | let fa := angularValue L q |
| 290 | let fr := Real.exp (rescale L q) |
| 291 | let ua := controlledValue U q |
| 292 | let ur := rescale U q |
| 293 | match r with |
| 294 | | .mass => x * du |
| 295 | | .angular => 2 * x ^ 2 * df |
| 296 | | .transport => 2 * x ^ 2 * (df * ua + fr * du) |
| 297 | | .energy => x * (du * (ua + ur) - x * df * (fa + fr)) |
| 298 | | .pressure => x * df * (fa + fr) |
| 299 | |
| 300 | theorem densityErrorFactor_smooth (X0 : ℝ) {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 301 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 302 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) (r : HistoryRow) : |
| 303 | ContDiffOn ℝ ∞ (densityErrorFactor X0 L U r) (scaledDomain J) := by |
| 304 | have hx := ((radius_smooth X0).comp (contDiff_fst.snd.mul contDiff_snd.fst)).contDiffOn |
| 305 | (s := scaledDomain J) |
| 306 | have hdf := angularErrorFactor_smooth hJ hL |
| 307 | have hdu := controlledErrorFactor_smooth hJ hU |
| 308 | have hfa := (controlledValue_smooth hJ hL).exp |
| 309 | have hfr := (rescale_smooth hJ hL).exp |
| 310 | have hua := controlledValue_smooth hJ hU |
| 311 | have hur := rescale_smooth hJ hU |
| 312 | cases r with |
| 313 | | mass => exact hx.mul hdu |
| 314 | | angular => exact (contDiffOn_const.mul (hx.pow 2)).mul hdf |
| 315 | | transport => |
| 316 | exact (contDiffOn_const.mul (hx.pow 2)).mul ((hdf.mul hua).add (hfr.mul hdu)) |
| 317 | | energy => exact hx.mul ((hdu.mul (hua.add hur)).sub ((hx.mul hdf).mul (hfa.add hfr))) |
| 318 | | pressure => exact (hx.mul hdf).mul (hfa.add hfr) |
| 319 | |
| 320 | theorem density_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ X0 : ℝ) |
| 321 | {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 322 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 323 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) |
| 324 | (r : HistoryRow) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 325 | logDensity X0 (activatedAngular T κ L) (controlled T κ U) r (T * u, η) - |
| 326 | logDensity X0 (referenceAngular L) U r (T * u, η) = |
| 327 | scaledDistance ((κ, T), (u, η)) * densityErrorFactor X0 L U r ((κ, T), (u, η)) := by |
| 328 | have hf := angular_scaled_factor hT κ hJ hL u hη |
| 329 | have hu := controlled_scaled_factor hT κ hJ hU u hη |
| 330 | have hfa : angularValue L ((κ, T), (u, η)) = activatedAngular T κ L (T * u, η) := by |
| 331 | rw [angularValue, controlledValue_eq hT κ hJ hL u hη] |
| 332 | rfl |
| 333 | have hua := controlledValue_eq hT κ hJ hU u hη |
| 334 | have hf' : angularValue L ((κ, T), (u, η)) = Real.exp (rescale L ((κ, T), (u, η))) + |
| 335 | scaledDistance ((κ, T), (u, η)) * angularErrorFactor L ((κ, T), (u, η)) := by |
| 336 | rw [hfa] |
| 337 | dsimp only [rescale, referenceAngular] at hf ⊢ |
| 338 | linarith |
| 339 | have hu' : controlledValue U ((κ, T), (u, η)) = rescale U ((κ, T), (u, η)) + |
| 340 | scaledDistance ((κ, T), (u, η)) * controlledErrorFactor U ((κ, T), (u, η)) := rfl |
| 341 | change radius X0 (T * u) * radialDensity r (radius X0 (T * u)) |
| 342 | (activatedAngular T κ L (T * u, η)) (controlled T κ U (T * u, η)) - |
| 343 | radius X0 (T * u) * radialDensity r (radius X0 (T * u)) |
| 344 | (Real.exp (rescale L ((κ, T), (u, η)))) (rescale U ((κ, T), (u, η))) = _ |
| 345 | rw [← hfa, ← hua] |
| 346 | cases r <;> dsimp only [radialDensity, densityErrorFactor] <;> |
| 347 | simp only [hf', hu'] <;> ring |
| 348 | |
| 349 | noncomputable def historyCoefficient (X0 : ℝ) (L U : Field) |
| 350 | (r : HistoryRow) (q : ScaledPoint) : ℝ := |
| 351 | q.1.2 * q.2.1 * densityErrorFactor X0 L U r q |
| 352 | |
| 353 | noncomputable def historyErrorFactor (X0 : ℝ) (L U : Field) |
| 354 | (r : HistoryRow) : ScaledPoint → ℝ := |
| 355 | parameterFactor (historyCoefficient X0 L U r) |
| 356 | |
| 357 | theorem historyErrorFactor_smooth (X0 : ℝ) {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 358 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 359 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) (r : HistoryRow) : |
| 360 | ContDiffOn ℝ ∞ (historyErrorFactor X0 L U r) (scaledDomain J) := |
| 361 | parameterFactor_smooth isOpen_univ hJ |
| 362 | ((contDiffOn_fst.snd.mul contDiffOn_snd.fst).mul (densityErrorFactor_smooth X0 hJ hL hU r)) |
| 363 | |
| 364 | @[simp] theorem historyErrorFactor_zero (X0 : ℝ) (L U : Field) |
| 365 | (r : HistoryRow) (κ T η : ℝ) : historyErrorFactor X0 L U r ((κ, T), (0, η)) = 0 := by |
| 366 | exact parameterFactor_zero _ _ _ |
| 367 | |
| 368 | theorem history_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ X0 : ℝ) |
| 369 | (initial : HistoryRow → ℝ → ℝ) {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 370 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 371 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) |
| 372 | (r : HistoryRow) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 373 | logHistory X0 initial (activatedAngular T κ L) (controlled T κ U) r (T * u, η) - |
| 374 | logHistory X0 initial (referenceAngular L) U r (T * u, η) = |
| 375 | scaledDistance ((κ, T), (u, η)) * historyErrorFactor X0 L U r ((κ, T), (u, η)) := by |
| 376 | let D : Field := fun p => logDensity X0 (activatedAngular T κ L) (controlled T κ U) r p - |
| 377 | logDensity X0 (referenceAngular L) U r p |
| 378 | have ha := radial_slice_intervalIntegrable (logDomain J hJ) |
| 379 | (logDensity_smooth X0 hJ (activatedAngular_smooth T κ hJ hL) |
| 380 | (controlled_smooth T κ hJ hU) r) (p := (T * u, η)) ⟨mem_univ _, hη⟩ |
| 381 | have hr := radial_slice_intervalIntegrable (logDomain J hJ) |
| 382 | (logDensity_smooth X0 hJ hL.exp hU r) (p := (T * u, η)) ⟨mem_univ _, hη⟩ |
| 383 | change IntervalIntegrable |
| 384 | (fun t => logDensity X0 (activatedAngular T κ L) (controlled T κ U) r (t, η)) volume 0 (T * u) at ha |
| 385 | change IntervalIntegrable |
| 386 | (fun t => logDensity X0 (referenceAngular L) U r (t, η)) volume 0 (T * u) at hr |
| 387 | have hsub : logHistory X0 initial (activatedAngular T κ L) (controlled T κ U) r (T * u, η) - |
| 388 | logHistory X0 initial (referenceAngular L) U r (T * u, η) = primitive D (T * u, η) := by |
| 389 | dsimp only [logHistory, primitive, D] |
| 390 | rw [add_sub_add_left_eq_sub, intervalIntegral.integral_sub ha hr] |
| 391 | rw [hsub, primitive_rescaled] |
| 392 | calc |
| 393 | T * primitive (fun p => D (T * p.1, p.2)) (u, η) = |
| 394 | T * weightedPrimitive 1 κ (fun p => historyCoefficient X0 L U r ((κ, T), p)) (u, η) := by |
| 395 | congr 1 |
| 396 | apply intervalIntegral.integral_congr |
| 397 | intro v _ |
| 398 | dsimp only [D, weightedField] |
| 399 | rw [density_scaled_factor hT κ X0 hJ hL hU r v hη] |
| 400 | dsimp only [scaledDistance, historyCoefficient] |
| 401 | ring |
| 402 | _ = _ := by |
| 403 | rw [parameterFactor_identity] |
| 404 | dsimp only [scaledDistance, historyErrorFactor] |
| 405 | ring |
| 406 | |
| 407 | /-! ## Genuine parameter differentiation of the scaled factors -/ |
| 408 | |
| 409 | noncomputable def etaD (H : ScaledPoint → ℝ) (q : ScaledPoint) : ℝ := |
| 410 | deriv (fun ξ => H (q.1, (q.2.1, ξ))) q.2.2 |
| 411 | |
| 412 | noncomputable def etaLinear (H : ScaledPoint → ℝ) (q : ScaledPoint) : ℝ := |
| 413 | fderiv ℝ H q ((0, 0), (0, 1)) |
| 414 | |
| 415 | theorem etaLinear_hasDerivAt {J : Set ℝ} (hJ : IsOpen J) {H : ScaledPoint → ℝ} |
| 416 | (hH : ContDiffOn ℝ ∞ H (scaledDomain J)) {q : ScaledPoint} (hq : q ∈ scaledDomain J) : |
| 417 | HasDerivAt (fun ξ => H (q.1, (q.2.1, ξ))) (etaLinear H q) q.2.2 := by |
| 418 | have hd := (hH.contDiffAt ((scaledDomain_open hJ).mem_nhds hq)).differentiableAt (by simp) |
| 419 | have h := hd.hasFDerivAt.comp_hasDerivAt q.2.2 |
| 420 | ((hasDerivAt_const q.2.2 q.1).prodMk |
| 421 | ((hasDerivAt_const q.2.2 q.2.1).prodMk (hasDerivAt_id q.2.2))) |
| 422 | simp only [Function.comp_def, id_eq] at h |
| 423 | exact h |
| 424 | |
| 425 | theorem etaD_eq_etaLinear {J : Set ℝ} (hJ : IsOpen J) {H : ScaledPoint → ℝ} |
| 426 | (hH : ContDiffOn ℝ ∞ H (scaledDomain J)) {q : ScaledPoint} (hq : q ∈ scaledDomain J) : |
| 427 | etaD H q = etaLinear H q := (etaLinear_hasDerivAt hJ hH hq).deriv |
| 428 | |
| 429 | theorem etaD_smooth {J : Set ℝ} (hJ : IsOpen J) {H : ScaledPoint → ℝ} |
| 430 | (hH : ContDiffOn ℝ ∞ H (scaledDomain J)) : |
| 431 | ContDiffOn ℝ ∞ (etaD H) (scaledDomain J) := by |
| 432 | have hl : ContDiffOn ℝ ∞ (etaLinear H) (scaledDomain J) := |
| 433 | (hH.fderiv_of_isOpen (scaledDomain_open hJ) (by simp)).clm_apply contDiffOn_const |
| 434 | exact hl.congr (fun _ hq => etaD_eq_etaLinear hJ hH hq) |
| 435 | |
| 436 | theorem etaD_hasDerivAt {J : Set ℝ} (hJ : IsOpen J) {H : ScaledPoint → ℝ} |
| 437 | (hH : ContDiffOn ℝ ∞ H (scaledDomain J)) {q : ScaledPoint} (hq : q ∈ scaledDomain J) : |
| 438 | HasDerivAt (fun ξ => H (q.1, (q.2.1, ξ))) (etaD H q) q.2.2 := by |
| 439 | rw [etaD_eq_etaLinear hJ hH hq] |
| 440 | exact etaLinear_hasDerivAt hJ hH hq |
| 441 | |
| 442 | theorem etaD_scaledDistance_mul (H : ScaledPoint → ℝ) (q : ScaledPoint) : |
| 443 | etaD (fun z => scaledDistance z * H z) q = scaledDistance q * etaD H q := by |
| 444 | exact deriv_const_mul_field (scaledDistance q) |
| 445 | |
| 446 | theorem etaD_congr {J : Set ℝ} (hJ : IsOpen J) {H G : ScaledPoint → ℝ} |
| 447 | (h : ∀ q ∈ scaledDomain J, H q = G q) {q : ScaledPoint} (hq : q ∈ scaledDomain J) : |
| 448 | etaD H q = etaD G q := by |
| 449 | apply Filter.EventuallyEq.deriv_eq |
| 450 | filter_upwards [hJ.mem_nhds hq.2.2] with ξ hξ |
| 451 | exact h (q.1, (q.2.1, ξ)) ⟨hq.1, hq.2.1, hξ⟩ |
| 452 | |
| 453 | /-! ## Independence of the continuation length on the natural overlap -/ |
| 454 | |
| 455 | namespace NaturalOverlap |
| 456 | |
| 457 | open ReferencePath |
| 458 | |
| 459 | variable (N : ReferencePath.Input) |
| 460 | |
| 461 | end NaturalOverlap |
| 462 | |
| 463 | end NavierStokes.ActivationBounds |