File size: 34,032 Bytes
9655094 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | import Mathlib
import OAI.Analysis.BoxTransport.Geometry
namespace OAI
/-! Localized solenoidal moving fields and their unique global flows. -/
noncomputable section
open scoped Topology
open scoped BigOperators ContDiff
namespace BoxTransport.Routing
noncomputable def derivativeEntry (i j : Fin 3) :
(SpaceTime →L[ℝ] Space) →L[ℝ] ℝ :=
(ContinuousLinearMap.proj j).comp
((ContinuousLinearMap.apply ℝ Space) (coordinateDirection (some i)))
@[simp] theorem derivativeEntry_apply (i j : Fin 3) (L : SpaceTime →L[ℝ] Space) :
derivativeEntry i j L = L (coordinateDirection (some i)) j := rfl
noncomputable def curlLinear : (SpaceTime →L[ℝ] Space) →L[ℝ] Space :=
ContinuousLinearMap.pi
![derivativeEntry 1 2 - derivativeEntry 2 1,
derivativeEntry 2 0 - derivativeEntry 0 2,
derivativeEntry 0 1 - derivativeEntry 1 0]
@[simp] theorem curlLinear_apply (L : SpaceTime →L[ℝ] Space) :
curlLinear L =
![L (coordinateDirection (some 1)) 2 - L (coordinateDirection (some 2)) 1,
L (coordinateDirection (some 2)) 0 - L (coordinateDirection (some 0)) 2,
L (coordinateDirection (some 0)) 1 - L (coordinateDirection (some 1)) 0] := by
ext j
fin_cases j <;> rfl
noncomputable def spatialCurl (A : Field) : Field := fun p => curlLinear (fderiv ℝ A p)
theorem spatial_slice_fderiv {U : Field} (hU : Differentiable ℝ U)
(t : ℝ) (x : Space) (v : Space) :
fderiv ℝ (fun y => U (t, y)) x v = fderiv ℝ U (t, x) (0, v) := by
have hs := (hasFDerivAt_const (𝕜 := ℝ) t x).prodMk (hasFDerivAt_id x)
have hd := (hU (t, x)).hasFDerivAt.comp x hs
exact congrArg (fun L : Space →L[ℝ] Space => L v) hd.fderiv
theorem spatialDivergence_eq_full {U : Field} (hU : Differentiable ℝ U)
(t : ℝ) (x : Space) :
spatialDivergence U t x =
∑ j : Fin 3, (fderiv ℝ U (t, x) (coordinateDirection (some j))) j := by
unfold spatialDivergence
apply Finset.sum_congr rfl
intro j hj
rw [spatial_slice_fderiv hU]
rfl
theorem contDiff_spatialCurl {A : Field} (hA : ContDiff ℝ ∞ A) :
ContDiff ℝ ∞ (spatialCurl A) := by
exact curlLinear.contDiff.comp (hA.fderiv_right (by simp))
theorem hasCompactSupport_spatialCurl {A : Field} (hA : HasCompactSupport A) :
HasCompactSupport (spatialCurl A) :=
(hA.fderiv ℝ).comp_left (map_zero curlLinear)
theorem fderiv_spatialCurl {A : Field} (hA : ContDiff ℝ ∞ A)
(p v : SpaceTime) :
fderiv ℝ (spatialCurl A) p v = curlLinear (fderiv ℝ (fderiv ℝ A) p v) := by
have hAd : ContDiff ℝ ∞ (fderiv ℝ A) := hA.fderiv_right (by simp)
exact congrArg (fun L : SpaceTime →L[ℝ] Space => L v)
((curlLinear.hasFDerivAt.comp p
((hAd.differentiable (by simp) p).hasFDerivAt)).fderiv)
theorem spatialDivergence_spatialCurl {A : Field} (hA : ContDiff ℝ ∞ A)
(t : ℝ) (x : Space) : spatialDivergence (spatialCurl A) t x = 0 := by
rw [spatialDivergence_eq_full ((contDiff_spatialCurl hA).differentiable (by simp))]
simp only [Fin.sum_univ_three,
fderiv_spatialCurl hA, curlLinear_apply,
Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two,
Matrix.head_cons, Matrix.tail_cons]
have hsym := hA.contDiffAt.isSymmSndFDerivAt (x := (t, x)) (by simp)
have h01 := congrArg (fun z : Space => z 2)
(hsym.eq (coordinateDirection (some 0)) (coordinateDirection (some 1)))
have h02 := congrArg (fun z : Space => z 1)
(hsym.eq (coordinateDirection (some 0)) (coordinateDirection (some 2)))
have h12 := congrArg (fun z : Space => z 0)
(hsym.eq (coordinateDirection (some 1)) (coordinateDirection (some 2)))
linarith
theorem spatialCurl_congr_of_eventuallyEq {A B : Field} {p : SpaceTime}
(h : A =ᶠ[nhds p] B) : spatialCurl A p = spatialCurl B p := by
unfold spatialCurl
rw [h.fderiv_eq]
theorem spatialCurl_zero_on_slice {A : Field} (hA : Differentiable ℝ A)
{t : ℝ} (ht : ∀ x : Space, A (t, x) = 0) (x : Space) :
spatialCurl A (t, x) = 0 := by
have hslice : (fun y => A (t, y)) = fun _ => 0 := funext ht
have hz (j : Fin 3) : fderiv ℝ A (t, x) (coordinateDirection (some j)) = 0 := by
change fderiv ℝ A (t, x) (0, coordinateVector j) = 0
rw [← spatial_slice_fderiv hA t x (coordinateVector j), hslice]
simp
simp [spatialCurl, hz]
theorem curl_field_properties {A : Field} (hA : ContDiff ℝ ∞ A)
(hcompact : HasCompactSupport A)
(htime : ∀ (t : ℝ) (x : Space),
t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) → A (t, x) = 0) :
ContDiff ℝ ∞ (spatialCurl A) ∧ HasCompactSupport (spatialCurl A) ∧
(∀ t x, spatialDivergence (spatialCurl A) t x = 0) ∧
(∀ (t : ℝ) (x : Space), t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) →
spatialCurl A (t, x) = 0) := by
refine ⟨contDiff_spatialCurl hA, hasCompactSupport_spatialCurl hcompact,
spatialDivergence_spatialCurl hA, ?_⟩
intro t x ht
exact spatialCurl_zero_on_slice (hA.differentiable (by simp)) (fun y => htime t y ht) x
noncomputable def potentialComponent (c v l : Space) (i j : Fin 3) (p : SpaceTime) : ℝ :=
(1 / 2 : ℝ) * (v i * (p.2 j - c j) - v j * (p.2 i - c i)) +
((1 / 3 : ℝ) * (l i - l j)) * ((p.2 i - c i) * (p.2 j - c j))
noncomputable def affinePotential (c v l : Space) : Field := fun p =>
![potentialComponent c v l 1 2 p, potentialComponent c v l 2 0 p,
potentialComponent c v l 0 1 p]
open scoped Matrix in
theorem affinePotential_eq_cross (c v l : Space) (p : SpaceTime) :
affinePotential c v l p =
(1 / 2 : ℝ) • (v ⨯₃ (p.2 - c)) +
(1 / 3 : ℝ) • ((fun j => l j * (p.2 j - c j)) ⨯₃ (p.2 - c)) := by
ext j
fin_cases j <;>
simp [affinePotential, potentialComponent, cross_apply] <;> ring
theorem contDiff_affinePotential (c v l : Space) :
ContDiff ℝ ∞ (affinePotential c v l) := by
apply contDiff_pi.mpr
intro j
fin_cases j <;> dsimp [affinePotential, potentialComponent] <;> fun_prop
theorem fderiv_potentialComponent (c v l : Space) (i j : Fin 3) (p w : SpaceTime) :
fderiv ℝ (potentialComponent c v l i j) p w =
(1 / 2 : ℝ) * (v i * w.2 j - v j * w.2 i) +
((1 / 3 : ℝ) * (l i - l j)) *
((p.2 i - c i) * w.2 j + (p.2 j - c j) * w.2 i) := by
let π (j : Fin 3) : SpaceTime →L[ℝ] ℝ :=
(ContinuousLinearMap.proj j).comp (ContinuousLinearMap.snd ℝ ℝ Space)
have hy (j : Fin 3) : HasFDerivAt (fun p : SpaceTime => p.2 j - c j) (π j) p := by
exact ((π j).hasFDerivAt).sub_const (c j)
have hd := ((((hy j).const_mul (v i)).sub ((hy i).const_mul (v j))).const_mul
(1 / 2 : ℝ)).add
(((hy i).mul (hy j)).const_mul ((1 / 3 : ℝ) * (l i - l j)))
have hd' : HasFDerivAt (potentialComponent c v l i j) _ p := hd
have he := congrArg (fun L : SpaceTime →L[ℝ] ℝ => L w) hd'.fderiv
simpa [π, mul_add] using he
theorem fderiv_affinePotential (c v l : Space) (p w : SpaceTime) :
fderiv ℝ (affinePotential c v l) p w =
![fderiv ℝ (potentialComponent c v l 1 2) p w,
fderiv ℝ (potentialComponent c v l 2 0) p w,
fderiv ℝ (potentialComponent c v l 0 1) p w] := by
have hA := (contDiff_affinePotential c v l).differentiable (by simp)
have hcoord (i : Fin 3) :
fderiv ℝ (affinePotential c v l) p w i =
fderiv ℝ (fun q => affinePotential c v l q i) p w := by
rw [fderiv_apply (hA p)]
rfl
ext j
fin_cases j
· exact hcoord 0
· exact hcoord 1
· exact hcoord 2
theorem spatialCurl_affinePotential (c v l : Space)
(htrace : ∑ j : Fin 3, l j = 0) (p : SpaceTime) :
spatialCurl (affinePotential c v l) p = fun j => v j + l j * (p.2 j - c j) := by
simp only [Fin.sum_univ_three] at htrace
have hl2 : l 2 = -l 0 - l 1 := by linarith
unfold spatialCurl
rw [curlLinear_apply]
simp only [fderiv_affinePotential, fderiv_potentialComponent]
ext j
fin_cases j <;>
dsimp [Matrix.cons_val] <;>
simp [coordinateDirection, coordinateVector, hl2] <;> ring
theorem spatialCurl_cutoff_plateau (c v l : Space)
(htrace : ∑ j : Fin 3, l j = 0) (χ : SpaceTime → ℝ) (p : SpaceTime)
(hχ : χ =ᶠ[nhds p] fun _ => 1) :
spatialCurl (fun q => χ q • affinePotential c v l q) p =
fun j => v j + l j * (p.2 j - c j) := by
rw [← spatialCurl_affinePotential c v l htrace p]
apply spatialCurl_congr_of_eventuallyEq
filter_upwards [hχ] with q hq
simp [hq]
theorem spatialCurl_congr_on_slice {A B : Field}
(hA : Differentiable ℝ A) (hB : Differentiable ℝ B) {t : ℝ}
(hslice : ∀ x : Space, A (t, x) = B (t, x)) (x : Space) :
spatialCurl A (t, x) = spatialCurl B (t, x) := by
have he (j : Fin 3) : fderiv ℝ A (t, x) (coordinateDirection (some j)) =
fderiv ℝ B (t, x) (coordinateDirection (some j)) := by
change fderiv ℝ A (t, x) (0, coordinateVector j) =
fderiv ℝ B (t, x) (0, coordinateVector j)
rw [← spatial_slice_fderiv hA, ← spatial_slice_fderiv hB, funext hslice]
simp only [spatialCurl, curlLinear_apply, he]
noncomputable def movingAffinePotential (c v l : ℝ → Space) : Field :=
fun p => affinePotential (c p.1) (v p.1) (l p.1) p
theorem contDiff_movingAffinePotential {c v l : ℝ → Space}
(hc : ContDiff ℝ ∞ c) (hv : ContDiff ℝ ∞ v) (hl : ContDiff ℝ ∞ l) :
ContDiff ℝ ∞ (movingAffinePotential c v l) := by
apply contDiff_pi.mpr
intro j
fin_cases j <;>
dsimp [movingAffinePotential, affinePotential, potentialComponent] <;> fun_prop
theorem spatialCurl_movingAffinePotential {c v l : ℝ → Space}
(hc : ContDiff ℝ ∞ c) (hv : ContDiff ℝ ∞ v) (hl : ContDiff ℝ ∞ l)
(htrace : ∀ t, ∑ j : Fin 3, l t j = 0) (t : ℝ) (x : Space) :
spatialCurl (movingAffinePotential c v l) (t, x) =
fun j => v t j + l t j * (x j - c t j) := by
rw [spatialCurl_congr_on_slice
((contDiff_movingAffinePotential hc hv hl).differentiable (by simp))
((contDiff_affinePotential (c t) (v t) (l t)).differentiable (by simp))
(fun _ => rfl), spatialCurl_affinePotential _ _ _ (htrace t)]
noncomputable def movingBoxCutoff (c r : ℝ → Space) (η : ℝ) (p : SpaceTime) : ℝ :=
∏ j : Fin 3,
Real.smoothTransition ((r p.1 j + 2 * η + (p.2 j - c p.1 j)) / η) *
Real.smoothTransition ((r p.1 j + 2 * η - (p.2 j - c p.1 j)) / η)
theorem contDiff_movingBoxCutoff {c r : ℝ → Space} (η : ℝ)
(hc : ContDiff ℝ ∞ c) (hr : ContDiff ℝ ∞ r) :
ContDiff ℝ ∞ (movingBoxCutoff c r η) := by
unfold movingBoxCutoff
apply contDiff_prod
intro j hj
apply ContDiff.mul <;> apply Real.smoothTransition.contDiff.comp <;> fun_prop
theorem movingBoxCutoff_one {c r : ℝ → Space} {η : ℝ} (hη : 0 < η)
{p : SpaceTime} (hp : p.2 ∈ realBox (c p.1) (fun j => r p.1 j + η)) :
movingBoxCutoff c r η p = 1 := by
apply Finset.prod_eq_one
intro j hj
have hleft : 1 ≤ (r p.1 j + 2 * η + (p.2 j - c p.1 j)) / η := by
apply (le_div_iff₀ hη).mpr
have := (abs_le.mp (hp j)).1
linarith
have hright : 1 ≤ (r p.1 j + 2 * η - (p.2 j - c p.1 j)) / η := by
apply (le_div_iff₀ hη).mpr
have := (abs_le.mp (hp j)).2
linarith
rw [Real.smoothTransition.one_of_one_le hleft,
Real.smoothTransition.one_of_one_le hright, mul_one]
theorem movingBoxCutoff_zero {c r : ℝ → Space} {η : ℝ} (hη : 0 < η)
{p : SpaceTime} (hp : p.2 ∉ openBox (c p.1) (r p.1) (2 * η)) :
movingBoxCutoff c r η p = 0 := by
classical
simp only [openBox, Set.mem_ofPred_eq, not_forall, not_lt] at hp
obtain ⟨j, hj⟩ := hp
apply Finset.prod_eq_zero (Finset.mem_univ j)
rcases le_or_gt (p.2 j - c p.1 j) 0 with hleft | hright
· rw [abs_of_nonpos hleft] at hj
have hz : Real.smoothTransition
((r p.1 j + 2 * η + (p.2 j - c p.1 j)) / η) = 0 := by
apply Real.smoothTransition.zero_of_nonpos
apply div_nonpos_of_nonpos_of_nonneg (by linarith) hη.le
rw [hz, zero_mul]
· rw [abs_of_pos hright] at hj
have hz : Real.smoothTransition
((r p.1 j + 2 * η - (p.2 j - c p.1 j)) / η) = 0 := by
apply Real.smoothTransition.zero_of_nonpos
apply div_nonpos_of_nonpos_of_nonneg (by linarith) hη.le
rw [hz, mul_zero]
def movingPlateau (c r : ℝ → Space) (η : ℝ) : Set SpaceTime :=
{p | p.2 ∈ openBox (c p.1) (r p.1) η}
theorem isOpen_movingPlateau {c r : ℝ → Space} (η : ℝ)
(hc : Continuous c) (hr : Continuous r) : IsOpen (movingPlateau c r η) := by
change IsOpen {p : SpaceTime | ∀ j, |p.2 j - c p.1 j| < r p.1 j + η}
simp only [Set.ofPred_forall]
apply isOpen_iInter_of_finite
intro j
apply isOpen_lt <;> fun_prop
theorem movingBoxCutoff_eventually_one {c r : ℝ → Space} {η : ℝ}
(hη : 0 < η) (hc : Continuous c) (hr : Continuous r)
{p : SpaceTime} (hp : p ∈ movingPlateau c r η) :
movingBoxCutoff c r η =ᶠ[nhds p] fun _ => 1 := by
filter_upwards [(isOpen_movingPlateau η hc hr).mem_nhds hp] with q hq
apply movingBoxCutoff_one hη
intro j
exact le_of_lt (hq j)
theorem spatialCurl_localized_movingAffinePotential {c v l r : ℝ → Space} {η : ℝ}
(hc : ContDiff ℝ ∞ c) (hv : ContDiff ℝ ∞ v) (hl : ContDiff ℝ ∞ l)
(hr : ContDiff ℝ ∞ r) (hη : 0 < η)
(htrace : ∀ t, ∑ j : Fin 3, l t j = 0)
{p : SpaceTime} (hp : p ∈ movingPlateau c r η) :
spatialCurl (fun q => movingBoxCutoff c r η q • movingAffinePotential c v l q) p =
fun j => v p.1 j + l p.1 j * (p.2 j - c p.1 j) := by
rw [← spatialCurl_movingAffinePotential hc hv hl htrace p.1 p.2]
apply spatialCurl_congr_of_eventuallyEq
filter_upwards [movingBoxCutoff_eventually_one hη hc.continuous hr.continuous hp]
with q hq
rw [hq, one_smul]
noncomputable def localizedPotential (c v l r : ℝ → Space) (η : ℝ) : Field :=
fun p => movingBoxCutoff c r η p • movingAffinePotential c v l p
theorem contDiff_localizedPotential {c v l r : ℝ → Space} (η : ℝ)
(hc : ContDiff ℝ ∞ c) (hv : ContDiff ℝ ∞ v)
(hl : ContDiff ℝ ∞ l) (hr : ContDiff ℝ ∞ r) :
ContDiff ℝ ∞ (localizedPotential c v l r η) :=
(contDiff_movingBoxCutoff η hc hr).smul (contDiff_movingAffinePotential hc hv hl)
theorem movingAffinePotential_zero {c v l : ℝ → Space} {t : ℝ}
(hv : v t = 0) (hl : l t = 0) (x : Space) :
movingAffinePotential c v l (t, x) = 0 := by
ext j
fin_cases j <;> simp [movingAffinePotential, affinePotential, potentialComponent, hv, hl]
theorem hasCompactSupport_localizedPotential {c v l r : ℝ → Space}
{η t₀ t₁ R : ℝ} (hη : 0 < η) (hR : 0 ≤ R)
(hbound : ∀ t ∈ Set.Icc t₀ t₁, ∀ j, |c t j| + r t j + 2 * η ≤ R)
(htime : ∀ t ∉ Set.Icc t₀ t₁, v t = 0 ∧ l t = 0) :
HasCompactSupport (localizedPotential c v l r η) := by
apply HasCompactSupport.of_support_subset_isCompact
(isCompact_Icc.prod (isCompact_closedBall (0 : Space) R))
intro p hp
have htimep : p.1 ∈ Set.Icc t₀ t₁ := by
by_contra hn
have hz := movingAffinePotential_zero (c := c) (htime p.1 hn).1 (htime p.1 hn).2 p.2
exact hp (by dsimp [localizedPotential]; rw [hz, smul_zero])
have hbox : p.2 ∈ openBox (c p.1) (r p.1) (2 * η) := by
by_contra hn
have hz := movingBoxCutoff_zero (c := c) (r := r) hη hn
exact hp (by dsimp [localizedPotential]; rw [hz, zero_smul])
refine ⟨htimep, ?_⟩
rw [Metric.mem_closedBall, dist_zero_right, pi_norm_le_iff_of_nonneg hR]
intro j
rw [Real.norm_eq_abs]
calc
|p.2 j| = |(p.2 j - c p.1 j) + c p.1 j| := by congr 1; ring
_ ≤ |p.2 j - c p.1 j| + |c p.1 j| := abs_add_le _ _
_ ≤ R := by have := hbox j; have := hbound p.1 htimep j; linarith
noncomputable def familyPotential {n : ℕ}
(c v l r : Fin n → ℝ → Space) (η : ℝ) : Field :=
fun p => ∑ i, localizedPotential (c i) (v i) (l i) (r i) η p
theorem contDiff_familyPotential {n : ℕ} {c v l r : Fin n → ℝ → Space} (η : ℝ)
(hc : ∀ i, ContDiff ℝ ∞ (c i)) (hv : ∀ i, ContDiff ℝ ∞ (v i))
(hl : ∀ i, ContDiff ℝ ∞ (l i)) (hr : ∀ i, ContDiff ℝ ∞ (r i)) :
ContDiff ℝ ∞ (familyPotential c v l r η) :=
ContDiff.sum (fun i _ => contDiff_localizedPotential η (hc i) (hv i) (hl i) (hr i))
theorem hasCompactSupport_familyPotential {n : ℕ} {c v l r : Fin n → ℝ → Space}
{η t₀ t₁ R : ℝ} (hη : 0 < η) (hR : 0 ≤ R)
(hbound : ∀ i t, t ∈ Set.Icc t₀ t₁ → ∀ j, |c i t j| + r i t j + 2 * η ≤ R)
(htime : ∀ i t, t ∉ Set.Icc t₀ t₁ → v i t = 0 ∧ l i t = 0) :
HasCompactSupport (familyPotential c v l r η) := by
have hi (i : Fin n) : HasCompactSupport (localizedPotential (c i) (v i) (l i) (r i) η) :=
hasCompactSupport_localizedPotential hη hR (hbound i) (htime i)
have hs := HasCompactSupport.finset_sum (s := (Finset.univ : Finset (Fin n)))
(fun i _ => hi i)
have he : familyPotential c v l r η =
∑ i : Fin n, localizedPotential (c i) (v i) (l i) (r i) η := by
funext p
exact (Finset.sum_apply p Finset.univ _).symm
rw [he]
exact hs
theorem familyPotential_zero {n : ℕ} {c v l r : Fin n → ℝ → Space}
(η : ℝ) {t : ℝ} (hv : ∀ i, v i t = 0) (hl : ∀ i, l i t = 0) (x : Space) :
familyPotential c v l r η (t, x) = 0 := by
apply Finset.sum_eq_zero
intro i hi
change movingBoxCutoff (c i) (r i) η (t, x) • movingAffinePotential (c i) (v i) (l i) (t, x) = 0
rw [movingAffinePotential_zero (hv i) (hl i), smul_zero]
theorem familyPotential_eq_on_plateau {n : ℕ} {c v l r : Fin n → ℝ → Space}
{η : ℝ} (hη : 0 < η)
(hdis : ∀ t, Pairwise fun i j =>
Disjoint (realBox (c i t) (fun k => r i t k + 2 * η))
(realBox (c j t) (fun k => r j t k + 2 * η)))
(i : Fin n) {p : SpaceTime} (hp : p ∈ movingPlateau (c i) (r i) η) :
familyPotential c v l r η p = movingAffinePotential (c i) (v i) (l i) p := by
have hx : p.2 ∈ realBox (c i p.1) (fun k => r i p.1 k + 2 * η) := by
intro k
have := hp k
linarith
rw [familyPotential, Finset.sum_eq_single i]
· unfold localizedPotential
rw [movingBoxCutoff_one hη (fun k => (hp k).le), one_smul]
· intro j hj hji
have hnot : p.2 ∉ openBox (c j p.1) (r j p.1) (2 * η) := by
intro hy
exact Set.disjoint_left.mp (hdis p.1 (Ne.symm hji)) hx (fun k => (hy k).le)
unfold localizedPotential
rw [movingBoxCutoff_zero hη hnot, zero_smul]
· simp
theorem spatialCurl_familyPotential_on_plateau {n : ℕ} {c v l r : Fin n → ℝ → Space}
{η : ℝ} (hη : 0 < η)
(hc : ∀ i, ContDiff ℝ ∞ (c i)) (hv : ∀ i, ContDiff ℝ ∞ (v i))
(hl : ∀ i, ContDiff ℝ ∞ (l i)) (hr : ∀ i, ContDiff ℝ ∞ (r i))
(htrace : ∀ i t, ∑ k : Fin 3, l i t k = 0)
(hdis : ∀ t, Pairwise fun i j =>
Disjoint (realBox (c i t) (fun k => r i t k + 2 * η))
(realBox (c j t) (fun k => r j t k + 2 * η)))
(i : Fin n) {p : SpaceTime} (hp : p ∈ movingPlateau (c i) (r i) η) :
spatialCurl (familyPotential c v l r η) p =
fun k => v i p.1 k + l i p.1 k * (p.2 k - c i p.1 k) := by
rw [← spatialCurl_movingAffinePotential (hc i) (hv i) (hl i) (htrace i) p.1 p.2]
apply spatialCurl_congr_of_eventuallyEq
filter_upwards [(isOpen_movingPlateau η (hc i).continuous (hr i).continuous).mem_nhds hp]
with q hq
exact familyPotential_eq_on_plateau hη hdis i hq
theorem localized_separated_motion {n : ℕ} {c v l r : Fin n → ℝ → Space}
{η R : ℝ} (hη : 0 < η) (hR : 0 ≤ R)
(hc : ∀ i, ContDiff ℝ ∞ (c i)) (hv : ∀ i, ContDiff ℝ ∞ (v i))
(hl : ∀ i, ContDiff ℝ ∞ (l i)) (hr : ∀ i, ContDiff ℝ ∞ (r i))
(htrace : ∀ i t, ∑ k : Fin 3, l i t k = 0)
(hdis : ∀ t, Pairwise fun i j =>
Disjoint (realBox (c i t) (fun k => r i t k + 2 * η))
(realBox (c j t) (fun k => r j t k + 2 * η)))
(hbound : ∀ i t, t ∈ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) →
∀ j, |c i t j| + r i t j + 2 * η ≤ R)
(htime : ∀ i t, t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) →
v i t = 0 ∧ l i t = 0) :
∃ U : Field,
ContDiff ℝ ∞ U ∧ HasCompactSupport U ∧
(∀ t x, spatialDivergence U t x = 0) ∧
(∀ (t : ℝ) x, t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) → U (t, x) = 0) ∧
(∀ i (p : SpaceTime), p ∈ movingPlateau (c i) (r i) η →
U p = fun k => v i p.1 k + l i p.1 k * (p.2 k - c i p.1 k)) := by
refine ⟨spatialCurl (familyPotential c v l r η), ?_⟩
have hA := contDiff_familyPotential η hc hv hl hr
have hcompact := hasCompactSupport_familyPotential hη hR hbound htime
have htimeA : ∀ (t : ℝ) (x : Space), t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) →
familyPotential c v l r η (t, x) = 0 := by
intro t x ht
exact familyPotential_zero η (fun i => (htime i t ht).1)
(fun i => (htime i t ht).2) x
obtain ⟨hsm, hcp, hdiv, htm⟩ := curl_field_properties hA hcompact htimeA
exact ⟨hsm, hcp, hdiv, htm,
fun i _ hp => spatialCurl_familyPotential_on_plateau hη hc hv hl hr htrace hdis i hp⟩
theorem smooth_compact_bounds {U : Field} (hU : ContDiff ℝ ∞ U)
(hs : HasCompactSupport U) :
∃ M K : NNReal, (∀ p, ‖U p‖ ≤ M) ∧ LipschitzWith K U := by
obtain ⟨M, hM, hMb⟩ := (hs.isCompact_range hU.continuous).isBounded.exists_pos_norm_le
obtain ⟨K, hK, hKb⟩ := ((hs.fderiv ℝ).isCompact_range
(hU.continuous_fderiv (by simp))).isBounded.exists_pos_norm_le
refine ⟨⟨M, hM.le⟩, ⟨K, hK.le⟩, (fun p => hMb _ ⟨p, rfl⟩), ?_⟩
apply lipschitzWith_of_nnnorm_fderiv_le (hU.differentiable (by simp))
intro p
exact hKb _ ⟨p, rfl⟩
theorem globalFlow_of_bounded_lipschitz {U : Field} {M K : NNReal}
(hcont : Continuous U) (hbound : ∀ p, ‖U p‖ ≤ M)
(hlip : ∀ t, LipschitzWith K (fun x => U (t, x))) :
∃ Φ, IsGlobalFlow U Φ := by
have localSolution (x : Space) (r : ℝ) (hr : 0 < r) :
∃ α : ℝ → Space, α 0 = x ∧
∀ t ∈ Set.Ioo (-r) r, HasDerivAt α (U (t, α t)) t := by
let t₀ : Set.Icc (-r) r := ⟨0, by constructor <;> linarith⟩
let a : NNReal := M * ⟨r, hr.le⟩
have hpl : IsPicardLindelof (fun t x => U (t, x)) t₀ x a 0 M K := by
constructor
· intro t ht
exact (hlip t).lipschitzOnWith
· intro y hy
exact (hcont.comp (continuous_id.prodMk continuous_const)).continuousOn
· intro t ht y hy
exact hbound (t, y)
· change (M : ℝ) * max (r - 0) (0 - (-r)) ≤ (M : ℝ) * r - 0
simp
obtain ⟨α, hα0, hα⟩ := hpl.exists_eq_forall_mem_Icc_hasDerivWithinAt₀
exact ⟨α, hα0, fun t ht => (hα t ⟨ht.1.le, ht.2.le⟩).hasDerivAt
(Icc_mem_nhds ht.1 ht.2)⟩
have trajectories (x : Space) :
∃ γ : ℝ → Space, γ 0 = x ∧ ∀ t, HasDerivAt γ (U (t, γ t)) t := by
let Radius := {r : ℝ // 0 < r}
have hlocal (r : Radius) := localSolution x r.1 r.2
choose α hα0 hα using hlocal
have compatibility (r s : Radius) (t : ℝ)
(htr : t ∈ Set.Ioo (-r.1) r.1) (hts : t ∈ Set.Ioo (-s.1) s.1) :
α r t = α s t := by
have hm : 0 < min r.1 s.1 := lt_min r.2 s.2
have he : Set.EqOn (α r) (α s) (Set.Ioo (-min r.1 s.1) (min r.1 s.1)) := by
apply ODE_solution_unique_of_mem_Ioo
(v := fun t x => U (t, x)) (s := fun _ => Set.univ) (K := K)
(t₀ := 0)
· intro t ht
exact (hlip t).lipschitzOnWith
· exact ⟨neg_neg_of_pos hm, hm⟩
· intro t ht
exact ⟨hα r t ⟨lt_of_le_of_lt (neg_le_neg (min_le_left _ _)) ht.1,
lt_of_lt_of_le ht.2 (min_le_left _ _)⟩, Set.mem_univ _⟩
· intro t ht
exact ⟨hα s t ⟨lt_of_le_of_lt (neg_le_neg (min_le_right _ _)) ht.1,
lt_of_lt_of_le ht.2 (min_le_right _ _)⟩, Set.mem_univ _⟩
· rw [hα0, hα0]
apply he
constructor
· rw [← max_neg_neg]
exact max_lt htr.1 hts.1
· exact lt_min htr.2 hts.2
let ρ : ℝ → Radius := fun t => ⟨|t| + 1, by positivity⟩
have hin (t : ℝ) : t ∈ Set.Ioo (-(ρ t).1) (ρ t).1 := by
have hp := le_abs_self t
have hn := neg_abs_le t
change -(|t| + 1) < t ∧ t < |t| + 1
constructor <;> linarith
let γ : ℝ → Space := fun t => α (ρ t) t
have heq (r : Radius) (t : ℝ) (ht : t ∈ Set.Ioo (-r.1) r.1) : γ t = α r t :=
compatibility (ρ t) r t (hin t) ht
refine ⟨γ, hα0 (ρ 0), ?_⟩
intro t
have hev : γ =ᶠ[nhds t] α (ρ t) := by
filter_upwards [isOpen_Ioo.mem_nhds (hin t)] with s hs
exact heq (ρ t) s hs
exact (hα (ρ t) t (hin t)).congr_of_eventuallyEq hev
choose γ hγ0 hγ using trajectories
refine ⟨fun t x => γ x t, (fun x => hγ0 x), (fun t x => hγ x t), ?_⟩
intro x ν hν0 hν t
have he : ν = γ x := ODE_solution_unique_univ
(v := fun t x => U (t, x)) (s := fun _ => Set.univ) (K := K) (t₀ := 0)
(fun t => (hlip t).lipschitzOnWith)
(fun t => ⟨hν t, Set.mem_univ _⟩)
(fun t => ⟨hγ x t, Set.mem_univ _⟩) (hν0.trans (hγ0 x).symm)
exact congrFun he t
theorem smooth_compact_globalFlow {U : Field} (hU : ContDiff ℝ ∞ U)
(hs : HasCompactSupport U) : ∃ Φ, IsGlobalFlow U Φ := by
obtain ⟨M, K, hb, hl⟩ := smooth_compact_bounds hU hs
apply globalFlow_of_bounded_lipschitz hU.continuous hb
intro t
simpa only [mul_one, Function.comp_def] using hl.comp (LipschitzWith.prodMk_left t)
theorem trace_zero_of_determinant_one {d : ℝ → Space} {l : Space} {t : ℝ}
(hd : ∀ j, HasDerivAt (fun s => d s j) (l j * d t j) t)
(hdet : ∀ s, ∏ j : Fin 3, d s j = 1) : ∑ j : Fin 3, l j = 0 := by
have he : (fun s => d s 0 * d s 1 * d s 2) = fun _ => (1 : ℝ) := by
funext s
simpa only [Fin.prod_univ_three] using hdet s
have hp := ((hd 0).mul (hd 1)).mul (hd 2)
change HasDerivAt (fun s => d s 0 * d s 1 * d s 2) _ t at hp
rw [he] at hp
have hz := hp.unique (hasDerivAt_const t (1 : ℝ))
dsimp only [Pi.mul_apply] at hz
have ht : d t 0 * d t 1 * d t 2 = 1 := by
simpa only [Fin.prod_univ_three] using hdet t
rw [Fin.sum_univ_three]
calc
l 0 + l 1 + l 2 = (l 0 + l 1 + l 2) * (d t 0 * d t 1 * d t 2) := by rw [ht, mul_one]
_ = 0 := by nlinarith only [hz]
def affineTrajectory (c d : ℝ → Space) (a x : Space) (t : ℝ) : Space :=
fun j => c t j + d t j * (x j - a j)
theorem affineTrajectory_initial {c d : ℝ → Space} {a : Space}
(hc : c 0 = a) (hd : d 0 = 1) (x : Space) : affineTrajectory c d a x 0 = x := by
ext j
simp [affineTrajectory, hc, hd]
theorem hasDerivAt_affineTrajectory {c d : ℝ → Space} {v l : Space} {t : ℝ}
(hc : HasDerivAt c v t)
(hd : ∀ j, HasDerivAt (fun s => d s j) (l j * d t j) t) (a x : Space) :
HasDerivAt (affineTrajectory c d a x)
(fun j => v j + l j * (affineTrajectory c d a x t j - c t j)) t := by
apply hasDerivAt_pi.mpr
intro j
simpa only [affineTrajectory, add_sub_cancel_left, mul_assoc] using
(hasDerivAt_pi.mp hc j).fun_add ((hd j).mul_const (x j - a j))
theorem affineTrajectory_in_plateau {c d : ℝ → Space} (a h : Space)
{η M : ℝ} (hη : 0 < η) (hM : 0 < M)
(hd : ∀ t j, 0 < d t j) (hdM : ∀ t j, d t j ≤ M)
{x : Space} (hx : x ∈ openBox a h (η / (2 * M))) (t : ℝ) :
(t, affineTrajectory c d a x t) ∈
movingPlateau c (fun s j => d s j * h j) η := by
have hδ : 0 < η / (2 * M) := div_pos hη (by positivity)
have hmδ : M * (η / (2 * M)) = η / 2 := by field_simp
have hp := affine_openBox_control a (c t) h (d t) hδ.le (hd t) (hdM t) hx
rw [hmδ] at hp
intro j
exact (hp j).trans (by linarith)
theorem realizes_supplied_separated_motion {n : ℕ}
(a h : Fin n → Space) {c v l d : Fin n → ℝ → Space}
{η M R : ℝ} (hη : 0 < η) (hM : 0 < M) (hR : 0 ≤ R)
(hc : ∀ i, ContDiff ℝ ∞ (c i)) (hv : ∀ i, ContDiff ℝ ∞ (v i))
(hl : ∀ i, ContDiff ℝ ∞ (l i)) (hd : ∀ i, ContDiff ℝ ∞ (d i))
(hc0 : ∀ i, c i 0 = a i) (hd0 : ∀ i, d i 0 = 1)
(hcv : ∀ i t, HasDerivAt (c i) (v i t) t)
(hdl : ∀ i t j, HasDerivAt (fun s => d i s j) (l i t j * d i t j) t)
(hdet : ∀ i t, ∏ j : Fin 3, d i t j = 1)
(hdpos : ∀ i t j, 0 < d i t j) (hdM : ∀ i t j, d i t j ≤ M)
(hdis : ∀ t, Pairwise fun i j =>
Disjoint (realBox (c i t) (fun k => d i t k * h i k + 2 * η))
(realBox (c j t) (fun k => d j t k * h j k + 2 * η)))
(hbound : ∀ i t, t ∈ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) →
∀ j, |c i t j| + d i t j * h i j + 2 * η ≤ R)
(htime : ∀ i t, t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) →
v i t = 0 ∧ l i t = 0) :
∃ (U : Field) (Φ : ℝ → Space → Space),
ContDiff ℝ ∞ U ∧ HasCompactSupport U ∧
(∀ t x, spatialDivergence U t x = 0) ∧
(∀ (t : ℝ) x, t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) → U (t, x) = 0) ∧
IsGlobalFlow U Φ ∧
(∀ i, ∃ O : Set Space, IsOpen O ∧ realBox (a i) (h i) ⊆ O ∧
∀ x ∈ O, ∀ t, Φ t x = affineTrajectory (c i) (d i) (a i) x t) := by
let r : Fin n → ℝ → Space := fun i t j => d i t j * h i j
have hr (i : Fin n) : ContDiff ℝ ∞ (r i) := by
apply contDiff_pi.mpr
intro j
exact (contDiff_pi.mp (hd i) j).mul contDiff_const
have htrace (i : Fin n) (t : ℝ) : ∑ j : Fin 3, l i t j = 0 :=
trace_zero_of_determinant_one (hdl i t) (hdet i)
obtain ⟨U, hUsm, hUcp, hUdiv, hUt, hUplat⟩ :=
localized_separated_motion hη hR hc hv hl hr htrace hdis hbound htime
obtain ⟨Φ, hΦ⟩ := smooth_compact_globalFlow hUsm hUcp
refine ⟨U, Φ, hUsm, hUcp, hUdiv, hUt, hΦ, ?_⟩
intro i
have hδ : 0 < η / (2 * M) := div_pos hη (by positivity)
refine ⟨openBox (a i) (h i) (η / (2 * M)), isOpen_openBox _ _ _,
realBox_subset_openBox _ _ hδ, ?_⟩
intro x hx t
apply Eq.symm
apply hΦ.2.2 x (affineTrajectory (c i) (d i) (a i) x)
(affineTrajectory_initial (hc0 i) (hd0 i) x)
intro s
have hp := affineTrajectory_in_plateau (c := c i) (a i) (h i) hη hM (hdpos i) (hdM i) hx s
rw [hUplat i _ hp]
exact hasDerivAt_affineTrajectory (hcv i s) (hdl i s) (a i) x
theorem contDiff_motion_deriv {c : ℝ → Space} (hc : ContDiff ℝ ∞ c) :
ContDiff ℝ ∞ (deriv c) :=
(hc.fderiv_right (m := ∞) (by simp)).clm_apply contDiff_const
noncomputable def diagonalLogVelocity (d : ℝ → Space) (t : ℝ) : Space :=
fun j => deriv d t j / d t j
theorem contDiff_diagonalLogVelocity {d : ℝ → Space}
(hd : ContDiff ℝ ∞ d) (hpos : ∀ t j, 0 < d t j) :
ContDiff ℝ ∞ (diagonalLogVelocity d) := by
apply contDiff_pi.mpr
intro j
exact (contDiff_pi.mp (contDiff_motion_deriv hd) j).div (contDiff_pi.mp hd j)
(fun t => ne_of_gt (hpos t j))
theorem hasDerivAt_diagonalLogVelocity {d : ℝ → Space}
(hd : ContDiff ℝ ∞ d) (hpos : ∀ t j, 0 < d t j) (t : ℝ) (j : Fin 3) :
HasDerivAt (fun s => d s j) (diagonalLogVelocity d t j * d t j) t := by
rw [diagonalLogVelocity, div_mul_cancel₀ _ (ne_of_gt (hpos t j))]
exact hasDerivAt_pi.mp ((hd.differentiable (by simp) t).hasDerivAt) j
theorem deriv_zero_outside_interval {f : ℝ → Space} {a b : Space} {u v t : ℝ}
(hbefore : ∀ s, s ≤ u → f s = a) (hafter : ∀ s, v ≤ s → f s = b)
(ht : t ∉ Set.Icc u v) : deriv f t = 0 := by
by_cases hlo : t < u
· have he : f =ᶠ[nhds t] fun _ => a := by
filter_upwards [eventually_lt_nhds hlo] with s hs
exact hbefore s hs.le
simp [deriv, he.fderiv_eq]
· have hhi : v < t := by
by_contra hh
exact ht ⟨le_of_not_gt hlo, le_of_not_gt hh⟩
have he : f =ᶠ[nhds t] fun _ => b := by
filter_upwards [eventually_gt_nhds hhi] with s hs
exact hafter s hs.le
simp [deriv, he.fderiv_eq]
theorem realizes_stationary_separated_motion {n : ℕ}
(a h : Fin n → Space) {c d : Fin n → ℝ → Space}
{η M R : ℝ} (hη : 0 < η) (hM : 0 < M) (hR : 0 ≤ R)
(hc : ∀ i, ContDiff ℝ ∞ (c i)) (hd : ∀ i, ContDiff ℝ ∞ (d i))
(hstart : ∀ i t, t ≤ (1 / 4 : ℝ) → c i t = a i ∧ d i t = 1)
(hend : ∀ i t, (3 / 4 : ℝ) ≤ t → c i t = c i 1 ∧ d i t = d i 1)
(hdet : ∀ i t, ∏ j : Fin 3, d i t j = 1)
(hdpos : ∀ i t j, 0 < d i t j) (hdM : ∀ i t j, d i t j ≤ M)
(hdis : ∀ t, Pairwise fun i j =>
Disjoint (realBox (c i t) (fun k => d i t k * h i k + 2 * η))
(realBox (c j t) (fun k => d j t k * h j k + 2 * η)))
(hbound : ∀ i t, t ∈ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) →
∀ j, |c i t j| + d i t j * h i j + 2 * η ≤ R) :
∃ (U : Field) (Φ : ℝ → Space → Space),
ContDiff ℝ ∞ U ∧ HasCompactSupport U ∧
(∀ t x, spatialDivergence U t x = 0) ∧
(∀ (t : ℝ) x, t ∉ Set.Icc (1 / 4 : ℝ) (3 / 4 : ℝ) → U (t, x) = 0) ∧
IsGlobalFlow U Φ ∧
(∀ i, ∃ O : Set Space, IsOpen O ∧ realBox (a i) (h i) ⊆ O ∧
∀ x ∈ O, ∀ t, Φ t x = affineTrajectory (c i) (d i) (a i) x t) := by
apply realizes_supplied_separated_motion a h hη hM hR hc
(fun i => contDiff_motion_deriv (hc i))
(fun i => contDiff_diagonalLogVelocity (hd i) (hdpos i)) hd
(fun i => (hstart i 0 (by norm_num)).1)
(fun i => (hstart i 0 (by norm_num)).2)
(fun i t => ((hc i).differentiable (by simp) t).hasDerivAt)
(fun i => hasDerivAt_diagonalLogVelocity (hd i) (hdpos i))
hdet hdpos hdM hdis hbound
intro i t ht
constructor
· exact deriv_zero_outside_interval (fun s hs => (hstart i s hs).1)
(fun s hs => (hend i s hs).1) ht
· have hz := deriv_zero_outside_interval (fun s hs => (hstart i s hs).2)
(fun s hs => (hend i s hs).2) ht
ext j
simp [diagonalLogVelocity, hz]
end BoxTransport.Routing
end
end OAI
|