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.StressAlgebra |
| 2 | import NavierStokes.SmoothParameterIntegral |
| 3 | import NavierStokes.ParametricFlatFactor |
| 4 | import Mathlib.Analysis.Calculus.ParametricIntervalIntegral |
| 5 | import Mathlib.Analysis.Calculus.Deriv.Prod |
| 6 | import Mathlib.Analysis.Calculus.Deriv.Comp |
| 7 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 8 | import Mathlib.Analysis.SpecialFunctions.Log.Deriv |
| 9 | |
| 10 | /-! |
| 11 | # Genuine smooth profile histories |
| 12 | |
| 13 | The histories are actual integrals of jointly smooth profiles. Their parameter |
| 14 | derivatives and radial identities are derived from differentiation under the |
| 15 | integral and the fundamental theorem of calculus, rather than supplied as |
| 16 | independent history data. |
| 17 | -/ |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | namespace NavierStokes.ProfileHistories |
| 22 | |
| 23 | open Set MeasureTheory Filter Metric |
| 24 | open scoped Topology ContDiff |
| 25 | |
| 26 | abbrev Point := ℝ × ℝ |
| 27 | abbrev Field := Point → ℝ |
| 28 | |
| 29 | /-- An open profile domain containing every radial segment from the axis to |
| 30 | one of its points. Open rectangles centered radially at zero are examples. -/ |
| 31 | structure RadialDomain where |
| 32 | carrier : Set Point |
| 33 | isOpen : IsOpen carrier |
| 34 | scale_mem : ∀ p ∈ carrier, ∀ t ∈ Icc (0 : ℝ) 1, (t * p.1, p.2) ∈ carrier |
| 35 | |
| 36 | /-- A concrete open rectangle meeting the axis. Positivity of R is needed |
| 37 | only to make it nonempty, not for the radial stability proof. -/ |
| 38 | def RadialDomain.rectangle (R a b : ℝ) : RadialDomain where |
| 39 | carrier := Ioo (-R) R ×ˢ Ioo a b |
| 40 | isOpen := isOpen_Ioo.prod isOpen_Ioo |
| 41 | scale_mem := by |
| 42 | intro p hp t ht |
| 43 | refine ⟨?_, hp.2⟩ |
| 44 | have hX : |p.1| < R := abs_lt.mpr hp.1 |
| 45 | have hmul : |t * p.1| ≤ |p.1| := by |
| 46 | rw [abs_mul, abs_of_nonneg ht.1] |
| 47 | exact mul_le_of_le_one_left (abs_nonneg _) ht.2 |
| 48 | exact abs_lt.mp (hmul.trans_lt hX) |
| 49 | |
| 50 | def radialPartial (F : Field) (p : Point) : ℝ := fderiv ℝ F p (1, 0) |
| 51 | def parameterPartial (F : Field) (p : Point) : ℝ := fderiv ℝ F p (0, 1) |
| 52 | |
| 53 | theorem radialPartial_hasDerivAt (D : RadialDomain) {F : Field} |
| 54 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 55 | HasDerivAt (fun x => F (x, p.2)) (radialPartial F p) p.1 := by |
| 56 | have hf := (hF.contDiffAt (D.isOpen.mem_nhds hp)).differentiableAt (by simp) |
| 57 | simpa only [radialPartial, Function.comp_def, id_eq, Prod.eta] using |
| 58 | hf.hasFDerivAt.comp_hasDerivAt p.1 ((hasDerivAt_id p.1).prodMk (hasDerivAt_const p.1 p.2)) |
| 59 | |
| 60 | theorem parameterPartial_hasDerivAt (D : RadialDomain) {F : Field} |
| 61 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 62 | HasDerivAt (fun η => F (p.1, η)) (parameterPartial F p) p.2 := by |
| 63 | have hf := (hF.contDiffAt (D.isOpen.mem_nhds hp)).differentiableAt (by simp) |
| 64 | simpa only [parameterPartial, Function.comp_def, id_eq, Prod.eta] using |
| 65 | hf.hasFDerivAt.comp_hasDerivAt p.2 ((hasDerivAt_const p.2 p.1).prodMk (hasDerivAt_id p.2)) |
| 66 | |
| 67 | theorem radialPartial_smooth (D : RadialDomain) {F : Field} |
| 68 | (hF : ContDiffOn ℝ ∞ F D.carrier) : ContDiffOn ℝ ∞ (radialPartial F) D.carrier := by |
| 69 | exact (hF.fderiv_of_isOpen D.isOpen (by simp)).clm_apply contDiffOn_const |
| 70 | |
| 71 | theorem parameterPartial_smooth (D : RadialDomain) {F : Field} |
| 72 | (hF : ContDiffOn ℝ ∞ F D.carrier) : ContDiffOn ℝ ∞ (parameterPartial F) D.carrier := by |
| 73 | exact (hF.fderiv_of_isOpen D.isOpen (by simp)).clm_apply contDiffOn_const |
| 74 | |
| 75 | section CompactParameterIntegral |
| 76 | |
| 77 | variable {s : Set Point} {G : Point → ℝ → ℝ} |
| 78 | |
| 79 | theorem compact_parameter_jet_continuous |
| 80 | (hG : ∀ p ∈ s, ∀ t ∈ Icc (0 : ℝ) 1, |
| 81 | ContDiffAt ℝ ∞ (fun z : Point × ℝ => G z.1 z.2) (p, t)) (k : ℕ) : |
| 82 | ContinuousOn (fun z : Point × ℝ => SmoothParameterIntegral.jet G k z.1 z.2) |
| 83 | (s ×ˢ Icc (0 : ℝ) 1) := by |
| 84 | rintro ⟨p, t⟩ ⟨hp, ht⟩ |
| 85 | have hflip : ContDiffAt ℝ ∞ (Function.uncurry (fun t p => G p t)) (t, p) := |
| 86 | (hG p hp t ht).comp (t, p) (contDiffAt_snd.prodMk contDiffAt_fst) |
| 87 | have h := ParametricFlatFactor.contDiffAt_partial_iteratedFDeriv (fun t p => G p t) k t p hflip |
| 88 | exact ((h.comp (p, t) (contDiffAt_snd.prodMk contDiffAt_fst)).continuousAt).continuousWithinAt |
| 89 | |
| 90 | theorem compact_parameter_integral_smooth (hs : IsOpen s) |
| 91 | (hG : ∀ p ∈ s, ∀ t ∈ Icc (0 : ℝ) 1, |
| 92 | ContDiffAt ℝ ∞ (fun z : Point × ℝ => G z.1 z.2) (p, t)) : |
| 93 | ContDiffOn ℝ ∞ (fun p => ∫ t in (0 : ℝ)..1, G p t) s := by |
| 94 | apply SmoothParameterIntegral.contDiffOn_intervalIntegral_of_continuous_jet hs zero_le_one |
| 95 | · intro t ht p hp |
| 96 | exact ((hG p hp t ht).comp p (contDiffAt_id.prodMk contDiffAt_const)).contDiffWithinAt |
| 97 | · exact compact_parameter_jet_continuous hG |
| 98 | |
| 99 | theorem compact_parameter_fderiv_continuous |
| 100 | (hG : ∀ p ∈ s, ∀ t ∈ Icc (0 : ℝ) 1, |
| 101 | ContDiffAt ℝ ∞ (fun z : Point × ℝ => G z.1 z.2) (p, t)) : |
| 102 | ContinuousOn (fun z : Point × ℝ => fderiv ℝ (fun p => G p z.2) z.1) |
| 103 | (s ×ˢ Icc (0 : ℝ) 1) := by |
| 104 | rintro ⟨p, t⟩ ⟨hp, ht⟩ |
| 105 | have hdup : ContDiffAt ℝ ∞ |
| 106 | (fun z : (Point × ℝ) × Point => G z.2 z.1.2) ((p, t), p) := |
| 107 | (hG p hp t ht).comp ((p, t), p) (contDiffAt_snd.prodMk contDiffAt_fst.snd) |
| 108 | have hd : ContDiffAt ℝ ∞ |
| 109 | (fun z : Point × ℝ => fderiv ℝ (fun q => G q z.2) z.1) (p, t) := |
| 110 | hdup.fderiv contDiffAt_fst (by simp) |
| 111 | exact hd.continuousAt.continuousWithinAt |
| 112 | |
| 113 | /-- The derivative of the compact parameter integral is the integral of the |
| 114 | genuine parameter derivative. Joint smoothness supplies the local majorant. -/ |
| 115 | theorem compact_parameter_integral_hasFDerivAt (hs : IsOpen s) |
| 116 | (hG : ∀ p ∈ s, ∀ t ∈ Icc (0 : ℝ) 1, |
| 117 | ContDiffAt ℝ ∞ (fun z : Point × ℝ => G z.1 z.2) (p, t)) |
| 118 | {p : Point} (hp : p ∈ s) : |
| 119 | HasFDerivAt (fun q => ∫ t in (0 : ℝ)..1, G q t) |
| 120 | (∫ t in (0 : ℝ)..1, fderiv ℝ (fun q => G q t) p) p := by |
| 121 | have hcont : ContinuousOn (fun z : Point × ℝ => G z.1 z.2) (s ×ˢ Icc (0 : ℝ) 1) := by |
| 122 | rintro ⟨q, t⟩ ⟨hq, ht⟩ |
| 123 | exact (hG q hq t ht).continuousAt.continuousWithinAt |
| 124 | have hD := compact_parameter_fderiv_continuous hG |
| 125 | obtain ⟨ε, hε, hεs⟩ := nhds_basis_closedBall.mem_iff.mp (hs.mem_nhds hp) |
| 126 | have hcompact : IsCompact (closedBall p ε ×ˢ Icc (0 : ℝ) 1) := |
| 127 | (isCompact_closedBall p ε).prod isCompact_Icc |
| 128 | obtain ⟨C, hC⟩ := hcompact.exists_bound_of_continuousOn |
| 129 | (hD.mono (Set.prod_mono hεs Subset.rfl)) |
| 130 | have hslice : ∀ q ∈ s, ContinuousOn (G q) (Icc (0 : ℝ) 1) := by |
| 131 | intro q hq |
| 132 | exact hcont.comp (continuous_const.prodMk continuous_id).continuousOn (fun t ht => ⟨hq, ht⟩) |
| 133 | have hDslice : ContinuousOn (fun t => fderiv ℝ (fun q => G q t) p) (Icc (0 : ℝ) 1) := |
| 134 | hD.comp (continuous_const.prodMk continuous_id).continuousOn (fun t ht => ⟨hp, ht⟩) |
| 135 | apply intervalIntegral.hasFDerivAt_integral_of_dominated_of_fderiv_le |
| 136 | (F := G) (F' := fun q t => fderiv ℝ (fun y => G y t) q) |
| 137 | (bound := fun _ => C) (Metric.ball_mem_nhds _ hε) |
| 138 | · filter_upwards [hs.mem_nhds hp] with q hq |
| 139 | simpa only [uIoc_of_le zero_le_one] using |
| 140 | ((hslice q hq).mono Ioc_subset_Icc_self).aestronglyMeasurable measurableSet_Ioc |
| 141 | · exact (hslice p hp).intervalIntegrable_of_Icc zero_le_one |
| 142 | · simpa only [uIoc_of_le zero_le_one] using |
| 143 | (hDslice.mono Ioc_subset_Icc_self).aestronglyMeasurable measurableSet_Ioc |
| 144 | · apply Filter.Eventually.of_forall |
| 145 | intro t ht q hq |
| 146 | rw [uIoc_of_le zero_le_one] at ht |
| 147 | exact hC (q, t) ⟨ball_subset_closedBall hq, ht.1.le, ht.2⟩ |
| 148 | · exact intervalIntegrable_const |
| 149 | · apply Filter.Eventually.of_forall |
| 150 | intro t ht q hq |
| 151 | rw [uIoc_of_le zero_le_one] at ht |
| 152 | exact (((hG q (hεs (ball_subset_closedBall hq)) t ⟨ht.1.le, ht.2⟩).comp q |
| 153 | (contDiffAt_id.prodMk contDiffAt_const)).differentiableAt (by simp)).hasFDerivAt |
| 154 | |
| 155 | end CompactParameterIntegral |
| 156 | |
| 157 | /-- Regular radial average, including its value at the axis. -/ |
| 158 | def average (F : Field) (p : Point) : ℝ := ∫ t in (0 : ℝ)..1, F (t * p.1, p.2) |
| 159 | |
| 160 | /-- Actual radial history from the axis. -/ |
| 161 | def primitive (F : Field) (p : Point) : ℝ := ∫ x in (0 : ℝ)..p.1, F (x, p.2) |
| 162 | |
| 163 | theorem primitive_eq_mul_average (F : Field) (p : Point) : |
| 164 | primitive F p = p.1 * average F p := by |
| 165 | simpa only [primitive, average, smul_eq_mul, zero_mul, one_mul] using |
| 166 | (intervalIntegral.smul_integral_comp_mul_right (fun x => F (x, p.2)) p.1 |
| 167 | (a := (0 : ℝ)) (b := 1)).symm |
| 168 | |
| 169 | theorem average_at_axis (F : Field) (η : ℝ) : average F (0, η) = F (0, η) := by |
| 170 | simp [average] |
| 171 | |
| 172 | theorem primitive_at_axis (F : Field) (η : ℝ) : primitive F (0, η) = 0 := by |
| 173 | simp [primitive] |
| 174 | |
| 175 | theorem average_integrand_smooth (D : RadialDomain) {F : Field} |
| 176 | (hF : ContDiffOn ℝ ∞ F D.carrier) (p : Point) (hp : p ∈ D.carrier) |
| 177 | (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |
| 178 | ContDiffAt ℝ ∞ (fun z : Point × ℝ => F (z.2 * z.1.1, z.1.2)) (p, t) := by |
| 179 | apply (hF.contDiffAt (D.isOpen.mem_nhds (D.scale_mem p hp t ht))).comp (p, t) |
| 180 | exact (contDiffAt_snd.mul contDiffAt_fst.fst).prodMk contDiffAt_fst.snd |
| 181 | |
| 182 | theorem average_smooth (D : RadialDomain) {F : Field} |
| 183 | (hF : ContDiffOn ℝ ∞ F D.carrier) : ContDiffOn ℝ ∞ (average F) D.carrier := |
| 184 | compact_parameter_integral_smooth D.isOpen (average_integrand_smooth D hF) |
| 185 | |
| 186 | theorem primitive_smooth (D : RadialDomain) {F : Field} |
| 187 | (hF : ContDiffOn ℝ ∞ F D.carrier) : ContDiffOn ℝ ∞ (primitive F) D.carrier := by |
| 188 | have heq : primitive F = fun p => p.1 * average F p := funext (primitive_eq_mul_average F) |
| 189 | rw [heq] |
| 190 | exact contDiffOn_fst.mul (average_smooth D hF) |
| 191 | |
| 192 | theorem RadialDomain.segment_mem (D : RadialDomain) {p : Point} |
| 193 | (hp : p ∈ D.carrier) {x : ℝ} (hx : x ∈ uIcc 0 p.1) : (x, p.2) ∈ D.carrier := by |
| 194 | rcases lt_trichotomy p.1 0 with hn | hz | hp' |
| 195 | · rw [uIcc_of_ge hn.le] at hx |
| 196 | have ht : x / p.1 ∈ Icc (0 : ℝ) 1 := |
| 197 | ⟨div_nonneg_of_nonpos hx.2 hn.le, (div_le_one_of_neg hn).2 hx.1⟩ |
| 198 | simpa only [div_mul_cancel₀ _ hn.ne] using D.scale_mem p hp (x / p.1) ht |
| 199 | · have hx0 : x = 0 := by simpa only [hz, uIcc_self, mem_singleton_iff] using hx |
| 200 | have hp' : (p.1, p.2) ∈ D.carrier := hp |
| 201 | simpa only [hx0, hz] using hp' |
| 202 | · rw [uIcc_of_le hp'.le] at hx |
| 203 | have ht : x / p.1 ∈ Icc (0 : ℝ) 1 := |
| 204 | ⟨div_nonneg hx.1 hp'.le, (div_le_one hp').2 hx.2⟩ |
| 205 | simpa only [div_mul_cancel₀ _ hp'.ne'] using D.scale_mem p hp (x / p.1) ht |
| 206 | |
| 207 | theorem radial_slice_continuous (D : RadialDomain) {F : Field} |
| 208 | (hF : ContDiffOn ℝ ∞ F D.carrier) (η : ℝ) : |
| 209 | ContinuousOn (fun x => F (x, η)) {x | (x, η) ∈ D.carrier} := |
| 210 | hF.continuousOn.comp (continuous_id.prodMk continuous_const).continuousOn |
| 211 | (fun _ hx => hx) |
| 212 | |
| 213 | theorem radial_slice_intervalIntegrable (D : RadialDomain) {F : Field} |
| 214 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 215 | IntervalIntegrable (fun x => F (x, p.2)) volume 0 p.1 := |
| 216 | ((radial_slice_continuous D hF p.2).mono (fun _ hx => D.segment_mem hp hx)).intervalIntegrable |
| 217 | |
| 218 | /-- The history has its defining integrand as genuine radial derivative. -/ |
| 219 | theorem primitive_hasDerivAt (D : RadialDomain) {F : Field} |
| 220 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 221 | HasDerivAt (fun x => primitive F (x, p.2)) (F p) p.1 := by |
| 222 | have hs : IsOpen {x | (x, p.2) ∈ D.carrier} := |
| 223 | D.isOpen.preimage (continuous_id.prodMk continuous_const) |
| 224 | have hc := radial_slice_continuous D hF p.2 |
| 225 | simpa only [primitive, Prod.eta] using intervalIntegral.integral_hasDerivAt_right |
| 226 | (radial_slice_intervalIntegrable D hF hp) |
| 227 | (hc.stronglyMeasurableAtFilter hs p.1 hp) |
| 228 | (hc.continuousAt (hs.mem_nhds hp)) |
| 229 | |
| 230 | theorem radialPartial_primitive (D : RadialDomain) {F : Field} |
| 231 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 232 | radialPartial (primitive F) p = F p := |
| 233 | (radialPartial_hasDerivAt D (primitive_smooth D hF) hp).unique (primitive_hasDerivAt D hF hp) |
| 234 | |
| 235 | theorem compact_parameter_integral_parameterPartial {s : Set Point} {G : Point → ℝ → ℝ} |
| 236 | (hs : IsOpen s) |
| 237 | (hG : ∀ p ∈ s, ∀ t ∈ Icc (0 : ℝ) 1, |
| 238 | ContDiffAt ℝ ∞ (fun z : Point × ℝ => G z.1 z.2) (p, t)) |
| 239 | {p : Point} (hp : p ∈ s) : |
| 240 | parameterPartial (fun q => ∫ t in (0 : ℝ)..1, G q t) p = |
| 241 | ∫ t in (0 : ℝ)..1, parameterPartial (fun q => G q t) p := by |
| 242 | have hi : IntervalIntegrable (fun t => fderiv ℝ (fun q => G q t) p) volume 0 1 := |
| 243 | ((compact_parameter_fderiv_continuous hG).comp |
| 244 | (continuous_const.prodMk continuous_id).continuousOn (fun _ ht => ⟨hp, ht⟩)).intervalIntegrable_of_Icc zero_le_one |
| 245 | unfold parameterPartial |
| 246 | rw [(compact_parameter_integral_hasFDerivAt hs hG hp).fderiv] |
| 247 | exact ContinuousLinearMap.intervalIntegral_apply hi (0, 1) |
| 248 | |
| 249 | /-- Parameter differentiation commutes with the regular average, including at X=0. -/ |
| 250 | theorem parameterPartial_average (D : RadialDomain) {F : Field} |
| 251 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 252 | parameterPartial (average F) p = average (parameterPartial F) p := by |
| 253 | change parameterPartial (fun q => ∫ t in (0 : ℝ)..1, F (t * q.1, q.2)) p = _ |
| 254 | rw [compact_parameter_integral_parameterPartial D.isOpen |
| 255 | (average_integrand_smooth D hF) hp] |
| 256 | apply intervalIntegral.integral_congr |
| 257 | intro t ht |
| 258 | rw [uIcc_of_le zero_le_one] at ht |
| 259 | have hg : DifferentiableAt ℝ (fun q : Point => F (t * q.1, q.2)) p := |
| 260 | (((average_integrand_smooth D hF p hp t ht).comp p |
| 261 | (contDiffAt_id.prodMk contDiffAt_const)).differentiableAt (by simp)) |
| 262 | have hd : HasDerivAt (fun η => F (t * p.1, η)) |
| 263 | (parameterPartial (fun q : Point => F (t * q.1, q.2)) p) p.2 := by |
| 264 | simpa only [parameterPartial, Function.comp_def, id_eq, Prod.eta] using |
| 265 | hg.hasFDerivAt.comp_hasDerivAt p.2 |
| 266 | ((hasDerivAt_const p.2 p.1).prodMk (hasDerivAt_id p.2)) |
| 267 | exact hd.unique (parameterPartial_hasDerivAt D hF (D.scale_mem p hp t ht)) |
| 268 | |
| 269 | /-- The parameter derivative of a history is the actual history of the |
| 270 | parameter derivative; no history derivative is assumed. -/ |
| 271 | theorem parameterPartial_primitive (D : RadialDomain) {F : Field} |
| 272 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 273 | parameterPartial (primitive F) p = primitive (parameterPartial F) p := by |
| 274 | have hd := (parameterPartial_hasDerivAt D (average_smooth D hF) hp).const_mul p.1 |
| 275 | rw [parameterPartial_average D hF hp] at hd |
| 276 | have hd' : HasDerivAt (fun η => primitive F (p.1, η)) |
| 277 | (primitive (parameterPartial F) p) p.2 := by |
| 278 | simpa only [primitive_eq_mul_average] using hd |
| 279 | exact (parameterPartial_hasDerivAt D (primitive_smooth D hF) hp).unique hd' |
| 280 | |
| 281 | /-- Mixed radial/parameter differentiation of an actual history. -/ |
| 282 | theorem parameterPartial_primitive_hasDerivAt (D : RadialDomain) {F : Field} |
| 283 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 284 | HasDerivAt (fun x => parameterPartial (primitive F) (x, p.2)) |
| 285 | (parameterPartial F p) p.1 := by |
| 286 | apply (primitive_hasDerivAt D (parameterPartial_smooth D hF) hp).congr_of_eventuallyEq |
| 287 | have hn : ∀ᶠ x in 𝓝 p.1, (x, p.2) ∈ D.carrier := |
| 288 | (continuous_id.prodMk continuous_const).continuousAt (D.isOpen.mem_nhds hp) |
| 289 | filter_upwards [hn] with x hx |
| 290 | exact parameterPartial_primitive D hF hx |
| 291 | |
| 292 | theorem parameterPartial_primitive_at_axis (D : RadialDomain) {F : Field} |
| 293 | (hF : ContDiffOn ℝ ∞ F D.carrier) {η : ℝ} (hη : (0, η) ∈ D.carrier) : |
| 294 | parameterPartial (primitive F) (0, η) = 0 := by |
| 295 | rw [parameterPartial_primitive D hF hη, primitive_at_axis] |
| 296 | |
| 297 | theorem average_eq_quotient (F : Field) {p : Point} (hX : p.1 ≠ 0) : |
| 298 | average F p = primitive F p / p.1 := by |
| 299 | rw [primitive_eq_mul_average, mul_div_cancel_left₀ _ hX] |
| 300 | |
| 301 | /-- Smooth profiles and an arbitrary smooth axial pressure normalization. |
| 302 | Only local smoothness at the relevant parameter values is required. -/ |
| 303 | structure Profiles (D : RadialDomain) where |
| 304 | f : Field |
| 305 | U : Field |
| 306 | f_smooth : ContDiffOn ℝ ∞ f D.carrier |
| 307 | U_smooth : ContDiffOn ℝ ∞ U D.carrier |
| 308 | pressure0 : ℝ → ℝ |
| 309 | pressure0_smooth : ∀ p ∈ D.carrier, ContDiffAt ℝ ∞ pressure0 p.2 |
| 310 | |
| 311 | namespace Profiles |
| 312 | |
| 313 | open StressAlgebra |
| 314 | |
| 315 | variable {D : RadialDomain} (P : Profiles D) |
| 316 | |
| 317 | def H : Field := fun p => 2 * p.1 * P.f p |
| 318 | def E : Field := fun p => Real.sqrt (2 * p.1) * P.f p |
| 319 | def Eη : Field := fun p => Real.sqrt (2 * p.1) * parameterPartial P.f p |
| 320 | def transportDensity : Field := fun p => P.U p * P.H p |
| 321 | def energyDensity : Field := fun p => P.U p ^ 2 - p.1 * P.f p ^ 2 |
| 322 | def M : Field := primitive P.U |
| 323 | def I : Field := primitive P.H |
| 324 | def J : Field := primitive P.transportDensity |
| 325 | def S : Field := primitive P.energyDensity |
| 326 | def Ubar : Field := average P.U |
| 327 | def pressure : Field := fun p => P.pressure0 p.2 + primitive (fun q => P.f q ^ 2) p |
| 328 | def W (h : ℝ) : Field := fun p => |
| 329 | 1 - 2 * axialExponent h * p.2 * P.Ubar p - |
| 330 | coordinateFactor p.2 * average (parameterPartial P.U) p |
| 331 | |
| 332 | theorem H_smooth : ContDiffOn ℝ ∞ P.H D.carrier := |
| 333 | (contDiffOn_const.mul contDiffOn_fst).mul P.f_smooth |
| 334 | |
| 335 | theorem transportDensity_smooth : ContDiffOn ℝ ∞ P.transportDensity D.carrier := |
| 336 | P.U_smooth.mul P.H_smooth |
| 337 | |
| 338 | theorem energyDensity_smooth : ContDiffOn ℝ ∞ P.energyDensity D.carrier := |
| 339 | (P.U_smooth.pow 2).sub (contDiffOn_fst.mul (P.f_smooth.pow 2)) |
| 340 | |
| 341 | theorem M_smooth : ContDiffOn ℝ ∞ P.M D.carrier := primitive_smooth D P.U_smooth |
| 342 | theorem I_smooth : ContDiffOn ℝ ∞ P.I D.carrier := primitive_smooth D P.H_smooth |
| 343 | theorem J_smooth : ContDiffOn ℝ ∞ P.J D.carrier := primitive_smooth D P.transportDensity_smooth |
| 344 | theorem S_smooth : ContDiffOn ℝ ∞ P.S D.carrier := primitive_smooth D P.energyDensity_smooth |
| 345 | theorem Ubar_smooth : ContDiffOn ℝ ∞ P.Ubar D.carrier := average_smooth D P.U_smooth |
| 346 | |
| 347 | theorem pressure_smooth : ContDiffOn ℝ ∞ P.pressure D.carrier := by |
| 348 | apply ContDiffOn.add _ (primitive_smooth D (P.f_smooth.pow 2)) |
| 349 | intro p hp |
| 350 | exact ((P.pressure0_smooth p hp).comp p contDiffAt_snd).contDiffWithinAt |
| 351 | |
| 352 | theorem W_smooth (h : ℝ) : ContDiffOn ℝ ∞ (P.W h) D.carrier := by |
| 353 | apply ContDiffOn.sub |
| 354 | · exact contDiffOn_const.sub |
| 355 | (((contDiffOn_const.mul contDiffOn_const).mul contDiffOn_snd).mul P.Ubar_smooth) |
| 356 | · exact (contDiffOn_const.sub (contDiffOn_snd.pow 2)).mul |
| 357 | (average_smooth D (parameterPartial_smooth D P.U_smooth)) |
| 358 | |
| 359 | theorem Ubar_at_axis (η : ℝ) : P.Ubar (0, η) = P.U (0, η) := average_at_axis P.U η |
| 360 | |
| 361 | theorem Ubar_eq_mass_quotient {p : Point} (hX : p.1 ≠ 0) : |
| 362 | P.Ubar p = P.M p / p.1 := average_eq_quotient P.U hX |
| 363 | |
| 364 | theorem W_formula (h : ℝ) {p : Point} (hp : p ∈ D.carrier) : |
| 365 | P.W h p = 1 - 2 * axialExponent h * p.2 * P.Ubar p - |
| 366 | coordinateFactor p.2 * parameterPartial P.Ubar p := by |
| 367 | rw [show parameterPartial P.Ubar p = average (parameterPartial P.U) p from |
| 368 | parameterPartial_average D P.U_smooth hp] |
| 369 | rfl |
| 370 | |
| 371 | theorem XW_eq_histories (h : ℝ) (p : Point) : |
| 372 | p.1 * P.W h p = p.1 - 2 * axialExponent h * p.2 * P.M p - |
| 373 | coordinateFactor p.2 * primitive (parameterPartial P.U) p := by |
| 374 | simp only [W, M, Ubar, primitive_eq_mul_average] |
| 375 | ring |
| 376 | |
| 377 | /-- The key identity used in both integrations by parts is derived from FTC. -/ |
| 378 | theorem XW_hasDerivAt (h : ℝ) {p : Point} (hp : p ∈ D.carrier) : |
| 379 | HasDerivAt (fun x => x * P.W h (x, p.2)) |
| 380 | (1 - 2 * axialExponent h * p.2 * P.U p - |
| 381 | coordinateFactor p.2 * parameterPartial P.U p) p.1 := by |
| 382 | have hd := ((hasDerivAt_id p.1).sub |
| 383 | ((primitive_hasDerivAt D P.U_smooth hp).const_mul (2 * axialExponent h * p.2))).sub |
| 384 | ((primitive_hasDerivAt D (parameterPartial_smooth D P.U_smooth) hp).const_mul |
| 385 | (coordinateFactor p.2)) |
| 386 | convert! hd using 1 |
| 387 | funext x |
| 388 | exact P.XW_eq_histories h (x, p.2) |
| 389 | |
| 390 | theorem W_balance (h : ℝ) {p : Point} (hp : p ∈ D.carrier) : |
| 391 | P.W h p + p.1 * radialPartial (P.W h) p = |
| 392 | 1 - 2 * axialExponent h * p.2 * P.U p - |
| 393 | coordinateFactor p.2 * parameterPartial P.U p := by |
| 394 | have hd := (hasDerivAt_id p.1).fun_mul (radialPartial_hasDerivAt D (P.W_smooth h) hp) |
| 395 | simpa only [id_eq, Prod.eta, one_mul] using hd.unique (P.XW_hasDerivAt h hp) |
| 396 | |
| 397 | theorem parameterPartial_H {p : Point} (hp : p ∈ D.carrier) : |
| 398 | parameterPartial P.H p = 2 * p.1 * parameterPartial P.f p := by |
| 399 | have hd := (parameterPartial_hasDerivAt D P.f_smooth hp).const_mul (2 * p.1) |
| 400 | exact (parameterPartial_hasDerivAt D P.H_smooth hp).unique hd |
| 401 | |
| 402 | theorem parameterPartial_transportDensity {p : Point} (hp : p ∈ D.carrier) : |
| 403 | parameterPartial P.transportDensity p = |
| 404 | parameterPartial P.U p * P.H p + P.U p * parameterPartial P.H p := |
| 405 | (parameterPartial_hasDerivAt D P.transportDensity_smooth hp).unique |
| 406 | ((parameterPartial_hasDerivAt D P.U_smooth hp).mul |
| 407 | (parameterPartial_hasDerivAt D P.H_smooth hp)) |
| 408 | |
| 409 | theorem parameterPartial_energyDensity {p : Point} (hp : p ∈ D.carrier) : |
| 410 | parameterPartial P.energyDensity p = 2 * P.U p * parameterPartial P.U p - |
| 411 | 2 * p.1 * P.f p * parameterPartial P.f p := by |
| 412 | have hd := ((parameterPartial_hasDerivAt D P.U_smooth hp).pow 2).sub |
| 413 | (((parameterPartial_hasDerivAt D P.f_smooth hp).fun_pow 2).const_mul p.1) |
| 414 | have heq := (parameterPartial_hasDerivAt D P.energyDensity_smooth hp).unique hd |
| 415 | simpa only [Nat.cast_ofNat, pow_one, Nat.reduceSub] using heq.trans (by ring) |
| 416 | |
| 417 | theorem E_sq {p : Point} (hX : 0 ≤ p.1) : P.E p ^ 2 / 2 = p.1 * P.f p ^ 2 := by |
| 418 | have hs : (Real.sqrt (2 * p.1)) ^ 2 = 2 * p.1 := Real.sq_sqrt (by positivity) |
| 419 | simp only [E, mul_pow, hs] |
| 420 | ring |
| 421 | |
| 422 | theorem E_mul_Eη {p : Point} (hX : 0 ≤ p.1) : |
| 423 | P.E p * P.Eη p = 2 * p.1 * P.f p * parameterPartial P.f p := by |
| 424 | have hs : (Real.sqrt (2 * p.1)) ^ 2 = 2 * p.1 := Real.sq_sqrt (by positivity) |
| 425 | dsimp [E, Eη] |
| 426 | calc |
| 427 | _ = Real.sqrt (2 * p.1) ^ 2 * P.f p * parameterPartial P.f p := by ring |
| 428 | _ = _ := by rw [hs] |
| 429 | |
| 430 | theorem Eη_hasDerivAt {p : Point} (hp : p ∈ D.carrier) : |
| 431 | HasDerivAt (fun η => P.E (p.1, η)) (P.Eη p) p.2 := |
| 432 | (parameterPartial_hasDerivAt D P.f_smooth hp).const_mul (Real.sqrt (2 * p.1)) |
| 433 | |
| 434 | theorem pressure_hasDerivAt {p : Point} (hp : p ∈ D.carrier) : |
| 435 | HasDerivAt (fun x => P.pressure (x, p.2)) (P.f p ^ 2) p.1 := by |
| 436 | unfold pressure |
| 437 | simpa only [zero_add] using |
| 438 | (hasDerivAt_const p.1 (P.pressure0 p.2)).fun_add |
| 439 | (primitive_hasDerivAt D (P.f_smooth.pow 2) hp) |
| 440 | |
| 441 | theorem radialPartial_pressure {p : Point} (hp : p ∈ D.carrier) : |
| 442 | radialPartial P.pressure p = P.f p ^ 2 := |
| 443 | (radialPartial_hasDerivAt D P.pressure_smooth hp).unique (P.pressure_hasDerivAt hp) |
| 444 | |
| 445 | theorem parameterPartial_pressure {p : Point} (hp : p ∈ D.carrier) : |
| 446 | parameterPartial P.pressure p = deriv P.pressure0 p.2 + |
| 447 | parameterPartial (primitive (fun q => P.f q ^ 2)) p := by |
| 448 | exact (parameterPartial_hasDerivAt D P.pressure_smooth hp).unique |
| 449 | (((P.pressure0_smooth p hp).differentiableAt (by simp)).hasDerivAt.add |
| 450 | (parameterPartial_hasDerivAt D (primitive_smooth D (P.f_smooth.pow 2)) hp)) |
| 451 | |
| 452 | theorem parameterPartial_pressure_hasDerivAt {p : Point} (hp : p ∈ D.carrier) : |
| 453 | HasDerivAt (fun x => parameterPartial P.pressure (x, p.2)) |
| 454 | (2 * P.f p * parameterPartial P.f p) p.1 := by |
| 455 | have hd := (hasDerivAt_const p.1 (deriv P.pressure0 p.2)).add |
| 456 | (parameterPartial_primitive_hasDerivAt D (P.f_smooth.pow 2) hp) |
| 457 | have hder : parameterPartial (fun q => P.f q ^ 2) p = |
| 458 | 2 * P.f p * parameterPartial P.f p := by |
| 459 | exact (parameterPartial_hasDerivAt D (P.f_smooth.pow 2) hp).unique |
| 460 | (by simpa only [Nat.cast_ofNat, pow_one, Nat.reduceSub] using |
| 461 | (parameterPartial_hasDerivAt D P.f_smooth hp).fun_pow 2) |
| 462 | rw [hder, zero_add] at hd |
| 463 | apply hd.congr_of_eventuallyEq |
| 464 | have hn : ∀ᶠ x in 𝓝 p.1, (x, p.2) ∈ D.carrier := |
| 465 | (continuous_id.prodMk continuous_const).continuousAt (D.isOpen.mem_nhds hp) |
| 466 | filter_upwards [hn] with x hx |
| 467 | exact P.parameterPartial_pressure hx |
| 468 | |
| 469 | theorem axis_mem {p : Point} (hp : p ∈ D.carrier) : (0, p.2) ∈ D.carrier := by |
| 470 | simpa only [zero_mul] using D.scale_mem p hp 0 ⟨le_rfl, zero_le_one⟩ |
| 471 | |
| 472 | /-- Every field and every derivative in the angular stress data is obtained |
| 473 | from the actual profiles and the actual integral histories. -/ |
| 474 | noncomputable def angularData (h : ℝ) (p : Point) (hp : p ∈ D.carrier) : |
| 475 | AngularMomentData h p.2 p.1 where |
| 476 | W := fun x => P.W h (x, p.2) |
| 477 | Wx := fun x => radialPartial (P.W h) (x, p.2) |
| 478 | H := fun x => P.H (x, p.2) |
| 479 | Hx := fun x => radialPartial P.H (x, p.2) |
| 480 | Hη := fun x => parameterPartial P.H (x, p.2) |
| 481 | U := fun x => P.U (x, p.2) |
| 482 | Uη := fun x => parameterPartial P.U (x, p.2) |
| 483 | I := fun x => P.I (x, p.2) |
| 484 | Iη := fun x => parameterPartial P.I (x, p.2) |
| 485 | J := fun x => P.J (x, p.2) |
| 486 | Jη := fun x => parameterPartial P.J (x, p.2) |
| 487 | W_deriv := fun _ hx => radialPartial_hasDerivAt D (P.W_smooth h) (D.segment_mem hp hx) |
| 488 | H_deriv := fun _ hx => radialPartial_hasDerivAt D P.H_smooth (D.segment_mem hp hx) |
| 489 | I_deriv := fun _ hx => primitive_hasDerivAt D P.H_smooth (D.segment_mem hp hx) |
| 490 | Iη_deriv := fun _ hx => parameterPartial_primitive_hasDerivAt D P.H_smooth (D.segment_mem hp hx) |
| 491 | J_deriv := fun _ hx => primitive_hasDerivAt D P.transportDensity_smooth (D.segment_mem hp hx) |
| 492 | Jη_deriv := by |
| 493 | intro x hx |
| 494 | apply (parameterPartial_primitive_hasDerivAt D P.transportDensity_smooth |
| 495 | (D.segment_mem hp hx)).congr_deriv |
| 496 | exact P.parameterPartial_transportDensity (D.segment_mem hp hx) |
| 497 | W_balance := fun _ hx => P.W_balance h (D.segment_mem hp hx) |
| 498 | I_zero := primitive_at_axis P.H p.2 |
| 499 | Iη_zero := parameterPartial_primitive_at_axis D P.H_smooth (axis_mem hp) |
| 500 | J_zero := primitive_at_axis P.transportDensity p.2 |
| 501 | Jη_zero := parameterPartial_primitive_at_axis D P.transportDensity_smooth (axis_mem hp) |
| 502 | |
| 503 | /-- The axial data also use the pressure constructed by integrating f². -/ |
| 504 | noncomputable def axialData (h : ℝ) (p : Point) (hp : p ∈ D.carrier) (hX : 0 ≤ p.1) : |
| 505 | AxialMomentData h p.2 p.1 where |
| 506 | W := fun x => P.W h (x, p.2) |
| 507 | Wx := fun x => radialPartial (P.W h) (x, p.2) |
| 508 | U := fun x => P.U (x, p.2) |
| 509 | Ux := fun x => radialPartial P.U (x, p.2) |
| 510 | Uη := fun x => parameterPartial P.U (x, p.2) |
| 511 | E := fun x => P.E (x, p.2) |
| 512 | Eη := fun x => P.Eη (x, p.2) |
| 513 | P := fun x => P.pressure (x, p.2) |
| 514 | Px := fun x => P.f (x, p.2) ^ 2 |
| 515 | Pη := fun x => parameterPartial P.pressure (x, p.2) |
| 516 | Pηx := fun x => 2 * P.f (x, p.2) * parameterPartial P.f (x, p.2) |
| 517 | M := fun x => P.M (x, p.2) |
| 518 | Mη := fun x => parameterPartial P.M (x, p.2) |
| 519 | S := fun x => P.S (x, p.2) |
| 520 | Sη := fun x => parameterPartial P.S (x, p.2) |
| 521 | W_deriv := fun _ hx => radialPartial_hasDerivAt D (P.W_smooth h) (D.segment_mem hp hx) |
| 522 | U_deriv := fun _ hx => radialPartial_hasDerivAt D P.U_smooth (D.segment_mem hp hx) |
| 523 | M_deriv := fun _ hx => primitive_hasDerivAt D P.U_smooth (D.segment_mem hp hx) |
| 524 | Mη_deriv := fun _ hx => parameterPartial_primitive_hasDerivAt D P.U_smooth (D.segment_mem hp hx) |
| 525 | S_deriv := by |
| 526 | intro x hx |
| 527 | have hx0 : 0 ≤ x := (show x ∈ Icc 0 p.1 by simpa only [uIcc_of_le hX] using hx).1 |
| 528 | apply (primitive_hasDerivAt D P.energyDensity_smooth (D.segment_mem hp hx)).congr_deriv |
| 529 | rw [P.E_sq hx0] |
| 530 | rfl |
| 531 | Sη_deriv := by |
| 532 | intro x hx |
| 533 | have hx0 : 0 ≤ x := (show x ∈ Icc 0 p.1 by simpa only [uIcc_of_le hX] using hx).1 |
| 534 | apply (parameterPartial_primitive_hasDerivAt D P.energyDensity_smooth |
| 535 | (D.segment_mem hp hx)).congr_deriv |
| 536 | rw [P.parameterPartial_energyDensity (D.segment_mem hp hx), P.E_mul_Eη hx0] |
| 537 | P_deriv := fun _ hx => P.pressure_hasDerivAt (D.segment_mem hp hx) |
| 538 | Pη_deriv := fun _ hx => P.parameterPartial_pressure_hasDerivAt (D.segment_mem hp hx) |
| 539 | W_balance := fun _ hx => P.W_balance h (D.segment_mem hp hx) |
| 540 | pressure_balance := by |
| 541 | intro x hx |
| 542 | have hx0 : 0 ≤ x := (show x ∈ Icc 0 p.1 by simpa only [uIcc_of_le hX] using hx).1 |
| 543 | exact (P.E_sq (p := (x, p.2)) hx0).symm |
| 544 | pressure_η_balance := by |
| 545 | intro x hx |
| 546 | have hx0 : 0 ≤ x := (show x ∈ Icc 0 p.1 by simpa only [uIcc_of_le hX] using hx).1 |
| 547 | rw [P.E_mul_Eη hx0] |
| 548 | ring |
| 549 | M_zero := primitive_at_axis P.U p.2 |
| 550 | Mη_zero := parameterPartial_primitive_at_axis D P.U_smooth (axis_mem hp) |
| 551 | S_zero := primitive_at_axis P.energyDensity p.2 |
| 552 | Sη_zero := parameterPartial_primitive_at_axis D P.energyDensity_smooth (axis_mem hp) |
| 553 | |
| 554 | def angularSource (h : ℝ) : Field := fun p => |
| 555 | StressAlgebra.angularSource h p.2 p.1 (P.W h p) (P.U p) (P.H p) |
| 556 | (radialPartial P.H p) (parameterPartial P.H p) |
| 557 | |
| 558 | def axialSource (h : ℝ) : Field := fun p => |
| 559 | StressAlgebra.axialSource h p.2 p.1 (P.W h p) (P.U p) |
| 560 | (radialPartial P.U p) (parameterPartial P.U p) (P.pressure p) |
| 561 | (P.f p ^ 2) (parameterPartial P.pressure p) |
| 562 | |
| 563 | theorem angularSource_smooth (h : ℝ) : ContDiffOn ℝ ∞ (P.angularSource h) D.carrier := by |
| 564 | exact ((((P.W_smooth h).neg.mul contDiffOn_fst).mul (radialPartial_smooth D P.H_smooth)).sub |
| 565 | ((contDiffOn_const.mul (contDiffOn_const.sub |
| 566 | ((contDiffOn_const.mul contDiffOn_snd).mul P.U_smooth))).mul P.H_smooth)).sub |
| 567 | (((contDiffOn_const.mul contDiffOn_snd).add |
| 568 | ((contDiffOn_const.sub (contDiffOn_snd.pow 2)).mul P.U_smooth)).mul |
| 569 | (parameterPartial_smooth D P.H_smooth)) |
| 570 | |
| 571 | theorem axialSource_smooth (h : ℝ) : ContDiffOn ℝ ∞ (P.axialSource h) D.carrier := by |
| 572 | exact (((((((P.W_smooth h).neg.mul contDiffOn_fst).mul |
| 573 | (radialPartial_smooth D P.U_smooth)).sub |
| 574 | ((contDiffOn_const.mul (contDiffOn_const.sub |
| 575 | ((contDiffOn_const.mul contDiffOn_snd).mul P.U_smooth))).mul P.U_smooth)).sub |
| 576 | (((contDiffOn_const.mul contDiffOn_snd).add |
| 577 | ((contDiffOn_const.sub (contDiffOn_snd.pow 2)).mul P.U_smooth)).mul |
| 578 | (parameterPartial_smooth D P.U_smooth))).sub |
| 579 | ((contDiffOn_const.sub (contDiffOn_snd.pow 2)).mul |
| 580 | (parameterPartial_smooth D P.pressure_smooth))).add |
| 581 | (((contDiffOn_const.mul contDiffOn_const).mul contDiffOn_snd).mul P.pressure_smooth)).add |
| 582 | (((contDiffOn_const.mul contDiffOn_snd).mul contDiffOn_fst).mul (P.f_smooth.pow 2)) |
| 583 | |
| 584 | /-- The printed Q_s is the regular primitive divided by its integrating factor. -/ |
| 585 | def angularLag (h : ℝ) : Field := fun p => primitive (P.angularSource h) p / (p.1 * P.H p) |
| 586 | |
| 587 | /-- The printed N_s is the regular primitive divided by X. -/ |
| 588 | def axialLag (h : ℝ) : Field := fun p => primitive (P.axialSource h) p / p.1 |
| 589 | |
| 590 | /-- Equation (9), angular row, for actual smooth profile histories. -/ |
| 591 | theorem angularLag_integrated (h : ℝ) {p : Point} (hp : p ∈ D.carrier) |
| 592 | (hX : p.1 ≠ 0) (hH : P.H p ≠ 0) : |
| 593 | P.angularLag h p = -P.W h p + |
| 594 | ((1 - h) * P.I p - axialExponent h * p.2 * parameterPartial P.I p - |
| 595 | coordinateFactor p.2 * parameterPartial P.J p + |
| 596 | 2 * (h - axialExponent h) * p.2 * P.J p) / (p.1 * P.H p) := by |
| 597 | exact angular_integrated_lag (P.angularData h p hp) hX hH |
| 598 | (radial_slice_intervalIntegrable D (P.angularSource_smooth h) hp) |
| 599 | |
| 600 | /-- Equation (9), axial row, with constructed pressure and actual histories. -/ |
| 601 | theorem axialLag_integrated (h : ℝ) {p : Point} (hp : p ∈ D.carrier) (hX : 0 < p.1) : |
| 602 | P.axialLag h p = -P.W h p * P.U p + |
| 603 | axialExponent h * (P.M p - p.2 * parameterPartial P.M p) / p.1 + |
| 604 | (4 * h * p.2 * P.S p - coordinateFactor p.2 * parameterPartial P.S p) / p.1 + |
| 605 | 4 * velocityExponent h * p.2 * P.pressure p - coordinateFactor p.2 * parameterPartial P.pressure p := by |
| 606 | exact axial_integrated_lag (P.axialData h p hp hX.le) hX.ne' |
| 607 | (radial_slice_intervalIntegrable D (P.axialSource_smooth h) hp) |
| 608 | |
| 609 | theorem angularLag_smoothAt (h : ℝ) {p : Point} (hp : p ∈ D.carrier) |
| 610 | (hX : p.1 ≠ 0) (hH : P.H p ≠ 0) : ContDiffAt ℝ ∞ (P.angularLag h) p := |
| 611 | ((primitive_smooth D (P.angularSource_smooth h)).contDiffAt (D.isOpen.mem_nhds hp)).div |
| 612 | (contDiffAt_fst.mul (P.H_smooth.contDiffAt (D.isOpen.mem_nhds hp))) (mul_ne_zero hX hH) |
| 613 | |
| 614 | theorem axialLag_smoothAt (h : ℝ) {p : Point} (hp : p ∈ D.carrier) |
| 615 | (hX : p.1 ≠ 0) : ContDiffAt ℝ ∞ (P.axialLag h) p := |
| 616 | ((primitive_smooth D (P.axialSource_smooth h)).contDiffAt (D.isOpen.mem_nhds hp)).div |
| 617 | contDiffAt_fst hX |
| 618 | |
| 619 | theorem angularLag_hasDerivAt (h : ℝ) {p : Point} (hp : p ∈ D.carrier) |
| 620 | (hX : p.1 ≠ 0) (hH : P.H p ≠ 0) : |
| 621 | HasDerivAt (fun x => P.angularLag h (x, p.2)) |
| 622 | ((P.angularSource h p * (p.1 * P.H p) - |
| 623 | primitive (P.angularSource h) p * (P.H p + p.1 * radialPartial P.H p)) / |
| 624 | (p.1 * P.H p) ^ 2) p.1 := by |
| 625 | unfold angularLag |
| 626 | simpa only [id_eq, Prod.eta, one_mul] using |
| 627 | (primitive_hasDerivAt D (P.angularSource_smooth h) hp).fun_div |
| 628 | ((hasDerivAt_id p.1).fun_mul (radialPartial_hasDerivAt D P.H_smooth hp)) |
| 629 | (mul_ne_zero hX hH) |
| 630 | |
| 631 | theorem axialLag_hasDerivAt (h : ℝ) {p : Point} (hp : p ∈ D.carrier) (hX : p.1 ≠ 0) : |
| 632 | HasDerivAt (fun x => P.axialLag h (x, p.2)) |
| 633 | ((P.axialSource h p * p.1 - primitive (P.axialSource h) p) / p.1 ^ 2) p.1 := by |
| 634 | unfold axialLag |
| 635 | simpa only [id_eq, Prod.eta, mul_one] using |
| 636 | (primitive_hasDerivAt D (P.axialSource_smooth h) hp).fun_div (hasDerivAt_id p.1) hX |
| 637 | |
| 638 | /-- The angular differential equation (6), with logarithmic slopes as ratios |
| 639 | of genuine derivatives. -/ |
| 640 | theorem angularLag_equation (h : ℝ) {p : Point} (hp : p ∈ D.carrier) |
| 641 | (hX : p.1 ≠ 0) (hH : P.H p ≠ 0) : |
| 642 | p.1 * deriv (fun x => P.angularLag h (x, p.2)) p.1 + |
| 643 | (1 + p.1 * radialPartial P.H p / P.H p) * P.angularLag h p = |
| 644 | P.angularSource h p / P.H p := by |
| 645 | rw [(P.angularLag_hasDerivAt h hp hX hH).deriv] |
| 646 | unfold angularLag |
| 647 | field_simp ; ring |
| 648 | |
| 649 | /-- The axial differential equation (6), with the actual primitive-defined N_s. -/ |
| 650 | theorem axialLag_equation (h : ℝ) {p : Point} (hp : p ∈ D.carrier) (hX : p.1 ≠ 0) : |
| 651 | p.1 * deriv (fun x => P.axialLag h (x, p.2)) p.1 + P.axialLag h p = |
| 652 | P.axialSource h p := by |
| 653 | rw [(P.axialLag_hasDerivAt h hp hX).deriv] |
| 654 | unfold axialLag |
| 655 | field_simp ; ring |
| 656 | |
| 657 | theorem H_ne_zero {p : Point} (hX : p.1 ≠ 0) (hf : P.f p ≠ 0) : P.H p ≠ 0 := |
| 658 | mul_ne_zero (mul_ne_zero (by norm_num) hX) hf |
| 659 | |
| 660 | theorem E_ne_zero {p : Point} (hX : 0 < p.1) (hf : P.f p ≠ 0) : P.E p ≠ 0 := |
| 661 | mul_ne_zero (ne_of_gt (Real.sqrt_pos.2 (by positivity))) hf |
| 662 | |
| 663 | theorem logH_radial_deriv {p : Point} (hp : p ∈ D.carrier) (hH : P.H p ≠ 0) : |
| 664 | deriv (fun x => Real.log (P.H (x, p.2))) p.1 = radialPartial P.H p / P.H p := |
| 665 | ((radialPartial_hasDerivAt D P.H_smooth hp).log hH).deriv |
| 666 | |
| 667 | theorem logE_parameter_deriv {p : Point} (hp : p ∈ D.carrier) |
| 668 | (hX : 0 < p.1) (hf : P.f p ≠ 0) : |
| 669 | deriv (fun η => Real.log (P.E (p.1, η))) p.2 = parameterPartial P.H p / P.H p := by |
| 670 | rw [((P.Eη_hasDerivAt hp).log (P.E_ne_zero hX hf)).deriv, P.parameterPartial_H hp] |
| 671 | have hs : Real.sqrt (2 * p.1) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 (by positivity)) |
| 672 | dsimp [Eη, E, H] |
| 673 | field_simp |
| 674 | |
| 675 | /-- The angular row of (6) with actual logarithms, not surrogate slope data. -/ |
| 676 | theorem angularLag_equation_logarithmic (h : ℝ) {p : Point} (hp : p ∈ D.carrier) |
| 677 | (hX : 0 < p.1) (hf : P.f p ≠ 0) : |
| 678 | p.1 * deriv (fun x => P.angularLag h (x, p.2)) p.1 + |
| 679 | (1 + p.1 * deriv (fun x => Real.log (P.H (x, p.2))) p.1) * P.angularLag h p = |
| 680 | -P.W h p * (p.1 * deriv (fun x => Real.log (P.H (x, p.2))) p.1) - |
| 681 | h * (1 - 2 * p.2 * P.U p) - |
| 682 | (axialExponent h * p.2 + coordinateFactor p.2 * P.U p) * |
| 683 | deriv (fun η => Real.log (P.E (p.1, η))) p.2 := by |
| 684 | have hH := P.H_ne_zero hX.ne' hf |
| 685 | rw [P.logH_radial_deriv hp hH, P.logE_parameter_deriv hp hX hf] |
| 686 | rw [← mul_div_assoc] |
| 687 | rw [P.angularLag_equation h hp hX.ne' hH] |
| 688 | dsimp [angularSource, StressAlgebra.angularSource] |
| 689 | field_simp |
| 690 | |
| 691 | /-- The axial row of (6), with the pressure derivative proved from its integral. -/ |
| 692 | theorem axialLag_equation_explicit (h : ℝ) {p : Point} (hp : p ∈ D.carrier) (hX : 0 < p.1) : |
| 693 | p.1 * deriv (fun x => P.axialLag h (x, p.2)) p.1 + P.axialLag h p = |
| 694 | -P.W h p * (p.1 * radialPartial P.U p) - |
| 695 | velocityExponent h * (1 - 2 * p.2 * P.U p) * P.U p - |
| 696 | (axialExponent h * p.2 + coordinateFactor p.2 * P.U p) * parameterPartial P.U p - |
| 697 | coordinateFactor p.2 * parameterPartial P.pressure p + |
| 698 | 4 * velocityExponent h * p.2 * P.pressure p + |
| 699 | 2 * p.2 * (p.1 * radialPartial P.pressure p) := by |
| 700 | rw [P.axialLag_equation h hp hX.ne', P.radialPartial_pressure hp] |
| 701 | dsimp [axialSource, StressAlgebra.axialSource] |
| 702 | ring |
| 703 | |
| 704 | end Profiles |
| 705 | |
| 706 | end NavierStokes.ProfileHistories |
| 707 | |
| 708 | end |