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.TransportPrimitive |
| 2 | import NavierStokes.PressureStream |
| 3 | import Mathlib.MeasureTheory.Integral.IntegralEqImproper |
| 4 | import Mathlib.Analysis.Calculus.Deriv.Support |
| 5 | import Mathlib.MeasureTheory.Function.LocallyIntegrable |
| 6 | |
| 7 | /-! |
| 8 | # Integrated tangential balances from actual radial differential expressions |
| 9 | |
| 10 | All moments below are actual Bochner integrals. Compact radial support supplies |
| 11 | the boundary cancellations, and parameter derivatives pass under integrals by |
| 12 | the dominated differentiation theorem in `TransportPrimitive`. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | namespace NavierStokes.IntegratedMeanBalances |
| 18 | |
| 19 | open Set Function MeasureTheory Filter |
| 20 | open scoped ContDiff Topology Interval |
| 21 | |
| 22 | noncomputable def moment (n : ℕ) (f : ℝ → ℝ) : ℝ := ∫ r, r ^ n * f r |
| 23 | |
| 24 | theorem weighted_integrable {f : ℝ → ℝ} (hf : Continuous f) |
| 25 | (hs : HasCompactSupport f) (n : ℕ) : Integrable (fun r => r ^ n * f r) := |
| 26 | ((continuous_id.pow n).mul hf).integrable_of_hasCompactSupport hs.mul_left |
| 27 | |
| 28 | theorem moment_add {f g : ℝ → ℝ} (n : ℕ) |
| 29 | (hf : Integrable (fun r => r ^ n * f r)) |
| 30 | (hg : Integrable (fun r => r ^ n * g r)) : |
| 31 | moment n (fun r => f r + g r) = moment n f + moment n g := by |
| 32 | simp only [moment, mul_add] |
| 33 | exact integral_add hf hg |
| 34 | |
| 35 | theorem moment_sub {f g : ℝ → ℝ} (n : ℕ) |
| 36 | (hf : Integrable (fun r => r ^ n * f r)) |
| 37 | (hg : Integrable (fun r => r ^ n * g r)) : |
| 38 | moment n (fun r => f r - g r) = moment n f - moment n g := by |
| 39 | simp only [moment, mul_sub] |
| 40 | exact integral_sub hf hg |
| 41 | |
| 42 | theorem moment_const_mul (n : ℕ) (c : ℝ) (f : ℝ → ℝ) : |
| 43 | moment n (fun r => c * f r) = c * moment n f := by |
| 44 | simp only [moment, ← mul_assoc, mul_comm _ c] |
| 45 | simp only [mul_assoc, integral_const_mul] |
| 46 | |
| 47 | theorem moment_mul_const (n : ℕ) (f : ℝ → ℝ) (c : ℝ) : |
| 48 | moment n (fun r => f r * c) = moment n f * c := by |
| 49 | simp only [moment, ← mul_assoc, integral_mul_const] |
| 50 | |
| 51 | theorem deriv_smooth {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) : |
| 52 | ContDiff ℝ ∞ (deriv f) := |
| 53 | (hf.fderiv_right (by simp)).clm_apply contDiff_const |
| 54 | |
| 55 | theorem ae_radial_ne_zero : ∀ᵐ r : ℝ, r ≠ 0 := by |
| 56 | simpa only [mem_singleton_iff] using (countable_singleton (0 : ℝ)).ae_notMem volume |
| 57 | |
| 58 | theorem integral_deriv_zero {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 59 | (hs : HasCompactSupport f) : (∫ r, deriv f r) = 0 := |
| 60 | integral_eq_zero_of_hasDerivAt_of_integrable |
| 61 | (fun r => (hf.differentiable (by simp) r).hasDerivAt) |
| 62 | ((deriv_smooth hf).continuous.integrable_of_hasCompactSupport hs.deriv) |
| 63 | (hf.continuous.integrable_of_hasCompactSupport hs) |
| 64 | |
| 65 | /-- Weighted integration by parts; compact support supplies both endpoint terms. -/ |
| 66 | theorem moment_deriv_succ {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 67 | (hs : HasCompactSupport f) (n : ℕ) : |
| 68 | moment (n + 1) (deriv f) = -((n + 1 : ℕ) : ℝ) * moment n f := by |
| 69 | have hd : ∀ r : ℝ, HasDerivAt (fun s : ℝ => s ^ (n + 1)) |
| 70 | (((n + 1 : ℕ) : ℝ) * r ^ n) r := by |
| 71 | intro r |
| 72 | simpa using (hasDerivAt_id r).fun_pow (n + 1) |
| 73 | have hi := integral_mul_deriv_eq_deriv_mul_of_integrable (fun r _ => hd r) |
| 74 | (fun r _ => (hf.differentiable (by simp) r).hasDerivAt) |
| 75 | (weighted_integrable (deriv_smooth hf).continuous hs.deriv (n + 1)) |
| 76 | (by |
| 77 | change Integrable (fun r => (((n + 1 : ℕ) : ℝ) * r ^ n) * f r) |
| 78 | simpa only [mul_assoc] using |
| 79 | (weighted_integrable hf.continuous hs n).const_mul ((n + 1 : ℕ) : ℝ)) |
| 80 | (weighted_integrable hf.continuous hs (n + 1)) |
| 81 | simpa only [moment, Pi.mul_apply, mul_assoc, integral_const_mul, neg_mul] using hi |
| 82 | |
| 83 | noncomputable def radialDivergence (c : ℝ) (f : ℝ → ℝ) (r : ℝ) : ℝ := |
| 84 | deriv f r + c / r * f r |
| 85 | |
| 86 | noncomputable def angularRadialViscosity (f : ℝ → ℝ) (r : ℝ) : ℝ := |
| 87 | deriv (deriv f) r + deriv f r / r - f r / r ^ 2 |
| 88 | |
| 89 | noncomputable def axialRadialViscosity (f : ℝ → ℝ) (r : ℝ) : ℝ := |
| 90 | deriv (deriv f) r + deriv f r / r |
| 91 | |
| 92 | theorem weighted_angular_divergence_ae (f : ℝ → ℝ) : |
| 93 | (fun r => r ^ 2 * radialDivergence 2 f r) =ᵐ[volume] |
| 94 | (fun r => r ^ 2 * deriv f r + 2 * (r * f r)) := by |
| 95 | filter_upwards [ae_radial_ne_zero] with r hr |
| 96 | unfold radialDivergence |
| 97 | field_simp [hr] |
| 98 | |
| 99 | theorem weighted_axial_divergence_ae (f : ℝ → ℝ) : |
| 100 | (fun r => r * radialDivergence 1 f r) =ᵐ[volume] |
| 101 | (fun r => r * deriv f r + f r) := by |
| 102 | filter_upwards [ae_radial_ne_zero] with r hr |
| 103 | unfold radialDivergence |
| 104 | field_simp [hr] |
| 105 | |
| 106 | theorem angular_divergence_integrable {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 107 | (hs : HasCompactSupport f) : Integrable (fun r => r ^ 2 * radialDivergence 2 f r) := by |
| 108 | apply Integrable.congr _ (weighted_angular_divergence_ae f).symm |
| 109 | have h := (weighted_integrable (deriv_smooth hf).continuous hs.deriv 2).add |
| 110 | ((weighted_integrable hf.continuous hs 1).const_mul 2) |
| 111 | simp only [pow_one] at h |
| 112 | exact h |
| 113 | |
| 114 | theorem axial_divergence_integrable {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 115 | (hs : HasCompactSupport f) : Integrable (fun r => r * radialDivergence 1 f r) := by |
| 116 | apply Integrable.congr _ (weighted_axial_divergence_ae f).symm |
| 117 | have h := (weighted_integrable (deriv_smooth hf).continuous hs.deriv 1).add |
| 118 | (hf.continuous.integrable_of_hasCompactSupport hs) |
| 119 | simp only [pow_one] at h |
| 120 | exact h |
| 121 | |
| 122 | theorem moment_angular_divergence {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 123 | (hs : HasCompactSupport f) : moment 2 (radialDivergence 2 f) = 0 := by |
| 124 | have hi1 := weighted_integrable (deriv_smooth hf).continuous hs.deriv 2 |
| 125 | have hi2 : Integrable (fun r => 2 * (r * f r)) := by |
| 126 | simpa only [pow_one] using (weighted_integrable hf.continuous hs 1).const_mul 2 |
| 127 | unfold moment |
| 128 | rw [integral_congr_ae (weighted_angular_divergence_ae f), integral_add hi1 hi2, |
| 129 | integral_const_mul] |
| 130 | have hb := moment_deriv_succ hf hs 1 |
| 131 | norm_num [moment] at hb |
| 132 | linarith |
| 133 | |
| 134 | theorem moment_axial_divergence {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 135 | (hs : HasCompactSupport f) : moment 1 (radialDivergence 1 f) = 0 := by |
| 136 | have hi1 : Integrable (fun r => r * deriv f r) := by |
| 137 | simpa only [pow_one] using weighted_integrable (deriv_smooth hf).continuous hs.deriv 1 |
| 138 | have hi2 : Integrable f := hf.continuous.integrable_of_hasCompactSupport hs |
| 139 | simp only [moment, pow_one] |
| 140 | rw [integral_congr_ae (weighted_axial_divergence_ae f), integral_add hi1 hi2] |
| 141 | have hb := moment_deriv_succ hf hs 0 |
| 142 | norm_num [moment] at hb |
| 143 | linarith |
| 144 | |
| 145 | /-- The radial pressure moment follows from the actual derivative equation. -/ |
| 146 | theorem pressure_moment {p g : ℝ → ℝ} (hp : ContDiff ℝ ∞ p) |
| 147 | (hs : HasCompactSupport p) (hd : ∀ r, deriv p r = g r) : |
| 148 | moment 1 p = -(1 / 2 : ℝ) * moment 2 g := by |
| 149 | have hb := moment_deriv_succ hp hs 1 |
| 150 | rw [show deriv p = g from funext hd] at hb |
| 151 | norm_num at hb |
| 152 | linarith |
| 153 | |
| 154 | theorem pressure_moment_reconstructed {p g ρ : ℝ → ℝ} (P : ℝ) |
| 155 | (hp : ContDiff ℝ ∞ p) (hsp : HasCompactSupport p) |
| 156 | (hg : Continuous g) (hsg : HasCompactSupport g) |
| 157 | (hρ : Continuous ρ) (hsρ : HasCompactSupport ρ) |
| 158 | (hd : ∀ r, deriv p r = g r - ρ r * P) : |
| 159 | moment 1 p = -(1 / 2 : ℝ) * moment 2 g + (moment 2 ρ / 2) * P := by |
| 160 | rw [pressure_moment hp hsp hd, |
| 161 | moment_sub 2 (weighted_integrable hg hsg 2) |
| 162 | (by simpa only [mul_assoc] using |
| 163 | (weighted_integrable hρ hsρ 2).mul_const P), moment_mul_const] |
| 164 | ring |
| 165 | |
| 166 | theorem weighted_angular_viscosity_ae (f : ℝ → ℝ) : |
| 167 | (fun r => r ^ 2 * angularRadialViscosity f r) =ᵐ[volume] |
| 168 | (fun r => r ^ 2 * deriv (deriv f) r + r * deriv f r - f r) := by |
| 169 | filter_upwards [ae_radial_ne_zero] with r hr |
| 170 | unfold angularRadialViscosity |
| 171 | field_simp [hr] |
| 172 | |
| 173 | theorem weighted_axial_viscosity_ae (f : ℝ → ℝ) : |
| 174 | (fun r => r * axialRadialViscosity f r) =ᵐ[volume] |
| 175 | (fun r => r * deriv (deriv f) r + deriv f r) := by |
| 176 | filter_upwards [ae_radial_ne_zero] with r hr |
| 177 | unfold axialRadialViscosity |
| 178 | field_simp [hr] |
| 179 | |
| 180 | theorem angular_viscosity_integrable {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 181 | (hs : HasCompactSupport f) : Integrable (fun r => r ^ 2 * angularRadialViscosity f r) := by |
| 182 | apply Integrable.congr _ (weighted_angular_viscosity_ae f).symm |
| 183 | have h1 : Integrable (fun r => r * deriv f r) := by |
| 184 | simpa only [pow_one] using weighted_integrable (deriv_smooth hf).continuous hs.deriv 1 |
| 185 | exact ((weighted_integrable (deriv_smooth (deriv_smooth hf)).continuous hs.deriv.deriv 2).add |
| 186 | h1).sub (hf.continuous.integrable_of_hasCompactSupport hs) |
| 187 | |
| 188 | theorem axial_viscosity_integrable {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 189 | (hs : HasCompactSupport f) : Integrable (fun r => r * axialRadialViscosity f r) := by |
| 190 | apply Integrable.congr _ (weighted_axial_viscosity_ae f).symm |
| 191 | have h1 : Integrable (fun r => r * deriv (deriv f) r) := by |
| 192 | simpa only [pow_one] using |
| 193 | weighted_integrable (deriv_smooth (deriv_smooth hf)).continuous hs.deriv.deriv 1 |
| 194 | exact h1.add ((deriv_smooth hf).continuous.integrable_of_hasCompactSupport hs.deriv) |
| 195 | |
| 196 | theorem moment_angular_viscosity {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 197 | (hs : HasCompactSupport f) : moment 2 (angularRadialViscosity f) = 0 := by |
| 198 | have hi2 := weighted_integrable (deriv_smooth (deriv_smooth hf)).continuous hs.deriv.deriv 2 |
| 199 | have hi1 : Integrable (fun r => r * deriv f r) := by |
| 200 | simpa only [pow_one] using weighted_integrable (deriv_smooth hf).continuous hs.deriv 1 |
| 201 | have hi0 : Integrable f := hf.continuous.integrable_of_hasCompactSupport hs |
| 202 | have his : Integrable (fun r => r ^ 2 * deriv (deriv f) r + r * deriv f r) := hi2.add hi1 |
| 203 | unfold moment |
| 204 | rw [integral_congr_ae (weighted_angular_viscosity_ae f), |
| 205 | integral_sub his hi0, integral_add hi2 hi1] |
| 206 | have h2 := moment_deriv_succ (deriv_smooth hf) hs.deriv 1 |
| 207 | have h1 := moment_deriv_succ hf hs 0 |
| 208 | norm_num [moment] at h1 h2 |
| 209 | linarith |
| 210 | |
| 211 | theorem moment_axial_viscosity {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 212 | (hs : HasCompactSupport f) : moment 1 (axialRadialViscosity f) = 0 := by |
| 213 | have hi1 : Integrable (fun r => r * deriv (deriv f) r) := by |
| 214 | simpa only [pow_one] using |
| 215 | weighted_integrable (deriv_smooth (deriv_smooth hf)).continuous hs.deriv.deriv 1 |
| 216 | have hi0 : Integrable (deriv f) := |
| 217 | (deriv_smooth hf).continuous.integrable_of_hasCompactSupport hs.deriv |
| 218 | simp only [moment, pow_one] |
| 219 | rw [integral_congr_ae (weighted_axial_viscosity_ae f), integral_add hi1 hi0] |
| 220 | have h1 := moment_deriv_succ (deriv_smooth hf) hs.deriv 0 |
| 221 | norm_num [moment] at h1 |
| 222 | linarith |
| 223 | |
| 224 | theorem positive_integral_eq_integral {a b : ℝ} (ha : 0 < a) {f : ℝ → ℝ} |
| 225 | (hs : support f ⊆ Icc a b) : (∫ r in Ioi (0 : ℝ), f r) = ∫ r, f r := by |
| 226 | apply setIntegral_eq_integral_of_forall_compl_eq_zero |
| 227 | intro r hr |
| 228 | by_contra hf |
| 229 | exact hr (ha.trans_le (hs hf).1) |
| 230 | |
| 231 | /-! ## Smooth compact radial families and their moments -/ |
| 232 | |
| 233 | section Families |
| 234 | |
| 235 | variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 236 | |
| 237 | noncomputable def radialMoment (n : ℕ) (F : ℝ × P → ℝ) (p : P) : ℝ := |
| 238 | moment n (fun r => F (r, p)) |
| 239 | |
| 240 | noncomputable def parameterPartial (v : P) (F : ℝ × P → ℝ) (x : ℝ × P) : ℝ := |
| 241 | fderiv ℝ F x (0, v) |
| 242 | |
| 243 | theorem parameterPartial_smooth (v : P) {F : ℝ × P → ℝ} |
| 244 | (hF : ContDiff ℝ ∞ F) : ContDiff ℝ ∞ (parameterPartial v F) := |
| 245 | (hF.fderiv_right (by simp)).clm_apply contDiff_const |
| 246 | |
| 247 | theorem parameterPartial_supported (v : P) {a b : ℝ} {F : ℝ × P → ℝ} |
| 248 | (hs : RadialAlias.RadiallySupported a b F) : |
| 249 | RadialAlias.RadiallySupported a b (parameterPartial v F) := |
| 250 | RadialAlias.radialSupport_fderiv_apply hs (0, v) |
| 251 | |
| 252 | theorem radial_slice_smooth {F : ℝ × P → ℝ} (hF : ContDiff ℝ ∞ F) (p : P) : |
| 253 | ContDiff ℝ ∞ (fun r => F (r, p)) := |
| 254 | hF.comp (contDiff_id.prodMk contDiff_const) |
| 255 | |
| 256 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 257 | theorem radial_slice_compact {a b : ℝ} {F : ℝ × P → ℝ} |
| 258 | (hs : RadialAlias.RadiallySupported a b F) (p : P) : |
| 259 | HasCompactSupport (fun r => F (r, p)) := |
| 260 | HasCompactSupport.intro isCompact_Icc (fun r hr => by |
| 261 | by_contra h |
| 262 | exact hr (hs h)) |
| 263 | |
| 264 | omit [NormedSpace ℝ P] in |
| 265 | theorem radialMoment_eq_interval {a b : ℝ} {F : ℝ × P → ℝ} |
| 266 | (hF : Continuous F) (hs : RadialAlias.RadiallySupported a b F) (n : ℕ) (p : P) : |
| 267 | radialMoment n F p = ∫ r in a..b, r ^ n * F (r, p) := by |
| 268 | symm |
| 269 | apply intervalIntegral.integral_eq_integral_of_support_subset |
| 270 | have hc : Continuous (fun r => r ^ n * F (r, p)) := |
| 271 | (continuous_id.pow n).mul (hF.comp (continuous_id.prodMk continuous_const)) |
| 272 | have hsp : support (fun r => r ^ n * F (r, p)) ⊆ Icc a b := by |
| 273 | intro r hr |
| 274 | exact hs (right_ne_zero_of_mul hr) |
| 275 | have hi : support (fun r => r ^ n * F (r, p)) ⊆ Ioo a b := by |
| 276 | simpa only [interior_Icc] using hc.isOpen_support.subset_interior_iff.mpr hsp |
| 277 | exact hi.trans Ioo_subset_Ioc_self |
| 278 | |
| 279 | theorem parameterIntegral_fderiv_apply {F : P × ℝ → ℝ} (hF : ContDiff ℝ ∞ F) |
| 280 | (a b : ℝ) (p v : P) : |
| 281 | fderiv ℝ (fun q => ∫ r in a..b, F (q, r)) p v = |
| 282 | ∫ r in a..b, fderiv ℝ F (p, r) (v, 0) := by |
| 283 | rw [(TransportPrimitive.parameterIntegral_hasFDerivAt (g := F) hF a b p).fderiv, |
| 284 | ContinuousLinearMap.intervalIntegral_apply] |
| 285 | · rfl |
| 286 | · exact ((TransportPrimitive.parameterDerivative_contDiff hF).continuous.comp |
| 287 | (continuous_const.prodMk continuous_id)).intervalIntegrable a b |
| 288 | |
| 289 | theorem weighted_swap_smooth {F : ℝ × P → ℝ} (hF : ContDiff ℝ ∞ F) (n : ℕ) : |
| 290 | ContDiff ℝ ∞ (fun x : P × ℝ => x.2 ^ n * F (x.2, x.1)) := |
| 291 | (contDiff_snd.pow n).mul (hF.comp (contDiff_snd.prodMk contDiff_fst)) |
| 292 | |
| 293 | theorem radialMoment_smooth {a b : ℝ} {F : ℝ × P → ℝ} (hF : ContDiff ℝ ∞ F) |
| 294 | (hs : RadialAlias.RadiallySupported a b F) (n : ℕ) : |
| 295 | ContDiff ℝ ∞ (radialMoment n F) := by |
| 296 | have he : radialMoment n F = (fun p => ∫ r in a..b, r ^ n * F (r, p)) := |
| 297 | funext (radialMoment_eq_interval hF.continuous hs n) |
| 298 | rw [he] |
| 299 | exact TransportPrimitive.parameterIntegral_contDiff |
| 300 | (g := fun x : P × ℝ => x.2 ^ n * F (x.2, x.1)) (weighted_swap_smooth hF n) a b |
| 301 | |
| 302 | theorem radialMoment_parameterPartial {a b : ℝ} {F : ℝ × P → ℝ} (hF : ContDiff ℝ ∞ F) |
| 303 | (hs : RadialAlias.RadiallySupported a b F) (n : ℕ) (p v : P) : |
| 304 | fderiv ℝ (radialMoment n F) p v = radialMoment n (parameterPartial v F) p := by |
| 305 | have he : radialMoment n F = (fun q => ∫ r in a..b, r ^ n * F (r, q)) := |
| 306 | funext (radialMoment_eq_interval hF.continuous hs n) |
| 307 | rw [he, parameterIntegral_fderiv_apply (weighted_swap_smooth hF n), |
| 308 | radialMoment_eq_interval (parameterPartial_smooth v hF).continuous |
| 309 | (parameterPartial_supported v hs)] |
| 310 | apply intervalIntegral.integral_congr |
| 311 | intro r _ |
| 312 | have hslice : HasFDerivAt (fun q : P => r ^ n * F (r, q)) |
| 313 | ((r ^ n) • (fderiv ℝ F (r, p)).comp (ContinuousLinearMap.inr ℝ ℝ P)) p := by |
| 314 | exact (((hF.differentiable (by simp)) (r, p)).hasFDerivAt.comp p |
| 315 | (hasFDerivAt_prodMk_right r p)).const_mul (r ^ n) |
| 316 | have heq := (TransportPrimitive.parameter_hasFDerivAt |
| 317 | (g := fun x : P × ℝ => x.2 ^ n * F (x.2, x.1)) |
| 318 | (weighted_swap_smooth hF n) p r).unique hslice |
| 319 | exact congrArg (fun L : P →L[ℝ] ℝ => L v) heq |
| 320 | |
| 321 | theorem zero_mass_parameterPartial {a b : ℝ} {F : ℝ × P → ℝ} (hF : ContDiff ℝ ∞ F) |
| 322 | (hs : RadialAlias.RadiallySupported a b F) (n : ℕ) |
| 323 | (hm : radialMoment n F = 0) (p v : P) : |
| 324 | radialMoment n (parameterPartial v F) p = 0 := by |
| 325 | rw [← radialMoment_parameterPartial hF hs n p v, hm] |
| 326 | simp |
| 327 | |
| 328 | theorem zero_mass_parameterPartial_twice {a b : ℝ} {F : ℝ × P → ℝ} (hF : ContDiff ℝ ∞ F) |
| 329 | (hs : RadialAlias.RadiallySupported a b F) (n : ℕ) |
| 330 | (hm : radialMoment n F = 0) (p v w : P) : |
| 331 | radialMoment n (parameterPartial w (parameterPartial v F)) p = 0 := by |
| 332 | apply zero_mass_parameterPartial (parameterPartial_smooth v hF) |
| 333 | (parameterPartial_supported v hs) n _ p w |
| 334 | funext q |
| 335 | exact zero_mass_parameterPartial hF hs n hm q v |
| 336 | |
| 337 | end Families |
| 338 | |
| 339 | /-! ## Actual torus averages annihilate the lift derivatives -/ |
| 340 | |
| 341 | section Torus |
| 342 | |
| 343 | variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 344 | |
| 345 | noncomputable def torusInner (F : (P × ℝ) × ℝ → ℝ) (q : P × ℝ) : ℝ := |
| 346 | ∫ x in (0 : ℝ)..1, F (q, x) |
| 347 | |
| 348 | noncomputable def torusAverage (F : (P × ℝ) × ℝ → ℝ) (p : P) : ℝ := |
| 349 | ∫ y in (0 : ℝ)..1, torusInner F (p, y) |
| 350 | |
| 351 | noncomputable def fixedPartial (v : (P × ℝ) × ℝ) (F : (P × ℝ) × ℝ → ℝ) |
| 352 | (q : (P × ℝ) × ℝ) : ℝ := fderiv ℝ F q v |
| 353 | |
| 354 | noncomputable def slowPartial (v : P) (F : (P × ℝ) × ℝ → ℝ) : (P × ℝ) × ℝ → ℝ := |
| 355 | fixedPartial ((v, 0), 0) F |
| 356 | |
| 357 | noncomputable def torusPartial (v : ℝ × ℝ) (F : (P × ℝ) × ℝ → ℝ) : (P × ℝ) × ℝ → ℝ := |
| 358 | fixedPartial ((0, v.2), v.1) F |
| 359 | |
| 360 | structure TorusPeriodic (F : (P × ℝ) × ℝ → ℝ) : Prop where |
| 361 | first : ∀ q, F (q + ((0, 0), 1)) = F q |
| 362 | second : ∀ q, F (q + ((0, 1), 0)) = F q |
| 363 | |
| 364 | theorem fixedPartial_smooth (v : (P × ℝ) × ℝ) {F : (P × ℝ) × ℝ → ℝ} |
| 365 | (hF : ContDiff ℝ ∞ F) : ContDiff ℝ ∞ (fixedPartial v F) := |
| 366 | (hF.fderiv_right (by simp)).clm_apply contDiff_const |
| 367 | |
| 368 | theorem fixedPartial_periodic (v : (P × ℝ) × ℝ) {F : (P × ℝ) × ℝ → ℝ} |
| 369 | (hp : TorusPeriodic F) : TorusPeriodic (fixedPartial v F) := by |
| 370 | constructor |
| 371 | · intro q |
| 372 | have he : (fun x => F (x + ((0, 0), 1))) = F := funext hp.first |
| 373 | have hd := congrArg (fun f => fderiv ℝ f q) he |
| 374 | rw [fderiv_comp_add_right] at hd |
| 375 | exact congrArg (fun L : ((P × ℝ) × ℝ) →L[ℝ] ℝ => L v) hd |
| 376 | · intro q |
| 377 | have he : (fun x => F (x + ((0, 1), 0))) = F := funext hp.second |
| 378 | have hd := congrArg (fun f => fderiv ℝ f q) he |
| 379 | rw [fderiv_comp_add_right] at hd |
| 380 | exact congrArg (fun L : ((P × ℝ) × ℝ) →L[ℝ] ℝ => L v) hd |
| 381 | |
| 382 | theorem torusInner_smooth {F : (P × ℝ) × ℝ → ℝ} (hF : ContDiff ℝ ∞ F) : |
| 383 | ContDiff ℝ ∞ (torusInner F) := |
| 384 | TransportPrimitive.parameterIntegral_contDiff (g := F) hF 0 1 |
| 385 | |
| 386 | theorem torusAverage_smooth {F : (P × ℝ) × ℝ → ℝ} (hF : ContDiff ℝ ∞ F) : |
| 387 | ContDiff ℝ ∞ (torusAverage F) := |
| 388 | TransportPrimitive.parameterIntegral_contDiff (g := torusInner F) (torusInner_smooth hF) 0 1 |
| 389 | |
| 390 | /-- Both parameter-integral interchanges are proved from joint smoothness on |
| 391 | the compact torus coordinate square. -/ |
| 392 | theorem torusAverage_fderiv {F : (P × ℝ) × ℝ → ℝ} (hF : ContDiff ℝ ∞ F) (p v : P) : |
| 393 | fderiv ℝ (torusAverage F) p v = torusAverage (slowPartial v F) p := by |
| 394 | rw [show torusAverage F = (fun p => ∫ y in (0 : ℝ)..1, torusInner F (p, y)) from rfl, |
| 395 | parameterIntegral_fderiv_apply (torusInner_smooth hF) 0 1 p v] |
| 396 | apply intervalIntegral.integral_congr |
| 397 | intro y _ |
| 398 | exact parameterIntegral_fderiv_apply hF 0 1 (p, y) (v, 0) |
| 399 | |
| 400 | theorem torusAverage_add {F G : (P × ℝ) × ℝ → ℝ} |
| 401 | (hF : ContDiff ℝ ∞ F) (hG : ContDiff ℝ ∞ G) (p : P) : |
| 402 | torusAverage (fun q => F q + G q) p = torusAverage F p + torusAverage G p := by |
| 403 | have he : torusInner (fun q => F q + G q) = (fun q => torusInner F q + torusInner G q) := by |
| 404 | funext q |
| 405 | exact intervalIntegral.integral_add |
| 406 | ((hF.continuous.comp (continuous_const.prodMk continuous_id)).intervalIntegrable 0 1) |
| 407 | ((hG.continuous.comp (continuous_const.prodMk continuous_id)).intervalIntegrable 0 1) |
| 408 | unfold torusAverage |
| 409 | rw [he] |
| 410 | exact intervalIntegral.integral_add |
| 411 | (((torusInner_smooth hF).continuous.comp |
| 412 | (continuous_const.prodMk continuous_id)).intervalIntegrable 0 1) |
| 413 | (((torusInner_smooth hG).continuous.comp |
| 414 | (continuous_const.prodMk continuous_id)).intervalIntegrable 0 1) |
| 415 | |
| 416 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 417 | theorem torusAverage_coeff_mul (a : P → ℝ) (F : (P × ℝ) × ℝ → ℝ) (p : P) : |
| 418 | torusAverage (fun q => a q.1.1 * F q) p = a p * torusAverage F p := by |
| 419 | simp only [torusAverage, torusInner, intervalIntegral.integral_const_mul] |
| 420 | |
| 421 | theorem torusAverage_first_zero {F : (P × ℝ) × ℝ → ℝ} |
| 422 | (hF : ContDiff ℝ ∞ F) (hp : TorusPeriodic F) (p : P) : |
| 423 | torusAverage (fixedPartial ((0, 0), 1) F) p = 0 := by |
| 424 | have hi : ∀ y, torusInner (fixedPartial ((0, 0), 1) F) (p, y) = 0 := by |
| 425 | intro y |
| 426 | have hd : ∀ x, HasDerivAt (fun s => F ((p, y), s)) |
| 427 | (fixedPartial ((0, 0), 1) F ((p, y), x)) x := by |
| 428 | intro x |
| 429 | exact ((hF.differentiable (by simp)) ((p, y), x)).hasFDerivAt.comp_hasDerivAt x |
| 430 | ((hasDerivAt_const x (p, y)).prodMk (hasDerivAt_id x)) |
| 431 | have hftc := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun x _ => hd x) |
| 432 | (((fixedPartial_smooth ((0, 0), 1) hF).continuous.comp |
| 433 | (continuous_const.prodMk continuous_id)).intervalIntegrable 0 1) |
| 434 | have he : F ((p, y), 1) = F ((p, y), 0) := by |
| 435 | simpa only [Prod.add_def, add_zero, zero_add] using hp.first ((p, y), 0) |
| 436 | rw [he, sub_self] at hftc |
| 437 | exact hftc |
| 438 | simp only [torusAverage, hi, intervalIntegral.integral_zero] |
| 439 | |
| 440 | theorem torusAverage_second_zero {F : (P × ℝ) × ℝ → ℝ} |
| 441 | (hF : ContDiff ℝ ∞ F) (hp : TorusPeriodic F) (p : P) : |
| 442 | torusAverage (fixedPartial ((0, 1), 0) F) p = 0 := by |
| 443 | have hd : ∀ y, HasDerivAt (fun s => torusInner F (p, s)) |
| 444 | (torusInner (fixedPartial ((0, 1), 0) F) (p, y)) y := by |
| 445 | intro y |
| 446 | have hh := (((torusInner_smooth hF).differentiable (by simp)) (p, y)).hasFDerivAt.comp_hasDerivAt y |
| 447 | ((hasDerivAt_const y p).prodMk (hasDerivAt_id y)) |
| 448 | have he := parameterIntegral_fderiv_apply hF 0 1 (p, y) (0, 1) |
| 449 | change fderiv ℝ (torusInner F) (p, y) (0, 1) = |
| 450 | torusInner (fixedPartial ((0, 1), 0) F) (p, y) at he |
| 451 | rw [he] at hh |
| 452 | exact hh |
| 453 | have hc : IntervalIntegrable |
| 454 | (fun y => torusInner (fixedPartial ((0, 1), 0) F) (p, y)) volume 0 1 := |
| 455 | ((torusInner_smooth (fixedPartial_smooth ((0, 1), 0) hF)).continuous.comp |
| 456 | (continuous_const.prodMk continuous_id)).intervalIntegrable 0 1 |
| 457 | have hftc := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun y _ => hd y) hc |
| 458 | have he : torusInner F (p, 1) = torusInner F (p, 0) := by |
| 459 | apply intervalIntegral.integral_congr |
| 460 | intro x _ |
| 461 | simpa only [Prod.add_def, add_zero, zero_add] using hp.second ((p, 0), x) |
| 462 | simpa only [torusAverage, he, sub_self] using hftc |
| 463 | |
| 464 | theorem torusPartial_decompose (v : ℝ × ℝ) (F : (P × ℝ) × ℝ → ℝ) : |
| 465 | torusPartial v F = (fun q => v.1 * fixedPartial ((0, 0), 1) F q + |
| 466 | v.2 * fixedPartial ((0, 1), 0) F q) := by |
| 467 | funext q |
| 468 | have hv : (((0 : P), v.2), v.1) = |
| 469 | v.1 • (((0 : P), 0), (1 : ℝ)) + v.2 • (((0 : P), 1), (0 : ℝ)) := by |
| 470 | ext <;> simp |
| 471 | simp only [torusPartial, fixedPartial, hv, map_add, map_smul, smul_eq_mul] |
| 472 | |
| 473 | theorem torusAverage_torusPartial_zero (v : ℝ × ℝ) {F : (P × ℝ) × ℝ → ℝ} |
| 474 | (hF : ContDiff ℝ ∞ F) (hp : TorusPeriodic F) (p : P) : |
| 475 | torusAverage (torusPartial v F) p = 0 := by |
| 476 | rw [torusPartial_decompose, |
| 477 | torusAverage_add (contDiff_const.mul (fixedPartial_smooth _ hF)) |
| 478 | (contDiff_const.mul (fixedPartial_smooth _ hF))] |
| 479 | rw [torusAverage_coeff_mul (fun _ => v.1), torusAverage_coeff_mul (fun _ => v.2), |
| 480 | torusAverage_first_zero hF hp, torusAverage_second_zero hF hp] |
| 481 | simp |
| 482 | |
| 483 | noncomputable def graphPartial (a : P → ℝ) (v : P) (w : ℝ × ℝ) |
| 484 | (F : (P × ℝ) × ℝ → ℝ) (q : (P × ℝ) × ℝ) : ℝ := |
| 485 | slowPartial v F q + a q.1.1 * torusPartial w F q |
| 486 | |
| 487 | theorem graphPartial_smooth {a : P → ℝ} {F : (P × ℝ) × ℝ → ℝ} |
| 488 | (ha : ContDiff ℝ ∞ a) (hF : ContDiff ℝ ∞ F) (v : P) (w : ℝ × ℝ) : |
| 489 | ContDiff ℝ ∞ (graphPartial a v w F) := |
| 490 | (fixedPartial_smooth _ hF).add ((ha.comp contDiff_fst.fst).mul (fixedPartial_smooth _ hF)) |
| 491 | |
| 492 | theorem graphPartial_periodic (a : P → ℝ) (v : P) (w : ℝ × ℝ) |
| 493 | {F : (P × ℝ) × ℝ → ℝ} (hp : TorusPeriodic F) : |
| 494 | TorusPeriodic (graphPartial a v w F) := by |
| 495 | have hs := fixedPartial_periodic ((v, 0), 0) hp |
| 496 | have ht := fixedPartial_periodic ((0, w.2), w.1) hp |
| 497 | constructor |
| 498 | · intro q |
| 499 | simp only [graphPartial, slowPartial, torusPartial] |
| 500 | rw [hs.first, ht.first] |
| 501 | simp only [Prod.add_def, add_zero] |
| 502 | · intro q |
| 503 | simp only [graphPartial, slowPartial, torusPartial] |
| 504 | rw [hs.second, ht.second] |
| 505 | simp only [Prod.add_def, add_zero] |
| 506 | |
| 507 | /-- Graph lift terms integrate to zero; only the genuine slow derivative remains. -/ |
| 508 | theorem torusAverage_graphPartial {a : P → ℝ} {F : (P × ℝ) × ℝ → ℝ} |
| 509 | (ha : ContDiff ℝ ∞ a) (hF : ContDiff ℝ ∞ F) (hp : TorusPeriodic F) |
| 510 | (v p : P) (w : ℝ × ℝ) : |
| 511 | torusAverage (graphPartial a v w F) p = fderiv ℝ (torusAverage F) p v := by |
| 512 | have hs : ContDiff ℝ ∞ (slowPartial v F) := fixedPartial_smooth _ hF |
| 513 | have ht : ContDiff ℝ ∞ (fun q => a q.1.1 * torusPartial w F q) := |
| 514 | (ha.comp contDiff_fst.fst).mul (fixedPartial_smooth _ hF) |
| 515 | unfold graphPartial |
| 516 | rw [torusAverage_add hs ht, torusAverage_coeff_mul, |
| 517 | torusAverage_torusPartial_zero w hF hp, mul_zero, add_zero] |
| 518 | exact (torusAverage_fderiv hF p v).symm |
| 519 | |
| 520 | theorem torusAverage_graphPartial_twice {a : P → ℝ} {F : (P × ℝ) × ℝ → ℝ} |
| 521 | (ha : ContDiff ℝ ∞ a) (hF : ContDiff ℝ ∞ F) (hp : TorusPeriodic F) |
| 522 | (v p : P) (w : ℝ × ℝ) : |
| 523 | torusAverage (graphPartial a v w (graphPartial a v w F)) p = |
| 524 | fderiv ℝ (fun q => fderiv ℝ (torusAverage F) q v) p v := by |
| 525 | rw [torusAverage_graphPartial ha (graphPartial_smooth ha hF v w) |
| 526 | (graphPartial_periodic a v w hp)] |
| 527 | have he : torusAverage (graphPartial a v w F) = |
| 528 | (fun q => fderiv ℝ (torusAverage F) q v) := |
| 529 | funext (fun q => torusAverage_graphPartial ha hF hp v q w) |
| 530 | rw [he] |
| 531 | |
| 532 | end Torus |
| 533 | |
| 534 | /-! ## The averaged chart balances and their exact weighted integrals -/ |
| 535 | |
| 536 | theorem weighted_integrable_add {n : ℕ} {f g : ℝ → ℝ} |
| 537 | (hf : Integrable (fun r => r ^ n * f r)) |
| 538 | (hg : Integrable (fun r => r ^ n * g r)) : |
| 539 | Integrable (fun r => r ^ n * (f r + g r)) := by |
| 540 | have hh : Integrable (fun r => r ^ n * f r + r ^ n * g r) := hf.add hg |
| 541 | simpa only [mul_add] using hh |
| 542 | |
| 543 | theorem weighted_integrable_sub {n : ℕ} {f g : ℝ → ℝ} |
| 544 | (hf : Integrable (fun r => r ^ n * f r)) |
| 545 | (hg : Integrable (fun r => r ^ n * g r)) : |
| 546 | Integrable (fun r => r ^ n * (f r - g r)) := by |
| 547 | have hh : Integrable (fun r => r ^ n * f r - r ^ n * g r) := hf.sub hg |
| 548 | simpa only [mul_sub] using hh |
| 549 | |
| 550 | theorem weighted_integrable_const_mul {n : ℕ} {f : ℝ → ℝ} |
| 551 | (hf : Integrable (fun r => r ^ n * f r)) (c : ℝ) : |
| 552 | Integrable (fun r => r ^ n * (c * f r)) := by |
| 553 | have hh : Integrable (fun r => c * (r ^ n * f r)) := hf.const_mul c |
| 554 | simpa only [mul_left_comm] using hh |
| 555 | |
| 556 | theorem moment_balance_algebra (n : ℕ) (α β δ : ℝ) (f g h j k l : ℝ → ℝ) |
| 557 | (hf : Integrable (fun r => r ^ n * f r)) |
| 558 | (hg : Integrable (fun r => r ^ n * g r)) |
| 559 | (hh : Integrable (fun r => r ^ n * h r)) |
| 560 | (hj : Integrable (fun r => r ^ n * j r)) |
| 561 | (hk : Integrable (fun r => r ^ n * k r)) |
| 562 | (hl : Integrable (fun r => r ^ n * l r)) : |
| 563 | moment n (fun r => α * f r + g r + β * h r - β * (j r + δ * k r) - l r) = |
| 564 | α * moment n f + moment n g + β * moment n h - |
| 565 | β * (moment n j + δ * moment n k) - moment n l := by |
| 566 | have hα := weighted_integrable_const_mul hf α |
| 567 | have hβ := weighted_integrable_const_mul hh β |
| 568 | have hδ := weighted_integrable_const_mul hk δ |
| 569 | have hleft := weighted_integrable_add (weighted_integrable_add hα hg) hβ |
| 570 | have hright := weighted_integrable_const_mul (weighted_integrable_add hj hδ) β |
| 571 | rw [moment_sub n (weighted_integrable_sub hleft hright) hl, |
| 572 | moment_sub n hleft hright, moment_add n (weighted_integrable_add hα hg) hβ, |
| 573 | moment_add n hα hg, moment_const_mul, moment_const_mul, moment_const_mul, |
| 574 | moment_add n hj hδ, moment_const_mul] |
| 575 | |
| 576 | abbrev MeanParameter := ℝ × ℝ |
| 577 | abbrev MeanPoint := ℝ × MeanParameter |
| 578 | abbrev MeanField := MeanPoint → ℝ |
| 579 | |
| 580 | /-- Joint smoothness and a common compact radial shell are genuine input |
| 581 | regularity conditions on the pointwise fields, not conditions on their moments. -/ |
| 582 | structure SmoothShell (a b : ℝ) (F : MeanField) : Prop where |
| 583 | smooth : ContDiff ℝ ∞ F |
| 584 | supported : RadialAlias.RadiallySupported a b F |
| 585 | |
| 586 | theorem SmoothShell.partial {a b : ℝ} {F : MeanField} (hF : SmoothShell a b F) |
| 587 | (v : MeanParameter) : SmoothShell a b (parameterPartial v F) := |
| 588 | ⟨parameterPartial_smooth v hF.smooth, parameterPartial_supported v hF.supported⟩ |
| 589 | |
| 590 | theorem SmoothShell.add {a b : ℝ} {F G : MeanField} |
| 591 | (hF : SmoothShell a b F) (hG : SmoothShell a b G) : |
| 592 | SmoothShell a b (fun x => F x + G x) := by |
| 593 | refine ⟨hF.smooth.add hG.smooth, ?_⟩ |
| 594 | intro x hx |
| 595 | by_contra hn |
| 596 | have hFx : F x = 0 := by |
| 597 | by_contra h |
| 598 | exact hn (hF.supported h) |
| 599 | have hGx : G x = 0 := by |
| 600 | by_contra h |
| 601 | exact hn (hG.supported h) |
| 602 | exact hx (by simp [hFx, hGx]) |
| 603 | |
| 604 | theorem SmoothShell.slice_smooth {a b : ℝ} {F : MeanField} (hF : SmoothShell a b F) |
| 605 | (p : MeanParameter) : ContDiff ℝ ∞ (fun r => F (r, p)) := |
| 606 | radial_slice_smooth hF.smooth p |
| 607 | |
| 608 | theorem SmoothShell.slice_compact {a b : ℝ} {F : MeanField} (hF : SmoothShell a b F) |
| 609 | (p : MeanParameter) : HasCompactSupport (fun r => F (r, p)) := |
| 610 | radial_slice_compact hF.supported p |
| 611 | |
| 612 | theorem SmoothShell.weighted_integrable {a b : ℝ} {F : MeanField} (hF : SmoothShell a b F) |
| 613 | (n : ℕ) (p : MeanParameter) : Integrable (fun r => r ^ n * F (r, p)) := |
| 614 | IntegratedMeanBalances.weighted_integrable (hF.slice_smooth p).continuous (hF.slice_compact p) n |
| 615 | |
| 616 | /-- The angular line of (32), after the actual torus average. Coordinates are |
| 617 | `(R,(T,Z))`; `ε` is constant on a chart. The supplied fluxes are full averages |
| 618 | of the pointwise products in (32), and the last radial divergence is the virtual stress. -/ |
| 619 | noncomputable def angularBalance (ε : ℝ) (v radialFlux axialFlux virtualFlux : MeanField) |
| 620 | (x : MeanPoint) : ℝ := |
| 621 | (-ε) * parameterPartial (1, 0) v x + |
| 622 | radialDivergence 2 (fun r => radialFlux (r, x.2)) x.1 + |
| 623 | ε * parameterPartial (0, 1) axialFlux x - |
| 624 | ε * (angularRadialViscosity (fun r => v (r, x.2)) x.1 + |
| 625 | ε ^ 2 * parameterPartial (0, 1) (parameterPartial (0, 1) v) x) - |
| 626 | radialDivergence 2 (fun r => virtualFlux (r, x.2)) x.1 |
| 627 | |
| 628 | /-- The axial line of (32), with pressure retained inside the axial flux. -/ |
| 629 | noncomputable def axialBalance (ε : ℝ) (γ radialFlux axialFlux pressure virtualFlux : MeanField) |
| 630 | (x : MeanPoint) : ℝ := |
| 631 | (-ε) * parameterPartial (1, 0) γ x + |
| 632 | radialDivergence 1 (fun r => radialFlux (r, x.2)) x.1 + |
| 633 | ε * parameterPartial (0, 1) (fun y => axialFlux y + pressure y) x - |
| 634 | ε * (axialRadialViscosity (fun r => γ (r, x.2)) x.1 + |
| 635 | ε ^ 2 * parameterPartial (0, 1) (parameterPartial (0, 1) γ) x) - |
| 636 | radialDivergence 1 (fun r => virtualFlux (r, x.2)) x.1 |
| 637 | |
| 638 | /-- The first identity in (34), derived from the pointwise angular balance. -/ |
| 639 | theorem integrated_angular_balance {a b : ℝ} (ε : ℝ) |
| 640 | {v radialFlux axialFlux virtualFlux : MeanField} |
| 641 | (hv : SmoothShell a b v) (hr : SmoothShell a b radialFlux) |
| 642 | (hz : SmoothShell a b axialFlux) (hT : SmoothShell a b virtualFlux) |
| 643 | (hmass : radialMoment 2 v = 0) (p : MeanParameter) : |
| 644 | radialMoment 2 (angularBalance ε v radialFlux axialFlux virtualFlux) p = |
| 645 | ε * fderiv ℝ (radialMoment 2 axialFlux) p (0, 1) := by |
| 646 | have halg := moment_balance_algebra 2 (-ε) ε (ε ^ 2) |
| 647 | (fun r => parameterPartial (1, 0) v (r, p)) |
| 648 | (radialDivergence 2 (fun r => radialFlux (r, p))) |
| 649 | (fun r => parameterPartial (0, 1) axialFlux (r, p)) |
| 650 | (angularRadialViscosity (fun r => v (r, p))) |
| 651 | (fun r => parameterPartial (0, 1) (parameterPartial (0, 1) v) (r, p)) |
| 652 | (radialDivergence 2 (fun r => virtualFlux (r, p))) |
| 653 | ((hv.partial (1, 0)).weighted_integrable 2 p) |
| 654 | (angular_divergence_integrable (hr.slice_smooth p) (hr.slice_compact p)) |
| 655 | ((hz.partial (0, 1)).weighted_integrable 2 p) |
| 656 | (angular_viscosity_integrable (hv.slice_smooth p) (hv.slice_compact p)) |
| 657 | (((hv.partial (0, 1)).partial (0, 1)).weighted_integrable 2 p) |
| 658 | (angular_divergence_integrable (hT.slice_smooth p) (hT.slice_compact p)) |
| 659 | have ht := zero_mass_parameterPartial hv.smooth hv.supported 2 hmass p (1, 0) |
| 660 | have hzz := zero_mass_parameterPartial_twice hv.smooth hv.supported 2 hmass p (0, 1) (0, 1) |
| 661 | have hd := radialMoment_parameterPartial hz.smooth hz.supported 2 p (0, 1) |
| 662 | change moment 2 _ = _ |
| 663 | simp only [angularBalance] |
| 664 | rw [halg, moment_angular_divergence (hr.slice_smooth p) (hr.slice_compact p), |
| 665 | moment_angular_divergence (hT.slice_smooth p) (hT.slice_compact p), |
| 666 | moment_angular_viscosity (hv.slice_smooth p) (hv.slice_compact p)] |
| 667 | change (-ε) * radialMoment 2 (parameterPartial (1, 0) v) p + 0 + |
| 668 | ε * radialMoment 2 (parameterPartial (0, 1) axialFlux) p - |
| 669 | ε * (0 + ε ^ 2 * radialMoment 2 (parameterPartial (0, 1) (parameterPartial (0, 1) v)) p) - 0 = _ |
| 670 | rw [ht, hzz, ← hd] |
| 671 | ring |
| 672 | |
| 673 | /-- The second tangential integral, before eliminating the pressure moment. -/ |
| 674 | theorem integrated_axial_balance {a b : ℝ} (ε : ℝ) |
| 675 | {γ radialFlux axialFlux pressure virtualFlux : MeanField} |
| 676 | (hγ : SmoothShell a b γ) (hr : SmoothShell a b radialFlux) |
| 677 | (hz : SmoothShell a b axialFlux) (hp : SmoothShell a b pressure) |
| 678 | (hT : SmoothShell a b virtualFlux) |
| 679 | (hmass : radialMoment 1 γ = 0) (p : MeanParameter) : |
| 680 | radialMoment 1 (axialBalance ε γ radialFlux axialFlux pressure virtualFlux) p = |
| 681 | ε * fderiv ℝ (radialMoment 1 (fun x => axialFlux x + pressure x)) p (0, 1) := by |
| 682 | have halg := moment_balance_algebra 1 (-ε) ε (ε ^ 2) |
| 683 | (fun r => parameterPartial (1, 0) γ (r, p)) |
| 684 | (radialDivergence 1 (fun r => radialFlux (r, p))) |
| 685 | (fun r => parameterPartial (0, 1) (fun x => axialFlux x + pressure x) (r, p)) |
| 686 | (axialRadialViscosity (fun r => γ (r, p))) |
| 687 | (fun r => parameterPartial (0, 1) (parameterPartial (0, 1) γ) (r, p)) |
| 688 | (radialDivergence 1 (fun r => virtualFlux (r, p))) |
| 689 | ((hγ.partial (1, 0)).weighted_integrable 1 p) |
| 690 | (by simpa only [pow_one] using axial_divergence_integrable (hr.slice_smooth p) (hr.slice_compact p)) |
| 691 | (((hz.add hp).partial (0, 1)).weighted_integrable 1 p) |
| 692 | (by simpa only [pow_one] using axial_viscosity_integrable (hγ.slice_smooth p) (hγ.slice_compact p)) |
| 693 | (((hγ.partial (0, 1)).partial (0, 1)).weighted_integrable 1 p) |
| 694 | (by simpa only [pow_one] using axial_divergence_integrable (hT.slice_smooth p) (hT.slice_compact p)) |
| 695 | have ht := zero_mass_parameterPartial hγ.smooth hγ.supported 1 hmass p (1, 0) |
| 696 | have hzz := zero_mass_parameterPartial_twice hγ.smooth hγ.supported 1 hmass p (0, 1) (0, 1) |
| 697 | have hd := radialMoment_parameterPartial (hz.add hp).smooth (hz.add hp).supported 1 p (0, 1) |
| 698 | change moment 1 _ = _ |
| 699 | simp only [axialBalance] |
| 700 | rw [halg, moment_axial_divergence (hr.slice_smooth p) (hr.slice_compact p), |
| 701 | moment_axial_divergence (hT.slice_smooth p) (hT.slice_compact p), |
| 702 | moment_axial_viscosity (hγ.slice_smooth p) (hγ.slice_compact p)] |
| 703 | change (-ε) * radialMoment 1 (parameterPartial (1, 0) γ) p + 0 + |
| 704 | ε * radialMoment 1 (parameterPartial (0, 1) (fun x => axialFlux x + pressure x)) p - |
| 705 | ε * (0 + ε ^ 2 * radialMoment 1 (parameterPartial (0, 1) (parameterPartial (0, 1) γ)) p) - 0 = _ |
| 706 | rw [ht, hzz, ← hd] |
| 707 | ring |
| 708 | |
| 709 | noncomputable def pressureTotal (gr : MeanField) : MeanParameter → ℝ := radialMoment 0 gr |
| 710 | |
| 711 | noncomputable def pressureCoefficient (ρ : MeanField) (p : MeanParameter) : ℝ := |
| 712 | radialMoment 2 ρ p / 2 |
| 713 | |
| 714 | noncomputable def axialDefect (axialFlux gr : MeanField) (p : MeanParameter) : ℝ := |
| 715 | radialMoment 1 axialFlux p - (1 / 2 : ℝ) * radialMoment 2 gr p |
| 716 | |
| 717 | theorem flux_pressure_moment {a b : ℝ} {axialFlux pressure gr ρ : MeanField} |
| 718 | (hz : SmoothShell a b axialFlux) (hp : SmoothShell a b pressure) |
| 719 | (hg : SmoothShell a b gr) (hρ : SmoothShell a b ρ) |
| 720 | (hderiv : ∀ r p, deriv (fun s => pressure (s, p)) r = |
| 721 | gr (r, p) - ρ (r, p) * pressureTotal gr p) : |
| 722 | radialMoment 1 (fun x => axialFlux x + pressure x) = |
| 723 | (fun p => axialDefect axialFlux gr p + pressureCoefficient ρ p * pressureTotal gr p) := by |
| 724 | funext p |
| 725 | change moment 1 (fun r => axialFlux (r, p) + pressure (r, p)) = _ |
| 726 | rw [moment_add 1 (hz.weighted_integrable 1 p) (hp.weighted_integrable 1 p), |
| 727 | pressure_moment_reconstructed (pressureTotal gr p) (hp.slice_smooth p) (hp.slice_compact p) |
| 728 | (hg.slice_smooth p).continuous (hg.slice_compact p) |
| 729 | (hρ.slice_smooth p).continuous (hρ.slice_compact p) (fun r => hderiv r p)] |
| 730 | unfold axialDefect pressureCoefficient radialMoment |
| 731 | ring |
| 732 | |
| 733 | /-- The pressure coefficient stays inside the actual axial derivative, exactly |
| 734 | as in (34); it may vary with both slow parameters. -/ |
| 735 | theorem integrated_axial_reconstructed {a b : ℝ} (ε : ℝ) |
| 736 | {γ radialFlux axialFlux pressure virtualFlux gr ρ : MeanField} |
| 737 | (hγ : SmoothShell a b γ) (hr : SmoothShell a b radialFlux) |
| 738 | (hz : SmoothShell a b axialFlux) (hp : SmoothShell a b pressure) |
| 739 | (hT : SmoothShell a b virtualFlux) (hg : SmoothShell a b gr) (hρ : SmoothShell a b ρ) |
| 740 | (hmass : radialMoment 1 γ = 0) |
| 741 | (hderiv : ∀ r p, deriv (fun s => pressure (s, p)) r = |
| 742 | gr (r, p) - ρ (r, p) * pressureTotal gr p) (p : MeanParameter) : |
| 743 | radialMoment 1 (axialBalance ε γ radialFlux axialFlux pressure virtualFlux) p = |
| 744 | ε * fderiv ℝ (fun q => axialDefect axialFlux gr q + |
| 745 | pressureCoefficient ρ q * pressureTotal gr q) p (0, 1) := by |
| 746 | rw [integrated_axial_balance ε hγ hr hz hp hT hmass, |
| 747 | flux_pressure_moment hz hp hg hρ hderiv] |
| 748 | |
| 749 | /-! ## Restriction to the physical positive radial half-line -/ |
| 750 | |
| 751 | theorem zero_of_not_mem_interval {a b r : ℝ} {f : ℝ → ℝ} |
| 752 | (hs : support f ⊆ Icc a b) (hr : r ∉ Icc a b) : f r = 0 := by |
| 753 | by_contra h |
| 754 | exact hr (hs h) |
| 755 | |
| 756 | theorem deriv_support_interval {a b : ℝ} {f : ℝ → ℝ} |
| 757 | (hs : support f ⊆ Icc a b) : support (deriv f) ⊆ Icc a b := |
| 758 | support_deriv_subset.trans (closure_minimal hs isClosed_Icc) |
| 759 | |
| 760 | theorem radialDivergence_supported {a b : ℝ} {f : ℝ → ℝ} |
| 761 | (hs : support f ⊆ Icc a b) (c : ℝ) : |
| 762 | support (radialDivergence c f) ⊆ Icc a b := by |
| 763 | intro r hr |
| 764 | by_contra hn |
| 765 | apply hr |
| 766 | simp [radialDivergence, zero_of_not_mem_interval hs hn, |
| 767 | zero_of_not_mem_interval (deriv_support_interval hs) hn] |
| 768 | |
| 769 | theorem angularViscosity_supported {a b : ℝ} {f : ℝ → ℝ} |
| 770 | (hs : support f ⊆ Icc a b) : support (angularRadialViscosity f) ⊆ Icc a b := by |
| 771 | intro r hr |
| 772 | by_contra hn |
| 773 | apply hr |
| 774 | simp [angularRadialViscosity, zero_of_not_mem_interval hs hn, |
| 775 | zero_of_not_mem_interval (deriv_support_interval hs) hn, |
| 776 | zero_of_not_mem_interval (deriv_support_interval (deriv_support_interval hs)) hn] |
| 777 | |
| 778 | theorem axialViscosity_supported {a b : ℝ} {f : ℝ → ℝ} |
| 779 | (hs : support f ⊆ Icc a b) : support (axialRadialViscosity f) ⊆ Icc a b := by |
| 780 | intro r hr |
| 781 | by_contra hn |
| 782 | apply hr |
| 783 | simp [axialRadialViscosity, zero_of_not_mem_interval (deriv_support_interval hs) hn, |
| 784 | zero_of_not_mem_interval (deriv_support_interval (deriv_support_interval hs)) hn] |
| 785 | |
| 786 | theorem SmoothShell.slice_support {a b : ℝ} {F : MeanField} (hF : SmoothShell a b F) |
| 787 | (p : MeanParameter) : support (fun r => F (r, p)) ⊆ Icc a b := |
| 788 | fun _ hr => hF.supported hr |
| 789 | |
| 790 | theorem SmoothShell.zero_of_not_mem {a b : ℝ} {F : MeanField} (hF : SmoothShell a b F) |
| 791 | {x : MeanPoint} (hx : x.1 ∉ Icc a b) : F x = 0 := by |
| 792 | by_contra h |
| 793 | exact hx (hF.supported h) |
| 794 | |
| 795 | theorem angularBalance_supported {a b : ℝ} (ε : ℝ) |
| 796 | {v radialFlux axialFlux virtualFlux : MeanField} |
| 797 | (hv : SmoothShell a b v) (hr : SmoothShell a b radialFlux) |
| 798 | (hz : SmoothShell a b axialFlux) (hT : SmoothShell a b virtualFlux) : |
| 799 | RadialAlias.RadiallySupported a b (angularBalance ε v radialFlux axialFlux virtualFlux) := by |
| 800 | intro x hx |
| 801 | by_contra hn |
| 802 | apply hx |
| 803 | simp [angularBalance, |
| 804 | (hv.partial (1, 0)).zero_of_not_mem hn, (hz.partial (0, 1)).zero_of_not_mem hn, |
| 805 | ((hv.partial (0, 1)).partial (0, 1)).zero_of_not_mem hn, |
| 806 | zero_of_not_mem_interval (radialDivergence_supported (hr.slice_support x.2) 2) hn, |
| 807 | zero_of_not_mem_interval (radialDivergence_supported (hT.slice_support x.2) 2) hn, |
| 808 | zero_of_not_mem_interval (angularViscosity_supported (hv.slice_support x.2)) hn] |
| 809 | |
| 810 | theorem axialBalance_supported {a b : ℝ} (ε : ℝ) |
| 811 | {γ radialFlux axialFlux pressure virtualFlux : MeanField} |
| 812 | (hγ : SmoothShell a b γ) (hr : SmoothShell a b radialFlux) |
| 813 | (hz : SmoothShell a b axialFlux) (hp : SmoothShell a b pressure) |
| 814 | (hT : SmoothShell a b virtualFlux) : |
| 815 | RadialAlias.RadiallySupported a b (axialBalance ε γ radialFlux axialFlux pressure virtualFlux) := by |
| 816 | intro x hx |
| 817 | by_contra hn |
| 818 | apply hx |
| 819 | simp [axialBalance, |
| 820 | (hγ.partial (1, 0)).zero_of_not_mem hn, ((hz.add hp).partial (0, 1)).zero_of_not_mem hn, |
| 821 | ((hγ.partial (0, 1)).partial (0, 1)).zero_of_not_mem hn, |
| 822 | zero_of_not_mem_interval (radialDivergence_supported (hr.slice_support x.2) 1) hn, |
| 823 | zero_of_not_mem_interval (radialDivergence_supported (hT.slice_support x.2) 1) hn, |
| 824 | zero_of_not_mem_interval (axialViscosity_supported (hγ.slice_support x.2)) hn] |
| 825 | |
| 826 | theorem positive_radialMoment {a b : ℝ} (ha : 0 < a) {F : MeanField} |
| 827 | (hs : RadialAlias.RadiallySupported a b F) (n : ℕ) (p : MeanParameter) : |
| 828 | (∫ r in Ioi (0 : ℝ), r ^ n * F (r, p)) = radialMoment n F p := by |
| 829 | apply positive_integral_eq_integral ha |
| 830 | intro r hr |
| 831 | exact hs (right_ne_zero_of_mul hr) |
| 832 | |
| 833 | theorem integrated_angular_positive {a b : ℝ} (ha : 0 < a) (ε : ℝ) |
| 834 | {v radialFlux axialFlux virtualFlux : MeanField} |
| 835 | (hv : SmoothShell a b v) (hr : SmoothShell a b radialFlux) |
| 836 | (hz : SmoothShell a b axialFlux) (hT : SmoothShell a b virtualFlux) |
| 837 | (hmass : radialMoment 2 v = 0) (p : MeanParameter) : |
| 838 | (∫ r in Ioi (0 : ℝ), r ^ 2 * angularBalance ε v radialFlux axialFlux virtualFlux (r, p)) = |
| 839 | ε * fderiv ℝ (radialMoment 2 axialFlux) p (0, 1) := by |
| 840 | rw [positive_radialMoment ha (angularBalance_supported ε hv hr hz hT), |
| 841 | integrated_angular_balance ε hv hr hz hT hmass] |
| 842 | |
| 843 | theorem integrated_axial_positive {a b : ℝ} (ha : 0 < a) (ε : ℝ) |
| 844 | {γ radialFlux axialFlux pressure virtualFlux gr ρ : MeanField} |
| 845 | (hγ : SmoothShell a b γ) (hr : SmoothShell a b radialFlux) |
| 846 | (hz : SmoothShell a b axialFlux) (hp : SmoothShell a b pressure) |
| 847 | (hT : SmoothShell a b virtualFlux) (hg : SmoothShell a b gr) (hρ : SmoothShell a b ρ) |
| 848 | (hmass : radialMoment 1 γ = 0) |
| 849 | (hderiv : ∀ r p, deriv (fun s => pressure (s, p)) r = |
| 850 | gr (r, p) - ρ (r, p) * pressureTotal gr p) (p : MeanParameter) : |
| 851 | (∫ r in Ioi (0 : ℝ), r * axialBalance ε γ radialFlux axialFlux pressure virtualFlux (r, p)) = |
| 852 | ε * fderiv ℝ (fun q => axialDefect axialFlux gr q + |
| 853 | pressureCoefficient ρ q * pressureTotal gr q) p (0, 1) := by |
| 854 | simpa only [pow_one] using |
| 855 | (positive_radialMoment ha (axialBalance_supported ε hγ hr hz hp hT) 1 p).trans |
| 856 | (integrated_axial_reconstructed ε hγ hr hz hp hT hg hρ hmass hderiv p) |
| 857 | |
| 858 | /-! ## The actual pressure primitive (33), without a supplied derivative identity -/ |
| 859 | |
| 860 | section PressurePrimitive |
| 861 | |
| 862 | variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] |
| 863 | |
| 864 | /-- Exact moment of the constructed compact pressure, including its normalized |
| 865 | mean correction. The derivative used in the proof is a theorem of the actual |
| 866 | physical transport integral, not an assumption here. -/ |
| 867 | theorem constructed_pressure_moment {d a b M : ℝ} |
| 868 | (ha : 0 < a) (hab : a < b) (hd : 0 < d) (v : ℝ × ℝ) |
| 869 | {f : PressureStream.Lift S → ℝ} (hf : ContDiff ℝ ∞ f) |
| 870 | (hs : RadialAlias.RadiallySupported a b f) (hper : PressureStream.TorusPeriodicLift f) |
| 871 | (s : S) : |
| 872 | moment 1 (fun r => PressureStream.torusAverage |
| 873 | (PressureStream.meanPressure d a b M hab v f) (r, s)) = |
| 874 | -(1 / 2 : ℝ) * moment 2 (fun r => PressureStream.torusAverage f (r, s)) + |
| 875 | (moment 2 (PressureStream.rho a b hab) / 2) * PressureStream.pressureMass f s := by |
| 876 | exact pressure_moment_reconstructed (PressureStream.pressureMass f s) |
| 877 | (PressureStream.torusAverage_slice_contDiff |
| 878 | (PressureStream.meanPressure_contDiff ha hab hd v hf hs) s) |
| 879 | (PressureStream.torusAverage_slice_hasCompactSupport |
| 880 | (PressureStream.meanPressure_supported ha hab hd v hf hs) s) |
| 881 | (PressureStream.torusAverage_slice_contDiff hf s).continuous |
| 882 | (PressureStream.torusAverage_slice_hasCompactSupport hs s) |
| 883 | (PressureStream.rho_contDiff a b hab).continuous |
| 884 | (PressureStream.rho_hasCompactSupport a b hab) |
| 885 | (fun r => (PressureStream.meanPressure_bar_hasDerivAt ha hab hd v hf hs hper s r).deriv) |
| 886 | |
| 887 | end PressurePrimitive |
| 888 | |
| 889 | noncomputable def reconstructedMeanPressure (d a b M : ℝ) (hab : a < b) (v : ℝ × ℝ) |
| 890 | (f : PressureStream.Lift MeanParameter → ℝ) : MeanField := |
| 891 | PressureStream.torusAverage (PressureStream.meanPressure d a b M hab v f) |
| 892 | |
| 893 | noncomputable def averagedRadialSource (f : PressureStream.Lift MeanParameter → ℝ) : MeanField := |
| 894 | PressureStream.torusAverage f |
| 895 | |
| 896 | noncomputable def normalizedMeanDensity (a b : ℝ) (hab : a < b) (x : MeanPoint) : ℝ := |
| 897 | PressureStream.rho a b hab x.1 |
| 898 | |
| 899 | theorem averagedRadialSource_shell {a b : ℝ} {f : PressureStream.Lift MeanParameter → ℝ} |
| 900 | (hf : ContDiff ℝ ∞ f) (hs : RadialAlias.RadiallySupported a b f) : |
| 901 | SmoothShell a b (averagedRadialSource f) := |
| 902 | ⟨PressureStream.torusAverage_contDiff hf, PressureStream.torusAverage_supported hs⟩ |
| 903 | |
| 904 | theorem reconstructedMeanPressure_shell {d a b M : ℝ} |
| 905 | (ha : 0 < a) (hab : a < b) (hd : 0 < d) (v : ℝ × ℝ) |
| 906 | {f : PressureStream.Lift MeanParameter → ℝ} (hf : ContDiff ℝ ∞ f) |
| 907 | (hs : RadialAlias.RadiallySupported a b f) : |
| 908 | SmoothShell a b (reconstructedMeanPressure d a b M hab v f) := |
| 909 | ⟨PressureStream.torusAverage_contDiff (PressureStream.meanPressure_contDiff ha hab hd v hf hs), |
| 910 | PressureStream.torusAverage_supported (PressureStream.meanPressure_supported ha hab hd v hf hs)⟩ |
| 911 | |
| 912 | theorem normalizedMeanDensity_shell (a b : ℝ) (hab : a < b) : |
| 913 | SmoothShell a b (normalizedMeanDensity a b hab) := by |
| 914 | refine ⟨(PressureStream.rho_contDiff a b hab).comp contDiff_fst, ?_⟩ |
| 915 | exact fun _ hx => PressureStream.rho_support a b hab hx |
| 916 | |
| 917 | theorem constructed_pressure_deriv {d a b M : ℝ} |
| 918 | (ha : 0 < a) (hab : a < b) (hd : 0 < d) (v : ℝ × ℝ) |
| 919 | {f : PressureStream.Lift MeanParameter → ℝ} (hf : ContDiff ℝ ∞ f) |
| 920 | (hs : RadialAlias.RadiallySupported a b f) (hper : PressureStream.TorusPeriodicLift f) |
| 921 | (r : ℝ) (p : MeanParameter) : |
| 922 | deriv (fun s => reconstructedMeanPressure d a b M hab v f (s, p)) r = |
| 923 | averagedRadialSource f (r, p) - normalizedMeanDensity a b hab (r, p) * |
| 924 | pressureTotal (averagedRadialSource f) p := by |
| 925 | simpa only [reconstructedMeanPressure, averagedRadialSource, normalizedMeanDensity, |
| 926 | pressureTotal, radialMoment, moment, pow_zero, one_mul, PressureStream.pressureMass] |
| 927 | using (PressureStream.meanPressure_bar_hasDerivAt ha hab hd v hf hs hper p r).deriv |
| 928 | |
| 929 | /-- The second identity of (34) with pressure supplied by the actual compact |
| 930 | primitive (33). No pressure moment or pressure derivative identity is assumed. -/ |
| 931 | theorem integrated_axial_constructed_pressure {d a b M : ℝ} |
| 932 | (ha : 0 < a) (hab : a < b) (hd : 0 < d) (ε : ℝ) (v : ℝ × ℝ) |
| 933 | {f : PressureStream.Lift MeanParameter → ℝ} (hf : ContDiff ℝ ∞ f) |
| 934 | (hs : RadialAlias.RadiallySupported a b f) (hper : PressureStream.TorusPeriodicLift f) |
| 935 | {γ radialFlux axialFlux virtualFlux : MeanField} |
| 936 | (hγ : SmoothShell a b γ) (hr : SmoothShell a b radialFlux) |
| 937 | (hz : SmoothShell a b axialFlux) (hT : SmoothShell a b virtualFlux) |
| 938 | (hmass : radialMoment 1 γ = 0) (p : MeanParameter) : |
| 939 | (∫ r in Ioi (0 : ℝ), r * axialBalance ε γ radialFlux axialFlux |
| 940 | (reconstructedMeanPressure d a b M hab v f) virtualFlux (r, p)) = |
| 941 | ε * fderiv ℝ (fun q => axialDefect axialFlux (averagedRadialSource f) q + |
| 942 | pressureCoefficient (normalizedMeanDensity a b hab) q * |
| 943 | pressureTotal (averagedRadialSource f) q) p (0, 1) := by |
| 944 | exact integrated_axial_positive ha ε hγ hr hz |
| 945 | (reconstructedMeanPressure_shell ha hab hd v hf hs) hT |
| 946 | (averagedRadialSource_shell hf hs) (normalizedMeanDensity_shell a b hab) hmass |
| 947 | (constructed_pressure_deriv ha hab hd v hf hs hper) p |
| 948 | |
| 949 | end NavierStokes.IntegratedMeanBalances |