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 | noncomputable def densityLift (P : Patch) (z : ℝ × ℝ) : ℝ := density P z.1 |
| 50 | |
| 51 | theorem densityLift_contDiff (P : Patch) : ContDiff ℝ ∞ (densityLift P) := |
| 52 | (density_contDiff P).comp contDiff_fst |
| 53 | |
| 54 | theorem densityLift_supported (P : Patch) : |
| 55 | RadialAlias.RadiallySupported P.left P.right (densityLift P) := |
| 56 | fun _ h => density_support P h |
| 57 | |
| 58 | noncomputable def cutoff (P : Patch) (r : ℝ) : ℝ := |
| 59 | TransportPrimitive.pastIntegral 0 (0 : ℝ) (densityLift P) (r, 0) |
| 60 | |
| 61 | theorem cutoff_contDiff (P : Patch) : ContDiff ℝ ∞ (cutoff P) := |
| 62 | (TransportPrimitive.pastIntegral_contDiff (densityLift_contDiff P) (densityLift_supported P)).comp |
| 63 | (contDiff_id.prodMk contDiff_const) |
| 64 | |
| 65 | theorem cutoff_total (P : Patch) (r : ℝ) : |
| 66 | TransportPrimitive.totalIntegral 0 (0 : ℝ) (densityLift P) (r, 0) = 1 := by |
| 67 | rw [TransportPrimitive.totalIntegral_eq_radialInterval |
| 68 | (densityLift_contDiff P).continuous (densityLift_supported P)] |
| 69 | simp only [densityLift] |
| 70 | have h := IntegratedMeanBalances.radialMoment_eq_interval |
| 71 | (densityLift_contDiff P).continuous (densityLift_supported P) 0 0 |
| 72 | simp only [IntegratedMeanBalances.radialMoment, IntegratedMeanBalances.moment, |
| 73 | densityLift, pow_zero, one_mul, density_integral] at h |
| 74 | exact h.symm |
| 75 | |
| 76 | theorem cutoff_zero (P : Patch) {r : ℝ} (hr : r ≤ P.left) : cutoff P r = 0 := |
| 77 | TransportPrimitive.pastIntegral_eq_zero_of_le |
| 78 | (densityLift_contDiff P).continuous (densityLift_supported P) (r, 0) hr |
| 79 | |
| 80 | theorem cutoff_one (P : Patch) {r : ℝ} (hr : P.right ≤ r) : cutoff P r = 1 := by |
| 81 | change TransportPrimitive.pastIntegral 0 (0 : ℝ) (densityLift P) (r, 0) = 1 |
| 82 | rw [TransportPrimitive.pastIntegral_eq_total_of_ge (densityLift_supported P) (r, 0) hr, |
| 83 | cutoff_total] |
| 84 | |
| 85 | theorem cutoff_hasDerivAt (P : Patch) (r : ℝ) : HasDerivAt (cutoff P) (density P r) r := by |
| 86 | have hs := TransportPrimitive.pastIntegral_contDiff (M := 0) (v := (0 : ℝ)) |
| 87 | (densityLift_contDiff P) (densityLift_supported P) |
| 88 | have hd := ((hs.differentiable (by simp)) (r, 0)).hasFDerivAt.comp_hasDerivAt r |
| 89 | ((hasDerivAt_id r).prodMk (hasDerivAt_const r (0 : ℝ))) |
| 90 | have ht := TransportPrimitive.transport_pastIntegral (M := 0) (v := (0 : ℝ)) |
| 91 | (densityLift_contDiff P) (densityLift_supported P) (r, 0) |
| 92 | simp only [TransportPrimitive.fixedDeriv, zero_smul, densityLift] at ht |
| 93 | unfold cutoff |
| 94 | simpa only [ht, Function.comp_def, id_eq] using hd |
| 95 | |
| 96 | theorem cutoff_deriv (P : Patch) (r : ℝ) : deriv (cutoff P) r = density P r := |
| 97 | (cutoff_hasDerivAt P r).deriv |
| 98 | |
| 99 | noncomputable def inversePower (P : Patch) (e : ℕ) (r : ℝ) : ℝ := |
| 100 | ((RadialPullback.positiveRadius (P.a / 4) r) ^ e)⁻¹ |
| 101 | |
| 102 | theorem inversePower_contDiff (P : Patch) (e : ℕ) : ContDiff ℝ ∞ (inversePower P e) := |
| 103 | ((RadialPullback.positiveRadius_contDiff _).pow e).inv |
| 104 | (fun r => pow_ne_zero _ (RadialPullback.positiveRadius_pos (by linarith [P.a_pos]) r).ne') |
| 105 | |
| 106 | theorem inversePower_eq (P : Patch) (e : ℕ) {r : ℝ} (hr : P.a ≤ r) : |
| 107 | inversePower P e r = (r ^ e)⁻¹ := by |
| 108 | unfold inversePower |
| 109 | rw [RadialPullback.positiveRadius_eq_self (by linarith [P.a_pos]) (by linarith [P.a_pos])] |
| 110 | |
| 111 | noncomputable def momentDensity (P : Patch) (e : ℕ) (r : ℝ) : ℝ := inversePower P e r * density P r |
| 112 | |
| 113 | theorem momentDensity_contDiff (P : Patch) (e : ℕ) : ContDiff ℝ ∞ (momentDensity P e) := |
| 114 | (inversePower_contDiff P e).mul (density_contDiff P) |
| 115 | |
| 116 | theorem momentDensity_support (P : Patch) (e : ℕ) : support (momentDensity P e) ⊆ Icc P.left P.right := |
| 117 | fun _ h => density_support P (right_ne_zero_of_mul h) |
| 118 | |
| 119 | theorem weighted_momentDensity (P : Patch) (e : ℕ) (r : ℝ) : |
| 120 | r ^ e * momentDensity P e r = density P r := by |
| 121 | by_cases h : density P r = 0 |
| 122 | · simp [momentDensity, h] |
| 123 | have hr := density_support P h |
| 124 | have hr0 : 0 < r := P.left_pos.trans_le hr.1 |
| 125 | rw [momentDensity, inversePower_eq P e (P.a_lt_left.le.trans hr.1)] |
| 126 | field_simp [hr0.ne'] |
| 127 | |
| 128 | theorem momentDensity_moment (P : Patch) (e : ℕ) : (∫ r, r ^ e * momentDensity P e r) = 1 := by |
| 129 | simp_rw [weighted_momentDensity] |
| 130 | exact density_integral P |
| 131 | |
| 132 | section Primitive |
| 133 | |
| 134 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 135 | |
| 136 | noncomputable def weightedSource (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := z.1 ^ e * F z |
| 137 | noncomputable def mass (e : ℕ) (F : ℝ × E → ℝ) : E → ℝ := IntegratedMeanBalances.radialMoment e F |
| 138 | noncomputable def bumpCorrection (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 139 | momentDensity P e z.1 * mass e F z.2 |
| 140 | noncomputable def adjusted (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 141 | F z - bumpCorrection P e F z |
| 142 | noncomputable def primitive (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) : ℝ × E → ℝ := |
| 143 | TransportPrimitive.compactIntegral (cutoff P) 0 0 (weightedSource e F) |
| 144 | noncomputable def sigma (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 145 | -inversePower P e z.1 * primitive P e F z |
| 146 | |
| 147 | theorem weightedSource_contDiff (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) : |
| 148 | ContDiff ℝ ∞ (weightedSource e F) := (contDiff_fst.pow e).mul hF |
| 149 | |
| 150 | omit [NormedSpace ℝ E] in |
| 151 | theorem weightedSource_continuous (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) : |
| 152 | Continuous (weightedSource e F) := (continuous_fst.pow e).mul hF |
| 153 | |
| 154 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 155 | theorem weightedSource_supported (e : ℕ) {P : Patch} {F : ℝ × E → ℝ} |
| 156 | (hF : RadialAlias.RadiallySupported P.a P.b F) : |
| 157 | RadialAlias.RadiallySupported P.a P.b (weightedSource e F) := |
| 158 | fun _ h => hF (right_ne_zero_of_mul h) |
| 159 | |
| 160 | theorem mass_contDiff {P : Patch} (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 161 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (mass e F) := |
| 162 | IntegratedMeanBalances.radialMoment_smooth hF hs e |
| 163 | |
| 164 | theorem bumpCorrection_contDiff (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 165 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (bumpCorrection P e F) := |
| 166 | ((momentDensity_contDiff P e).comp contDiff_fst).mul ((mass_contDiff e hF hs).comp contDiff_snd) |
| 167 | |
| 168 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 169 | theorem bumpCorrection_supported (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) : |
| 170 | RadialAlias.RadiallySupported P.left P.right (bumpCorrection P e F) := |
| 171 | fun _ h => momentDensity_support P e (left_ne_zero_of_mul h) |
| 172 | |
| 173 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 174 | theorem bumpCorrection_moment (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (p : E) : |
| 175 | mass e (bumpCorrection P e F) p = mass e F p := by |
| 176 | change (∫ r, r ^ e * (momentDensity P e r * mass e F p)) = _ |
| 177 | simp_rw [← mul_assoc] |
| 178 | rw [integral_mul_const, momentDensity_moment, one_mul] |
| 179 | |
| 180 | theorem primitive_contDiff (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 181 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (primitive P e F) := |
| 182 | TransportPrimitive.compactIntegral_contDiff (cutoff_contDiff P) |
| 183 | (weightedSource_contDiff e hF) (weightedSource_supported e hs) |
| 184 | |
| 185 | theorem primitive_supported (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 186 | (hs : RadialAlias.RadiallySupported P.a P.b F) : |
| 187 | RadialAlias.RadiallySupported P.a P.b (primitive P e F) := |
| 188 | TransportPrimitive.compactIntegral_supported ((continuous_fst.pow e).mul hF) |
| 189 | (weightedSource_supported e hs) |
| 190 | (fun _ hr => cutoff_zero P (hr.trans P.a_lt_left.le)) |
| 191 | (fun _ hr => cutoff_one P (P.right_lt_b.le.trans hr)) |
| 192 | |
| 193 | theorem sigma_contDiff (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 194 | (hs : RadialAlias.RadiallySupported P.a P.b F) : ContDiff ℝ ∞ (sigma P e F) := |
| 195 | (((inversePower_contDiff P e).comp contDiff_fst).neg).mul (primitive_contDiff P e hF hs) |
| 196 | |
| 197 | theorem sigma_supported (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 198 | (hs : RadialAlias.RadiallySupported P.a P.b F) : |
| 199 | RadialAlias.RadiallySupported P.a P.b (sigma P e F) := |
| 200 | fun _ h => primitive_supported P e hF hs (right_ne_zero_of_mul h) |
| 201 | |
| 202 | theorem total_weightedSource (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 203 | (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 204 | TransportPrimitive.totalIntegral 0 (0 : E) (weightedSource e F) z = mass e F z.2 := by |
| 205 | rw [TransportPrimitive.totalIntegral_eq_radialInterval |
| 206 | (weightedSource_continuous e hF) (weightedSource_supported e hs)] |
| 207 | simp only [zero_mul, zero_smul, add_zero, weightedSource] |
| 208 | exact (IntegratedMeanBalances.radialMoment_eq_interval hF hs e z.2).symm |
| 209 | |
| 210 | theorem past_zero_eq_integral {a b : ℝ} (ha : 0 ≤ a) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 211 | (hs : RadialAlias.RadiallySupported a b F) (z : ℝ × E) : |
| 212 | TransportPrimitive.pastIntegral 0 (0 : E) F z = ∫ r in (0 : ℝ)..z.1, F (r, z.2) := by |
| 213 | have hs0 : RadialAlias.RadiallySupported 0 b F := fun y hy => ⟨ha.trans (hs hy).1, (hs hy).2⟩ |
| 214 | simpa only [zero_mul, zero_smul, add_zero] using |
| 215 | TransportPrimitive.pastIntegral_eq_radialInterval (M := 0) (v := (0 : E)) hF hs0 z |
| 216 | |
| 217 | theorem cutoff_eq_integral (P : Patch) (r : ℝ) : cutoff P r = ∫ s in (0 : ℝ)..r, density P s := |
| 218 | past_zero_eq_integral P.left_pos.le (densityLift_contDiff P).continuous (densityLift_supported P) (r, 0) |
| 219 | |
| 220 | theorem primitive_eq_integral (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) |
| 221 | (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 222 | primitive P e F z = ∫ r in (0 : ℝ)..z.1, r ^ e * adjusted P e F (r, z.2) := by |
| 223 | have hiF : IntervalIntegrable (fun r => r ^ e * F (r, z.2)) volume 0 z.1 := |
| 224 | ((continuous_id.pow e).mul (hF.continuous.comp (continuous_id.prodMk continuous_const))).intervalIntegrable _ _ |
| 225 | have hiD : IntervalIntegrable (fun r => density P r * mass e F z.2) volume 0 z.1 := |
| 226 | ((density_contDiff P).continuous.mul continuous_const).intervalIntegrable _ _ |
| 227 | have heq : (fun r => r ^ e * adjusted P e F (r, z.2)) = |
| 228 | fun r => r ^ e * F (r, z.2) - density P r * mass e F z.2 := by |
| 229 | funext r |
| 230 | dsimp [adjusted, bumpCorrection] |
| 231 | rw [mul_sub, ← mul_assoc, weighted_momentDensity] |
| 232 | rw [heq, intervalIntegral.integral_sub hiF hiD, intervalIntegral.integral_mul_const] |
| 233 | unfold primitive TransportPrimitive.compactIntegral |
| 234 | rw [past_zero_eq_integral P.a_pos.le (weightedSource_continuous e hF.continuous) |
| 235 | (weightedSource_supported e hs), total_weightedSource P e hF.continuous hs, cutoff_eq_integral] |
| 236 | rfl |
| 237 | |
| 238 | theorem weighted_sigma_eq (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} (hF : Continuous F) |
| 239 | (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 240 | z.1 ^ e * sigma P e F z = -primitive P e F z := by |
| 241 | by_cases h : primitive P e F z = 0 |
| 242 | · simp [sigma, h] |
| 243 | have hr := primitive_supported P e hF hs h |
| 244 | have hz0 : z.1 ≠ 0 := (P.a_pos.trans_le hr.1).ne' |
| 245 | rw [sigma, inversePower_eq P e hr.1] |
| 246 | field_simp |
| 247 | |
| 248 | theorem sigma_eq_negative_primitive (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 249 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (z : ℝ × E) : |
| 250 | sigma P e F z = -(∫ r in (0 : ℝ)..z.1, r ^ e * adjusted P e F (r, z.2)) / z.1 ^ e := by |
| 251 | rw [← primitive_eq_integral P e hF hs] |
| 252 | by_cases h : primitive P e F z = 0 |
| 253 | · simp [sigma, h] |
| 254 | rw [sigma, inversePower_eq P e (primitive_supported P e hF.continuous hs h).1] |
| 255 | ring |
| 256 | |
| 257 | theorem adjusted_moment_zero (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 258 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) : |
| 259 | mass e (adjusted P e F) p = 0 := by |
| 260 | have hiF := IntegratedMeanBalances.weighted_integrable |
| 261 | (IntegratedMeanBalances.radial_slice_smooth hF p).continuous |
| 262 | (IntegratedMeanBalances.radial_slice_compact hs p) e |
| 263 | have hiB := IntegratedMeanBalances.weighted_integrable |
| 264 | (IntegratedMeanBalances.radial_slice_smooth (bumpCorrection_contDiff P e hF hs) p).continuous |
| 265 | (IntegratedMeanBalances.radial_slice_compact (bumpCorrection_supported P e F) p) e |
| 266 | change IntegratedMeanBalances.moment e |
| 267 | (fun r => F (r, p) - bumpCorrection P e F (r, p)) = 0 |
| 268 | rw [IntegratedMeanBalances.moment_sub e hiF hiB] |
| 269 | change mass e F p - mass e (bumpCorrection P e F) p = 0 |
| 270 | rw [bumpCorrection_moment, sub_self] |
| 271 | |
| 272 | theorem primitive_hasDerivAt (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 273 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) (r : ℝ) : |
| 274 | HasDerivAt (fun t => primitive P e F (t, p)) (r ^ e * adjusted P e F (r, p)) r := by |
| 275 | have hp := primitive_contDiff P e hF hs |
| 276 | have hd := ((hp.differentiable (by simp)) (r, p)).hasFDerivAt.comp_hasDerivAt r |
| 277 | ((hasDerivAt_id r).prodMk (hasDerivAt_const r p)) |
| 278 | have ht := TransportPrimitive.transport_compactIntegral (M := 0) (v := (0 : E)) |
| 279 | (cutoff_contDiff P) (weightedSource_contDiff e hF) (weightedSource_supported e hs) (r, p) |
| 280 | simp only [TransportPrimitive.fixedDeriv, zero_smul, cutoff_deriv, |
| 281 | total_weightedSource P e hF.continuous hs, smul_eq_mul] at ht |
| 282 | have he : weightedSource e F (r, p) - density P r * mass e F p = |
| 283 | r ^ e * adjusted P e F (r, p) := by |
| 284 | dsimp [weightedSource, adjusted, bumpCorrection] |
| 285 | rw [mul_sub, ← mul_assoc, weighted_momentDensity] |
| 286 | rw [he] at ht |
| 287 | change fderiv ℝ (primitive P e F) (r, p) (1, 0) = _ at ht |
| 288 | simpa only [ht, Function.comp_def, id_eq] using hd |
| 289 | |
| 290 | /-- The sign is the one required to cancel the adjusted residual by divergence. -/ |
| 291 | theorem weighted_sigma_hasDerivAt (P : Patch) (e : ℕ) {F : ℝ × E → ℝ} |
| 292 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) (r : ℝ) : |
| 293 | HasDerivAt (fun t => t ^ e * sigma P e F (t, p)) (-r ^ e * adjusted P e F (r, p)) r := by |
| 294 | have he : (fun t => t ^ e * sigma P e F (t, p)) = |
| 295 | fun t => -primitive P e F (t, p) := funext (fun t => weighted_sigma_eq P e hF.continuous hs (t, p)) |
| 296 | rw [he] |
| 297 | convert! (primitive_hasDerivAt P e hF hs p r).neg using 1 |
| 298 | ring |
| 299 | |
| 300 | theorem angular_divergence (P : Patch) {F : ℝ × E → ℝ} |
| 301 | (hF : ContDiff ℝ ∞ F) (hs : RadialAlias.RadiallySupported P.a P.b F) (p : E) {r : ℝ} (hr : 0 < r) : |
| 302 | IntegratedMeanBalances.radialDivergence 2 (fun t => sigma P 2 F (t, p)) r = |
| 303 | -adjusted P 2 F (r, p) := by |
| 304 | have hsD := ((IntegratedMeanBalances.radial_slice_smooth (sigma_contDiff P 2 hF hs) p).differentiable (by simp) r).hasDerivAt |
| 305 | have he := ((hasDerivAt_pow 2 r).mul hsD).unique (weighted_sigma_hasDerivAt P 2 hF hs p r) |
| 306 | norm_num at he |
| 307 | apply mul_left_cancel₀ (pow_ne_zero 2 hr.ne') |
| 308 | dsimp [IntegratedMeanBalances.radialDivergence] |
| 309 | calc |
| 310 | _ = 2 * r * sigma P 2 F (r, p) + r ^ 2 * deriv (fun t => sigma P 2 F (t, p)) r := by |
| 311 | field_simp ; ring |
| 312 | _ = _ := by nlinarith [he] |
| 313 | |
| 314 | /-- The constructed interior bump carries the full edge weight, because its |
| 315 | support lies in a fixed compact subset of the active annulus. -/ |
| 316 | theorem momentDensity_meanClass (P : Patch) (e : ℕ) {cL cR : ℝ} (hcL : 0 < cL) (hcR : 0 < cR) |
| 317 | (ε slow : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) : |
| 318 | WeightedClasses.MeanClass |
| 319 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 320 | 0 (fun _ (z : ℝ × E) => momentDensity P e z.1) := by |
| 321 | let s := WeightedRadialPrimitive.logStripData (E := E) P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow |
| 322 | have hmem : ∀ r ∈ Icc P.left P.right, (r, (0 : E)) ∈ s.domain := by |
| 323 | intro r hr |
| 324 | exact ⟨P.a_lt_left.trans_le hr.1, hr.2.trans_lt P.right_lt_b⟩ |
| 325 | have hc : ContinuousOn (fun r => s.zeta (r, (0 : E))) (Icc P.left P.right) := |
| 326 | s.zeta_smooth.continuousOn.comp (continuous_id.prodMk continuous_const).continuousOn hmem |
| 327 | have hp : ∀ r ∈ Icc P.left P.right, 0 < s.zeta (r, (0 : E)) := by |
| 328 | intro r hr |
| 329 | exact WeightedRadialPrimitive.zeta_pos cL cR |
| 330 | (WeightedRadialPrimitive.logPosition_mem P.a_pos (hmem r hr)) |
| 331 | obtain ⟨D, hD, hDb⟩ := UniformCone.positive_uniform_margin isCompact_Icc hc hp |
| 332 | have hs : RadialAlias.RadiallySupported P.left P.right (fun z : ℝ × E => momentDensity P e z.1) := |
| 333 | fun z hz => momentDensity_support P e hz |
| 334 | refine ⟨fun _ z hz => s.zeta_nonneg z hz, |
| 335 | fun _ => ((momentDensity_contDiff P e).comp contDiff_fst).contDiffOn, ?_⟩ |
| 336 | intro m |
| 337 | obtain ⟨C, hC, hCb⟩ := WeightedRadialPrimitive.cutoff_finiteJet_bound (E := E) |
| 338 | P.a P.b (momentDensity P e) (momentDensity_contDiff P e) m |
| 339 | refine ⟨C / D, div_nonneg hC hD.le, 0, ?_⟩ |
| 340 | intro n z hz j hj |
| 341 | change ‖iteratedFDeriv ℝ j (fun z : ℝ × E => momentDensity P e z.1) z‖ ≤ |
| 342 | WeightedClasses.majorant s (fun _ y => s.zeta y) 0 (C / D) 0 n z |
| 343 | simp only [WeightedClasses.majorant, Real.rpow_zero, pow_zero, mul_one] |
| 344 | by_cases hi : z.1 ∈ Icc P.left P.right |
| 345 | · have hd : D ≤ s.zeta z := hDb z.1 hi |
| 346 | calc |
| 347 | _ ≤ C := hCb j hj z ⟨hz.1.le, hz.2.le⟩ |
| 348 | _ = (C / D) * D := by field_simp |
| 349 | _ ≤ _ := mul_le_mul_of_nonneg_left hd (div_nonneg hC hD.le) |
| 350 | · have hzj : iteratedFDeriv ℝ j (fun z : ℝ × E => momentDensity P e z.1) z = 0 := by |
| 351 | by_contra hn |
| 352 | exact hi (TransportPrimitive.iteratedFDeriv_supported hs j hn) |
| 353 | rw [hzj, norm_zero] |
| 354 | exact mul_nonneg (div_nonneg hC hD.le) (s.zeta_nonneg z hz) |
| 355 | |
| 356 | theorem fderiv_lift (D : E → ℝ) (hD : ContDiff ℝ ∞ D) (z : ℝ × E) (v : E) : |
| 357 | fderiv ℝ (fun y : ℝ × E => D y.2) z (0, v) = fderiv ℝ D z.2 v := by |
| 358 | have h := ((hD.differentiable (by simp)) z.2).hasFDerivAt.comp z hasFDerivAt_snd |
| 359 | change fderiv ℝ (D ∘ Prod.snd) z (0, v) = _ |
| 360 | rw [h.fderiv] |
| 361 | simp |
| 362 | |
| 363 | /-- The improved bump order follows from a proved residual-moment identity: |
| 364 | one slow derivative comes with one additional factor of epsilon. -/ |
| 365 | theorem bump_improvedClass_of_moment_identity (P : Patch) (e : ℕ) {cL cR : ℝ} |
| 366 | (hcL : 0 < cL) (hcR : 0 < cR) (ε slow : ℕ → ℝ) |
| 367 | (hε : ∀ n, 0 < ε n) (hε1 : ∀ n, ε n ≤ 1) (hslow : ∀ n, 1 ≤ slow n) |
| 368 | (α : ℝ) (F : ℕ → ℝ × E → ℝ) (D : ℕ → E → ℝ) (v : E) |
| 369 | (hD : ∀ n, ContDiff ℝ ∞ (D n)) |
| 370 | (hclass : WeightedClasses.UnweightedClass |
| 371 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 372 | α (fun n (z : ℝ × E) => D n z.2)) |
| 373 | (hmoment : ∀ n p, mass e (F n) p = ε n * fderiv ℝ (D n) p v) : |
| 374 | WeightedClasses.MeanClass |
| 375 | (WeightedRadialPrimitive.logStripData P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow) |
| 376 | (α + 1) (fun n => bumpCorrection P e (F n)) := by |
| 377 | let s := WeightedRadialPrimitive.logStripData (E := E) P.a P.b cL cR P.a_pos hcL hcR ε slow hε hε1 hslow |
| 378 | have hd := hclass.directional ((0 : ℝ), v) |
| 379 | have hb := (momentDensity_meanClass (E := E) P e hcL hcR ε slow hε hε1 hslow).mul hd |
| 380 | have hmean : WeightedClasses.MeanClass s α (fun n (z : ℝ × E) => |
| 381 | momentDensity P e z.1 * fderiv ℝ (D n) z.2 v) := by |
| 382 | simpa only [WeightedClasses.MeanClass, zero_add, mul_one, fderiv_lift _ (hD _)] using hb |
| 383 | have hh := hmean.band_smul (WeightedClasses.bandBound_rpow s 1) |
| 384 | have heq : (fun n (z : ℝ × E) => s.epsilon n ^ (1 : ℝ) • |
| 385 | (momentDensity P e z.1 * fderiv ℝ (D n) z.2 v)) = fun n => bumpCorrection P e (F n) := by |
| 386 | funext n z |
| 387 | simp only [Real.rpow_one, smul_eq_mul, bumpCorrection, hmoment] |
| 388 | change ε n * (momentDensity P e z.1 * _) = momentDensity P e z.1 * (ε n * _) |
| 389 | ring |
| 390 | rwa [heq] at hh |
| 391 | |
| 392 | noncomputable def barSigma (P : Patch) (e : ℕ) (F : PressureStream.Lift E → ℝ) : ℝ × E → ℝ := |
| 393 | sigma P e (PressureStream.torusAverage F) |
| 394 | |
| 395 | /-- Slow coefficients are constant along the ordinary radial integration. -/ |
| 396 | theorem sigma_slow_mul (P : Patch) (e : ℕ) (k : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : |
| 397 | sigma P e (fun y => k y.2 * F y) z = k z.2 * sigma P e F z := by |
| 398 | have hp : TransportPrimitive.pastIntegral 0 (0 : E) (weightedSource e (fun y => k y.2 * F y)) z = |
| 399 | k z.2 * TransportPrimitive.pastIntegral 0 (0 : E) (weightedSource e F) z := by |
| 400 | unfold TransportPrimitive.pastIntegral |
| 401 | rw [← integral_const_mul] |
| 402 | apply integral_congr_ae |
| 403 | exact Filter.Eventually.of_forall (fun u => by simp [weightedSource, TransportPrimitive.shift]; ring) |
| 404 | have ht : TransportPrimitive.totalIntegral 0 (0 : E) (weightedSource e (fun y => k y.2 * F y)) z = |
| 405 | k z.2 * TransportPrimitive.totalIntegral 0 (0 : E) (weightedSource e F) z := by |
| 406 | unfold TransportPrimitive.totalIntegral |
| 407 | rw [← integral_const_mul] |
| 408 | apply integral_congr_ae |
| 409 | exact Filter.Eventually.of_forall (fun u => by simp [weightedSource, TransportPrimitive.shift]; ring) |
| 410 | unfold sigma primitive TransportPrimitive.compactIntegral |
| 411 | rw [hp, ht] |
| 412 | simp only [smul_eq_mul] |
| 413 | ring |
| 414 | |
| 415 | end Primitive |
| 416 | |
| 417 | section Physical |
| 418 | |
| 419 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 420 | |
| 421 | /-- The physical radial length is sqrt q, as in the chart R = r / sqrt Q. -/ |
| 422 | noncomputable def lengthScale (q : E → ℝ) (p : E) : ℝ := Real.sqrt (q p) |
| 423 | noncomputable def nativeSource (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 424 | F (lengthScale q z.2 * z.1, z.2) |
| 425 | noncomputable def physicalDensity (P : Patch) (e : ℕ) (q : E → ℝ) (z : ℝ × E) : ℝ := |
| 426 | momentDensity P e (z.1 / lengthScale q z.2) / lengthScale q z.2 ^ (e + 1) |
| 427 | noncomputable def physicalBump (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 428 | physicalDensity P e q z * mass e F z.2 |
| 429 | noncomputable def physicalAdjusted (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 430 | F z - physicalBump P e q F z |
| 431 | noncomputable def physicalSigma (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := |
| 432 | lengthScale q z.2 * sigma P e (nativeSource q F) (z.1 / lengthScale q z.2, z.2) |
| 433 | |
| 434 | /-- Radial support stated directly using the physical q, with no band index. -/ |
| 435 | def PhysicalSupport (P : Patch) (q : E → ℝ) (F : ℝ × E → ℝ) : Prop := |
| 436 | ∀ z, F z ≠ 0 → z.1 / lengthScale q z.2 ∈ Icc P.a P.b |
| 437 | |
| 438 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 439 | theorem lengthScale_pos {q : E → ℝ} (hq : ∀ p, 0 < q p) (p : E) : 0 < lengthScale q p := |
| 440 | Real.sqrt_pos.mpr (hq p) |
| 441 | |
| 442 | theorem lengthScale_contDiff {q : E → ℝ} (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) : |
| 443 | ContDiff ℝ ∞ (lengthScale q) := hq.sqrt (fun p => (hpos p).ne') |
| 444 | |
| 445 | theorem nativeSource_contDiff {q : E → ℝ} (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) |
| 446 | {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) : ContDiff ℝ ∞ (nativeSource q F) := |
| 447 | hF.comp ((((lengthScale_contDiff hq hpos).comp contDiff_snd).mul contDiff_fst).prodMk contDiff_snd) |
| 448 | |
| 449 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 450 | theorem nativeSource_supported (P : Patch) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 451 | {F : ℝ × E → ℝ} (hs : PhysicalSupport P q F) : |
| 452 | RadialAlias.RadiallySupported P.a P.b (nativeSource q F) := by |
| 453 | intro z hz |
| 454 | have h := hs (lengthScale q z.2 * z.1, z.2) hz |
| 455 | simp only [mul_div_cancel_left₀ _ (lengthScale_pos hq z.2).ne'] at h |
| 456 | exact h |
| 457 | |
| 458 | theorem integral_dilate_weighted (e : ℕ) (f : ℝ → ℝ) {s : ℝ} (hs : 0 < s) : |
| 459 | (∫ r, r ^ e * f (s * r)) = (∫ r, r ^ e * f r) / s ^ (e + 1) := by |
| 460 | have he : (fun r => r ^ e * f (s * r)) = |
| 461 | fun r => (s ^ e)⁻¹ * ((s * r) ^ e * f (s * r)) := by |
| 462 | funext r |
| 463 | rw [mul_pow] |
| 464 | field_simp [hs.ne'] |
| 465 | rw [he, integral_const_mul, Measure.integral_comp_mul_left (fun r => r ^ e * f r) s] |
| 466 | rw [abs_of_pos (inv_pos.mpr hs), smul_eq_mul, pow_succ] |
| 467 | field_simp [hs.ne'] |
| 468 | |
| 469 | theorem interval_dilate_weighted (e : ℕ) (f : ℝ → ℝ) {s : ℝ} (hs : 0 < s) (x : ℝ) : |
| 470 | (∫ r in (0 : ℝ)..x, r ^ e * f (s * r)) = |
| 471 | (∫ r in (0 : ℝ)..(s * x), r ^ e * f r) / s ^ (e + 1) := by |
| 472 | have he : (fun r => r ^ e * f (s * r)) = |
| 473 | fun r => (s ^ e)⁻¹ * ((s * r) ^ e * f (s * r)) := by |
| 474 | funext r |
| 475 | rw [mul_pow] |
| 476 | field_simp [hs.ne'] |
| 477 | rw [he, intervalIntegral.integral_const_mul, |
| 478 | intervalIntegral.integral_comp_mul_left (fun r => r ^ e * f r) hs.ne'] |
| 479 | rw [mul_zero, smul_eq_mul, pow_succ] |
| 480 | field_simp [hs.ne'] |
| 481 | |
| 482 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 483 | theorem nativeSource_mass (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 484 | (F : ℝ × E → ℝ) (p : E) : |
| 485 | mass e (nativeSource q F) p = mass e F p / lengthScale q p ^ (e + 1) := |
| 486 | integral_dilate_weighted e (fun r => F (r, p)) (lengthScale_pos hq p) |
| 487 | |
| 488 | theorem physicalDensity_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 489 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) : ContDiff ℝ ∞ (physicalDensity P e q) := by |
| 490 | have hs := (lengthScale_contDiff hq hpos).comp (contDiff_snd (E := ℝ)) |
| 491 | exact ((momentDensity_contDiff P e).comp |
| 492 | (contDiff_fst.div hs (fun z => (lengthScale_pos hpos z.2).ne'))).div (hs.pow (e + 1)) |
| 493 | (fun z => pow_ne_zero _ (lengthScale_pos hpos z.2).ne') |
| 494 | |
| 495 | theorem physical_mass_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 496 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 497 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : ContDiff ℝ ∞ (mass e F) := by |
| 498 | have hn := mass_contDiff e (nativeSource_contDiff hq hpos hF) (nativeSource_supported P hpos hs) |
| 499 | have he : mass e F = fun p => lengthScale q p ^ (e + 1) * mass e (nativeSource q F) p := by |
| 500 | funext p |
| 501 | rw [nativeSource_mass e hpos] |
| 502 | field_simp [(lengthScale_pos hpos p).ne'] |
| 503 | rw [he] |
| 504 | exact ((lengthScale_contDiff hq hpos).pow (e + 1)).mul hn |
| 505 | |
| 506 | theorem physicalBump_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 507 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 508 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : ContDiff ℝ ∞ (physicalBump P e q F) := |
| 509 | (physicalDensity_contDiff P e hq hpos).mul ((physical_mass_contDiff P e hq hpos hF hs).comp contDiff_snd) |
| 510 | |
| 511 | theorem physicalSigma_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 512 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 513 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : ContDiff ℝ ∞ (physicalSigma P e q F) := by |
| 514 | have hl : ContDiff ℝ ∞ (fun z : ℝ × E => lengthScale q z.2) := |
| 515 | (lengthScale_contDiff hq hpos).comp contDiff_snd |
| 516 | exact hl.mul ((sigma_contDiff P e (nativeSource_contDiff hq hpos hF) |
| 517 | (nativeSource_supported P hpos hs)).comp |
| 518 | ((contDiff_fst.div hl (fun z => (lengthScale_pos hpos z.2).ne')).prodMk contDiff_snd)) |
| 519 | |
| 520 | theorem physicalSigma_supported (P : Patch) (e : ℕ) {q : E → ℝ} |
| 521 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 522 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : PhysicalSupport P q (physicalSigma P e q F) := by |
| 523 | intro z hz |
| 524 | exact sigma_supported P e (nativeSource_contDiff hq hpos hF).continuous |
| 525 | (nativeSource_supported P hpos hs) (right_ne_zero_of_mul hz) |
| 526 | |
| 527 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 528 | theorem native_adjusted_eq (P : Patch) (e : ℕ) {q : E → ℝ} (hq : ∀ p, 0 < q p) |
| 529 | (F : ℝ × E → ℝ) (z : ℝ × E) : |
| 530 | adjusted P e (nativeSource q F) z = |
| 531 | physicalAdjusted P e q F (lengthScale q z.2 * z.1, z.2) := by |
| 532 | simp only [adjusted, bumpCorrection, nativeSource, physicalAdjusted, physicalBump, physicalDensity, |
| 533 | nativeSource_mass e hq, mul_div_cancel_left₀ _ (lengthScale_pos hq z.2).ne'] |
| 534 | ring |
| 535 | |
| 536 | /-- The physical sigma is exactly the requested negative primitive from zero. |
| 537 | No fixed-Q chart enters this definition or identity. -/ |
| 538 | theorem physicalSigma_eq_negative_primitive (P : Patch) (e : ℕ) {q : E → ℝ} |
| 539 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 540 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (z : ℝ × E) : |
| 541 | physicalSigma P e q F z = |
| 542 | -(∫ r in (0 : ℝ)..z.1, r ^ e * physicalAdjusted P e q F (r, z.2)) / z.1 ^ e := by |
| 543 | have hl := lengthScale_pos hpos z.2 |
| 544 | unfold physicalSigma |
| 545 | rw [sigma_eq_negative_primitive P e (nativeSource_contDiff hq hpos hF) (nativeSource_supported P hpos hs)] |
| 546 | simp_rw [native_adjusted_eq P e hpos] |
| 547 | rw [interval_dilate_weighted e (fun r => physicalAdjusted P e q F (r, z.2)) hl, |
| 548 | mul_div_cancel₀ z.1 hl.ne'] |
| 549 | rw [div_pow, pow_succ] |
| 550 | by_cases hr : z.1 = 0 |
| 551 | · simp [hr] |
| 552 | · field_simp [hl.ne', hr] |
| 553 | |
| 554 | theorem physicalAdjusted_moment_zero (P : Patch) (e : ℕ) {q : E → ℝ} |
| 555 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 556 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) : |
| 557 | mass e (physicalAdjusted P e q F) p = 0 := by |
| 558 | have he : nativeSource q (physicalAdjusted P e q F) = adjusted P e (nativeSource q F) := |
| 559 | funext fun z => (native_adjusted_eq P e hpos F z).symm |
| 560 | have hz := adjusted_moment_zero P e (nativeSource_contDiff hq hpos hF) |
| 561 | (nativeSource_supported P hpos hs) p |
| 562 | have hh := nativeSource_mass e hpos (physicalAdjusted P e q F) p |
| 563 | rw [he, hz] at hh |
| 564 | have hm := congrArg (fun t => t * lengthScale q p ^ (e + 1)) hh |
| 565 | simpa only [zero_mul, div_mul_cancel₀ _ (pow_ne_zero _ (lengthScale_pos hpos p).ne')] using hm.symm |
| 566 | |
| 567 | theorem physicalSigma_slice_compact (P : Patch) (e : ℕ) {q : E → ℝ} |
| 568 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 569 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) : |
| 570 | HasCompactSupport (fun r => physicalSigma P e q F (r, p)) := by |
| 571 | apply HasCompactSupport.of_support_subset_isCompact |
| 572 | (isCompact_Icc (a := lengthScale q p * P.a) (b := lengthScale q p * P.b)) |
| 573 | intro r hr |
| 574 | have h := physicalSigma_supported P e hq hpos hF hs (r, p) hr |
| 575 | exact ⟨by simpa only [mul_comm] using (le_div_iff₀ (lengthScale_pos hpos p)).mp h.1, |
| 576 | by simpa only [mul_comm] using (div_le_iff₀ (lengthScale_pos hpos p)).mp h.2⟩ |
| 577 | |
| 578 | theorem physicalAdjusted_contDiff (P : Patch) (e : ℕ) {q : E → ℝ} |
| 579 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 580 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) : |
| 581 | ContDiff ℝ ∞ (physicalAdjusted P e q F) := hF.sub (physicalBump_contDiff P e hq hpos hF hs) |
| 582 | |
| 583 | theorem physical_weighted_sigma_eq (P : Patch) (e : ℕ) {q : E → ℝ} |
| 584 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 585 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) (r : ℝ) : |
| 586 | r ^ e * physicalSigma P e q F (r, p) = |
| 587 | -(∫ t in (0 : ℝ)..r, t ^ e * physicalAdjusted P e q F (t, p)) := by |
| 588 | rw [physicalSigma_eq_negative_primitive P e hq hpos hF hs] |
| 589 | by_cases hr : r = 0 |
| 590 | · subst r |
| 591 | simp |
| 592 | · field_simp |
| 593 | |
| 594 | theorem physical_weighted_sigma_hasDerivAt (P : Patch) (e : ℕ) {q : E → ℝ} |
| 595 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 596 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) (r : ℝ) : |
| 597 | HasDerivAt (fun t => t ^ e * physicalSigma P e q F (t, p)) |
| 598 | (-r ^ e * physicalAdjusted P e q F (r, p)) r := by |
| 599 | have hc : Continuous (fun t => t ^ e * physicalAdjusted P e q F (t, p)) := |
| 600 | (continuous_id.pow e).mul ((physicalAdjusted_contDiff P e hq hpos hF hs).continuous.comp |
| 601 | (continuous_id.prodMk continuous_const)) |
| 602 | have hd := (intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 r) |
| 603 | hc.aestronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt).neg |
| 604 | have he : (fun t => t ^ e * physicalSigma P e q F (t, p)) = |
| 605 | fun t => -(∫ u in (0 : ℝ)..t, u ^ e * physicalAdjusted P e q F (u, p)) := |
| 606 | funext (physical_weighted_sigma_eq P e hq hpos hF hs p) |
| 607 | rw [he] |
| 608 | convert! hd using 1 |
| 609 | ring |
| 610 | |
| 611 | theorem physical_angular_divergence (P : Patch) {q : E → ℝ} |
| 612 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 613 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) {r : ℝ} (hr : 0 < r) : |
| 614 | IntegratedMeanBalances.radialDivergence 2 (fun t => physicalSigma P 2 q F (t, p)) r = |
| 615 | -physicalAdjusted P 2 q F (r, p) := by |
| 616 | have hd := ((IntegratedMeanBalances.radial_slice_smooth (physicalSigma_contDiff P 2 hq hpos hF hs) p).differentiable |
| 617 | (by simp) r).hasDerivAt |
| 618 | have he := ((hasDerivAt_pow 2 r).mul hd).unique |
| 619 | (physical_weighted_sigma_hasDerivAt P 2 hq hpos hF hs p r) |
| 620 | norm_num at he |
| 621 | apply mul_left_cancel₀ (pow_ne_zero 2 hr.ne') |
| 622 | dsimp [IntegratedMeanBalances.radialDivergence] |
| 623 | calc |
| 624 | _ = 2 * r * physicalSigma P 2 q F (r, p) + |
| 625 | r ^ 2 * deriv (fun t => physicalSigma P 2 q F (t, p)) r := by field_simp ; ring |
| 626 | _ = _ := by nlinarith [he] |
| 627 | |
| 628 | theorem physical_axial_divergence (P : Patch) {q : E → ℝ} |
| 629 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : ℝ × E → ℝ} |
| 630 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P q F) (p : E) {r : ℝ} (hr : 0 < r) : |
| 631 | IntegratedMeanBalances.radialDivergence 1 (fun t => physicalSigma P 1 q F (t, p)) r = |
| 632 | -physicalAdjusted P 1 q F (r, p) := by |
| 633 | have hd := ((IntegratedMeanBalances.radial_slice_smooth (physicalSigma_contDiff P 1 hq hpos hF hs) p).differentiable |
| 634 | (by simp) r).hasDerivAt |
| 635 | have he := ((hasDerivAt_pow 1 r).mul hd).unique |
| 636 | (physical_weighted_sigma_hasDerivAt P 1 hq hpos hF hs p r) |
| 637 | norm_num at he |
| 638 | apply mul_left_cancel₀ hr.ne' |
| 639 | dsimp [IntegratedMeanBalances.radialDivergence] |
| 640 | calc |
| 641 | _ = physicalSigma P 1 q F (r, p) + r * deriv (fun t => physicalSigma P 1 q F (t, p)) r := by |
| 642 | field_simp ; ring |
| 643 | _ = _ := by nlinarith [he] |
| 644 | |
| 645 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 646 | /-- Taking the torus bar preserves support described by the physical q. -/ |
| 647 | theorem physical_torusAverage_supported (P : Patch) {q : E → ℝ} |
| 648 | {F : PressureStream.Lift E → ℝ} |
| 649 | (hs : PhysicalSupport P (fun p => q p.1) F) : |
| 650 | PhysicalSupport P q (PressureStream.torusAverage F) := by |
| 651 | intro z hz |
| 652 | by_contra hn |
| 653 | apply hz |
| 654 | apply PressureStream.torusAverage_zero_of_forall |
| 655 | intro Y |
| 656 | by_contra hF |
| 657 | exact hn (hs (z.1, (z.2, Y)) hF) |
| 658 | |
| 659 | noncomputable def physicalBarSigma (P : Patch) (e : ℕ) (q : E → ℝ) |
| 660 | (F : PressureStream.Lift E → ℝ) : ℝ × E → ℝ := |
| 661 | physicalSigma P e q (PressureStream.torusAverage F) |
| 662 | |
| 663 | theorem physicalBarSigma_eq_negative_primitive (P : Patch) (e : ℕ) {q : E → ℝ} |
| 664 | (hq : ContDiff ℝ ∞ q) (hpos : ∀ p, 0 < q p) {F : PressureStream.Lift E → ℝ} |
| 665 | (hF : ContDiff ℝ ∞ F) (hs : PhysicalSupport P (fun p => q p.1) F) (z : ℝ × E) : |
| 666 | physicalBarSigma P e q F z = -(∫ r in (0 : ℝ)..z.1, |
| 667 | r ^ e * physicalAdjusted P e q (PressureStream.torusAverage F) (r, z.2)) / z.1 ^ e := |
| 668 | physicalSigma_eq_negative_primitive P e hq hpos (PressureStream.torusAverage_contDiff hF) |
| 669 | (physical_torusAverage_supported P hs) z |
| 670 | |
| 671 | end Physical |
| 672 | |
| 673 | section IntegratedBalances |
| 674 | |
| 675 | open IntegratedMeanBalances |
| 676 | |
| 677 | /-- The removed angular moment is the actual defect derivative in (34). -/ |
| 678 | theorem angular_bump_identity (P : Patch) (ε : ℝ) |
| 679 | {v radialFlux axialFlux virtualFlux : MeanField} |
| 680 | (hv : SmoothShell P.a P.b v) (hr : SmoothShell P.a P.b radialFlux) |
| 681 | (hz : SmoothShell P.a P.b axialFlux) (hT : SmoothShell P.a P.b virtualFlux) |
| 682 | (hmass : radialMoment 2 v = 0) (z : MeanPoint) : |
| 683 | bumpCorrection P 2 (angularBalance ε v radialFlux axialFlux virtualFlux) z = |
| 684 | momentDensity P 2 z.1 * (ε * fderiv ℝ (radialMoment 2 axialFlux) z.2 (0, 1)) := by |
| 685 | unfold bumpCorrection mass |
| 686 | rw [integrated_angular_balance ε hv hr hz hT hmass] |
| 687 | |
| 688 | end IntegratedBalances |
| 689 | |
| 690 | section ChartComparison |
| 691 | |
| 692 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 693 | |
| 694 | |
| 695 | end ChartComparison |
| 696 | |
| 697 | end NavierStokes.SignedStressPrimitive |