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.ActivationBounds |
| 2 | import NavierStokes.NaturalEntrance |
| 3 | |
| 4 | /-! |
| 5 | # Actual lag stocks during the activation ramp |
| 6 | |
| 7 | The stock formulas are obtained from the genuine five profile histories. |
| 8 | Smooth difference factors are constructed from the field and history factors; |
| 9 | no estimate for a stock difference is supplied as an assumption. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | namespace NavierStokes.ActivationStocks |
| 15 | |
| 16 | open Set Filter ProfileHistories StressActivation |
| 17 | open scoped Topology ContDiff |
| 18 | |
| 19 | |
| 20 | noncomputable def massFlux (h X η M Mη : ℝ) : ℝ := |
| 21 | X - 2 * NaturalAxisData.D h * η * M - NaturalAxisData.d η * Mη |
| 22 | |
| 23 | noncomputable def angularRemainder (h η I Iη J Jη : ℝ) : ℝ := |
| 24 | (1 - h) * I - NaturalAxisData.D h * η * Iη - NaturalAxisData.d η * Jη + |
| 25 | 2 * (h - NaturalAxisData.D h) * η * J |
| 26 | |
| 27 | noncomputable def stockOne (h X η f M Mη I Iη J Jη : ℝ) : ℝ := |
| 28 | (-massFlux h X η M Mη + angularRemainder h η I Iη J Jη / (2 * X * f)) / |
| 29 | NaturalAxisData.L h η |
| 30 | |
| 31 | noncomputable def stockTwo (h X η f U M Mη S Sη P Pη : ℝ) : ℝ := |
| 32 | (-massFlux h X η M Mη * U + NaturalAxisData.D h * (M - η * Mη) + |
| 33 | 4 * h * η * S - NaturalAxisData.d η * Sη + |
| 34 | X * (4 * NaturalAxisData.A h * η * P - NaturalAxisData.d η * Pη)) / |
| 35 | (NaturalAxisData.L h η * Real.sqrt (2 * X) * f) |
| 36 | |
| 37 | noncomputable def profileStockOne {D : RadialDomain} (P : Profiles D) (h : ℝ) |
| 38 | (p : Point) : ℝ := p.1 * P.angularLag h p / NaturalAxisData.L h p.2 |
| 39 | |
| 40 | noncomputable def profileStockTwo {D : RadialDomain} (P : Profiles D) (h : ℝ) |
| 41 | (p : Point) : ℝ := p.1 * P.axialLag h p / (NaturalAxisData.L h p.2 * P.E p) |
| 42 | |
| 43 | theorem profile_massFlux {D : RadialDomain} (P : Profiles D) (h : ℝ) |
| 44 | {p : Point} (hp : p ∈ D.carrier) : |
| 45 | p.1 * P.W h p = massFlux h p.1 p.2 (P.M p) (parameterPartial P.M p) := by |
| 46 | rw [P.XW_eq_histories] |
| 47 | have hm : parameterPartial P.M p = primitive (parameterPartial P.U) p := |
| 48 | parameterPartial_primitive D P.U_smooth hp |
| 49 | rw [hm] |
| 50 | rfl |
| 51 | |
| 52 | theorem profileStockOne_eq {D : RadialDomain} (P : Profiles D) (h : ℝ) |
| 53 | {p : Point} (hp : p ∈ D.carrier) (hX : p.1 ≠ 0) (hf : P.f p ≠ 0) : |
| 54 | profileStockOne P h p = stockOne h p.1 p.2 (P.f p) |
| 55 | (P.M p) (parameterPartial P.M p) (P.I p) (parameterPartial P.I p) |
| 56 | (P.J p) (parameterPartial P.J p) := by |
| 57 | rw [profileStockOne, P.angularLag_integrated h hp hX (P.H_ne_zero hX hf)] |
| 58 | change p.1 * (-P.W h p + angularRemainder h p.2 (P.I p) |
| 59 | (parameterPartial P.I p) (P.J p) (parameterPartial P.J p) / (p.1 * P.H p)) / |
| 60 | NaturalAxisData.L h p.2 = _ |
| 61 | calc |
| 62 | _ = (-p.1 * P.W h p + angularRemainder h p.2 (P.I p) |
| 63 | (parameterPartial P.I p) (P.J p) (parameterPartial P.J p) / P.H p) / |
| 64 | NaturalAxisData.L h p.2 := by |
| 65 | congr 1 |
| 66 | rw [mul_add, ← mul_div_assoc, mul_div_mul_left _ _ hX] |
| 67 | ring |
| 68 | _ = _ := by |
| 69 | rw [show -p.1 * P.W h p = -(p.1 * P.W h p) by ring, profile_massFlux P h hp] |
| 70 | rfl |
| 71 | |
| 72 | theorem profileStockTwo_eq {D : RadialDomain} (P : Profiles D) (h : ℝ) |
| 73 | {p : Point} (hp : p ∈ D.carrier) (hX : 0 < p.1) : |
| 74 | profileStockTwo P h p = stockTwo h p.1 p.2 (P.f p) (P.U p) |
| 75 | (P.M p) (parameterPartial P.M p) (P.S p) (parameterPartial P.S p) |
| 76 | (P.pressure p) (parameterPartial P.pressure p) := by |
| 77 | rw [profileStockTwo, P.axialLag_integrated h hp hX] |
| 78 | unfold stockTwo |
| 79 | rw [show NaturalAxisData.L h p.2 * Real.sqrt (2 * p.1) * P.f p = |
| 80 | NaturalAxisData.L h p.2 * P.E p by dsimp only [Profiles.E]; ring] |
| 81 | congr 1 |
| 82 | rw [← profile_massFlux P h hp] |
| 83 | dsimp only [StressAlgebra.axialExponent, StressAlgebra.velocityExponent, |
| 84 | StressAlgebra.coordinateFactor, NaturalAxisData.D, NaturalAxisData.A, NaturalAxisData.d] |
| 85 | field_simp ; ring |
| 86 | |
| 87 | section SmoothPairs |
| 88 | |
| 89 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 90 | |
| 91 | /-- Two actual smooth values with an explicitly constructed smooth factor |
| 92 | for their difference. The following algebra constructs new factors. -/ |
| 93 | structure SmoothPair (Ω : Set E) (w : E → ℝ) where |
| 94 | actual : E → ℝ |
| 95 | reference : E → ℝ |
| 96 | factor : E → ℝ |
| 97 | actual_smooth : ContDiffOn ℝ ∞ actual Ω |
| 98 | reference_smooth : ContDiffOn ℝ ∞ reference Ω |
| 99 | factor_smooth : ContDiffOn ℝ ∞ factor Ω |
| 100 | difference : ∀ p ∈ Ω, actual p - reference p = w p * factor p |
| 101 | |
| 102 | namespace SmoothPair |
| 103 | |
| 104 | variable {Ω : Set E} {w : E → ℝ} |
| 105 | |
| 106 | noncomputable def common (F : E → ℝ) (hF : ContDiffOn ℝ ∞ F Ω) : SmoothPair Ω w where |
| 107 | actual := F |
| 108 | reference := F |
| 109 | factor := fun _ => 0 |
| 110 | actual_smooth := hF |
| 111 | reference_smooth := hF |
| 112 | factor_smooth := contDiffOn_const |
| 113 | difference := by intro p hp; simp |
| 114 | |
| 115 | noncomputable def add (A B : SmoothPair Ω w) : SmoothPair Ω w where |
| 116 | actual := fun p => A.actual p + B.actual p |
| 117 | reference := fun p => A.reference p + B.reference p |
| 118 | factor := fun p => A.factor p + B.factor p |
| 119 | actual_smooth := A.actual_smooth.add B.actual_smooth |
| 120 | reference_smooth := A.reference_smooth.add B.reference_smooth |
| 121 | factor_smooth := A.factor_smooth.add B.factor_smooth |
| 122 | difference := by intro p hp; nlinarith [A.difference p hp, B.difference p hp] |
| 123 | |
| 124 | noncomputable def neg (A : SmoothPair Ω w) : SmoothPair Ω w where |
| 125 | actual := fun p => -A.actual p |
| 126 | reference := fun p => -A.reference p |
| 127 | factor := fun p => -A.factor p |
| 128 | actual_smooth := A.actual_smooth.neg |
| 129 | reference_smooth := A.reference_smooth.neg |
| 130 | factor_smooth := A.factor_smooth.neg |
| 131 | difference := by intro p hp; nlinarith [A.difference p hp] |
| 132 | |
| 133 | noncomputable def sub (A B : SmoothPair Ω w) : SmoothPair Ω w := A.add B.neg |
| 134 | |
| 135 | noncomputable def mul (A B : SmoothPair Ω w) : SmoothPair Ω w where |
| 136 | actual := fun p => A.actual p * B.actual p |
| 137 | reference := fun p => A.reference p * B.reference p |
| 138 | factor := fun p => A.factor p * B.actual p + A.reference p * B.factor p |
| 139 | actual_smooth := A.actual_smooth.mul B.actual_smooth |
| 140 | reference_smooth := A.reference_smooth.mul B.reference_smooth |
| 141 | factor_smooth := (A.factor_smooth.mul B.actual_smooth).add (A.reference_smooth.mul B.factor_smooth) |
| 142 | difference := by |
| 143 | intro p hp |
| 144 | calc |
| 145 | _ = (A.actual p - A.reference p) * B.actual p + |
| 146 | A.reference p * (B.actual p - B.reference p) := by ring |
| 147 | _ = _ := by rw [A.difference p hp, B.difference p hp]; ring |
| 148 | |
| 149 | noncomputable def inv (A : SmoothPair Ω w) |
| 150 | (ha : ∀ p ∈ Ω, A.actual p ≠ 0) (hr : ∀ p ∈ Ω, A.reference p ≠ 0) : SmoothPair Ω w where |
| 151 | actual := fun p => (A.actual p)⁻¹ |
| 152 | reference := fun p => (A.reference p)⁻¹ |
| 153 | factor := fun p => -A.factor p / (A.actual p * A.reference p) |
| 154 | actual_smooth := A.actual_smooth.inv ha |
| 155 | reference_smooth := A.reference_smooth.inv hr |
| 156 | factor_smooth := A.factor_smooth.neg.div (A.actual_smooth.mul A.reference_smooth) |
| 157 | (fun p hp => mul_ne_zero (ha p hp) (hr p hp)) |
| 158 | difference := by |
| 159 | intro p hp |
| 160 | have hpa := ha p hp |
| 161 | have hpr := hr p hp |
| 162 | calc |
| 163 | _ = -(A.actual p - A.reference p) / (A.actual p * A.reference p) := by field_simp ; ring |
| 164 | _ = _ := by rw [A.difference p hp]; ring |
| 165 | |
| 166 | noncomputable def div (A B : SmoothPair Ω w) |
| 167 | (ha : ∀ p ∈ Ω, B.actual p ≠ 0) (hr : ∀ p ∈ Ω, B.reference p ≠ 0) : SmoothPair Ω w := |
| 168 | A.mul (B.inv ha hr) |
| 169 | |
| 170 | end SmoothPair |
| 171 | |
| 172 | end SmoothPairs |
| 173 | |
| 174 | noncomputable def etaD (F : Field) (p : Point) : ℝ := |
| 175 | deriv (fun η => F (p.1, η)) p.2 |
| 176 | |
| 177 | theorem etaD_eq_parameterPartial {D : RadialDomain} {F : Field} |
| 178 | (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : |
| 179 | etaD F p = parameterPartial F p := |
| 180 | (parameterPartial_hasDerivAt D hF hp).deriv |
| 181 | |
| 182 | noncomputable def logViewOne (h X0 : ℝ) (f : Field) (H : HistoryRow → Field) (p : Point) : ℝ := |
| 183 | stockOne h (radius X0 p.1) p.2 (f p) (H .mass p) (etaD (H .mass) p) |
| 184 | (H .angular p) (etaD (H .angular) p) (H .transport p) (etaD (H .transport) p) |
| 185 | |
| 186 | noncomputable def logViewTwo (h X0 : ℝ) (f U : Field) (H : HistoryRow → Field) (p : Point) : ℝ := |
| 187 | stockTwo h (radius X0 p.1) p.2 (f p) (U p) (H .mass p) (etaD (H .mass) p) |
| 188 | (H .energy p) (etaD (H .energy) p) (H .pressure p) (etaD (H .pressure) p) |
| 189 | |
| 190 | theorem etaD_history_identity {D : RadialDomain} (P : Profiles D) (r : HistoryRow) |
| 191 | {J : Set ℝ} (hJ : IsOpen J) {X y η : ℝ} (hη : η ∈ J) {H : Field} |
| 192 | (hmem : (X, η) ∈ D.carrier) |
| 193 | (heq : ∀ ξ ∈ J, H (y, ξ) = profileHistory P r (X, ξ)) : |
| 194 | etaD H (y, η) = parameterPartial (profileHistory P r) (X, η) := by |
| 195 | have hevent : (fun ξ => H (y, ξ)) =ᶠ[𝓝 η] fun ξ => profileHistory P r (X, ξ) := by |
| 196 | filter_upwards [hJ.mem_nhds hη] with ξ hξ |
| 197 | exact heq ξ hξ |
| 198 | exact hevent.deriv_eq.trans (parameterPartial_hasDerivAt D (profileHistory_smooth P r) hmem).deriv |
| 199 | |
| 200 | theorem profileStockOne_logView {D : RadialDomain} (P : Profiles D) (h X0 : ℝ) |
| 201 | {J : Set ℝ} (hJ : IsOpen J) {p : Point} (hη : p.2 ∈ J) |
| 202 | (hmem : (radius X0 p.1, p.2) ∈ D.carrier) (hX : radius X0 p.1 ≠ 0) |
| 203 | {f : Field} {H : HistoryRow → Field} |
| 204 | (hfield : f p = P.f (radius X0 p.1, p.2)) (hf : f p ≠ 0) |
| 205 | (hH : ∀ r ξ, ξ ∈ J → H r (p.1, ξ) = profileHistory P r (radius X0 p.1, ξ)) : |
| 206 | profileStockOne P h (radius X0 p.1, p.2) = logViewOne h X0 f H p := by |
| 207 | have hpf : P.f (radius X0 p.1, p.2) ≠ 0 := hfield ▸ hf |
| 208 | rw [profileStockOne_eq P h hmem hX hpf] |
| 209 | have hd (r : HistoryRow) : etaD (H r) p = |
| 210 | parameterPartial (profileHistory P r) (radius X0 p.1, p.2) := |
| 211 | etaD_history_identity P r hJ hη hmem (hH r) |
| 212 | dsimp only [logViewOne] |
| 213 | rw [hfield, show H .mass p = profileHistory P .mass (radius X0 p.1, p.2) from hH .mass p.2 hη, |
| 214 | show H .angular p = profileHistory P .angular (radius X0 p.1, p.2) from hH .angular p.2 hη, |
| 215 | show H .transport p = profileHistory P .transport (radius X0 p.1, p.2) from hH .transport p.2 hη, |
| 216 | hd .mass, hd .angular, hd .transport] |
| 217 | rfl |
| 218 | |
| 219 | theorem profileStockTwo_logView {D : RadialDomain} (P : Profiles D) (h X0 : ℝ) |
| 220 | {J : Set ℝ} (hJ : IsOpen J) {p : Point} (hη : p.2 ∈ J) |
| 221 | (hmem : (radius X0 p.1, p.2) ∈ D.carrier) (hX : 0 < radius X0 p.1) |
| 222 | {f U : Field} {H : HistoryRow → Field} |
| 223 | (hfield : f p = P.f (radius X0 p.1, p.2)) |
| 224 | (hU : U p = P.U (radius X0 p.1, p.2)) |
| 225 | (hH : ∀ r ξ, ξ ∈ J → H r (p.1, ξ) = profileHistory P r (radius X0 p.1, ξ)) : |
| 226 | profileStockTwo P h (radius X0 p.1, p.2) = logViewTwo h X0 f U H p := by |
| 227 | rw [profileStockTwo_eq P h hmem hX] |
| 228 | have hd (r : HistoryRow) : etaD (H r) p = |
| 229 | parameterPartial (profileHistory P r) (radius X0 p.1, p.2) := |
| 230 | etaD_history_identity P r hJ hη hmem (hH r) |
| 231 | dsimp only [logViewTwo] |
| 232 | rw [hfield, hU, |
| 233 | show H .mass p = profileHistory P .mass (radius X0 p.1, p.2) from hH .mass p.2 hη, |
| 234 | show H .energy p = profileHistory P .energy (radius X0 p.1, p.2) from hH .energy p.2 hη, |
| 235 | show H .pressure p = profileHistory P .pressure (radius X0 p.1, p.2) from hH .pressure p.2 hη, |
| 236 | hd .mass, hd .energy, hd .pressure] |
| 237 | rfl |
| 238 | |
| 239 | namespace FromReference |
| 240 | |
| 241 | open ReferencePath |
| 242 | |
| 243 | variable (N : ReferencePath.Input) |
| 244 | |
| 245 | noncomputable def initial {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 246 | (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) : HistoryRow → ℝ → ℝ := |
| 247 | fun r η => profileHistory (N.histories hδ hδT P0 hP0) r (N.endpoint, η) |
| 248 | |
| 249 | theorem initial_smooth {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 250 | (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) (r : HistoryRow) : |
| 251 | ContDiffOn ℝ ∞ (initial N hδ hδT P0 hP0 r) parameterInterval := by |
| 252 | apply (profileHistory_smooth (N.histories hδ hδT P0 hP0) r).comp |
| 253 | (contDiff_const.prodMk contDiff_id).contDiffOn |
| 254 | intro η hη |
| 255 | simpa only [radius, Real.exp_zero, mul_one, id_eq] using |
| 256 | StressActivation.FromReference.log_radius_mem N 0 hη |
| 257 | |
| 258 | theorem actual_stockOne_logView {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) |
| 259 | (hδT : 2 * δ < rampLimit) (κ h : ℝ) (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) |
| 260 | (y : ℝ) {η : ℝ} (hη : η ∈ parameterInterval) : |
| 261 | profileStockOne (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) h |
| 262 | (radius N.endpoint y, η) = |
| 263 | logViewOne h N.endpoint (activatedAngular T κ (StressActivation.FromReference.refLog N δ)) |
| 264 | (logHistory N.endpoint (initial N hδ hδT P0 hP0) |
| 265 | (activatedAngular T κ (StressActivation.FromReference.refLog N δ)) |
| 266 | (controlled T κ (StressActivation.FromReference.refAxial N δ))) (y, η) := by |
| 267 | apply profileStockOne_logView (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) |
| 268 | h N.endpoint parameterInterval_open (p := (y, η)) hη |
| 269 | (StressActivation.FromReference.log_radius_mem N y hη) |
| 270 | (mul_pos N.endpoint_pos (Real.exp_pos y)).ne' |
| 271 | · exact (StressActivation.FromReference.f_logPullback N hT hδ hδT κ y hη).symm |
| 272 | · exact (Real.exp_pos _).ne' |
| 273 | · intro r ξ hξ |
| 274 | exact (StressActivation.FromReference.histories_log_formula N hT hδ hδT κ P0 hP0 r y hξ).symm |
| 275 | |
| 276 | theorem actual_stockTwo_logView {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) |
| 277 | (hδT : 2 * δ < rampLimit) (κ h : ℝ) (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) |
| 278 | (y : ℝ) {η : ℝ} (hη : η ∈ parameterInterval) : |
| 279 | profileStockTwo (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) h |
| 280 | (radius N.endpoint y, η) = |
| 281 | logViewTwo h N.endpoint (activatedAngular T κ (StressActivation.FromReference.refLog N δ)) |
| 282 | (controlled T κ (StressActivation.FromReference.refAxial N δ)) |
| 283 | (logHistory N.endpoint (initial N hδ hδT P0 hP0) |
| 284 | (activatedAngular T κ (StressActivation.FromReference.refLog N δ)) |
| 285 | (controlled T κ (StressActivation.FromReference.refAxial N δ))) (y, η) := by |
| 286 | apply profileStockTwo_logView (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) |
| 287 | h N.endpoint parameterInterval_open (p := (y, η)) hη |
| 288 | (StressActivation.FromReference.log_radius_mem N y hη) |
| 289 | (mul_pos N.endpoint_pos (Real.exp_pos y)) |
| 290 | · exact (StressActivation.FromReference.f_logPullback N hT hδ hδT κ y hη).symm |
| 291 | · exact (StressActivation.FromReference.U_logPullback N hT hδ hδT κ y hη).symm |
| 292 | · intro r ξ hξ |
| 293 | exact (StressActivation.FromReference.histories_log_formula N hT hδ hδT κ P0 hP0 r y hξ).symm |
| 294 | |
| 295 | theorem reference_stockOne_logView {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 296 | (h : ℝ) (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) |
| 297 | (y : ℝ) {η : ℝ} (hη : η ∈ parameterInterval) : |
| 298 | profileStockOne (N.histories hδ hδT P0 hP0) h (radius N.endpoint y, η) = |
| 299 | logViewOne h N.endpoint (referenceAngular (StressActivation.FromReference.refLog N δ)) |
| 300 | (logHistory N.endpoint (initial N hδ hδT P0 hP0) |
| 301 | (referenceAngular (StressActivation.FromReference.refLog N δ)) |
| 302 | (StressActivation.FromReference.refAxial N δ)) (y, η) := by |
| 303 | apply profileStockOne_logView (N.histories hδ hδT P0 hP0) |
| 304 | h N.endpoint parameterInterval_open (p := (y, η)) hη |
| 305 | (StressActivation.FromReference.log_radius_mem N y hη) |
| 306 | (mul_pos N.endpoint_pos (Real.exp_pos y)).ne' |
| 307 | · exact (StressActivation.FromReference.refF_logPullback N hδ hδT y hη).symm |
| 308 | · exact (Real.exp_pos _).ne' |
| 309 | · intro r ξ hξ |
| 310 | exact (StressActivation.FromReference.reference_histories_log_formula N hδ hδT P0 hP0 r y hξ).symm |
| 311 | |
| 312 | theorem reference_stockTwo_logView {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 313 | (h : ℝ) (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) |
| 314 | (y : ℝ) {η : ℝ} (hη : η ∈ parameterInterval) : |
| 315 | profileStockTwo (N.histories hδ hδT P0 hP0) h (radius N.endpoint y, η) = |
| 316 | logViewTwo h N.endpoint (referenceAngular (StressActivation.FromReference.refLog N δ)) |
| 317 | (StressActivation.FromReference.refAxial N δ) |
| 318 | (logHistory N.endpoint (initial N hδ hδT P0 hP0) |
| 319 | (referenceAngular (StressActivation.FromReference.refLog N δ)) |
| 320 | (StressActivation.FromReference.refAxial N δ)) (y, η) := by |
| 321 | apply profileStockTwo_logView (N.histories hδ hδT P0 hP0) |
| 322 | h N.endpoint parameterInterval_open (p := (y, η)) hη |
| 323 | (StressActivation.FromReference.log_radius_mem N y hη) |
| 324 | (mul_pos N.endpoint_pos (Real.exp_pos y)) |
| 325 | · exact (StressActivation.FromReference.refF_logPullback N hδ hδT y hη).symm |
| 326 | · exact (StressActivation.FromReference.refU_logPullback N hδ hδT y hη).symm |
| 327 | · intro r ξ hξ |
| 328 | exact (StressActivation.FromReference.reference_histories_log_formula N hδ hδT P0 hP0 r y hξ).symm |
| 329 | |
| 330 | end FromReference |
| 331 | |
| 332 | open ActivationBounds (ScaledPoint scaledDomain scaledDistance) |
| 333 | |
| 334 | abbrev StockPair (J : Set ℝ) := SmoothPair (scaledDomain J) scaledDistance |
| 335 | |
| 336 | /-- Parameter differentiation preserves the same flat-distance factor. -/ |
| 337 | noncomputable def etaPair {J : Set ℝ} (hJ : IsOpen J) (A : StockPair J) : StockPair J where |
| 338 | actual := ActivationBounds.etaD A.actual |
| 339 | reference := ActivationBounds.etaD A.reference |
| 340 | factor := ActivationBounds.etaD A.factor |
| 341 | actual_smooth := ActivationBounds.etaD_smooth hJ A.actual_smooth |
| 342 | reference_smooth := ActivationBounds.etaD_smooth hJ A.reference_smooth |
| 343 | factor_smooth := ActivationBounds.etaD_smooth hJ A.factor_smooth |
| 344 | difference := by |
| 345 | intro q hq |
| 346 | have he := ActivationBounds.etaD_congr hJ A.difference hq |
| 347 | have hs : ActivationBounds.etaD (fun z => A.actual z - A.reference z) q = |
| 348 | ActivationBounds.etaD A.actual q - ActivationBounds.etaD A.reference q := |
| 349 | ((ActivationBounds.etaD_hasDerivAt hJ A.actual_smooth hq).sub |
| 350 | (ActivationBounds.etaD_hasDerivAt hJ A.reference_smooth hq)).deriv |
| 351 | rw [hs, ActivationBounds.etaD_scaledDistance_mul] at he |
| 352 | exact he |
| 353 | |
| 354 | theorem etaPair_actual_eq {J : Set ℝ} (hJ : IsOpen J) (A : StockPair J) |
| 355 | (F : Field) (κ T u : ℝ) {η : ℝ} (hη : η ∈ J) |
| 356 | (heq : ∀ ξ ∈ J, A.actual ((κ, T), (u, ξ)) = F (T * u, ξ)) : |
| 357 | (etaPair hJ A).actual ((κ, T), (u, η)) = etaD F (T * u, η) := by |
| 358 | apply Filter.EventuallyEq.deriv_eq |
| 359 | filter_upwards [hJ.mem_nhds hη] with ξ hξ |
| 360 | exact heq ξ hξ |
| 361 | |
| 362 | theorem etaPair_reference_eq {J : Set ℝ} (hJ : IsOpen J) (A : StockPair J) |
| 363 | (F : Field) (κ T u : ℝ) {η : ℝ} (hη : η ∈ J) |
| 364 | (heq : ∀ ξ ∈ J, A.reference ((κ, T), (u, ξ)) = F (T * u, ξ)) : |
| 365 | (etaPair hJ A).reference ((κ, T), (u, η)) = etaD F (T * u, η) := by |
| 366 | apply Filter.EventuallyEq.deriv_eq |
| 367 | filter_upwards [hJ.mem_nhds hη] with ξ hξ |
| 368 | exact heq ξ hξ |
| 369 | |
| 370 | noncomputable def controlledPair {J : Set ℝ} (hJ : IsOpen J) {U : Field} |
| 371 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) : StockPair J where |
| 372 | actual := ActivationBounds.controlledValue U |
| 373 | reference := ActivationBounds.rescale U |
| 374 | factor := ActivationBounds.controlledErrorFactor U |
| 375 | actual_smooth := ActivationBounds.controlledValue_smooth hJ hU |
| 376 | reference_smooth := ActivationBounds.rescale_smooth hJ hU |
| 377 | factor_smooth := ActivationBounds.controlledErrorFactor_smooth hJ hU |
| 378 | difference := by intro q hq; dsimp only [ActivationBounds.controlledValue]; ring |
| 379 | |
| 380 | noncomputable def angularPair {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 381 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) : StockPair J where |
| 382 | actual := ActivationBounds.angularValue L |
| 383 | reference := fun q => Real.exp (ActivationBounds.rescale L q) |
| 384 | factor := ActivationBounds.angularErrorFactor L |
| 385 | actual_smooth := (ActivationBounds.controlledValue_smooth hJ hL).exp |
| 386 | reference_smooth := (ActivationBounds.rescale_smooth hJ hL).exp |
| 387 | factor_smooth := ActivationBounds.angularErrorFactor_smooth hJ hL |
| 388 | difference := by |
| 389 | intro q hq |
| 390 | dsimp only [ActivationBounds.angularValue, ActivationBounds.controlledValue, |
| 391 | ActivationBounds.angularErrorFactor, ActivationBounds.relativeErrorFactor] |
| 392 | rw [Real.exp_add] |
| 393 | rw [show Real.exp (ActivationBounds.rescale L q) * |
| 394 | Real.exp (scaledDistance q * ActivationBounds.controlledErrorFactor L q) - |
| 395 | Real.exp (ActivationBounds.rescale L q) = |
| 396 | Real.exp (ActivationBounds.rescale L q) * |
| 397 | (Real.exp (scaledDistance q * ActivationBounds.controlledErrorFactor L q) - 1) by ring] |
| 398 | rw [StressActivation.exp_sub_one] |
| 399 | ring |
| 400 | |
| 401 | noncomputable def historyPair (X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 402 | {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 403 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 404 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) |
| 405 | (hi : ∀ r, ContDiffOn ℝ ∞ (initial r) J) (r : HistoryRow) : StockPair J where |
| 406 | actual := fun q => ActivationBounds.rescale (logHistory X0 initial (referenceAngular L) U r) q + |
| 407 | scaledDistance q * ActivationBounds.historyErrorFactor X0 L U r q |
| 408 | reference := ActivationBounds.rescale (logHistory X0 initial (referenceAngular L) U r) |
| 409 | factor := ActivationBounds.historyErrorFactor X0 L U r |
| 410 | actual_smooth := (ActivationBounds.rescale_smooth hJ |
| 411 | (logHistory_smooth X0 initial hJ hL.exp hU r (hi r))).add |
| 412 | (ActivationBounds.scaledDistance_smooth.contDiffOn.mul |
| 413 | (ActivationBounds.historyErrorFactor_smooth X0 hJ hL hU r)) |
| 414 | reference_smooth := ActivationBounds.rescale_smooth hJ |
| 415 | (logHistory_smooth X0 initial hJ hL.exp hU r (hi r)) |
| 416 | factor_smooth := ActivationBounds.historyErrorFactor_smooth X0 hJ hL hU r |
| 417 | difference := by intro q hq; ring |
| 418 | |
| 419 | theorem historyPair_actual_eq (X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 420 | {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 421 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 422 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) |
| 423 | (hi : ∀ r, ContDiffOn ℝ ∞ (initial r) J) |
| 424 | {T : ℝ} (hT : T ≠ 0) (κ : ℝ) (r : HistoryRow) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 425 | (historyPair X0 initial hJ hL hU hi r).actual ((κ, T), (u, η)) = |
| 426 | logHistory X0 initial (activatedAngular T κ L) (controlled T κ U) r (T * u, η) := by |
| 427 | have he := ActivationBounds.history_scaled_factor hT κ X0 initial hJ hL hU r u hη |
| 428 | dsimp only [historyPair, ActivationBounds.rescale] |
| 429 | linarith |
| 430 | |
| 431 | theorem angularPair_actual_eq {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 432 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 433 | {T : ℝ} (hT : T ≠ 0) (κ u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 434 | (angularPair hJ hL).actual ((κ, T), (u, η)) = activatedAngular T κ L (T * u, η) := by |
| 435 | dsimp only [angularPair, ActivationBounds.angularValue, activatedAngular] |
| 436 | rw [ActivationBounds.controlledValue_eq hT κ hJ hL u hη] |
| 437 | |
| 438 | noncomputable def scaledRadius (X0 : ℝ) (q : ScaledPoint) : ℝ := radius X0 (q.1.2 * q.2.1) |
| 439 | |
| 440 | theorem scaledRadius_smooth (X0 : ℝ) : ContDiff ℝ ∞ (scaledRadius X0) := |
| 441 | (radius_smooth X0).comp (contDiff_fst.snd.mul contDiff_snd.fst) |
| 442 | |
| 443 | theorem scaledRadius_pos {X0 : ℝ} (hX0 : 0 < X0) (q : ScaledPoint) : 0 < scaledRadius X0 q := |
| 444 | mul_pos hX0 (Real.exp_pos _) |
| 445 | |
| 446 | noncomputable def constantPair (J : Set ℝ) (c : ℝ) : StockPair J := |
| 447 | SmoothPair.common (fun _ => c) contDiffOn_const |
| 448 | |
| 449 | noncomputable def parameterPair (J : Set ℝ) (g : ℝ → ℝ) (hg : ContDiff ℝ ∞ g) : StockPair J := |
| 450 | SmoothPair.common (fun q => g q.2.2) (hg.comp contDiff_snd.snd).contDiffOn |
| 451 | |
| 452 | noncomputable def radiusPair (J : Set ℝ) (X0 : ℝ) : StockPair J := |
| 453 | SmoothPair.common (scaledRadius X0) (scaledRadius_smooth X0).contDiffOn |
| 454 | |
| 455 | noncomputable def sqrtRadiusPair (J : Set ℝ) {X0 : ℝ} (hX0 : 0 < X0) : StockPair J := |
| 456 | SmoothPair.common (fun q => Real.sqrt (2 * scaledRadius X0 q)) |
| 457 | ((contDiff_const.mul (scaledRadius_smooth X0)).sqrt |
| 458 | (fun q => (mul_pos (by norm_num) (scaledRadius_pos hX0 q)).ne')).contDiffOn |
| 459 | |
| 460 | noncomputable def dPair (J : Set ℝ) : StockPair J := |
| 461 | parameterPair J NaturalAxisData.d (contDiff_const.sub (contDiff_id.pow 2)) |
| 462 | |
| 463 | noncomputable def lPair (J : Set ℝ) (h : ℝ) : StockPair J := |
| 464 | parameterPair J (NaturalAxisData.L h) |
| 465 | (contDiff_const.sub (contDiff_const.mul (contDiff_id.pow 2))) |
| 466 | |
| 467 | noncomputable def etaPairCommon (J : Set ℝ) : StockPair J := parameterPair J id contDiff_id |
| 468 | |
| 469 | noncomputable def massFluxPair {J : Set ℝ} (h X0 : ℝ) |
| 470 | (H Hη : HistoryRow → StockPair J) : StockPair J := |
| 471 | ((radiusPair J X0).sub |
| 472 | ((parameterPair J (fun η => 2 * NaturalAxisData.D h * η) (contDiff_const.mul contDiff_id)).mul |
| 473 | (H .mass))).sub ((dPair J).mul (Hη .mass)) |
| 474 | |
| 475 | noncomputable def angularRemainderPair {J : Set ℝ} (h : ℝ) |
| 476 | (H Hη : HistoryRow → StockPair J) : StockPair J := |
| 477 | ((((constantPair J (1 - h)).mul (H .angular)).sub |
| 478 | ((parameterPair J (fun η => NaturalAxisData.D h * η) (contDiff_const.mul contDiff_id)).mul |
| 479 | (Hη .angular))).sub ((dPair J).mul (Hη .transport))).add |
| 480 | ((parameterPair J (fun η => 2 * (h - NaturalAxisData.D h) * η) |
| 481 | (contDiff_const.mul contDiff_id)).mul (H .transport)) |
| 482 | |
| 483 | noncomputable def stockOnePair {J : Set ℝ} (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 484 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 485 | (F : StockPair J) (H Hη : HistoryRow → StockPair J) |
| 486 | (hfa : ∀ q ∈ scaledDomain J, F.actual q ≠ 0) |
| 487 | (hfr : ∀ q ∈ scaledDomain J, F.reference q ≠ 0) : StockPair J := by |
| 488 | let den := ((constantPair J 2).mul (radiusPair J X0)).mul F |
| 489 | have hda : ∀ q ∈ scaledDomain J, den.actual q ≠ 0 := by |
| 490 | intro q hq |
| 491 | change 2 * scaledRadius X0 q * F.actual q ≠ 0 |
| 492 | exact mul_ne_zero (mul_ne_zero (by norm_num) (scaledRadius_pos hX0 q).ne') (hfa q hq) |
| 493 | have hdr : ∀ q ∈ scaledDomain J, den.reference q ≠ 0 := by |
| 494 | intro q hq |
| 495 | change 2 * scaledRadius X0 q * F.reference q ≠ 0 |
| 496 | exact mul_ne_zero (mul_ne_zero (by norm_num) (scaledRadius_pos hX0 q).ne') (hfr q hq) |
| 497 | let num := (massFluxPair h X0 H Hη).neg.add ((angularRemainderPair h H Hη).div den hda hdr) |
| 498 | exact num.div (lPair J h) (fun q hq => hcoef q.2.2 hq.2.2) (fun q hq => hcoef q.2.2 hq.2.2) |
| 499 | |
| 500 | noncomputable def stockTwoPair {J : Set ℝ} (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 501 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 502 | (F U : StockPair J) (H Hη : HistoryRow → StockPair J) |
| 503 | (hfa : ∀ q ∈ scaledDomain J, F.actual q ≠ 0) |
| 504 | (hfr : ∀ q ∈ scaledDomain J, F.reference q ≠ 0) : StockPair J := by |
| 505 | let num := (((((massFluxPair h X0 H Hη).neg.mul U).add |
| 506 | ((constantPair J (NaturalAxisData.D h)).mul ((H .mass).sub ((etaPairCommon J).mul (Hη .mass))))).add |
| 507 | ((parameterPair J (fun η => 4 * h * η) (contDiff_const.mul contDiff_id)).mul (H .energy))).sub |
| 508 | ((dPair J).mul (Hη .energy))).add |
| 509 | ((radiusPair J X0).mul (((parameterPair J (fun η => 4 * NaturalAxisData.A h * η) |
| 510 | (contDiff_const.mul contDiff_id)).mul (H .pressure)).sub ((dPair J).mul (Hη .pressure)))) |
| 511 | let den := ((lPair J h).mul (sqrtRadiusPair J hX0)).mul F |
| 512 | have hda : ∀ q ∈ scaledDomain J, den.actual q ≠ 0 := by |
| 513 | intro q hq |
| 514 | exact mul_ne_zero (mul_ne_zero (hcoef q.2.2 hq.2.2) |
| 515 | (Real.sqrt_pos.mpr (mul_pos (by norm_num) (scaledRadius_pos hX0 q))).ne') (hfa q hq) |
| 516 | have hdr : ∀ q ∈ scaledDomain J, den.reference q ≠ 0 := by |
| 517 | intro q hq |
| 518 | exact mul_ne_zero (mul_ne_zero (hcoef q.2.2 hq.2.2) |
| 519 | (Real.sqrt_pos.mpr (mul_pos (by norm_num) (scaledRadius_pos hX0 q))).ne') (hfr q hq) |
| 520 | exact num.div den hda hdr |
| 521 | |
| 522 | theorem stockOnePair_actual {J : Set ℝ} (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 523 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 524 | (F : StockPair J) (H Hη : HistoryRow → StockPair J) |
| 525 | (hfa : ∀ q ∈ scaledDomain J, F.actual q ≠ 0) |
| 526 | (hfr : ∀ q ∈ scaledDomain J, F.reference q ≠ 0) (q : ScaledPoint) : |
| 527 | (stockOnePair h hX0 hcoef F H Hη hfa hfr).actual q = |
| 528 | stockOne h (scaledRadius X0 q) q.2.2 (F.actual q) |
| 529 | ((H .mass).actual q) ((Hη .mass).actual q) |
| 530 | ((H .angular).actual q) ((Hη .angular).actual q) |
| 531 | ((H .transport).actual q) ((Hη .transport).actual q) := by |
| 532 | dsimp only [stockOnePair, massFluxPair, angularRemainderPair, constantPair, parameterPair, |
| 533 | radiusPair, dPair, lPair, SmoothPair.common, SmoothPair.add, SmoothPair.sub, |
| 534 | SmoothPair.neg, SmoothPair.mul, SmoothPair.div, SmoothPair.inv, |
| 535 | stockOne, massFlux, angularRemainder] |
| 536 | ring |
| 537 | |
| 538 | theorem stockOnePair_reference {J : Set ℝ} (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 539 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 540 | (F : StockPair J) (H Hη : HistoryRow → StockPair J) |
| 541 | (hfa : ∀ q ∈ scaledDomain J, F.actual q ≠ 0) |
| 542 | (hfr : ∀ q ∈ scaledDomain J, F.reference q ≠ 0) (q : ScaledPoint) : |
| 543 | (stockOnePair h hX0 hcoef F H Hη hfa hfr).reference q = |
| 544 | stockOne h (scaledRadius X0 q) q.2.2 (F.reference q) |
| 545 | ((H .mass).reference q) ((Hη .mass).reference q) |
| 546 | ((H .angular).reference q) ((Hη .angular).reference q) |
| 547 | ((H .transport).reference q) ((Hη .transport).reference q) := by |
| 548 | dsimp only [stockOnePair, massFluxPair, angularRemainderPair, constantPair, parameterPair, |
| 549 | radiusPair, dPair, lPair, SmoothPair.common, SmoothPair.add, SmoothPair.sub, |
| 550 | SmoothPair.neg, SmoothPair.mul, SmoothPair.div, SmoothPair.inv, |
| 551 | stockOne, massFlux, angularRemainder] |
| 552 | ring |
| 553 | |
| 554 | theorem stockTwoPair_actual {J : Set ℝ} (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 555 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 556 | (F U : StockPair J) (H Hη : HistoryRow → StockPair J) |
| 557 | (hfa : ∀ q ∈ scaledDomain J, F.actual q ≠ 0) |
| 558 | (hfr : ∀ q ∈ scaledDomain J, F.reference q ≠ 0) (q : ScaledPoint) : |
| 559 | (stockTwoPair h hX0 hcoef F U H Hη hfa hfr).actual q = |
| 560 | stockTwo h (scaledRadius X0 q) q.2.2 (F.actual q) (U.actual q) |
| 561 | ((H .mass).actual q) ((Hη .mass).actual q) |
| 562 | ((H .energy).actual q) ((Hη .energy).actual q) |
| 563 | ((H .pressure).actual q) ((Hη .pressure).actual q) := by |
| 564 | dsimp only [stockTwoPair, massFluxPair, constantPair, parameterPair, |
| 565 | radiusPair, sqrtRadiusPair, etaPairCommon, dPair, lPair, SmoothPair.common, |
| 566 | SmoothPair.add, SmoothPair.sub, SmoothPair.neg, SmoothPair.mul, SmoothPair.div, |
| 567 | SmoothPair.inv, stockTwo, massFlux, id_eq] |
| 568 | ring |
| 569 | |
| 570 | theorem stockTwoPair_reference {J : Set ℝ} (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 571 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 572 | (F U : StockPair J) (H Hη : HistoryRow → StockPair J) |
| 573 | (hfa : ∀ q ∈ scaledDomain J, F.actual q ≠ 0) |
| 574 | (hfr : ∀ q ∈ scaledDomain J, F.reference q ≠ 0) (q : ScaledPoint) : |
| 575 | (stockTwoPair h hX0 hcoef F U H Hη hfa hfr).reference q = |
| 576 | stockTwo h (scaledRadius X0 q) q.2.2 (F.reference q) (U.reference q) |
| 577 | ((H .mass).reference q) ((Hη .mass).reference q) |
| 578 | ((H .energy).reference q) ((Hη .energy).reference q) |
| 579 | ((H .pressure).reference q) ((Hη .pressure).reference q) := by |
| 580 | dsimp only [stockTwoPair, massFluxPair, constantPair, parameterPair, |
| 581 | radiusPair, sqrtRadiusPair, etaPairCommon, dPair, lPair, SmoothPair.common, |
| 582 | SmoothPair.add, SmoothPair.sub, SmoothPair.neg, SmoothPair.mul, SmoothPair.div, |
| 583 | SmoothPair.inv, stockTwo, massFlux, id_eq] |
| 584 | ring |
| 585 | |
| 586 | section ConstructedFactors |
| 587 | |
| 588 | variable (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) (initial : HistoryRow → ℝ → ℝ) |
| 589 | {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 590 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 591 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) |
| 592 | (hi : ∀ r, ContDiffOn ℝ ∞ (initial r) J) |
| 593 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 594 | |
| 595 | noncomputable def activationOnePair : StockPair J := |
| 596 | stockOnePair h hX0 hcoef (angularPair hJ hL) |
| 597 | (historyPair X0 initial hJ hL hU hi) |
| 598 | (fun r => etaPair hJ (historyPair X0 initial hJ hL hU hi r)) |
| 599 | (fun _q _ => (Real.exp_pos _).ne') (fun _q _ => (Real.exp_pos _).ne') |
| 600 | |
| 601 | noncomputable def activationTwoPair : StockPair J := |
| 602 | stockTwoPair h hX0 hcoef (angularPair hJ hL) (controlledPair hJ hU) |
| 603 | (historyPair X0 initial hJ hL hU hi) |
| 604 | (fun r => etaPair hJ (historyPair X0 initial hJ hL hU hi r)) |
| 605 | (fun _q _ => (Real.exp_pos _).ne') (fun _q _ => (Real.exp_pos _).ne') |
| 606 | |
| 607 | theorem historyEtaPair_actual {T : ℝ} (hT : T ≠ 0) (κ u : ℝ) |
| 608 | {η : ℝ} (hη : η ∈ J) (r : HistoryRow) : |
| 609 | (etaPair hJ (historyPair X0 initial hJ hL hU hi r)).actual ((κ, T), (u, η)) = |
| 610 | etaD (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U) r) (T * u, η) := by |
| 611 | refine etaPair_actual_eq hJ (historyPair X0 initial hJ hL hU hi r) _ κ T u hη ?_ |
| 612 | intro ξ hξ |
| 613 | exact historyPair_actual_eq X0 initial hJ hL hU hi hT κ r u hξ |
| 614 | |
| 615 | theorem historyEtaPair_reference (q : ScaledPoint) (r : HistoryRow) : |
| 616 | (etaPair hJ (historyPair X0 initial hJ hL hU hi r)).reference q = |
| 617 | etaD (logHistory X0 initial (referenceAngular L) U r) (q.1.2 * q.2.1, q.2.2) := rfl |
| 618 | |
| 619 | theorem activationOnePair_actual {T : ℝ} (hT : T ≠ 0) (κ u : ℝ) |
| 620 | {η : ℝ} (hη : η ∈ J) : |
| 621 | (activationOnePair h hX0 initial hJ hL hU hi hcoef).actual ((κ, T), (u, η)) = |
| 622 | logViewOne h X0 (activatedAngular T κ L) |
| 623 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (T * u, η) := by |
| 624 | erw [activationOnePair, stockOnePair_actual] |
| 625 | dsimp only [logViewOne, scaledRadius] |
| 626 | rw [angularPair_actual_eq hJ hL hT κ u hη, |
| 627 | historyPair_actual_eq X0 initial hJ hL hU hi hT κ .mass u hη, |
| 628 | historyPair_actual_eq X0 initial hJ hL hU hi hT κ .angular u hη, |
| 629 | historyPair_actual_eq X0 initial hJ hL hU hi hT κ .transport u hη, |
| 630 | historyEtaPair_actual initial hJ hL hU hi hT κ u hη .mass, |
| 631 | historyEtaPair_actual initial hJ hL hU hi hT κ u hη .angular, |
| 632 | historyEtaPair_actual initial hJ hL hU hi hT κ u hη .transport] |
| 633 | |
| 634 | theorem activationOnePair_reference (q : ScaledPoint) : |
| 635 | (activationOnePair h hX0 initial hJ hL hU hi hcoef).reference q = |
| 636 | logViewOne h X0 (referenceAngular L) |
| 637 | (logHistory X0 initial (referenceAngular L) U) (q.1.2 * q.2.1, q.2.2) := by |
| 638 | erw [activationOnePair, stockOnePair_reference] |
| 639 | rfl |
| 640 | |
| 641 | theorem activationTwoPair_actual {T : ℝ} (hT : T ≠ 0) (κ u : ℝ) |
| 642 | {η : ℝ} (hη : η ∈ J) : |
| 643 | (activationTwoPair h hX0 initial hJ hL hU hi hcoef).actual ((κ, T), (u, η)) = |
| 644 | logViewTwo h X0 (activatedAngular T κ L) (controlled T κ U) |
| 645 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (T * u, η) := by |
| 646 | erw [activationTwoPair, stockTwoPair_actual] |
| 647 | dsimp only [logViewTwo, scaledRadius] |
| 648 | rw [angularPair_actual_eq hJ hL hT κ u hη, |
| 649 | historyPair_actual_eq X0 initial hJ hL hU hi hT κ .mass u hη, |
| 650 | historyPair_actual_eq X0 initial hJ hL hU hi hT κ .energy u hη, |
| 651 | historyPair_actual_eq X0 initial hJ hL hU hi hT κ .pressure u hη, |
| 652 | historyEtaPair_actual initial hJ hL hU hi hT κ u hη .mass, |
| 653 | historyEtaPair_actual initial hJ hL hU hi hT κ u hη .energy, |
| 654 | historyEtaPair_actual initial hJ hL hU hi hT κ u hη .pressure] |
| 655 | change stockTwo _ _ _ _ (ActivationBounds.controlledValue U ((κ, T), (u, η))) _ _ _ _ _ _ = _ |
| 656 | rw [ActivationBounds.controlledValue_eq hT κ hJ hU u hη] |
| 657 | |
| 658 | theorem activationTwoPair_reference (q : ScaledPoint) : |
| 659 | (activationTwoPair h hX0 initial hJ hL hU hi hcoef).reference q = |
| 660 | logViewTwo h X0 (referenceAngular L) U |
| 661 | (logHistory X0 initial (referenceAngular L) U) (q.1.2 * q.2.1, q.2.2) := by |
| 662 | erw [activationTwoPair, stockTwoPair_reference] |
| 663 | rfl |
| 664 | |
| 665 | include hX0 hJ hL hU hi hcoef in |
| 666 | /-- Both stock errors have actual smooth factors on a domain containing |
| 667 | the zero-width face. The input hypotheses concern only fields, initial |
| 668 | history values, and the nonzero coordinate coefficient. -/ |
| 669 | theorem exists_log_stock_factors : |
| 670 | ∃ P Q : ScaledPoint → ℝ, |
| 671 | ContDiffOn ℝ ∞ P (scaledDomain J) ∧ ContDiffOn ℝ ∞ Q (scaledDomain J) ∧ |
| 672 | ∀ T : ℝ, T ≠ 0 → ∀ κ u η : ℝ, η ∈ J → |
| 673 | logViewOne h X0 (activatedAngular T κ L) |
| 674 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (T * u, η) - |
| 675 | logViewOne h X0 (referenceAngular L) |
| 676 | (logHistory X0 initial (referenceAngular L) U) (T * u, η) = |
| 677 | scaledDistance ((κ, T), (u, η)) * P ((κ, T), (u, η)) ∧ |
| 678 | logViewTwo h X0 (activatedAngular T κ L) (controlled T κ U) |
| 679 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (T * u, η) - |
| 680 | logViewTwo h X0 (referenceAngular L) U |
| 681 | (logHistory X0 initial (referenceAngular L) U) (T * u, η) = |
| 682 | scaledDistance ((κ, T), (u, η)) * Q ((κ, T), (u, η)) := by |
| 683 | let A := activationOnePair h hX0 initial hJ hL hU hi hcoef |
| 684 | let B := activationTwoPair h hX0 initial hJ hL hU hi hcoef |
| 685 | refine ⟨A.factor, B.factor, A.factor_smooth, B.factor_smooth, ?_⟩ |
| 686 | intro T hT κ u η hη |
| 687 | have hq : ((κ, T), (u, η)) ∈ scaledDomain J := ⟨mem_univ _, mem_univ _, hη⟩ |
| 688 | constructor |
| 689 | · have he := A.difference ((κ, T), (u, η)) hq |
| 690 | rwa [activationOnePair_actual h hX0 initial hJ hL hU hi hcoef hT κ u hη, |
| 691 | activationOnePair_reference h hX0 initial hJ hL hU hi hcoef] at he |
| 692 | · have he := B.difference ((κ, T), (u, η)) hq |
| 693 | rwa [activationTwoPair_actual h hX0 initial hJ hL hU hi hcoef hT κ u hη, |
| 694 | activationTwoPair_reference h hX0 initial hJ hL hU hi hcoef] at he |
| 695 | |
| 696 | theorem activationOnePair_zero (κ u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 697 | (activationOnePair h hX0 initial hJ hL hU hi hcoef).actual ((κ, 0), (u, η)) = |
| 698 | (activationOnePair h hX0 initial hJ hL hU hi hcoef).reference ((κ, 0), (u, η)) := by |
| 699 | have he := (activationOnePair h hX0 initial hJ hL hU hi hcoef).difference |
| 700 | ((κ, 0), (u, η)) ⟨mem_univ _, mem_univ _, hη⟩ |
| 701 | simpa only [scaledDistance, zero_mul, sub_eq_zero] using he |
| 702 | |
| 703 | theorem activationTwoPair_zero (κ u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 704 | (activationTwoPair h hX0 initial hJ hL hU hi hcoef).actual ((κ, 0), (u, η)) = |
| 705 | (activationTwoPair h hX0 initial hJ hL hU hi hcoef).reference ((κ, 0), (u, η)) := by |
| 706 | have he := (activationTwoPair h hX0 initial hJ hL hU hi hcoef).difference |
| 707 | ((κ, 0), (u, η)) ⟨mem_univ _, mem_univ _, hη⟩ |
| 708 | simpa only [scaledDistance, zero_mul, sub_eq_zero] using he |
| 709 | |
| 710 | include hX0 hJ hL hU hi hcoef in |
| 711 | theorem log_stocks_uniform_jets {K : Set ℝ} (hK : IsCompact K) (hKJ : K ⊆ J) |
| 712 | (T0 : ℝ) (n : ℕ) : |
| 713 | ∃ M : ℝ, 0 ≤ M ∧ ∀ T ∈ Ioc (0 : ℝ) T0, ∀ κ ∈ Icc (0 : ℝ) 1, |
| 714 | ∀ y ∈ Icc (0 : ℝ) T, ∀ η ∈ K, |
| 715 | |iteratedDeriv n (fun ξ => |
| 716 | logViewOne h X0 (activatedAngular T κ L) |
| 717 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (y, ξ) - |
| 718 | logViewOne h X0 (referenceAngular L) |
| 719 | (logHistory X0 initial (referenceAngular L) U) (y, ξ)) η| ≤ M * y * activation T κ y ∧ |
| 720 | |iteratedDeriv n (fun ξ => |
| 721 | logViewTwo h X0 (activatedAngular T κ L) (controlled T κ U) |
| 722 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (y, ξ) - |
| 723 | logViewTwo h X0 (referenceAngular L) U |
| 724 | (logHistory X0 initial (referenceAngular L) U) (y, ξ)) η| ≤ M * y * activation T κ y := by |
| 725 | obtain ⟨P, Q, hP, hQ, hfactor⟩ := exists_log_stock_factors h hX0 initial hJ hL hU hi hcoef |
| 726 | obtain ⟨M₁, hM₁, hb₁⟩ := ActivationBounds.width_uniform_jet_bound hJ hK hKJ hP |
| 727 | (E := fun κ T y η => logViewOne h X0 (activatedAngular T κ L) |
| 728 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (y, η) - |
| 729 | logViewOne h X0 (referenceAngular L) (logHistory X0 initial (referenceAngular L) U) (y, η)) |
| 730 | (fun κ T hT u η hη => (hfactor T hT.ne' κ u η hη).1) T0 n |
| 731 | obtain ⟨M₂, hM₂, hb₂⟩ := ActivationBounds.width_uniform_jet_bound hJ hK hKJ hQ |
| 732 | (E := fun κ T y η => logViewTwo h X0 (activatedAngular T κ L) (controlled T κ U) |
| 733 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) (y, η) - |
| 734 | logViewTwo h X0 (referenceAngular L) U (logHistory X0 initial (referenceAngular L) U) (y, η)) |
| 735 | (fun κ T hT u η hη => (hfactor T hT.ne' κ u η hη).2) T0 n |
| 736 | refine ⟨max M₁ M₂, hM₁.trans (le_max_left _ _), ?_⟩ |
| 737 | intro T hT κ hκ y hy η hη |
| 738 | have hb1 := hb₁ T hT κ hκ y hy η hη |
| 739 | have hb2 := hb₂ T hT κ hκ y hy η hη |
| 740 | have ha : 0 ≤ y * activation T κ y := mul_nonneg hy.1 (activation_nonneg T κ y hκ.2) |
| 741 | have hinc1 := mul_nonneg (sub_nonneg.mpr (le_max_left M₁ M₂)) ha |
| 742 | have hinc2 := mul_nonneg (sub_nonneg.mpr (le_max_right M₁ M₂)) ha |
| 743 | constructor <;> nlinarith |
| 744 | |
| 745 | end ConstructedFactors |
| 746 | |
| 747 | namespace FromReference |
| 748 | |
| 749 | open ReferencePath |
| 750 | |
| 751 | variable (N : ReferencePath.Input) |
| 752 | |
| 753 | /-- The factors concern the actual recomputed ACT and REF lag histories. |
| 754 | Their common scaled domain contains `T=0`. -/ |
| 755 | theorem exists_physical_stock_factors {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 756 | (h : ℝ) (hcoef : ∀ η ∈ parameterInterval, NaturalAxisData.L h η ≠ 0) |
| 757 | (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) : |
| 758 | ∃ P Q : ScaledPoint → ℝ, |
| 759 | ContDiffOn ℝ ∞ P (scaledDomain parameterInterval) ∧ |
| 760 | ContDiffOn ℝ ∞ Q (scaledDomain parameterInterval) ∧ |
| 761 | ∀ T : ℝ, ∀ hT : 0 < T, ∀ κ u η : ℝ, η ∈ parameterInterval → |
| 762 | profileStockOne (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) h |
| 763 | (radius N.endpoint (T * u), η) - |
| 764 | profileStockOne (N.histories hδ hδT P0 hP0) h (radius N.endpoint (T * u), η) = |
| 765 | scaledDistance ((κ, T), (u, η)) * P ((κ, T), (u, η)) ∧ |
| 766 | profileStockTwo (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) h |
| 767 | (radius N.endpoint (T * u), η) - |
| 768 | profileStockTwo (N.histories hδ hδT P0 hP0) h (radius N.endpoint (T * u), η) = |
| 769 | scaledDistance ((κ, T), (u, η)) * Q ((κ, T), (u, η)) := by |
| 770 | obtain ⟨P, Q, hP, hQ, hf⟩ := exists_log_stock_factors h N.endpoint_pos |
| 771 | (initial N hδ hδT P0 hP0) parameterInterval_open |
| 772 | (StressActivation.FromReference.refLog_smooth N hδ hδT) |
| 773 | (StressActivation.FromReference.refAxial_smooth N hδ hδT) |
| 774 | (initial_smooth N hδ hδT P0 hP0) hcoef |
| 775 | refine ⟨P, Q, hP, hQ, ?_⟩ |
| 776 | intro T hT κ u η hη |
| 777 | rw [actual_stockOne_logView N hT hδ hδT κ h P0 hP0 (T * u) hη, |
| 778 | reference_stockOne_logView N hδ hδT h P0 hP0 (T * u) hη, |
| 779 | actual_stockTwo_logView N hT hδ hδT κ h P0 hP0 (T * u) hη, |
| 780 | reference_stockTwo_logView N hδ hδT h P0 hP0 (T * u) hη] |
| 781 | exact hf T hT.ne' κ u η hη |
| 782 | |
| 783 | /-- One constant controls both actual stock errors for every sufficiently |
| 784 | small positive width and all activation parameters, including `κ=0`. -/ |
| 785 | theorem physical_stocks_uniform_bound {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 786 | (h : ℝ) (hcoef : ∀ η ∈ parameterInterval, NaturalAxisData.L h η ≠ 0) |
| 787 | (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) (T0 : ℝ) : |
| 788 | ∃ M : ℝ, 0 ≤ M ∧ ∀ T : ℝ, ∀ hT : 0 < T, T ≤ T0 → ∀ κ ∈ Icc (0 : ℝ) 1, |
| 789 | ∀ y ∈ Icc (0 : ℝ) T, ∀ η ∈ Icc (-1 : ℝ) 1, |
| 790 | |profileStockOne (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) h |
| 791 | (radius N.endpoint y, η) - |
| 792 | profileStockOne (N.histories hδ hδT P0 hP0) h (radius N.endpoint y, η)| ≤ |
| 793 | M * y * activation T κ y ∧ |
| 794 | |profileStockTwo (StressActivation.FromReference.histories N hT hδ hδT κ P0 hP0) h |
| 795 | (radius N.endpoint y, η) - |
| 796 | profileStockTwo (N.histories hδ hδT P0 hP0) h (radius N.endpoint y, η)| ≤ |
| 797 | M * y * activation T κ y := by |
| 798 | have hKJ : Icc (-1 : ℝ) 1 ⊆ parameterInterval := |
| 799 | NaturalAxisCoefficients.original_interval_interior |
| 800 | obtain ⟨M, hM, hbound⟩ := log_stocks_uniform_jets h N.endpoint_pos |
| 801 | (initial N hδ hδT P0 hP0) parameterInterval_open |
| 802 | (StressActivation.FromReference.refLog_smooth N hδ hδT) |
| 803 | (StressActivation.FromReference.refAxial_smooth N hδ hδT) |
| 804 | (initial_smooth N hδ hδT P0 hP0) hcoef isCompact_Icc hKJ T0 0 |
| 805 | refine ⟨M, hM, ?_⟩ |
| 806 | intro T hT hTT κ hκ y hy η hη |
| 807 | rw [actual_stockOne_logView N hT hδ hδT κ h P0 hP0 y (hKJ hη), |
| 808 | reference_stockOne_logView N hδ hδT h P0 hP0 y (hKJ hη), |
| 809 | actual_stockTwo_logView N hT hδ hδT κ h P0 hP0 y (hKJ hη), |
| 810 | reference_stockTwo_logView N hδ hδT h P0 hP0 y (hKJ hη)] |
| 811 | simpa only [iteratedDeriv_zero] using hbound T ⟨hT, hTT⟩ κ hκ y hy η hη |
| 812 | |
| 813 | end FromReference |
| 814 | |
| 815 | /-! ## Agreement of the reference stocks with the natural stress-free stocks -/ |
| 816 | |
| 817 | theorem profileHistory_congr_across {D E : RadialDomain} (P : Profiles D) (Q : Profiles E) |
| 818 | (r : HistoryRow) {X η : ℝ} (hX : 0 ≤ X) |
| 819 | (h0 : profileInitial P r η = profileInitial Q r η) |
| 820 | (hf : ∀ x ∈ Icc (0 : ℝ) X, P.f (x, η) = Q.f (x, η)) |
| 821 | (hu : ∀ x ∈ Icc (0 : ℝ) X, P.U (x, η) = Q.U (x, η)) : |
| 822 | profileHistory P r (X, η) = profileHistory Q r (X, η) := by |
| 823 | rw [profileHistory_eq_initial_add_primitive, profileHistory_eq_initial_add_primitive] |
| 824 | dsimp only |
| 825 | rw [h0] |
| 826 | congr 1 |
| 827 | apply intervalIntegral.integral_congr |
| 828 | intro x hx |
| 829 | rw [uIcc_of_le hX] at hx |
| 830 | dsimp only [profileDensity] |
| 831 | rw [hf x hx, hu x hx] |
| 832 | |
| 833 | theorem profiles_stocks_congr {D E : RadialDomain} (P : Profiles D) (Q : Profiles E) |
| 834 | (h : ℝ) {J : Set ℝ} (hJ : IsOpen J) {X η : ℝ} (hη : η ∈ J) |
| 835 | (hp : (X, η) ∈ D.carrier) (hq : (X, η) ∈ E.carrier) (hX : 0 < X) |
| 836 | (hf : P.f (X, η) = Q.f (X, η)) (hfne : Q.f (X, η) ≠ 0) |
| 837 | (hu : P.U (X, η) = Q.U (X, η)) |
| 838 | (hH : ∀ r ξ, ξ ∈ J → profileHistory P r (X, ξ) = profileHistory Q r (X, ξ)) : |
| 839 | profileStockOne P h (X, η) = profileStockOne Q h (X, η) ∧ |
| 840 | profileStockTwo P h (X, η) = profileStockTwo Q h (X, η) := by |
| 841 | have hD (r : HistoryRow) : parameterPartial (profileHistory P r) (X, η) = |
| 842 | parameterPartial (profileHistory Q r) (X, η) := by |
| 843 | have he : (fun ξ => profileHistory P r (X, ξ)) =ᶠ[𝓝 η] |
| 844 | fun ξ => profileHistory Q r (X, ξ) := by |
| 845 | filter_upwards [hJ.mem_nhds hη] with ξ hξ |
| 846 | exact hH r ξ hξ |
| 847 | exact (parameterPartial_hasDerivAt D (profileHistory_smooth P r) hp).deriv.symm.trans |
| 848 | (he.deriv_eq.trans (parameterPartial_hasDerivAt E (profileHistory_smooth Q r) hq).deriv) |
| 849 | constructor |
| 850 | · rw [profileStockOne_eq P h hp hX.ne' (hf.trans_ne hfne), |
| 851 | profileStockOne_eq Q h hq hX.ne' hfne] |
| 852 | change stockOne h X η (P.f (X, η)) |
| 853 | (profileHistory P .mass (X, η)) (parameterPartial (profileHistory P .mass) (X, η)) |
| 854 | (profileHistory P .angular (X, η)) (parameterPartial (profileHistory P .angular) (X, η)) |
| 855 | (profileHistory P .transport (X, η)) (parameterPartial (profileHistory P .transport) (X, η)) = _ |
| 856 | rw [hf, hH .mass η hη, hH .angular η hη, hH .transport η hη, |
| 857 | hD .mass, hD .angular, hD .transport] |
| 858 | rfl |
| 859 | · rw [profileStockTwo_eq P h hp hX, profileStockTwo_eq Q h hq hX] |
| 860 | change stockTwo h X η (P.f (X, η)) (P.U (X, η)) |
| 861 | (profileHistory P .mass (X, η)) (parameterPartial (profileHistory P .mass) (X, η)) |
| 862 | (profileHistory P .energy (X, η)) (parameterPartial (profileHistory P .energy) (X, η)) |
| 863 | (profileHistory P .pressure (X, η)) (parameterPartial (profileHistory P .pressure) (X, η)) = _ |
| 864 | rw [hf, hu, hH .mass η hη, hH .energy η hη, hH .pressure η hη, |
| 865 | hD .mass, hD .energy, hD .pressure] |
| 866 | rfl |
| 867 | |
| 868 | noncomputable def naturalDomain {Λ : ℝ} (hΛ : 0 < Λ) : RadialDomain where |
| 869 | carrier := NaturalProfile.domain Λ |
| 870 | isOpen := NaturalProfile.domain_isOpen Λ |
| 871 | scale_mem := by |
| 872 | intro p hp t ht |
| 873 | apply NaturalProfile.domain_segment hΛ hp |
| 874 | rcases le_total 0 p.1 with hx | hx |
| 875 | · rw [uIcc_of_le hx] |
| 876 | exact ⟨mul_nonneg ht.1 hx, mul_le_of_le_one_left hx ht.2⟩ |
| 877 | · rw [uIcc_of_ge hx] |
| 878 | constructor |
| 879 | · nlinarith [ht.2] |
| 880 | · exact mul_nonpos_of_nonneg_of_nonpos ht.1 hx |
| 881 | |
| 882 | section NaturalHistories |
| 883 | |
| 884 | open NaturalProfile NaturalAxisBridge |
| 885 | |
| 886 | variable {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : NaturalAxisCoefficients.AnalyticInputs h j σ P0} |
| 887 | (F : ProfileFamily d Λ C) (hΛ : 0 < Λ) (hP0 : ContDiff ℝ ∞ P0) |
| 888 | |
| 889 | noncomputable def naturalHistories : Profiles (naturalDomain hΛ) where |
| 890 | f := F.f |
| 891 | U := F.U |
| 892 | f_smooth := F.natural.f_smooth |
| 893 | U_smooth := F.natural.U_smooth |
| 894 | pressure0 := P0 |
| 895 | pressure0_smooth := fun _ _ => hP0.contDiffAt |
| 896 | |
| 897 | include hΛ in |
| 898 | theorem radialPartial_natural_field {G : Field} (hG : ContDiffOn ℝ ∞ G (domain Λ)) |
| 899 | {p : Point} (hp : p ∈ domain Λ) : radialPartial G p = partialY G p := |
| 900 | (radialPartial_hasDerivAt (naturalDomain hΛ) hG hp).deriv.symm |
| 901 | |
| 902 | include hΛ in |
| 903 | theorem parameterPartial_natural_field {G : Field} (hG : ContDiffOn ℝ ∞ G (domain Λ)) |
| 904 | {p : Point} (hp : p ∈ domain Λ) : parameterPartial G p = partialEta G p := |
| 905 | (parameterPartial_hasDerivAt (naturalDomain hΛ) hG hp).deriv.symm |
| 906 | |
| 907 | theorem naturalHistories_average {p : Point} (hp : p ∈ domain Λ) : |
| 908 | (naturalHistories F hΛ hP0).Ubar p = F.Ubar p := by |
| 909 | change average F.U p = F.Ubar p |
| 910 | by_cases hx : p.1 = 0 |
| 911 | · have he : p = (0, p.2) := Prod.ext hx rfl |
| 912 | have hu0 : F.U (0, p.2) = NaturalAxisData.U j p.2 := F.natural.U_axis p.2 hp.2 |
| 913 | have hv0 : F.Ubar (0, p.2) = NaturalAxisData.U j p.2 := F.natural.average_axis p.2 hp.2 |
| 914 | rw [he, average_at_axis, hu0, hv0] |
| 915 | · rw [average_eq_quotient F.U hx] |
| 916 | change (∫ x in (0 : ℝ)..p.1, F.U (x, p.2)) / p.1 = F.Ubar p |
| 917 | have hint : p.1 * F.Ubar p = ∫ x in (0 : ℝ)..p.1, F.U (x, p.2) := |
| 918 | F.natural.average_integral p hp |
| 919 | rw [← hint, mul_div_cancel_left₀ _ hx] |
| 920 | |
| 921 | theorem naturalHistories_pressure {p : Point} (hp : p ∈ domain Λ) : |
| 922 | (naturalHistories F hΛ hP0).pressure p = F.Pi p := by |
| 923 | have he := F.natural.pressure_integral p hp |
| 924 | change F.Pi p - P0 p.2 = ∫ x in (0 : ℝ)..p.1, F.f (x, p.2) ^ 2 at he |
| 925 | change P0 p.2 + (∫ x in (0 : ℝ)..p.1, F.f (x, p.2) ^ 2) = F.Pi p |
| 926 | linarith |
| 927 | |
| 928 | theorem naturalHistories_average_derivative {p : Point} (hp : p ∈ domain Λ) : |
| 929 | parameterPartial (naturalHistories F hΛ hP0).Ubar p = partialEta F.Ubar p := by |
| 930 | have he : (naturalHistories F hΛ hP0).Ubar =ᶠ[𝓝 p] F.Ubar := by |
| 931 | filter_upwards [(domain_isOpen Λ).mem_nhds hp] with q hq |
| 932 | exact naturalHistories_average F hΛ hP0 hq |
| 933 | change fderiv ℝ _ p (0, 1) = _ |
| 934 | rw [he.fderiv_eq] |
| 935 | exact parameterPartial_natural_field hΛ F.natural.average_smooth hp |
| 936 | |
| 937 | theorem naturalHistories_pressure_derivative {p : Point} (hp : p ∈ domain Λ) : |
| 938 | parameterPartial (naturalHistories F hΛ hP0).pressure p = partialEta F.Pi p := by |
| 939 | have he : (naturalHistories F hΛ hP0).pressure =ᶠ[𝓝 p] F.Pi := by |
| 940 | filter_upwards [(domain_isOpen Λ).mem_nhds hp] with q hq |
| 941 | exact naturalHistories_pressure F hΛ hP0 hq |
| 942 | change fderiv ℝ _ p (0, 1) = _ |
| 943 | rw [he.fderiv_eq] |
| 944 | exact parameterPartial_natural_field hΛ F.natural.pressure_smooth hp |
| 945 | |
| 946 | theorem naturalHistories_W {p : Point} (hp : p ∈ domain Λ) : |
| 947 | (naturalHistories F hΛ hP0).W h p = transportW h F.Ubar p := by |
| 948 | rw [Profiles.W_formula _ h hp, naturalHistories_average F hΛ hP0 hp, |
| 949 | naturalHistories_average_derivative F hΛ hP0 hp] |
| 950 | rfl |
| 951 | |
| 952 | theorem naturalHistories_angularSource {p : Point} (hp : p ∈ domain Λ) (hf : F.f p ≠ 0) : |
| 953 | (naturalHistories F hΛ hP0).angularSource h p = |
| 954 | (2 * p.1 * F.f p) * NaturalEntrance.Sq h F.f F.U F.Ubar p := by |
| 955 | let P := naturalHistories F hΛ hP0 |
| 956 | have hrad : radialPartial P.H p = 2 * F.f p + 2 * p.1 * partialY F.f p := by |
| 957 | have hd := ((hasDerivAt_id p.1).const_mul 2).mul |
| 958 | (radialPartial_hasDerivAt (naturalDomain hΛ) (F := F.f) F.natural.f_smooth hp) |
| 959 | have he := (radialPartial_hasDerivAt (naturalDomain hΛ) P.H_smooth hp).unique hd |
| 960 | simpa only [one_mul, mul_one, id_eq, Prod.eta, |
| 961 | radialPartial_natural_field hΛ (G := F.f) F.natural.f_smooth hp] using he |
| 962 | have heta : parameterPartial P.H p = 2 * p.1 * partialEta F.f p := by |
| 963 | rw [P.parameterPartial_H hp] |
| 964 | exact congrArg (fun t => 2 * p.1 * t) |
| 965 | (parameterPartial_natural_field hΛ (G := F.f) F.natural.f_smooth hp) |
| 966 | change P.angularSource h p = _ |
| 967 | rw [Profiles.angularSource, hrad, heta, naturalHistories_W F hΛ hP0 hp] |
| 968 | dsimp only [StressAlgebra.angularSource, P, naturalHistories, Profiles.H, |
| 969 | NaturalEntrance.Sq, transportH, NaturalAxisData.D, NaturalAxisData.d, |
| 970 | StressAlgebra.axialExponent, StressAlgebra.coordinateFactor] |
| 971 | field_simp |
| 972 | |
| 973 | theorem naturalHistories_axialSource {p : Point} (hp : p ∈ domain Λ) : |
| 974 | (naturalHistories F hΛ hP0).axialSource h p = |
| 975 | NaturalEntrance.Sn h F.U F.Ubar F.Pi p := by |
| 976 | rw [Profiles.axialSource, naturalHistories_W F hΛ hP0 hp, |
| 977 | naturalHistories_pressure F hΛ hP0 hp, naturalHistories_pressure_derivative F hΛ hP0 hp] |
| 978 | change StressAlgebra.axialSource h p.2 p.1 (transportW h F.Ubar p) (F.U p) |
| 979 | (radialPartial F.U p) (parameterPartial F.U p) (F.Pi p) (F.f p ^ 2) (partialEta F.Pi p) = _ |
| 980 | rw [radialPartial_natural_field hΛ (G := F.U) F.natural.U_smooth hp, |
| 981 | parameterPartial_natural_field hΛ (G := F.U) F.natural.U_smooth hp] |
| 982 | dsimp only [NaturalEntrance.Sn] |
| 983 | have hpressure : partialY F.Pi p = F.f p ^ 2 := F.natural.pressure_equation p hp |
| 984 | rw [hpressure] |
| 985 | dsimp only [StressAlgebra.axialSource, StressAlgebra.axialExponent, |
| 986 | StressAlgebra.velocityExponent, StressAlgebra.coordinateFactor, |
| 987 | NaturalAxisData.A, NaturalAxisData.D, NaturalAxisData.d, transportH] |
| 988 | ring |
| 989 | |
| 990 | theorem naturalHistories_stocks {p : Point} (hp : p ∈ domain Λ) (hX : 0 < p.1) |
| 991 | (hL : NaturalAxisData.L h p.2 ≠ 0) |
| 992 | (hf : ∀ x ∈ uIcc (0 : ℝ) p.1, F.f (x, p.2) ≠ 0) : |
| 993 | profileStockOne (naturalHistories F hΛ hP0) h p = NaturalEntrance.p1 F.f p ∧ |
| 994 | profileStockTwo (naturalHistories F hΛ hP0) h p = NaturalEntrance.p2 F.f F.U p := by |
| 995 | let P := naturalHistories F hΛ hP0 |
| 996 | have hi : primitive (P.angularSource h) p = |
| 997 | ∫ x in (0 : ℝ)..p.1, (2 * x * F.f (x, p.2)) * NaturalEntrance.Sq h F.f F.U F.Ubar (x, p.2) := by |
| 998 | apply intervalIntegral.integral_congr |
| 999 | intro x hx |
| 1000 | exact naturalHistories_angularSource F hΛ hP0 (domain_segment hΛ hp hx) (hf x hx) |
| 1001 | have hn : primitive (P.axialSource h) p = |
| 1002 | ∫ x in (0 : ℝ)..p.1, NaturalEntrance.Sn h F.U F.Ubar F.Pi (x, p.2) := by |
| 1003 | apply intervalIntegral.integral_congr |
| 1004 | intro x hx |
| 1005 | exact naturalHistories_axialSource F hΛ hP0 (domain_segment hΛ hp hx) |
| 1006 | have hq := NaturalEntrance.p1_eq_scaled_regularAngularLag F.natural hΛ hp hX.ne' hL hf |
| 1007 | have hns : NaturalEntrance.ns F.U p = |
| 1008 | NaturalEntrance.regularAxialLag h F.U F.Ubar F.Pi p / NaturalAxisData.L h p.2 := |
| 1009 | NaturalEntrance.ns_eq_scaled_regularAxialLag F.natural hΛ hp hX.ne' hL |
| 1010 | constructor |
| 1011 | · change p.1 * (primitive (P.angularSource h) p / (p.1 * (2 * p.1 * F.f p))) / |
| 1012 | NaturalAxisData.L h p.2 = _ |
| 1013 | rw [hi] |
| 1014 | exact hq.symm |
| 1015 | · change p.1 * (primitive (P.axialSource h) p / p.1) / |
| 1016 | (NaturalAxisData.L h p.2 * (Real.sqrt (2 * p.1) * F.f p)) = _ |
| 1017 | rw [hn] |
| 1018 | dsimp only [NaturalEntrance.p2, NaturalEntrance.angularVelocity] |
| 1019 | rw [hns] |
| 1020 | dsimp only [NaturalEntrance.regularAxialLag] |
| 1021 | ring |
| 1022 | |
| 1023 | /-- On the full natural part of REF, including its endpoint, the actual |
| 1024 | integral-defined stocks equal the stress-free derivative coordinates. |
| 1025 | The proof transfers all five history rows and their genuine parameter |
| 1026 | derivatives from the natural solution. -/ |
| 1027 | theorem reference_stocks_natural {δ : ℝ} (hδ : 0 < δ) |
| 1028 | (hδT : 2 * δ < ReferencePath.rampLimit) |
| 1029 | (hsmall : NaturalAxisData.SmallParameters h j) (y : ℝ) (hy : y ≤ δ) |
| 1030 | {η : ℝ} (hη : η ∈ Icc (-1 : ℝ) 1) : |
| 1031 | let N := ReferencePath.Input.ofNatural hΛ F |
| 1032 | let p := N.fromLog (y, η) |
| 1033 | profileStockOne (N.histories hδ hδT P0 hP0) h p = NaturalEntrance.p1 F.f p ∧ |
| 1034 | profileStockTwo (N.histories hδ hδT P0 hP0) h p = NaturalEntrance.p2 F.f F.U p := by |
| 1035 | let N := ReferencePath.Input.ofNatural hΛ F |
| 1036 | let P := N.histories hδ hδT P0 hP0 |
| 1037 | let Q := naturalHistories F hΛ hP0 |
| 1038 | let p := N.fromLog (y, η) |
| 1039 | change profileStockOne P h p = NaturalEntrance.p1 F.f p ∧ |
| 1040 | profileStockTwo P h p = NaturalEntrance.p2 F.f F.U p |
| 1041 | have hηJ : η ∈ ReferencePath.parameterInterval := NaturalAxisCoefficients.original_interval_interior hη |
| 1042 | have hyT : y < ReferencePath.rampLimit := by linarith |
| 1043 | have hp : p ∈ domain Λ := N.fromLog_mem ⟨hyT, hηJ⟩ |
| 1044 | have hpN : p ∈ N.radialDomain.carrier := |
| 1045 | StressActivation.FromReference.log_radius_mem N y hηJ |
| 1046 | have hX : 0 < p.1 := mul_pos N.endpoint_pos (Real.exp_pos _) |
| 1047 | have hupper : p.1 ≤ N.endpoint * Real.exp δ := |
| 1048 | mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hy) N.endpoint_pos.le |
| 1049 | have hfp : 0 < Q.f p := N.fromLog_f_pos ⟨hyT, hηJ⟩ |
| 1050 | have hfields : P.f p = Q.f p := N.refF_eq_natural hδ hδT hηJ hupper |
| 1051 | have hUfields : P.U p = Q.U p := N.refU_eq_natural hδ hδT hηJ hupper |
| 1052 | have hrows : ∀ r ξ, ξ ∈ ReferencePath.parameterInterval → |
| 1053 | profileHistory P r (p.1, ξ) = profileHistory Q r (p.1, ξ) := by |
| 1054 | intro r ξ hξ |
| 1055 | apply profileHistory_congr_across P Q r hX.le |
| 1056 | · cases r <;> rfl |
| 1057 | · intro x hx |
| 1058 | exact N.refF_eq_natural hδ hδT hξ (hx.2.trans hupper) |
| 1059 | · intro x hx |
| 1060 | exact N.refU_eq_natural hδ hδT hξ (hx.2.trans hupper) |
| 1061 | have hagree := profiles_stocks_congr P Q h ReferencePath.parameterInterval_open hηJ |
| 1062 | hpN hp hX hfields hfp.ne' hUfields hrows |
| 1063 | have hY : Λ * p.1 ≤ 41 / 10 := by |
| 1064 | have hs : Λ * p.1 = 4 * Real.exp y := N.fromLog_scaled (y, η) |
| 1065 | have he : Real.exp y < 41 / 40 := by |
| 1066 | simpa only [ReferencePath.rampLimit, Real.exp_log (by norm_num : (0 : ℝ) < 41 / 40)] using |
| 1067 | Real.exp_lt_exp.mpr hyT |
| 1068 | rw [hs] |
| 1069 | linarith |
| 1070 | have hf : ∀ x ∈ uIcc (0 : ℝ) p.1, F.f (x, p.2) ≠ 0 := by |
| 1071 | intro x hx |
| 1072 | have hx' : x ∈ Icc (0 : ℝ) p.1 := by simpa only [uIcc_of_le hX.le] using hx |
| 1073 | exact (F.positive (x, p.2) (domain_segment hΛ hp hx) (mul_nonneg hΛ.le hx'.1) |
| 1074 | ((mul_le_mul_of_nonneg_left hx'.2 hΛ.le).trans hY)).ne' |
| 1075 | have hnat := naturalHistories_stocks F hΛ hP0 hp hX (NaturalAxisData.L_pos hsmall hη).ne' hf |
| 1076 | exact ⟨hagree.1.trans hnat.1, hagree.2.trans hnat.2⟩ |
| 1077 | |
| 1078 | end NaturalHistories |
| 1079 | |
| 1080 | end NavierStokes.ActivationStocks |
| 1081 | |
| 1082 | end |