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.IntegratedMeanBalances |
| 2 | import NavierStokes.WeightedRadialPrimitive |
| 3 | import NavierStokes.RadialPullback |
| 4 | |
| 5 | /-! |
| 6 | # The actual compact signed-stress primitive |
| 7 | |
| 8 | A positive normalized bump is constructed in a chosen interior slow patch. |
| 9 | Subtracting its exact weighted moment makes the negative radial primitive |
| 10 | compact. The physical construction is normalized by the physical scale. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set Function Filter MeasureTheory |
| 16 | open scoped ContDiff Topology BigOperators |
| 17 | |
| 18 | namespace NavierStokes.SignedStressPrimitive |
| 19 | |
| 20 | private theorem nat_le_smooth (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := |
| 21 | WithTop.coe_le_coe.mpr le_top |
| 22 | |
| 23 | structure Patch where |
| 24 | a : ℝ |
| 25 | b : ℝ |
| 26 | left : ℝ |
| 27 | right : ℝ |
| 28 | a_pos : 0 < a |
| 29 | a_lt_left : a < left |
| 30 | left_lt_right : left < right |
| 31 | right_lt_b : right < b |
| 32 | |
| 33 | theorem Patch.a_lt_b (P : Patch) : P.a < P.b := |
| 34 | P.a_lt_left.trans (P.left_lt_right.trans P.right_lt_b) |
| 35 | |
| 36 | theorem Patch.left_pos (P : Patch) : 0 < P.left := P.a_pos.trans P.a_lt_left |
| 37 | |
| 38 | noncomputable def density (P : Patch) : ℝ → ℝ := |
| 39 | PressureStream.rho P.left P.right P.left_lt_right |
| 40 | |
| 41 | theorem density_contDiff (P : Patch) : ContDiff ℝ ∞ (density P) := |
| 42 | PressureStream.rho_contDiff _ _ _ |
| 43 | |
| 44 | theorem density_support (P : Patch) : support (density P) ⊆ Icc P.left P.right := |
| 45 | PressureStream.rho_support _ _ _ |
| 46 | |
| 47 | theorem density_integral (P : Patch) : (∫ r, density P r) = 1 := PressureStream.rho_integral _ _ _ |
| 48 | |
| 49 | theorem density_nonneg (P : Patch) (r : ℝ) : 0 ≤ density P r := PressureStream.rho_nonneg _ _ _ r |
| 50 | |
| 51 | noncomputable def densityLift (P : Patch) (z : ℝ × ℝ) : ℝ := density P z.1 |
| 52 | |
| 53 | theorem densityLift_contDiff (P : Patch) : ContDiff ℝ ∞ (densityLift P) := |
| 54 | (density_contDiff P).comp contDiff_fst |
| 55 | |
| 56 | theorem densityLift_supported (P : Patch) : |
| 57 | RadialAlias.RadiallySupported P.left P.right (densityLift P) := |
| 58 | fun _ h => density_support P h |
| 59 | |
| 60 | noncomputable def cutoff (P : Patch) (r : ℝ) : ℝ := |
| 61 | TransportPrimitive.pastIntegral 0 (0 : ℝ) (densityLift P) (r, 0) |
| 62 | |
| 63 | theorem cutoff_contDiff (P : Patch) : ContDiff ℝ ∞ (cutoff P) := |
| 64 | (TransportPrimitive.pastIntegral_contDiff (densityLift_contDiff P) (densityLift_supported P)).comp |
| 65 | (contDiff_id.prodMk contDiff_const) |
| 66 | |
| 67 | theorem cutoff_total (P : Patch) (r : ℝ) : |
| 68 | TransportPrimitive.totalIntegral 0 (0 : ℝ) (densityLift P) (r, 0) = 1 := by |
| 69 | rw [TransportPrimitive.totalIntegral_eq_radialInterval |
| 70 | (densityLift_contDiff P).continuous (densityLift_supported P)] |
| 71 | simp only [densityLift] |
| 72 | have h := IntegratedMeanBalances.radialMoment_eq_interval |
| 73 | (densityLift_contDiff P).continuous (densityLift_supported P) 0 0 |
| 74 | simp only [IntegratedMeanBalances.radialMoment, IntegratedMeanBalances.moment, |
| 75 | densityLift, pow_zero, one_mul, density_integral] at h |
| 76 | exact h.symm |
| 77 | |
| 78 | theorem cutoff_zero (P : Patch) {r : ℝ} (hr : r ≤ P.left) : cutoff P r = 0 := |
| 79 | TransportPrimitive.pastIntegral_eq_zero_of_le |
| 80 | (densityLift_contDiff P).continuous (densityLift_supported P) (r, 0) hr |
| 81 | |
| 82 | theorem cutoff_one (P : Patch) {r : ℝ} (hr : P.right ≤ r) : cutoff P r = 1 := by |
| 83 | change TransportPrimitive.pastIntegral 0 (0 : ℝ) (densityLift P) (r, 0) = 1 |
| 84 | rw [TransportPrimitive.pastIntegral_eq_total_of_ge (densityLift_supported P) (r, 0) hr, |
| 85 | cutoff_total] |
| 86 | |
| 87 | theorem cutoff_hasDerivAt (P : Patch) (r : ℝ) : HasDerivAt (cutoff P) (density P r) r := by |
| 88 | have hs := TransportPrimitive.pastIntegral_contDiff (M := 0) (v := (0 : ℝ)) |
| 89 | (densityLift_contDiff P) (densityLift_supported P) |
| 90 | have hd := ((hs.differentiable (by simp)) (r, 0)).hasFDerivAt.comp_hasDerivAt r |
| 91 | ((hasDerivAt_id r).prodMk (hasDerivAt_const r (0 : ℝ))) |
| 92 | have ht := TransportPrimitive.transport_pastIntegral (M := 0) (v := (0 : ℝ)) |
| 93 | (densityLift_contDiff P) (densityLift_supported P) (r, 0) |
| 94 | simp only [TransportPrimitive.fixedDeriv, zero_smul, densityLift] at ht |
| 95 | unfold cutoff |
| 96 | simpa only [ht, Function.comp_def, id_eq] using hd |
| 97 | |
| 98 | theorem cutoff_deriv (P : Patch) (r : ℝ) : deriv (cutoff P) r = density P r := |
| 99 | (cutoff_hasDerivAt P r).deriv |
| 100 | |
| 101 | noncomputable def inversePower (P : Patch) (e : ℕ) (r : ℝ) : ℝ := |
| 102 | ((RadialPullback.positiveRadius (P.a / 4) r) ^ e)⁻¹ |
| 103 | |
| 104 | theorem inversePower_contDiff (P : Patch) (e : ℕ) : ContDiff ℝ ∞ (inversePower P e) := |
| 105 | ((RadialPullback.positiveRadius_contDiff _).pow e).inv |
| 106 | (fun r => pow_ne_zero _ (RadialPullback.positiveRadius_pos (by linarith [P.a_pos]) r).ne') |
| 107 | |
| 108 | theorem inversePower_nonneg (P : Patch) (e : ℕ) (r : ℝ) : 0 ≤ inversePower P e r := |
| 109 | inv_nonneg.mpr (pow_nonneg (RadialPullback.positiveRadius_pos (by linarith [P.a_pos]) r).le e) |
| 110 | |
| 111 | theorem inversePower_eq (P : Patch) (e : ℕ) {r : ℝ} (hr : P.a ≤ r) : |
| 112 | inversePower P e r = (r ^ e)⁻¹ := by |
| 113 | unfold inversePower |
| 114 | rw [RadialPullback.positiveRadius_eq_self (by linarith [P.a_pos]) (by linarith [P.a_pos])] |
| 115 | |
| 116 | noncomputable def momentDensity (P : Patch) (e : ℕ) (r : ℝ) : ℝ := inversePower P e r * density P r |
| 117 | |
| 118 | theorem momentDensity_contDiff (P : Patch) (e : ℕ) : ContDiff ℝ ∞ (momentDensity P e) := |
| 119 | (inversePower_contDiff P e).mul (density_contDiff P) |
| 120 | |
| 121 | theorem momentDensity_nonneg (P : Patch) (e : ℕ) (r : ℝ) : 0 ≤ momentDensity P e r := |
| 122 | mul_nonneg (inversePower_nonneg P e r) (density_nonneg P r) |
| 123 | |
| 124 | theorem momentDensity_support (P : Patch) (e : ℕ) : support (momentDensity P e) ⊆ Icc P.left P.right := |
| 125 | fun _ h => density_support P (right_ne_zero_of_mul h) |
| 126 | |
| 127 | theorem weighted_momentDensity (P : Patch) (e : ℕ) (r : ℝ) : |
| 128 | r ^ e * momentDensity P e r = density P r := by |
| 129 | by_cases h : density P r = 0 |
| 130 | · simp [momentDensity, h] |
| 131 | have hr := density_support P h |
| 132 | have hr0 : 0 < r := P.left_pos.trans_le hr.1 |
| 133 | rw [momentDensity, inversePower_eq P e (P.a_lt_left.le.trans hr.1)] |
| 134 | field_simp [hr0.ne'] |
| 135 | |
| 136 | theorem momentDensity_moment (P : Patch) (e : ℕ) : (∫ r, r ^ e * momentDensity P e r) = 1 := by |
| 137 | simp_rw [weighted_momentDensity] |
| 138 | exact density_integral P |
| 139 | |
| 140 | theorem momentDensity_positive_moment (P : Patch) (e : ℕ) : |
| 141 | (∫ r in Ioi (0 : ℝ), r ^ e * momentDensity P e r) = 1 := by |
| 142 | rw [IntegratedMeanBalances.positive_integral_eq_integral P.left_pos] |
| 143 | · exact momentDensity_moment P e |
| 144 | · intro r hr |
| 145 | exact momentDensity_support P e (right_ne_zero_of_mul hr) |
| 146 | |
| 147 | theorem momentDensity_tsupport (P : Patch) (e : ℕ) : tsupport (momentDensity P e) ⊆ Ioo P.a P.b := by |
| 148 | intro r hr |
| 149 | have h := closure_minimal (momentDensity_support P e) isClosed_Icc hr |
| 150 | exact ⟨P.a_lt_left.trans_le h.1, h.2.trans_lt P.right_lt_b⟩ |
| 151 | |
| 152 | section Primitive |
| 153 | |
| 154 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 155 | |
| 156 | noncomputable def weightedSource (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := z.1 ^ e * F z |
| 157 | noncomputable def mass (e : ℕ) (F : ℝ × E → ℝ) : E → ℝ := IntegratedMeanBalances.radialMoment e F |
| 158 | noncomputable def bumpCorrection (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 159 | momentDensity P e z.1 * mass e F z.2 |
| 160 | noncomputable def adjusted (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 161 | F z - bumpCorrection P e F z |
| 162 | noncomputable def primitive (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) : ℝ × E → ℝ := |
| 163 | TransportPrimitive.compactIntegral (cutoff P) 0 0 (weightedSource e F) |
| 164 | noncomputable def sigma (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 165 | -inversePower P e z.1 * primitive P e F z |
| 166 | |
| 167 | theorem weightedSource_contDiff (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) : |
| 168 | ContDiff ℝ ∞ (weightedSource e F) := (contDiff_fst.pow e).mul hF |
| 169 | |
| 170 | omit [NormedSpace ℝ E] in |
| 171 | theorem weightedSource_continuous (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) : |
| 172 | Continuous (weightedSource e F) := (continuous_fst.pow e).mul hF |
| 173 | |
| 174 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 175 | theorem weightedSource_supported (e : ℕ) {P : Patch} {F : ℝ × E → ℝ} |
| 176 | (hF : RadialAlias.RadiallySupported P.a P.b F) : |
| 177 | RadialAlias.RadiallySupported P.a P.b (weightedSource e F) := |
| 178 | fun _ h => hF (right_ne_zero_of_mul h) |
| 179 | |
| 180 | theorem mass_contDiff {P : Patch} (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 181 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (mass e F) := |
| 182 | IntegratedMeanBalances.radialMoment_smooth hF hs e |
| 183 | |
| 184 | theorem bumpCorrection_contDiff (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 185 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (bumpCorrection P e F) := |
| 186 | ((momentDensity_contDiff P e).comp contDiff_fst).mul ((mass_contDiff e hF hs).comp contDiff_snd) |
| 187 | |
| 188 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 189 | theorem bumpCorrection_supported (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) : |
| 190 | RadialAlias.RadiallySupported P.left P.right (bumpCorrection P e F) := |
| 191 | fun _ h => momentDensity_support P e (left_ne_zero_of_mul h) |
| 192 | |
| 193 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 194 | theorem bumpCorrection_moment (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (p : E) : |
| 195 | mass e (bumpCorrection P e F) p = mass e F p := by |
| 196 | change (∫ r, r ^ e * (momentDensity P e r * mass e F p)) = _ |
| 197 | simp_rw [← mul_assoc] |
| 198 | rw [integral_mul_const, momentDensity_moment, one_mul] |
| 199 | |
| 200 | theorem adjusted_contDiff (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 201 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (adjusted P e F) := |
| 202 | hF.sub (bumpCorrection_contDiff P e hF hs) |
| 203 | |
| 204 | theorem primitive_contDiff (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 205 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (primitive P e F) := |
| 206 | TransportPrimitive.compactIntegral_contDiff (cutoff_contDiff P) |
| 207 | (weightedSource_contDiff e hF) (weightedSource_supported e hs) |
| 208 | |
| 209 | theorem primitive_supported (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 210 | (hs : RadialAlias.RadiallySupported P.a P.b F) : |
| 211 | RadialAlias.RadiallySupported P.a P.b (primitive P e F) := |
| 212 | TransportPrimitive.compactIntegral_supported ((continuous_fst.pow e).mul hF) |
| 213 | (weightedSource_supported e hs) |
| 214 | (fun _ hr => cutoff_zero P (hr.trans P.a_lt_left.le)) |
| 215 | (fun _ hr => cutoff_one P (P.right_lt_b.le.trans hr)) |
| 216 | |
| 217 | theorem sigma_contDiff (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 218 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (sigma P e F) := |
| 219 | (((inversePower_contDiff P e).comp contDiff_fst).neg).mul (primitive_contDiff P e hF hs) |
| 220 | |
| 221 | theorem sigma_supported (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 222 | (hs : RadialAlias.RadiallySupported P.a P.b F) : |
| 223 | RadialAlias.RadiallySupported P.a P.b (sigma P e F) := |
| 224 | fun _ h => primitive_supported P e hF hs (right_ne_zero_of_mul h) |
| 225 | |
| 226 | theorem total_weightedSource (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 227 | (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 228 | TransportPrimitive.totalIntegral 0 (0 : E) (weightedSource e F) z = mass e F z.2 := by |
| 229 | rw [TransportPrimitive.totalIntegral_eq_radialInterval |
| 230 | (weightedSource_continuous e hF) (weightedSource_supported e hs)] |
| 231 | simp only [zero_mul, zero_smul, add_zero, weightedSource] |
| 232 | exact (IntegratedMeanBalances.radialMoment_eq_interval hF hs e z.2).symm |
| 233 | |
| 234 | theorem past_zero_eq_integral {a b : ℝ} (ha : 0 ≤ a) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 235 | (hs : RadialAlias.RadiallySupported a b F) (z : ℝ × E) : |
| 236 | TransportPrimitive.pastIntegral 0 (0 : E) F z = ∫ r in (0 : ℝ)..z.1, F (r, z.2) := by |
| 237 | have hs0 : RadialAlias.RadiallySupported 0 b F := fun y hy => ⟨ha.trans (hs hy).1, (hs hy).2⟩ |
| 238 | simpa only [zero_mul, zero_smul, add_zero] using |
| 239 | TransportPrimitive.pastIntegral_eq_radialInterval (M := 0) (v := (0 : E)) hF hs0 z |
| 240 | |
| 241 | theorem cutoff_eq_integral (P : Patch) (r : ℝ) : cutoff P r = ∫ s in (0 : ℝ)..r, density P s := |
| 242 | past_zero_eq_integral P.left_pos.le (densityLift_contDiff P).continuous (densityLift_supported P) (r, 0) |
| 243 | |
| 244 | theorem primitive_eq_integral (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 245 | (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 246 | primitive P e F z = ∫ r in (0 : ℝ)..z.1, r ^ e * adjusted P e F (r, z.2) := by |
| 247 | have hiF : IntervalIntegrable (fun r => r ^ e * F (r, z.2)) volume 0 z.1 := |
| 248 | ((continuous_id.pow e).mul (hF.continuous.comp (continuous_id.prodMk continuous_const))).intervalIntegrable _ _ |
| 249 | have hiD : IntervalIntegrable (fun r => density P r * mass e F z.2) volume 0 z.1 := |
| 250 | ((density_contDiff P).continuous.mul continuous_const).intervalIntegrable _ _ |
| 251 | have heq : (fun r => r ^ e * adjusted P e F (r, z.2)) = |
| 252 | fun r => r ^ e * F (r, z.2) - density P r * mass e F z.2 := by |
| 253 | funext r |
| 254 | dsimp [adjusted, bumpCorrection] |
| 255 | rw [mul_sub, ← mul_assoc, weighted_momentDensity] |
| 256 | rw [heq, intervalIntegral.integral_sub hiF hiD, intervalIntegral.integral_mul_const] |
| 257 | unfold primitive TransportPrimitive.compactIntegral |
| 258 | rw [past_zero_eq_integral P.a_pos.le (weightedSource_continuous e hF.continuous) |
| 259 | (weightedSource_supported e hs), total_weightedSource P e hF.continuous hs, cutoff_eq_integral] |
| 260 | rfl |
| 261 | |
| 262 | theorem weighted_sigma_eq (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 263 | (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 264 | z.1 ^ e * sigma P e F z = -primitive P e F z := by |
| 265 | by_cases h : primitive P e F z = 0 |
| 266 | · simp [sigma, h] |
| 267 | have hr := primitive_supported P e hF hs h |
| 268 | have hz0 : z.1 ≠ 0 := (P.a_pos.trans_le hr.1).ne' |
| 269 | rw [sigma, inversePower_eq P e hr.1] |
| 270 | field_simp |
| 271 | |
| 272 | theorem sigma_eq_negative_primitive (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 273 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 274 | sigma P e F z = -(∫ r in (0 : ℝ)..z.1, r ^ e * adjusted P e F (r, z.2)) / z.1 ^ e := by |
| 275 | rw [← primitive_eq_integral P e hF hs] |
| 276 | by_cases h : primitive P e F z = 0 |
| 277 | · simp [sigma, h] |
| 278 | rw [sigma, inversePower_eq P e (primitive_supported P e hF.continuous hs h).1] |
| 279 | ring |
| 280 | |
| 281 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 282 | theorem adjusted_supported (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 283 | (hs : RadialAlias.RadiallySupported P.a P.b F) : |
| 284 | RadialAlias.RadiallySupported P.a P.b (adjusted P e F) := by |
| 285 | intro z hz |
| 286 | by_contra hn |
| 287 | have hF : F z = 0 := by |
| 288 | by_contra h |
| 289 | exact hn (hs h) |
| 290 | have hB : bumpCorrection P e F z = 0 := by |
| 291 | by_contra h |
| 292 | have hp := bumpCorrection_supported P e F h |
| 293 | exact hn ⟨P.a_lt_left.le.trans hp.1, hp.2.trans P.right_lt_b.le⟩ |
| 294 | exact hz (by simp [adjusted, hF, hB]) |
| 295 | |
| 296 | theorem adjusted_moment_zero (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 297 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) : |
| 298 | mass e (adjusted P e F) p = 0 := by |
| 299 | have hiF := IntegratedMeanBalances.weighted_integrable |
| 300 | (IntegratedMeanBalances.radial_slice_smooth hF p).continuous |
| 301 | (IntegratedMeanBalances.radial_slice_compact hs p) e |
| 302 | have hiB := IntegratedMeanBalances.weighted_integrable |
| 303 | (IntegratedMeanBalances.radial_slice_smooth (bumpCorrection_contDiff P e hF hs) p).continuous |
| 304 | (IntegratedMeanBalances.radial_slice_compact (bumpCorrection_supported P e F) p) e |
| 305 | change IntegratedMeanBalances.moment e |
| 306 | (fun r => F (r, p) - bumpCorrection P e F (r, p)) = 0 |
| 307 | rw [IntegratedMeanBalances.moment_sub e hiF hiB] |
| 308 | change mass e F p - mass e (bumpCorrection P e F) p = 0 |
| 309 | rw [bumpCorrection_moment, sub_self] |
| 310 | |
| 311 | theorem adjusted_positive_moment_zero (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 312 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) : |
| 313 | (∫ r in Ioi (0 : ℝ), r ^ e * adjusted P e F (r, p)) = 0 := by |
| 314 | rw [IntegratedMeanBalances.positive_integral_eq_integral P.a_pos] |
| 315 | · exact adjusted_moment_zero P e hF hs p |
| 316 | · intro r hr |
| 317 | exact adjusted_supported P e hs (right_ne_zero_of_mul hr) |
| 318 | |
| 319 | theorem primitive_hasDerivAt (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 320 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) (r : ℝ) : |
| 321 | HasDerivAt (fun t => primitive P e F (t, p)) (r ^ e * adjusted P e F (r, p)) r := by |
| 322 | have hp := primitive_contDiff P e hF hs |
| 323 | have hd := ((hp.differentiable (by simp)) (r, p)).hasFDerivAt.comp_hasDerivAt r |
| 324 | ((hasDerivAt_id r).prodMk (hasDerivAt_const r p)) |
| 325 | have ht := TransportPrimitive.transport_compactIntegral (M := 0) (v := (0 : E)) |
| 326 | (cutoff_contDiff P) (weightedSource_contDiff e hF) (weightedSource_supported e hs) (r, p) |
| 327 | simp only [TransportPrimitive.fixedDeriv, zero_smul, cutoff_deriv, |
| 328 | total_weightedSource P e hF.continuous hs, smul_eq_mul] at ht |
| 329 | have he : weightedSource e F (r, p) - density P r * mass e F p = |
| 330 | r ^ e * adjusted P e F (r, p) := by |
| 331 | dsimp [weightedSource, adjusted, bumpCorrection] |
| 332 | rw [mul_sub, ← mul_assoc, weighted_momentDensity] |
| 333 | rw [he] at ht |
| 334 | change fderiv ℝ (primitive P e F) (r, p) (1, 0) = _ at ht |
| 335 | simpa only [ht, Function.comp_def, id_eq] using hd |
| 336 | |
| 337 | /-- The sign is the one required to cancel the adjusted residual by divergence. -/ |
| 338 | theorem weighted_sigma_hasDerivAt (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 339 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) (r : ℝ) : |
| 340 | HasDerivAt (fun t => t ^ e * sigma P e F (t, p)) (-r ^ e * adjusted P e F (r, p)) r := by |
| 341 | have he : (fun t => t ^ e * sigma P e F (t, p)) = |
| 342 | fun t => -primitive P e F (t, p) := funext (fun t => weighted_sigma_eq P e hF.continuous hs (t, p)) |
| 343 | rw [he] |
| 344 | convert! (primitive_hasDerivAt P e hF hs p r).neg using 1 |
| 345 | ring |
| 346 | |
| 347 | theorem sigma_slice_compact (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 348 | (hF : Continuous F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) : |
| 349 | HasCompactSupport (fun r => sigma P e F (r, p)) := |
| 350 | IntegratedMeanBalances.radial_slice_compact (sigma_supported P e hF hs) p |
| 351 | |
| 352 | theorem angular_divergence (P : Patch) {F : ℝ × E → ℝ} |
| 353 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) {r : ℝ} (hr : 0 < r) : |
| 354 | IntegratedMeanBalances.radialDivergence 2 (fun t => sigma P 2 F (t, p)) r = |
| 355 | -adjusted P 2 F (r, p) := by |
| 356 | have hsD := ((IntegratedMeanBalances.radial_slice_smooth (sigma_contDiff P 2 hF hs) p).differentiable (by simp) r).hasDerivAt |
| 357 | have he := ((hasDerivAt_pow 2 r).mul hsD).unique (weighted_sigma_hasDerivAt P 2 hF hs p r) |
| 358 | norm_num at he |
| 359 | apply mul_left_cancel₀ (pow_ne_zero 2 hr.ne') |
| 360 | dsimp [IntegratedMeanBalances.radialDivergence] |
| 361 | calc |
| 362 | _ = 2 * r * sigma P 2 F (r, p) + r ^ 2 * deriv (fun t => sigma P 2 F (t, p)) r := by |
| 363 | field_simp ; ring |
| 364 | _ = _ := by nlinarith [he] |
| 365 | |
| 366 | theorem axial_divergence (P : Patch) {F : ℝ × E → ℝ} |
| 367 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) {r : ℝ} (hr : 0 < r) : |
| 368 | IntegratedMeanBalances.radialDivergence 1 (fun t => sigma P 1 F (t, p)) r = |
| 369 | -adjusted P 1 F (r, p) := by |
| 370 | have hsD := ((IntegratedMeanBalances.radial_slice_smooth (sigma_contDiff P 1 hF hs) p).differentiable (by simp) r).hasDerivAt |
| 371 | have he := ((hasDerivAt_pow 1 r).mul hsD).unique (weighted_sigma_hasDerivAt P 1 hF hs p r) |
| 372 | norm_num at he |
| 373 | apply mul_left_cancel₀ hr.ne' |
| 374 | dsimp [IntegratedMeanBalances.radialDivergence] |
| 375 | calc |
| 376 | _ = sigma P 1 F (r, p) + r * deriv (fun t => sigma P 1 F (t, p)) r := by |
| 377 | field_simp ; ring |
| 378 | _ = _ := by nlinarith [he] |
| 379 | |
| 380 | /-- All fixed-order constants come from the proved weighted integral estimate |
| 381 | and bounded radial multipliers on a fixed positive annulus. -/ |
| 382 | theorem sigma_finiteJets_uniform (P : Patch) (e : ℕ) {cL cR : ℝ} |
| 383 | (hcL : 0 < cL) (hcR : 0 < cR) (p m : ℕ) : |
| 384 | ∃ K : ℝ, 0 ≤ K ∧ ∀ F : ℝ × E → ℝ, ContDiff ℝ ∞ F → |
| 385 | RadialAlias.RadiallySupported P.a P.b F → ∀ A : ℝ, 0 ≤ A → |
| 386 | (∀ i ≤ m, ∀ r ∈ Ioo P.a P.b, ∀ y : E, |
| 387 | ‖iteratedFDeriv ℝ i F (r, y)‖ ≤ A * WeightedRadialPrimitive.logWeight cL cR P.a P.b p r) → |
| 388 | ∀ z : ℝ × E, z.1 ∈ Ioo P.a P.b → ∀ j ≤ m, |
| 389 | ‖iteratedFDeriv ℝ j (sigma P e F) z‖ ≤ |
| 390 | K * A * WeightedRadialPrimitive.logWeight cL cR P.a P.b p z.1 := by |
| 391 | obtain ⟨K1, hK1, h1⟩ := RadialPullback.radial_multiplier_finiteJets_uniform |
| 392 | (E := E) (V := ℝ) P.a P.b (contDiff_id.pow e) m |
| 393 | obtain ⟨K2, hK2, h2⟩ := WeightedRadialPrimitive.transport_compact_finiteJets_uniform |
| 394 | (E := E) (V := ℝ) P.a_pos P.a_lt_left P.left_lt_right P.right_lt_b hcL hcR p m |
| 395 | (cutoff P) (cutoff_contDiff P) (fun _ h => cutoff_zero P h) (fun _ h => cutoff_one P h) |
| 396 | obtain ⟨K3, hK3, h3⟩ := RadialPullback.radial_multiplier_finiteJets_uniform |
| 397 | (E := E) (V := ℝ) P.a P.b (inversePower_contDiff P e).neg m |
| 398 | refine ⟨K3 * K2 * K1, by positivity, ?_⟩ |
| 399 | intro F hF hs A hA hFbound z hz j hj |
| 400 | have hweight (r : ℝ) (hr : r ∈ Ioo P.a P.b) : |
| 401 | 0 ≤ WeightedRadialPrimitive.logWeight cL cR P.a P.b p r := |
| 402 | (WeightedRadialPrimitive.weight_pos cL cR p (WeightedRadialPrimitive.logPosition_mem P.a_pos hr)).le |
| 403 | have hweighted : ∀ i ≤ m, ∀ r ∈ Ioo P.a P.b, ∀ y : E, |
| 404 | ‖iteratedFDeriv ℝ i (weightedSource e F) (r, y)‖ ≤ |
| 405 | (K1 * A) * WeightedRadialPrimitive.logWeight cL cR P.a P.b p r := by |
| 406 | intro i hi r hr y |
| 407 | have h := h1 F hF (r, y) ⟨hr.1.le, hr.2.le⟩ |
| 408 | (A * WeightedRadialPrimitive.logWeight cL cR P.a P.b p r) (mul_nonneg hA (hweight r hr)) |
| 409 | (fun k hk => hFbound k hk r hr y) i hi |
| 410 | simp only [smul_eq_mul, mul_assoc, id_eq] at h ⊢ |
| 411 | exact h |
| 412 | have hprimitive (i : ℕ) (hi : i ≤ m) : |
| 413 | ‖iteratedFDeriv ℝ i (primitive P e F) z‖ ≤ |
| 414 | (K2 * (K1 * A)) * WeightedRadialPrimitive.logWeight cL cR P.a P.b p z.1 := |
| 415 | h2 0 0 (weightedSource e F) (weightedSource_contDiff e hF) (weightedSource_supported e hs) |
| 416 | (K1 * A) (mul_nonneg hK1 hA) hweighted z hz i hi |
| 417 | have h := h3 (primitive P e F) (primitive_contDiff P e hF hs) z ⟨hz.1.le, hz.2.le⟩ |
| 418 | ((K2 * (K1 * A)) * WeightedRadialPrimitive.logWeight cL cR P.a P.b p z.1) |
| 419 | (mul_nonneg (mul_nonneg hK2 (mul_nonneg hK1 hA)) (hweight z.1 hz)) hprimitive j hj |
| 420 | simp only [smul_eq_mul, mul_assoc] at h ⊢ |
| 421 | exact h |
| 422 | |
| 423 | theorem meanClass_sigma (P : Patch) (e : ℕ) {cL cR : ℝ} (hcL : 0 < cL) (hcR : 0 < cR) |
| 424 | (ε slow : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) |
| 425 | (α : ℝ) (F : ℕ → ℝ × E → ℝ) (hF : ∀ n, ContDiff ℝ ∞ (F n)) |
| 426 | (hs : ∀ n, RadialAlias.RadiallySupported P.a P.b (F n)) |
| 427 | (hclass : WeightedClasses.MeanClass |
| 428 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) α F) : |
| 429 | WeightedClasses.MeanClass |
| 430 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) α |
| 431 | (fun n => sigma P e (F n)) := by |
| 432 | refine ⟨hclass.weight_nonneg, fun n => (sigma_contDiff P e (hF n) (hs n)).contDiffOn, ?_⟩ |
| 433 | intro m |
| 434 | obtain ⟨C, hC, p, hsource⟩ := hclass.bounds m |
| 435 | obtain ⟨K, hK, hbound⟩ := sigma_finiteJets_uniform (E := E) P e hcL hcR p m |
| 436 | refine ⟨K * C, mul_nonneg hK hC, p, ?_⟩ |
| 437 | intro n z hz j hj |
| 438 | change z.1 ∈ Ioo P.a P.b at hz |
| 439 | have hA : 0 ≤ C * (ε n) ^ α * (slow n) ^ p := |
| 440 | mul_nonneg (mul_nonneg hC (Real.rpow_pos_of_pos (hε n) α).le) |
| 441 | (pow_nonneg (zero_le_one.trans (hslow n)) p) |
| 442 | have hinput : ∀ i ≤ m, ∀ r ∈ Ioo P.a P.b, ∀ y : E, |
| 443 | ‖iteratedFDeriv ℝ i (F n) (r, y)‖ ≤ |
| 444 | (C * (ε n) ^ α * (slow n) ^ p) * WeightedRadialPrimitive.logWeight cL cR P.a P.b p r := by |
| 445 | intro i hi r hr y |
| 446 | have h := hsource n (r, y) hr i hi |
| 447 | rw [WeightedRadialPrimitive.logStrip_majorant_eq P.a_pos hcL hcR ε slow hε hε1 hslow |
| 448 | α C p n (r, y) hr] at h |
| 449 | exact h |
| 450 | have h := hbound (F n) (hF n) (hs n) _ hA hinput z hz j hj |
| 451 | rw [WeightedRadialPrimitive.logStrip_majorant_eq P.a_pos hcL hcR ε slow hε hε1 hslow |
| 452 | α (K * C) p n z hz] |
| 453 | simpa only [mul_assoc] using h |
| 454 | |
| 455 | /-- The constructed interior bump carries the full edge weight, because its |
| 456 | support lies in a fixed compact subset of the active annulus. -/ |
| 457 | theorem momentDensity_meanClass (P : Patch) (e : ℕ) {cL cR : ℝ} (hcL : 0 < cL) (hcR : 0 < cR) |
| 458 | (ε slow : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) : |
| 459 | WeightedClasses.MeanClass |
| 460 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 461 | 0 (fun _ (z : ℝ × E) => momentDensity P e z.1) := by |
| 462 | let s := WeightedRadialPrimitive.logStripData (E := E) P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow |
| 463 | have hmem : ∀ r ∈ Icc P.left P.right, (r, (0 : E)) ∈ s.domain := by |
| 464 | intro r hr |
| 465 | exact ⟨P.a_lt_left.trans_le hr.1, hr.2.trans_lt P.right_lt_b⟩ |
| 466 | have hc : ContinuousOn (fun r => s.zeta (r, (0 : E))) (Icc P.left P.right) := |
| 467 | s.zeta_smooth.continuousOn.comp (continuous_id.prodMk continuous_const).continuousOn hmem |
| 468 | have hp : ∀ r ∈ Icc P.left P.right, 0 < s.zeta (r, (0 : E)) := by |
| 469 | intro r hr |
| 470 | exact WeightedRadialPrimitive.zeta_pos cL cR |
| 471 | (WeightedRadialPrimitive.logPosition_mem P.a_pos (hmem r hr)) |
| 472 | obtain ⟨D, hD, hDb⟩ := UniformCone.positive_uniform_margin isCompact_Icc hc hp |
| 473 | have hs : RadialAlias.RadiallySupported P.left P.right (fun z : ℝ × E => momentDensity P e z.1) := |
| 474 | fun z hz => momentDensity_support P e hz |
| 475 | refine ⟨fun _ z hz => s.zeta_nonneg z hz, |
| 476 | fun _ => ((momentDensity_contDiff P e).comp contDiff_fst).contDiffOn, ?_⟩ |
| 477 | intro m |
| 478 | obtain ⟨C, hC, hCb⟩ := WeightedRadialPrimitive.cutoff_finiteJet_bound (E := E) |
| 479 | P.a P.b (momentDensity P e) (momentDensity_contDiff P e) m |
| 480 | refine ⟨C / D, div_nonneg hC hD.le, 0, ?_⟩ |
| 481 | intro n z hz j hj |
| 482 | change ‖iteratedFDeriv ℝ j (fun z : ℝ × E => momentDensity P e z.1) z‖ ≤ |
| 483 | WeightedClasses.majorant s (fun _ y => s.zeta y) 0 (C / D) 0 n z |
| 484 | simp only [WeightedClasses.majorant, Real.rpow_zero, pow_zero, mul_one] |
| 485 | by_cases hi : z.1 ∈ Icc P.left P.right |
| 486 | · have hd : D ≤ s.zeta z := hDb z.1 hi |
| 487 | calc |
| 488 | _ ≤ C := hCb j hj z ⟨hz.1.le, hz.2.le⟩ |
| 489 | _ = (C / D) * D := by field_simp |
| 490 | _ ≤ _ := mul_le_mul_of_nonneg_left hd (div_nonneg hC hD.le) |
| 491 | · have hzj : iteratedFDeriv ℝ j (fun z : ℝ × E => momentDensity P e z.1) z = 0 := by |
| 492 | by_contra hn |
| 493 | exact hi (TransportPrimitive.iteratedFDeriv_supported hs j hn) |
| 494 | rw [hzj, norm_zero] |
| 495 | exact mul_nonneg (div_nonneg hC hD.le) (s.zeta_nonneg z hz) |
| 496 | |
| 497 | theorem fderiv_lift (D : E → ℝ) (hD : ContDiff ℝ ∞ D) (z : ℝ × E) (v : E) : |
| 498 | fderiv ℝ (fun y : ℝ × E => D y.2) z (0, v) = fderiv ℝ D z.2 v := by |
| 499 | have h := ((hD.differentiable (by simp)) z.2).hasFDerivAt.comp z hasFDerivAt_snd |
| 500 | change fderiv ℝ (D ∘ Prod.snd) z (0, v) = _ |
| 501 | rw [h.fderiv] |
| 502 | simp |
| 503 | |
| 504 | /-- The improved bump order follows from a proved residual-moment identity: |
| 505 | one slow derivative comes with one additional factor of epsilon. -/ |
| 506 | theorem bump_improvedClass_of_moment_identity (P : Patch) (e : ℕ) {cL cR : ℝ} |
| 507 | (hcL : 0 < cL) (hcR : 0 < cR) (ε slow : ℕ → ℝ) |
| 508 | (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) |
| 509 | (α : ℝ) (F : ℕ → ℝ × E → ℝ) (D : ℕ → E → ℝ) (v : E) |
| 510 | (hD : ∀ n, ContDiff ℝ ∞ (D n)) |
| 511 | (hclass : WeightedClasses.UnweightedClass |
| 512 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 513 | α (fun n (z : ℝ × E) => D n z.2)) |
| 514 | (hmoment : ∀ n p, mass e (F n) p = ε n * fderiv ℝ (D n) p v) : |
| 515 | WeightedClasses.MeanClass |
| 516 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 517 | (α + 1) (fun n => bumpCorrection P e (F n)) := by |
| 518 | let s := WeightedRadialPrimitive.logStripData (E := E) P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow |
| 519 | have hd := hclass.directional ((0 : ℝ), v) |
| 520 | have hb := (momentDensity_meanClass (E := E) P e hcL hcR ε slow hε hε1 hslow).mul hd |
| 521 | have hmean : WeightedClasses.MeanClass s α (fun n (z : ℝ × E) => |
| 522 | momentDensity P e z.1 * fderiv ℝ (D n) z.2 v) := by |
| 523 | simpa only [WeightedClasses.MeanClass, zero_add, mul_one, fderiv_lift _ (hD _)] using hb |
| 524 | have hh := hmean.band_smul (WeightedClasses.bandBound_rpow s 1) |
| 525 | have heq : (fun n (z : ℝ × E) => s.epsilon n ^ (1 : ℝ) • |
| 526 | (momentDensity P e z.1 * fderiv ℝ (D n) z.2 v)) = fun n => bumpCorrection P e (F n) := by |
| 527 | funext n z |
| 528 | simp only [Real.rpow_one, smul_eq_mul, bumpCorrection, hmoment] |
| 529 | change ε n * (momentDensity P e z.1 * _) = momentDensity P e z.1 * (ε n * _) |
| 530 | ring |
| 531 | rwa [heq] at hh |
| 532 | |
| 533 | noncomputable def barSigma (P : Patch) (e : ℕ) (F : PressureStream.Lift E → ℝ) : ℝ × E → ℝ := |
| 534 | sigma P e (PressureStream.torusAverage F) |
| 535 | |
| 536 | theorem barSigma_contDiff (P : Patch) (e : ℕ) {F : PressureStream.Lift E → ℝ} |
| 537 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) : |
| 538 | ContDiff ℝ ∞ (barSigma P e F) := |
| 539 | sigma_contDiff P e (PressureStream.torusAverage_contDiff hF) (PressureStream.torusAverage_supported hs) |
| 540 | |
| 541 | theorem barSigma_eq_primitive (P : Patch) (e : ℕ) {F : PressureStream.Lift E → ℝ} |
| 542 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 543 | barSigma P e F z = -(∫ r in (0 : ℝ)..z.1, |
| 544 | r ^ e * adjusted P e (PressureStream.torusAverage F) (r, z.2)) / z.1 ^ e := |
| 545 | sigma_eq_negative_primitive P e (PressureStream.torusAverage_contDiff hF) |
| 546 | (PressureStream.torusAverage_supported hs) z |
| 547 | |
| 548 | /-- Slow coefficients are constant along the ordinary radial integration. -/ |
| 549 | theorem sigma_slow_mul (P : Patch) (e : ℕ) (k : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : |
| 550 | sigma P e (fun y => k y.2 * F y) z = k z.2 * sigma P e F z := by |
| 551 | have hp : TransportPrimitive.pastIntegral 0 (0 : E) (weightedSource e (fun y => k y.2 * F y)) z = |
| 552 | k z.2 * TransportPrimitive.pastIntegral 0 (0 : E) (weightedSource e F) z := by |
| 553 | unfold TransportPrimitive.pastIntegral |
| 554 | rw [← integral_const_mul] |
| 555 | apply integral_congr_ae |
| 556 | exact Filter.Eventually.of_forall (fun u => by simp [weightedSource, TransportPrimitive.shift]; ring) |
| 557 | have ht : TransportPrimitive.totalIntegral 0 (0 : E) (weightedSource e (fun y => k y.2 * F y)) z = |
| 558 | k z.2 * TransportPrimitive.totalIntegral 0 (0 : E) (weightedSource e F) z := by |
| 559 | unfold TransportPrimitive.totalIntegral |
| 560 | rw [← integral_const_mul] |
| 561 | apply integral_congr_ae |
| 562 | exact Filter.Eventually.of_forall (fun u => by simp [weightedSource, TransportPrimitive.shift]; ring) |
| 563 | unfold sigma primitive TransportPrimitive.compactIntegral |
| 564 | rw [hp, ht] |
| 565 | simp only [smul_eq_mul] |
| 566 | ring |
| 567 | |
| 568 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 569 | theorem mass_slow_mul (e : ℕ) (k : E → ℝ) (F : ℝ × E → ℝ) (p : E) : |
| 570 | mass e (fun y => k y.2 * F y) p = k p * mass e F p := by |
| 571 | change (∫ r, r ^ e * (k p * F (r, p))) = k p * ∫ r, r ^ e * F (r, p) |
| 572 | rw [← integral_const_mul] |
| 573 | apply integral_congr_ae |
| 574 | exact Filter.Eventually.of_forall (fun _ => by ring) |
| 575 | |
| 576 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 577 | theorem bump_slow_mul (P : Patch) (e : ℕ) (k : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : |
| 578 | bumpCorrection P e (fun y => k y.2 * F y) z = k z.2 * bumpCorrection P e F z := by |
| 579 | simp only [bumpCorrection, mass_slow_mul] |
| 580 | ring |
| 581 | |
| 582 | end Primitive |
| 583 | |
| 584 | section Physical |
| 585 | |
| 586 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 587 | |
| 588 | /-- The physical radial length is sqrt q, as in the chart R = r / sqrt Q. -/ |
| 589 | noncomputable def lengthScale (q : E → ℝ) (p : E) : ℝ := Real.sqrt (q p) |
| 590 | noncomputable def nativeSource (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 591 | F (lengthScale q z.2 * z.1, z.2) |
| 592 | noncomputable def physicalDensity (P : Patch) (e : ℕ) (q : E → ℝ) (z : ℝ × E) : ℝ := |
| 593 | momentDensity P e (z.1 / lengthScale q z.2) / lengthScale q z.2 ^ (e + 1) |
| 594 | noncomputable def physicalBump (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 595 | physicalDensity P e q z * mass e F z.2 |
| 596 | noncomputable def physicalAdjusted (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 597 | F z - physicalBump P e q F z |
| 598 | noncomputable def physicalSigma (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 599 | lengthScale q z.2 * sigma P e (nativeSource q F) (z.1 / lengthScale q z.2, z.2) |
| 600 | |
| 601 | /-- Radial support stated directly using the physical q, with no band index. -/ |
| 602 | def PhysicalSupport (P : Patch) (q : E → ℝ) (F : ℝ × E → ℝ) : Prop := |
| 603 | ∀ z, F z ≠ 0 → z.1 / lengthScale q z.2 ∈ Icc P.a P.b |
| 604 | |
| 605 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 606 | theorem lengthScale_pos {q : E → ℝ} (hq : ∀ p, 0 < q p) (p : E) : 0 < lengthScale q p := |
| 607 | Real.sqrt_pos.mpr (hq p) |
| 608 | |
| 609 | theorem lengthScale_contDiff {q : E → ℝ} (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) : |
| 610 | ContDiff ℝ ∞ (lengthScale q) := hq.sqrt (fun p => (hpos p).ne') |
| 611 | |
| 612 | theorem nativeSource_contDiff {q : E → ℝ} (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) |
| 613 | {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) : ContDiff ℝ ∞ (nativeSource q F) := |
| 614 | hF.comp ((((lengthScale_contDiff hq hpos).comp contDiff_snd).mul contDiff_fst).prodMk contDiff_snd) |
| 615 | |
| 616 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 617 | theorem nativeSource_supported (P : Patch) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 618 | {F : ℝ × E → ℝ} (hs : PhysicalSupport P q F) : |
| 619 | RadialAlias.RadiallySupported P.a P.b (nativeSource q F) := by |
| 620 | intro z hz |
| 621 | have h := hs (lengthScale q z.2 * z.1, z.2) hz |
| 622 | simp only [mul_div_cancel_left₀ _ (lengthScale_pos hq z.2).ne'] at h |
| 623 | exact h |
| 624 | |
| 625 | theorem integral_dilate_weighted (e : ℕ) (f : ℝ → ℝ) {s : ℝ} (hs : 0 < s) : |
| 626 | (∫ r, r ^ e * f (s * r)) = (∫ r, r ^ e * f r) / s ^ (e + 1) := by |
| 627 | have he : (fun r => r ^ e * f (s * r)) = |
| 628 | fun r => (s ^ e)⁻¹ * ((s * r) ^ e * f (s * r)) := by |
| 629 | funext r |
| 630 | rw [mul_pow] |
| 631 | field_simp [hs.ne'] |
| 632 | rw [he, integral_const_mul, Measure.integral_comp_mul_left (fun r => r ^ e * f r) s] |
| 633 | rw [abs_of_pos (inv_pos.mpr hs), smul_eq_mul, pow_succ] |
| 634 | field_simp [hs.ne'] |
| 635 | |
| 636 | theorem interval_dilate_weighted (e : ℕ) (f : ℝ → ℝ) {s : ℝ} (hs : 0 < s) (x : ℝ) : |
| 637 | (∫ r in (0 : ℝ)..x, r ^ e * f (s * r)) = |
| 638 | (∫ r in (0 : ℝ)..(s * x), r ^ e * f r) / s ^ (e + 1) := by |
| 639 | have he : (fun r => r ^ e * f (s * r)) = |
| 640 | fun r => (s ^ e)⁻¹ * ((s * r) ^ e * f (s * r)) := by |
| 641 | funext r |
| 642 | rw [mul_pow] |
| 643 | field_simp [hs.ne'] |
| 644 | rw [he, intervalIntegral.integral_const_mul, |
| 645 | intervalIntegral.integral_comp_mul_left (fun r => r ^ e * f r) hs.ne'] |
| 646 | rw [mul_zero, smul_eq_mul, pow_succ] |
| 647 | field_simp [hs.ne'] |
| 648 | |
| 649 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 650 | theorem nativeSource_mass (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 651 | (F : ℝ × E → ℝ) (p : E) : |
| 652 | mass e (nativeSource q F) p = mass e F p / lengthScale q p ^ (e + 1) := |
| 653 | integral_dilate_weighted e (fun r => F (r, p)) (lengthScale_pos hq p) |
| 654 | |
| 655 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 656 | theorem physicalDensity_moment (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) (p : E) : |
| 657 | (∫ r, r ^ e * physicalDensity P e q (r, p)) = 1 := by |
| 658 | let s := lengthScale q p |
| 659 | have hs : 0 < s := lengthScale_pos hq p |
| 660 | have h := integral_dilate_weighted e (momentDensity P e) (inv_pos.mpr hs) |
| 661 | simp only [momentDensity_moment] at h |
| 662 | have he : (fun r => r ^ e * physicalDensity P e q (r, p)) = |
| 663 | fun r => (r ^ e * momentDensity P e (s⁻¹ * r)) / s ^ (e + 1) := by |
| 664 | funext r |
| 665 | simp [physicalDensity, s, div_eq_mul_inv, mul_comm, mul_left_comm] |
| 666 | rw [he, integral_div, h, inv_pow] |
| 667 | field_simp [hs.ne'] |
| 668 | |
| 669 | theorem physicalDensity_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 670 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) : ContDiff ℝ ∞ (physicalDensity P e q) := by |
| 671 | have hs := (lengthScale_contDiff hq hpos).comp (contDiff_snd (E := ℝ)) |
| 672 | exact ((momentDensity_contDiff P e).comp |
| 673 | (contDiff_fst.div hs (fun z => (lengthScale_pos hpos z.2).ne'))).div (hs.pow (e + 1)) |
| 674 | (fun z => pow_ne_zero _ (lengthScale_pos hpos z.2).ne') |
| 675 | |
| 676 | theorem physical_mass_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 677 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 678 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : ContDiff ℝ ∞ (mass e F) := by |
| 679 | have hn := mass_contDiff e (nativeSource_contDiff hq hpos hF) (nativeSource_supported P hpos hs) |
| 680 | have he : mass e F = fun p => lengthScale q p ^ (e + 1) * mass e (nativeSource q F) p := by |
| 681 | funext p |
| 682 | rw [nativeSource_mass e hpos] |
| 683 | field_simp [(lengthScale_pos hpos p).ne'] |
| 684 | rw [he] |
| 685 | exact ((lengthScale_contDiff hq hpos).pow (e + 1)).mul hn |
| 686 | |
| 687 | theorem physicalBump_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 688 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 689 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : ContDiff ℝ ∞ (physicalBump P e q F) := |
| 690 | (physicalDensity_contDiff P e hq hpos).mul ((physical_mass_contDiff P e hq hpos hF hs).comp contDiff_snd) |
| 691 | |
| 692 | theorem physicalSigma_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 693 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 694 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : ContDiff ℝ ∞ (physicalSigma P e q F) := by |
| 695 | have hl : ContDiff ℝ ∞ (fun z : ℝ × E => lengthScale q z.2) := |
| 696 | (lengthScale_contDiff hq hpos).comp contDiff_snd |
| 697 | exact hl.mul ((sigma_contDiff P e (nativeSource_contDiff hq hpos hF) |
| 698 | (nativeSource_supported P hpos hs)).comp |
| 699 | ((contDiff_fst.div hl (fun z => (lengthScale_pos hpos z.2).ne')).prodMk contDiff_snd)) |
| 700 | |
| 701 | theorem physicalSigma_supported (P : Patch) (e : ℕ) {q : E → ℝ} |
| 702 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 703 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : PhysicalSupport P q (physicalSigma P e q F) := by |
| 704 | intro z hz |
| 705 | exact sigma_supported P e (nativeSource_contDiff hq hpos hF).continuous |
| 706 | (nativeSource_supported P hpos hs) (right_ne_zero_of_mul hz) |
| 707 | |
| 708 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 709 | theorem native_adjusted_eq (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 710 | (F : ℝ × E → ℝ) (z : ℝ × E) : |
| 711 | adjusted P e (nativeSource q F) z = |
| 712 | physicalAdjusted P e q F (lengthScale q z.2 * z.1, z.2) := by |
| 713 | simp only [adjusted, bumpCorrection, nativeSource, physicalAdjusted, physicalBump, physicalDensity, |
| 714 | nativeSource_mass e hq, mul_div_cancel_left₀ _ (lengthScale_pos hq z.2).ne'] |
| 715 | ring |
| 716 | |
| 717 | /-- The physical sigma is exactly the requested negative primitive from zero. |
| 718 | No fixed-Q chart enters this definition or identity. -/ |
| 719 | theorem physicalSigma_eq_negative_primitive (P : Patch) (e : ℕ) {q : E → ℝ} |
| 720 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 721 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (z : ℝ × E) : |
| 722 | physicalSigma P e q F z = |
| 723 | -(∫ r in (0 : ℝ)..z.1, r ^ e * physicalAdjusted P e q F (r, z.2)) / z.1 ^ e := by |
| 724 | have hl := lengthScale_pos hpos z.2 |
| 725 | unfold physicalSigma |
| 726 | rw [sigma_eq_negative_primitive P e (nativeSource_contDiff hq hpos hF) (nativeSource_supported P hpos hs)] |
| 727 | simp_rw [native_adjusted_eq P e hpos] |
| 728 | rw [interval_dilate_weighted e (fun r => physicalAdjusted P e q F (r, z.2)) hl, |
| 729 | mul_div_cancel₀ z.1 hl.ne'] |
| 730 | rw [div_pow, pow_succ] |
| 731 | by_cases hr : z.1 = 0 |
| 732 | · simp [hr] |
| 733 | · field_simp [hl.ne', hr] |
| 734 | |
| 735 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 736 | theorem physicalDensity_support (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) (p : E) : |
| 737 | support (fun r => physicalDensity P e q (r, p)) ⊆ |
| 738 | Icc (lengthScale q p * P.left) (lengthScale q p * P.right) := by |
| 739 | intro r hr |
| 740 | have hmd : momentDensity P e (r / lengthScale q p) ≠ 0 := by |
| 741 | intro h |
| 742 | apply hr |
| 743 | simp [physicalDensity, h] |
| 744 | have h := momentDensity_support P e hmd |
| 745 | exact ⟨by simpa only [mul_comm] using (le_div_iff₀ (lengthScale_pos hq p)).mp h.1, |
| 746 | by simpa only [mul_comm] using (div_le_iff₀ (lengthScale_pos hq p)).mp h.2⟩ |
| 747 | |
| 748 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 749 | theorem physicalDensity_positive_moment (P : Patch) (e : ℕ) {q : E → ℝ} |
| 750 | (hq : ∀ p, 0 < q p) (p : E) : |
| 751 | (∫ r in Ioi (0 : ℝ), r ^ e * physicalDensity P e q (r, p)) = 1 := by |
| 752 | rw [IntegratedMeanBalances.positive_integral_eq_integral (mul_pos (lengthScale_pos hq p) P.left_pos)] |
| 753 | · exact physicalDensity_moment P e hq p |
| 754 | · intro r hr |
| 755 | exact physicalDensity_support P e hq p (right_ne_zero_of_mul hr) |
| 756 | |
| 757 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 758 | theorem physicalBump_moment (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 759 | (F : ℝ × E → ℝ) (p : E) : mass e (physicalBump P e q F) p = mass e F p := by |
| 760 | change (∫ r, r ^ e * (physicalDensity P e q (r, p) * mass e F p)) = _ |
| 761 | simp_rw [← mul_assoc] |
| 762 | rw [integral_mul_const, physicalDensity_moment P e hq p, one_mul] |
| 763 | |
| 764 | theorem physicalAdjusted_moment_zero (P : Patch) (e : ℕ) {q : E → ℝ} |
| 765 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 766 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) : |
| 767 | mass e (physicalAdjusted P e q F) p = 0 := by |
| 768 | have he : nativeSource q (physicalAdjusted P e q F) = adjusted P e (nativeSource q F) := |
| 769 | funext fun z => (native_adjusted_eq P e hpos F z).symm |
| 770 | have hz := adjusted_moment_zero P e (nativeSource_contDiff hq hpos hF) |
| 771 | (nativeSource_supported P hpos hs) p |
| 772 | have hh := nativeSource_mass e hpos (physicalAdjusted P e q F) p |
| 773 | rw [he, hz] at hh |
| 774 | have hm := congrArg (fun t => t * lengthScale q p ^ (e + 1)) hh |
| 775 | simpa only [zero_mul, div_mul_cancel₀ _ (pow_ne_zero _ (lengthScale_pos hpos p).ne')] using hm.symm |
| 776 | |
| 777 | theorem physicalSigma_slice_compact (P : Patch) (e : ℕ) {q : E → ℝ} |
| 778 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 779 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) : |
| 780 | HasCompactSupport (fun r => physicalSigma P e q F (r, p)) := by |
| 781 | apply HasCompactSupport.of_support_subset_isCompact |
| 782 | (isCompact_Icc (a := lengthScale q p * P.a) (b := lengthScale q p * P.b)) |
| 783 | intro r hr |
| 784 | have h := physicalSigma_supported P e hq hpos hF hs (r, p) hr |
| 785 | exact ⟨by simpa only [mul_comm] using (le_div_iff₀ (lengthScale_pos hpos p)).mp h.1, |
| 786 | by simpa only [mul_comm] using (div_le_iff₀ (lengthScale_pos hpos p)).mp h.2⟩ |
| 787 | |
| 788 | theorem physicalAdjusted_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 789 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 790 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : |
| 791 | ContDiff ℝ ∞ (physicalAdjusted P e q F) := hF.sub (physicalBump_contDiff P e hq hpos hF hs) |
| 792 | |
| 793 | theorem physical_weighted_sigma_eq (P : Patch) (e : ℕ) {q : E → ℝ} |
| 794 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 795 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) (r : ℝ) : |
| 796 | r ^ e * physicalSigma P e q F (r, p) = |
| 797 | -(∫ t in (0 : ℝ)..r, t ^ e * physicalAdjusted P e q F (t, p)) := by |
| 798 | rw [physicalSigma_eq_negative_primitive P e hq hpos hF hs] |
| 799 | by_cases hr : r = 0 |
| 800 | · subst r |
| 801 | simp |
| 802 | · field_simp |
| 803 | |
| 804 | theorem physical_weighted_sigma_hasDerivAt (P : Patch) (e : ℕ) {q : E → ℝ} |
| 805 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 806 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) (r : ℝ) : |
| 807 | HasDerivAt (fun t => t ^ e * physicalSigma P e q F (t, p)) |
| 808 | (-r ^ e * physicalAdjusted P e q F (r, p)) r := by |
| 809 | have hc : Continuous (fun t => t ^ e * physicalAdjusted P e q F (t, p)) := |
| 810 | (continuous_id.pow e).mul ((physicalAdjusted_contDiff P e hq hpos hF hs).continuous.comp |
| 811 | (continuous_id.prodMk continuous_const)) |
| 812 | have hd := (intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 r) |
| 813 | hc.aestronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt).neg |
| 814 | have he : (fun t => t ^ e * physicalSigma P e q F (t, p)) = |
| 815 | fun t => -(∫ u in (0 : ℝ)..t, u ^ e * physicalAdjusted P e q F (u, p)) := |
| 816 | funext (physical_weighted_sigma_eq P e hq hpos hF hs p) |
| 817 | rw [he] |
| 818 | convert! hd using 1 |
| 819 | ring |
| 820 | |
| 821 | theorem physical_angular_divergence (P : Patch) {q : E → ℝ} |
| 822 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 823 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) {r : ℝ} (hr : 0 < r) : |
| 824 | IntegratedMeanBalances.radialDivergence 2 (fun t => physicalSigma P 2 q F (t, p)) r = |
| 825 | -physicalAdjusted P 2 q F (r, p) := by |
| 826 | have hd := ((IntegratedMeanBalances.radial_slice_smooth (physicalSigma_contDiff P 2 hq hpos hF hs) p).differentiable |
| 827 | (by simp) r).hasDerivAt |
| 828 | have he := ((hasDerivAt_pow 2 r).mul hd).unique |
| 829 | (physical_weighted_sigma_hasDerivAt P 2 hq hpos hF hs p r) |
| 830 | norm_num at he |
| 831 | apply mul_left_cancel₀ (pow_ne_zero 2 hr.ne') |
| 832 | dsimp [IntegratedMeanBalances.radialDivergence] |
| 833 | calc |
| 834 | _ = 2 * r * physicalSigma P 2 q F (r, p) + |
| 835 | r ^ 2 * deriv (fun t => physicalSigma P 2 q F (t, p)) r := by field_simp ; ring |
| 836 | _ = _ := by nlinarith [he] |
| 837 | |
| 838 | theorem physical_axial_divergence (P : Patch) {q : E → ℝ} |
| 839 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 840 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) {r : ℝ} (hr : 0 < r) : |
| 841 | IntegratedMeanBalances.radialDivergence 1 (fun t => physicalSigma P 1 q F (t, p)) r = |
| 842 | -physicalAdjusted P 1 q F (r, p) := by |
| 843 | have hd := ((IntegratedMeanBalances.radial_slice_smooth (physicalSigma_contDiff P 1 hq hpos hF hs) p).differentiable |
| 844 | (by simp) r).hasDerivAt |
| 845 | have he := ((hasDerivAt_pow 1 r).mul hd).unique |
| 846 | (physical_weighted_sigma_hasDerivAt P 1 hq hpos hF hs p r) |
| 847 | norm_num at he |
| 848 | apply mul_left_cancel₀ hr.ne' |
| 849 | dsimp [IntegratedMeanBalances.radialDivergence] |
| 850 | calc |
| 851 | _ = physicalSigma P 1 q F (r, p) + r * deriv (fun t => physicalSigma P 1 q F (t, p)) r := by |
| 852 | field_simp ; ring |
| 853 | _ = _ := by nlinarith [he] |
| 854 | |
| 855 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 856 | /-- Taking the torus bar preserves support described by the physical q. -/ |
| 857 | theorem physical_torusAverage_supported (P : Patch) {q : E → ℝ} |
| 858 | {F : PressureStream.Lift E → ℝ} |
| 859 | (hs : PhysicalSupport P (fun p => q p.1) F) : |
| 860 | PhysicalSupport P q (PressureStream.torusAverage F) := by |
| 861 | intro z hz |
| 862 | by_contra hn |
| 863 | apply hz |
| 864 | apply PressureStream.torusAverage_zero_of_forall |
| 865 | intro Y |
| 866 | by_contra hF |
| 867 | exact hn (hs (z.1, (z.2, Y)) hF) |
| 868 | |
| 869 | noncomputable def physicalBarSigma (P : Patch) (e : ℕ) (q : E → ℝ) |
| 870 | (F : PressureStream.Lift E → ℝ) : ℝ × E → ℝ := |
| 871 | physicalSigma P e q (PressureStream.torusAverage F) |
| 872 | |
| 873 | theorem physicalBarSigma_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 874 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : PressureStream.Lift E → ℝ} |
| 875 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P (fun p => q p.1) F) : |
| 876 | ContDiff ℝ ∞ (physicalBarSigma P e q F) := |
| 877 | physicalSigma_contDiff P e hq hpos (PressureStream.torusAverage_contDiff hF) |
| 878 | (physical_torusAverage_supported P hs) |
| 879 | |
| 880 | theorem physicalBarSigma_eq_negative_primitive (P : Patch) (e : ℕ) {q : E → ℝ} |
| 881 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : PressureStream.Lift E → ℝ} |
| 882 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P (fun p => q p.1) F) (z : ℝ × E) : |
| 883 | physicalBarSigma P e q F z = -(∫ r in (0 : ℝ)..z.1, |
| 884 | r ^ e * physicalAdjusted P e q (PressureStream.torusAverage F) (r, z.2)) / z.1 ^ e := |
| 885 | physicalSigma_eq_negative_primitive P e hq hpos (PressureStream.torusAverage_contDiff hF) |
| 886 | (physical_torusAverage_supported P hs) z |
| 887 | |
| 888 | /-- Residual units in the q-chart: q^(2A+1/2) times the physical residual. -/ |
| 889 | noncomputable def normalizedResidual (q : E → ℝ) (A : ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 890 | q z.2 ^ (2 * A + 1 / 2) * nativeSource q F z |
| 891 | |
| 892 | noncomputable def qChartTensor (P : Patch) (e : ℕ) (q : E → ℝ) (A : ℝ) |
| 893 | (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 894 | q z.2 ^ (2 * A) * physicalSigma P e q F (lengthScale q z.2 * z.1, z.2) |
| 895 | |
| 896 | noncomputable def qChartBump (P : Patch) (e : ℕ) (q : E → ℝ) (A : ℝ) |
| 897 | (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 898 | q z.2 ^ (2 * A + 1 / 2) * physicalBump P e q F (lengthScale q z.2 * z.1, z.2) |
| 899 | |
| 900 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 901 | theorem qChartBump_eq (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 902 | (A : ℝ) (F : ℝ × E → ℝ) : qChartBump P e q A F = bumpCorrection P e (normalizedResidual q A F) := by |
| 903 | funext z |
| 904 | unfold qChartBump normalizedResidual |
| 905 | rw [bump_slow_mul P e (fun p => q p ^ (2 * A + 1 / 2)) (nativeSource q F)] |
| 906 | simp only [physicalBump, physicalDensity, bumpCorrection, nativeSource_mass e hq, |
| 907 | mul_div_cancel_left₀ _ (lengthScale_pos hq z.2).ne'] |
| 908 | ring |
| 909 | |
| 910 | theorem tensor_units_identity (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 911 | (A : ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : |
| 912 | q z.2 ^ (2 * A) * physicalSigma P e q F z = |
| 913 | sigma P e (normalizedResidual q A F) (z.1 / lengthScale q z.2, z.2) := by |
| 914 | unfold normalizedResidual |
| 915 | rw [sigma_slow_mul P e (fun p => q p ^ (2 * A + 1 / 2)) (nativeSource q F)] |
| 916 | unfold physicalSigma lengthScale |
| 917 | rw [← mul_assoc, Real.sqrt_eq_rpow, ← Real.rpow_add (hq z.2)] |
| 918 | |
| 919 | /-- Exact chart tensor units, with no preferred band in the physical definition. -/ |
| 920 | theorem qChartTensor_eq (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 921 | (A : ℝ) (F : ℝ × E → ℝ) : qChartTensor P e q A F = sigma P e (normalizedResidual q A F) := by |
| 922 | funext z |
| 923 | rw [qChartTensor, tensor_units_identity P e hq A F (lengthScale q z.2 * z.1, z.2)] |
| 924 | simp only [mul_div_cancel_left₀ _ (lengthScale_pos hq z.2).ne'] |
| 925 | |
| 926 | theorem normalizedResidual_contDiff {q : E → ℝ} (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) |
| 927 | (A : ℝ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) : ContDiff ℝ ∞ (normalizedResidual q A F) := by |
| 928 | have hp : ContDiff ℝ ∞ (fun z : ℝ × E => q z.2 ^ (2 * A + 1 / 2)) := by |
| 929 | rw [contDiff_iff_contDiffAt] |
| 930 | intro z |
| 931 | exact (hq.comp contDiff_snd).contDiffAt.rpow_const_of_ne (hpos z.2).ne' |
| 932 | exact hp.mul (nativeSource_contDiff hq hpos hF) |
| 933 | |
| 934 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 935 | theorem normalizedResidual_supported (P : Patch) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 936 | (A : ℝ) {F : ℝ × E → ℝ} (hs : PhysicalSupport P q F) : |
| 937 | RadialAlias.RadiallySupported P.a P.b (normalizedResidual q A F) := |
| 938 | fun _ h => nativeSource_supported P hq hs (right_ne_zero_of_mul h) |
| 939 | |
| 940 | /-- The actual physical stress has the claimed all-jet tensor class after |
| 941 | conversion to q-chart units, directly from the normalized residual class. -/ |
| 942 | theorem meanClass_qChartTensor (P : Patch) (e : ℕ) {cL cR : ℝ} (hcL : 0 < cL) (hcR : 0 < cR) |
| 943 | (ε slow : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) |
| 944 | {q : E → ℝ} (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) (A α : ℝ) |
| 945 | (F : ℕ → ℝ × E → ℝ) (hF : ∀ n, ContDiff ℝ ∞ (F n)) |
| 946 | (hs : ∀ n, PhysicalSupport P q (F n)) |
| 947 | (hclass : WeightedClasses.MeanClass |
| 948 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 949 | α (fun n => normalizedResidual q A (F n))) : |
| 950 | WeightedClasses.MeanClass |
| 951 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 952 | α (fun n => qChartTensor P e q A (F n)) := by |
| 953 | simp_rw [qChartTensor_eq P e hpos A] |
| 954 | exact meanClass_sigma P e hcL hcR ε slow hε hε1 hslow α _ |
| 955 | (fun n => normalizedResidual_contDiff hq hpos A (hF n)) |
| 956 | (fun n => normalizedResidual_supported P hpos A (hs n)) hclass |
| 957 | |
| 958 | /-- A fixed-Q chart is an exact reparametrization of the physical-q stress; |
| 959 | the physical stress itself was defined without Q. -/ |
| 960 | theorem fixedQ_tensor_identity (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 961 | {Q : ℝ} (hQ : 0 < Q) (A : ℝ) (F : ℝ × E → ℝ) (R : ℝ) (p : E) : |
| 962 | Q ^ (2 * A) * physicalSigma P e q F (Real.sqrt Q * R, p) = |
| 963 | (Q / q p) ^ (2 * A) * sigma P e (normalizedResidual q A F) |
| 964 | ((Real.sqrt Q / Real.sqrt (q p)) * R, p) := by |
| 965 | have hcoord : (Real.sqrt Q / Real.sqrt (q p)) * R = (Real.sqrt Q * R) / lengthScale q p := by |
| 966 | unfold lengthScale |
| 967 | ring |
| 968 | rw [hcoord, ← tensor_units_identity P e hq A F (Real.sqrt Q * R, p), |
| 969 | Real.div_rpow hQ.le (hq p).le] |
| 970 | field_simp [(Real.rpow_pos_of_pos (hq p) (2 * A)).ne'] |
| 971 | |
| 972 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 973 | theorem fixedQ_density_identity (P : Patch) (e : ℕ) (q : E → ℝ) |
| 974 | (Q R : ℝ) (p : E) : |
| 975 | Real.sqrt Q ^ (e + 1) * physicalDensity P e q (Real.sqrt Q * R, p) = |
| 976 | (Real.sqrt Q / Real.sqrt (q p)) ^ (e + 1) * |
| 977 | momentDensity P e ((Real.sqrt Q / Real.sqrt (q p)) * R) := by |
| 978 | unfold physicalDensity lengthScale |
| 979 | rw [div_pow] |
| 980 | have hc : (Real.sqrt Q * R) / Real.sqrt (q p) = (Real.sqrt Q / Real.sqrt (q p)) * R := by ring |
| 981 | rw [hc] |
| 982 | ring |
| 983 | |
| 984 | end Physical |
| 985 | |
| 986 | section IntegratedBalances |
| 987 | |
| 988 | open IntegratedMeanBalances |
| 989 | |
| 990 | /-- The removed angular moment is the actual defect derivative in (34). -/ |
| 991 | theorem angular_bump_identity (P : Patch) (ε : ℝ) |
| 992 | {v radialFlux axialFlux virtualFlux : MeanField} |
| 993 | (hv : SmoothShell P.a P.b v) (hr : SmoothShell P.a P.b radialFlux) |
| 994 | (hz : SmoothShell P.a P.b axialFlux) (hT : SmoothShell P.a P.b virtualFlux) |
| 995 | (hmass : radialMoment 2 v = 0) (z : MeanPoint) : |
| 996 | bumpCorrection P 2 (angularBalance ε v radialFlux axialFlux virtualFlux) z = |
| 997 | momentDensity P 2 z.1 * (ε * fderiv ℝ (radialMoment 2 axialFlux) z.2 (0, 1)) := by |
| 998 | unfold bumpCorrection mass |
| 999 | rw [integrated_angular_balance ε hv hr hz hT hmass] |
| 1000 | |
| 1001 | noncomputable def axialMomentPotential (axialFlux gr ρ : MeanField) (p : MeanParameter) : ℝ := |
| 1002 | axialDefect axialFlux gr p + pressureCoefficient ρ p * pressureTotal gr p |
| 1003 | |
| 1004 | theorem axialMomentPotential_contDiff (P : Patch) {axialFlux gr ρ : MeanField} |
| 1005 | (hz : SmoothShell P.a P.b axialFlux) (hg : SmoothShell P.a P.b gr) |
| 1006 | (hρ : SmoothShell P.a P.b ρ) : ContDiff ℝ ∞ (axialMomentPotential axialFlux gr ρ) := by |
| 1007 | have h1 := radialMoment_smooth hz.smooth hz.supported 1 |
| 1008 | have h2 := radialMoment_smooth hg.smooth hg.supported 2 |
| 1009 | have h3 := radialMoment_smooth hρ.smooth hρ.supported 2 |
| 1010 | have h4 := radialMoment_smooth hg.smooth hg.supported 0 |
| 1011 | exact (h1.sub (contDiff_const.mul h2)).add ((h3.div_const 2).mul h4) |
| 1012 | |
| 1013 | /-- The pressure coefficient remains inside the actual slow derivative. -/ |
| 1014 | theorem axial_bump_identity (P : Patch) (ε : ℝ) |
| 1015 | {γ radialFlux axialFlux pressure virtualFlux gr ρ : MeanField} |
| 1016 | (hγ : SmoothShell P.a P.b γ) (hr : SmoothShell P.a P.b radialFlux) |
| 1017 | (hz : SmoothShell P.a P.b axialFlux) (hp : SmoothShell P.a P.b pressure) |
| 1018 | (hT : SmoothShell P.a P.b virtualFlux) (hg : SmoothShell P.a P.b gr) |
| 1019 | (hρ : SmoothShell P.a P.b ρ) (hmass : radialMoment 1 γ = 0) |
| 1020 | (hderiv : ∀ r p, deriv (fun s => pressure (s, p)) r = |
| 1021 | gr (r, p) - ρ (r, p) * pressureTotal gr p) (z : MeanPoint) : |
| 1022 | bumpCorrection P 1 (axialBalance ε γ radialFlux axialFlux pressure virtualFlux) z = |
| 1023 | momentDensity P 1 z.1 * (ε * fderiv ℝ (axialMomentPotential axialFlux gr ρ) z.2 (0, 1)) := by |
| 1024 | unfold bumpCorrection mass |
| 1025 | rw [integrated_axial_reconstructed ε hγ hr hz hp hT hg hρ hmass hderiv] |
| 1026 | rfl |
| 1027 | |
| 1028 | /-- The axial bump identity with pressure supplied by the actual torus-averaged |
| 1029 | compact pressure constructor, so no pressure moment or derivative is assumed. -/ |
| 1030 | theorem axial_bump_constructed_pressure_identity (P : Patch) {d M : ℝ} |
| 1031 | (hd : 0 < d) (ε : ℝ) (v : ℝ × ℝ) |
| 1032 | {f : PressureStream.Lift MeanParameter → ℝ} (hf : ContDiff ℝ ∞ f) |
| 1033 | (hs : RadialAlias.RadiallySupported P.a P.b f) (hper : PressureStream.TorusPeriodicLift f) |
| 1034 | {γ radialFlux axialFlux virtualFlux : MeanField} |
| 1035 | (hγ : SmoothShell P.a P.b γ) (hr : SmoothShell P.a P.b radialFlux) |
| 1036 | (hz : SmoothShell P.a P.b axialFlux) (hT : SmoothShell P.a P.b virtualFlux) |
| 1037 | (hmass : radialMoment 1 γ = 0) (z : MeanPoint) : |
| 1038 | bumpCorrection P 1 (axialBalance ε γ radialFlux axialFlux |
| 1039 | (reconstructedMeanPressure d P.a P.b M P.a_lt_b v f) virtualFlux) z = |
| 1040 | momentDensity P 1 z.1 * (ε * fderiv ℝ (axialMomentPotential axialFlux |
| 1041 | (averagedRadialSource f) (normalizedMeanDensity P.a P.b P.a_lt_b)) z.2 (0, 1)) := |
| 1042 | axial_bump_identity P ε hγ hr hz |
| 1043 | (reconstructedMeanPressure_shell P.a_pos P.a_lt_b hd v hf hs) hT |
| 1044 | (averagedRadialSource_shell hf hs) (normalizedMeanDensity_shell P.a P.b P.a_lt_b) |
| 1045 | hmass (constructed_pressure_deriv P.a_pos P.a_lt_b hd v hf hs hper) z |
| 1046 | |
| 1047 | theorem angular_bump_improvedClass (P : Patch) {cL cR : ℝ} (hcL : 0 < cL) (hcR : 0 < cR) |
| 1048 | (ε slow : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) |
| 1049 | (α : ℝ) (v radialFlux axialFlux virtualFlux : ℕ → MeanField) |
| 1050 | (hv : ∀ n, SmoothShell P.a P.b (v n)) (hr : ∀ n, SmoothShell P.a P.b (radialFlux n)) |
| 1051 | (hz : ∀ n, SmoothShell P.a P.b (axialFlux n)) (hT : ∀ n, SmoothShell P.a P.b (virtualFlux n)) |
| 1052 | (hmass : ∀ n, radialMoment 2 (v n) = 0) |
| 1053 | (hclass : WeightedClasses.UnweightedClass |
| 1054 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 1055 | α (fun n (z : MeanPoint) => radialMoment 2 (axialFlux n) z.2)) : |
| 1056 | WeightedClasses.MeanClass |
| 1057 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 1058 | (α + 1) (fun n => bumpCorrection P 2 |
| 1059 | (angularBalance (ε n) (v n) (radialFlux n) (axialFlux n) (virtualFlux n))) := by |
| 1060 | apply bump_improvedClass_of_moment_identity P 2 hcL hcR ε slow hε hε1 hslow α |
| 1061 | (fun n => angularBalance (ε n) (v n) (radialFlux n) (axialFlux n) (virtualFlux n)) |
| 1062 | (fun n => radialMoment 2 (axialFlux n)) (0, 1) |
| 1063 | (fun n => radialMoment_smooth (hz n).smooth (hz n).supported 2) hclass |
| 1064 | exact fun n p => integrated_angular_balance (ε n) (hv n) (hr n) (hz n) (hT n) (hmass n) p |
| 1065 | |
| 1066 | theorem axial_bump_improvedClass (P : Patch) {cL cR : ℝ} (hcL : 0 < cL) (hcR : 0 < cR) |
| 1067 | (ε slow : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) |
| 1068 | (α : ℝ) (γ radialFlux axialFlux pressure virtualFlux gr ρ : ℕ → MeanField) |
| 1069 | (hγ : ∀ n, SmoothShell P.a P.b (γ n)) (hr : ∀ n, SmoothShell P.a P.b (radialFlux n)) |
| 1070 | (hz : ∀ n, SmoothShell P.a P.b (axialFlux n)) (hp : ∀ n, SmoothShell P.a P.b (pressure n)) |
| 1071 | (hT : ∀ n, SmoothShell P.a P.b (virtualFlux n)) (hg : ∀ n, SmoothShell P.a P.b (gr n)) |
| 1072 | (hρ : ∀ n, SmoothShell P.a P.b (ρ n)) (hmass : ∀ n, radialMoment 1 (γ n) = 0) |
| 1073 | (hderiv : ∀ n r p, deriv (fun s => pressure n (s, p)) r = |
| 1074 | gr n (r, p) - ρ n (r, p) * pressureTotal (gr n) p) |
| 1075 | (hclass : WeightedClasses.UnweightedClass |
| 1076 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 1077 | α (fun n (z : MeanPoint) => axialMomentPotential (axialFlux n) (gr n) (ρ n) z.2)) : |
| 1078 | WeightedClasses.MeanClass |
| 1079 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 1080 | (α + 1) (fun n => bumpCorrection P 1 |
| 1081 | (axialBalance (ε n) (γ n) (radialFlux n) (axialFlux n) (pressure n) (virtualFlux n))) := by |
| 1082 | apply bump_improvedClass_of_moment_identity P 1 hcL hcR ε slow hε hε1 hslow α |
| 1083 | (fun n => axialBalance (ε n) (γ n) (radialFlux n) (axialFlux n) (pressure n) (virtualFlux n)) |
| 1084 | (fun n => axialMomentPotential (axialFlux n) (gr n) (ρ n)) (0, 1) |
| 1085 | (fun n => axialMomentPotential_contDiff P (hz n) (hg n) (hρ n)) hclass |
| 1086 | exact fun n p => integrated_axial_reconstructed (ε n) (hγ n) (hr n) (hz n) (hp n) |
| 1087 | (hT n) (hg n) (hρ n) (hmass n) (hderiv n) p |
| 1088 | |
| 1089 | end IntegratedBalances |
| 1090 | |
| 1091 | section ChartComparison |
| 1092 | |
| 1093 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 1094 | |
| 1095 | theorem compact_jet_bounds {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 1096 | [NormedAddCommGroup Y] [NormedSpace ℝ Y] {K : Set X} (hK : IsCompact K) |
| 1097 | {f : X → Y} (hf : ContDiff ℝ ∞ f) (m : ℕ) : |
| 1098 | ∃ C : ℝ, 1 ≤ C ∧ ∀ j ≤ m, ∀ x ∈ K, ‖iteratedFDeriv ℝ j f x‖ ≤ C := by |
| 1099 | have hb : ∀ j : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ K, ‖iteratedFDeriv ℝ j f x‖ ≤ C := by |
| 1100 | intro j |
| 1101 | obtain ⟨C, hC⟩ := hK.exists_bound_of_continuousOn |
| 1102 | (hf.continuous_iteratedFDeriv (nat_le_smooth j)).continuousOn |
| 1103 | exact ⟨max C 0, le_max_right _ _, fun x hx => (hC x hx).trans (le_max_left _ _)⟩ |
| 1104 | choose C hC hbound using hb |
| 1105 | refine ⟨1 + ∑ j ∈ Finset.range (m + 1), C j, ?_, ?_⟩ |
| 1106 | · have h := Finset.sum_nonneg (s := Finset.range (m + 1)) (fun j _ => hC j) |
| 1107 | linarith |
| 1108 | · intro j hj x hx |
| 1109 | have h := Finset.single_le_sum (fun j _ => hC j) (Finset.mem_range.mpr (Nat.lt_succ_of_le hj)) |
| 1110 | exact (hbound j x hx).trans (by linarith) |
| 1111 | |
| 1112 | /-- Smooth coordinate changes and multipliers have actual finite-jet operator |
| 1113 | bounds on compact sets; the bound is uniform over every input function. -/ |
| 1114 | theorem compact_change_jet_bound {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 1115 | {K : Set X} (hK : IsCompact K) {a : X → ℝ} (ha : ContDiff ℝ ∞ a) |
| 1116 | {φ : X → X} (hφ : ContDiff ℝ ∞ φ) (m : ℕ) : |
| 1117 | ∃ C : ℝ, 0 < C ∧ ∀ f : X → ℝ, ContDiff ℝ ∞ f → ∀ x ∈ K, ∀ B : ℝ, 0 ≤ B → |
| 1118 | (∀ i ≤ m, ‖iteratedFDeriv ℝ i f (φ x)‖ ≤ B) → ∀ j ≤ m, |
| 1119 | ‖iteratedFDeriv ℝ j (fun y => a y * f (φ y)) x‖ ≤ C * B := by |
| 1120 | obtain ⟨A, hA, haB⟩ := compact_jet_bounds hK ha m |
| 1121 | obtain ⟨L, hL, hφB⟩ := compact_jet_bounds hK hφ m |
| 1122 | let D : ℝ := (m.factorial : ℝ) * L ^ m |
| 1123 | have hD : 0 < D := mul_pos (Nat.cast_pos.mpr (Nat.factorial_pos m)) (pow_pos (zero_lt_one.trans_le hL) m) |
| 1124 | refine ⟨(2 : ℝ) ^ m * A * D, by positivity, ?_⟩ |
| 1125 | intro f hf x hx B hB hfb j hj |
| 1126 | have hcomp : ∀ i ≤ m, ‖iteratedFDeriv ℝ i (f ∘ φ) x‖ ≤ D * B := by |
| 1127 | intro i hi |
| 1128 | have h := norm_iteratedFDeriv_comp_le hf hφ (nat_le_smooth i) x |
| 1129 | (fun k hk => hfb k (hk.trans hi)) (D := L) |
| 1130 | (fun k hk hki => (hφB k (hki.trans hi) x hx).trans |
| 1131 | (by simpa only [pow_one] using pow_le_pow_right₀ hL hk)) |
| 1132 | apply h.trans |
| 1133 | have hfac : (i.factorial : ℝ) ≤ m.factorial := by exact_mod_cast Nat.factorial_le hi |
| 1134 | calc |
| 1135 | _ ≤ (m.factorial : ℝ) * B * L ^ m := by |
| 1136 | exact mul_le_mul (mul_le_mul_of_nonneg_right hfac hB) (pow_le_pow_right₀ hL hi) |
| 1137 | (pow_nonneg (zero_le_one.trans hL) _) (mul_nonneg (Nat.cast_nonneg _) hB) |
| 1138 | _ = D * B := by dsimp [D]; ring |
| 1139 | have h := ParametricKernelBounds.norm_iteratedFDeriv_mul_le_of_bounds ha (hf.comp hφ) j x |
| 1140 | (zero_le_one.trans hA) (mul_nonneg hD.le hB) |
| 1141 | (fun i hi => haB i (hi.trans hj) x hx) (fun i hi => hcomp i (hi.trans hj)) |
| 1142 | have hsum : (∑ i ∈ Finset.range (j + 1), (j.choose i : ℝ)) = (2 : ℝ) ^ j := by |
| 1143 | exact_mod_cast Nat.sum_range_choose j |
| 1144 | rw [hsum] at h |
| 1145 | apply h.trans |
| 1146 | calc |
| 1147 | _ ≤ (2 : ℝ) ^ m * A * (D * B) := |
| 1148 | mul_le_mul_of_nonneg_right |
| 1149 | (mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num) hj) (zero_le_one.trans hA)) |
| 1150 | (mul_nonneg hD.le hB) |
| 1151 | _ = _ := by ring |
| 1152 | |
| 1153 | noncomputable def changeChart (ρ : E → ℝ) (A : ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 1154 | ρ z.2 ^ (-2 * A) * F (z.1 / Real.sqrt (ρ z.2), z.2) |
| 1155 | noncomputable def inverseChangeChart (ρ : E → ℝ) (A : ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 1156 | ρ z.2 ^ (2 * A) * F (Real.sqrt (ρ z.2) * z.1, z.2) |
| 1157 | |
| 1158 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 1159 | theorem changeChart_inverse {ρ : E → ℝ} (hρ : ∀ p, 0 < ρ p) (A : ℝ) (F : ℝ × E → ℝ) : |
| 1160 | changeChart ρ A (inverseChangeChart ρ A F) = F ∧ |
| 1161 | inverseChangeChart ρ A (changeChart ρ A F) = F := by |
| 1162 | constructor |
| 1163 | · funext z |
| 1164 | simp only [changeChart, inverseChangeChart, |
| 1165 | mul_div_cancel₀ z.1 (Real.sqrt_pos.mpr (hρ z.2)).ne'] |
| 1166 | rw [← mul_assoc, ← Real.rpow_add (hρ z.2)] |
| 1167 | simp [] |
| 1168 | · funext z |
| 1169 | simp only [changeChart, inverseChangeChart, |
| 1170 | mul_div_cancel_left₀ z.1 (Real.sqrt_pos.mpr (hρ z.2)).ne'] |
| 1171 | rw [← mul_assoc, ← Real.rpow_add (hρ z.2)] |
| 1172 | simp [] |
| 1173 | |
| 1174 | /-- Both directions of the q/Q chart comparison have uniform finite-jet |
| 1175 | operator bounds. The positive ratio and all its derivatives are bounded by |
| 1176 | compactness, rather than postulated bounds on the transformed stress. -/ |
| 1177 | theorem chart_change_finiteJets {ρ : E → ℝ} (hρ : ContDiff ℝ ∞ ρ) (hpos : ∀ p, 0 < ρ p) |
| 1178 | (A : ℝ) {K : Set (ℝ × E)} (hK : IsCompact K) (m : ℕ) : |
| 1179 | ∃ C : ℝ, 0 < C ∧ ∀ F : ℝ × E → ℝ, ContDiff ℝ ∞ F → ∀ z ∈ K, ∀ B : ℝ, 0 ≤ B → |
| 1180 | ((∀ i ≤ m, ‖iteratedFDeriv ℝ i F (z.1 / Real.sqrt (ρ z.2), z.2)‖ ≤ B) → |
| 1181 | ∀ j ≤ m, ‖iteratedFDeriv ℝ j (changeChart ρ A F) z‖ ≤ C * B) ∧ |
| 1182 | ((∀ i ≤ m, ‖iteratedFDeriv ℝ i F (Real.sqrt (ρ z.2) * z.1, z.2)‖ ≤ B) → |
| 1183 | ∀ j ≤ m, ‖iteratedFDeriv ℝ j (inverseChangeChart ρ A F) z‖ ≤ C * B) := by |
| 1184 | have hs : ContDiff ℝ ∞ (fun z : ℝ × E => Real.sqrt (ρ z.2)) := |
| 1185 | (hρ.comp contDiff_snd).sqrt (fun z => (hpos z.2).ne') |
| 1186 | have ha : ContDiff ℝ ∞ (fun z : ℝ × E => ρ z.2 ^ (-2 * A)) := |
| 1187 | (hρ.comp contDiff_snd).rpow_const_of_ne (fun z => (hpos z.2).ne') |
| 1188 | have hb : ContDiff ℝ ∞ (fun z : ℝ × E => ρ z.2 ^ (2 * A)) := |
| 1189 | (hρ.comp contDiff_snd).rpow_const_of_ne (fun z => (hpos z.2).ne') |
| 1190 | have hφ : ContDiff ℝ ∞ (fun z : ℝ × E => (z.1 / Real.sqrt (ρ z.2), z.2)) := |
| 1191 | (contDiff_fst.div hs (fun z => (Real.sqrt_pos.mpr (hpos z.2)).ne')).prodMk contDiff_snd |
| 1192 | have hψ : ContDiff ℝ ∞ (fun z : ℝ × E => (Real.sqrt (ρ z.2) * z.1, z.2)) := |
| 1193 | (hs.mul contDiff_fst).prodMk contDiff_snd |
| 1194 | obtain ⟨C1, hC1, h1⟩ := compact_change_jet_bound hK ha hφ m |
| 1195 | obtain ⟨C2, hC2, h2⟩ := compact_change_jet_bound hK hb hψ m |
| 1196 | refine ⟨C1 + C2, add_pos hC1 hC2, ?_⟩ |
| 1197 | intro F hF z hz B hB |
| 1198 | constructor |
| 1199 | · intro hfb j hj |
| 1200 | exact (h1 F hF z hz B hB hfb j hj).trans (mul_le_mul_of_nonneg_right (by linarith) hB) |
| 1201 | · intro hfb j hj |
| 1202 | exact (h2 F hF z hz B hB hfb j hj).trans (mul_le_mul_of_nonneg_right (by linarith) hB) |
| 1203 | |
| 1204 | theorem fixedQ_tensor_common_ratio (P : Patch) (e : ℕ) {ρ : E → ℝ} (hρ : ∀ p, 0 < ρ p) |
| 1205 | {Q : ℝ} (hQ : 0 < Q) (A : ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : |
| 1206 | Q ^ (2 * A) * physicalSigma P e (fun p => Q * ρ p) F (Real.sqrt Q * z.1, z.2) = |
| 1207 | changeChart ρ A (sigma P e (normalizedResidual (fun p => Q * ρ p) A F)) z := by |
| 1208 | rw [fixedQ_tensor_identity P e (fun p => mul_pos hQ (hρ p)) hQ A F z.1 z.2] |
| 1209 | have hr : Q / (Q * ρ z.2) = (ρ z.2)⁻¹ := by field_simp [hQ.ne', (hρ z.2).ne'] |
| 1210 | have hs : Real.sqrt Q / Real.sqrt (Q * ρ z.2) = (Real.sqrt (ρ z.2))⁻¹ := by |
| 1211 | rw [Real.sqrt_mul hQ.le] |
| 1212 | field_simp [(Real.sqrt_pos.mpr hQ).ne', (Real.sqrt_pos.mpr (hρ z.2)).ne'] |
| 1213 | rw [hr, hs, Real.inv_rpow (hρ z.2).le, ← Real.rpow_neg (hρ z.2).le] |
| 1214 | unfold changeChart |
| 1215 | congr 2 |
| 1216 | · ring |
| 1217 | · ring_nf |
| 1218 | |
| 1219 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 1220 | theorem fixedQ_density_common_ratio (P : Patch) (e : ℕ) {ρ : E → ℝ} |
| 1221 | (hρ : ∀ p, 0 < ρ p) {Q : ℝ} (hQ : 0 < Q) (z : ℝ × E) : |
| 1222 | Real.sqrt Q ^ (e + 1) * |
| 1223 | physicalDensity P e (fun p => Q * ρ p) (Real.sqrt Q * z.1, z.2) = |
| 1224 | physicalDensity P e ρ z := by |
| 1225 | rw [fixedQ_density_identity] |
| 1226 | have hs : Real.sqrt Q / Real.sqrt (Q * ρ z.2) = (Real.sqrt (ρ z.2))⁻¹ := by |
| 1227 | rw [Real.sqrt_mul hQ.le] |
| 1228 | field_simp [(Real.sqrt_pos.mpr hQ).ne', (Real.sqrt_pos.mpr (hρ z.2)).ne'] |
| 1229 | rw [hs, inv_pow] |
| 1230 | simp only [physicalDensity, lengthScale, div_eq_mul_inv, mul_comm] |
| 1231 | |
| 1232 | /-- For a fixed smooth positive ratio q/Q, every derivative of the |
| 1233 | length-normalized physical bump is bounded independently of the band Q. -/ |
| 1234 | theorem fixedQ_density_finiteJets (P : Patch) (e : ℕ) {ρ : E → ℝ} |
| 1235 | (hρ : ContDiff ℝ ∞ ρ) (hpos : ∀ p, 0 < ρ p) |
| 1236 | {K : Set (ℝ × E)} (hK : IsCompact K) (m : ℕ) : |
| 1237 | ∃ C : ℝ, 0 < C ∧ ∀ Q : ℝ, 0 < Q → ∀ i ≤ m, ∀ z ∈ K, |
| 1238 | ‖iteratedFDeriv ℝ i (fun y : ℝ × E => Real.sqrt Q ^ (e + 1) * |
| 1239 | physicalDensity P e (fun p => Q * ρ p) (Real.sqrt Q * y.1, y.2)) z‖ ≤ C := by |
| 1240 | obtain ⟨C, hC, hb⟩ := compact_jet_bounds hK (physicalDensity_contDiff P e hρ hpos) m |
| 1241 | refine ⟨C, zero_lt_one.trans_le hC, ?_⟩ |
| 1242 | intro Q hQ i hi z hz |
| 1243 | have he : (fun y : ℝ × E => Real.sqrt Q ^ (e + 1) * |
| 1244 | physicalDensity P e (fun p => Q * ρ p) (Real.sqrt Q * y.1, y.2)) = |
| 1245 | physicalDensity P e ρ := by |
| 1246 | funext y |
| 1247 | exact fixedQ_density_common_ratio P e hpos hQ y |
| 1248 | rw [he] |
| 1249 | exact hb i hi z hz |
| 1250 | |
| 1251 | end ChartComparison |
| 1252 | |
| 1253 | end NavierStokes.SignedStressPrimitive |