roseking's picture
Add lean source and binary files (part 91)
caec230 verified
Raw History Blame Contribute Delete
4.61 kB
17
def force (p : Coord 2) : VectorField 3 := fun t X =>
body · 1 line
  lift (residual ν (uncurry (field hb table terminal ν m))) (uncurry (impulse p)) (t, X)
20
@[fun_prop] theorem contDiff_force (hν : 0 < ν) (p : Coord 2) :
    ContDiff ℝ ∞ (uncurry (force hb table terminal ν m p)) :=
proof · 2 lines
  contDiff_lift (contDiff_residual ν (contDiff_field hb table terminal ν m hν))
    (contDiff_impulse p)
25
theorem force_uniformly_bounded (hν : 0 < ν) (hm : 1 ≤ m)
    (hdir : IncomingDirection table) (hin : IncomingRule table) (p : Coord 2) :
    Bounded (fun _ : Unit => uncurry (force hb table terminal ν m p)) := by
proof · 5 lines
  apply bounded_lift (contDiff_residual ν (contDiff_field hb table terminal ν m hν))
    (contDiff_impulse p)
  · exact Bounded.residual ν (contDiff_field hb table terminal ν m hν)
      (field_uniformly_bounded hb table terminal ν m hν hm hdir hin)
  · exact compact (contDiff_impulse p) (compactSupport_impulse p)
34
theorem force_vertical_independent (p : Coord 2) (t : ℝ) (X : Coord 3) (z : ℝ) :
    force hb table terminal ν m p t (update X 2 z) = force hb table terminal ν m p t X := by
proof · 1 line
  simp only [force, lift, projection_apply, horizontal_update_two]
38
theorem force_eq_triangular (hν : 0 < ν) (p : Coord 2) {t : ℝ} (ht : 0 ≤ t) (X : Coord 3) :
    force hb table terminal ν m p t X =
      triangularForce ν (field hb table terminal ν m) (impulse p) t X := by
proof · 3 lines
  simp only [force, lift, projection_apply,
    residual_eq_horizontalResidual ν (a := field hb table terminal ν m) (contDiff_field hb table terminal ν m hν) ht,
    triangularForce, liftVelocity, uncurry_apply_pair]
45
theorem force_finiteCylinderSupport (hν : 0 < ν) (p : Coord 2) (T : ℝ) :
    ∃ K : Set (Coord 2), IsCompact K ∧ ∀ t, 0 ≤ t → t ≤ T →
      ∀ X : Coord 3, horizontal X ∉ K → force hb table terminal ν m p t X = 0 := by
proof · 26 lines
  obtain ⟨Q, hQ⟩ := exists_nat_gt T
  let a : ℝ × Coord 2 → Coord 2 :=
    fun q => ∑ n ∈ Finset.range Q, stage hb table terminal ν m n q.1 q.2
  have ha : HasCompactSupport a := by
    simpa only [Finset.sum_fn, a] using HasCompactSupport.finset_sum
      (fun n (_ : n ∈ Finset.range Q) => compactSupport_stage hb table terminal ν m hν n)
  let K : Set (Coord 2) := (Prod.snd '' tsupport (residual ν a)) ∪ tsupport (spatialPulse p)
  refine ⟨K, ((compactSupport_residual ν ha).image continuous_snd).union
    (compactSupport_spatialPulse p), ?_⟩
  intro t ht0 ht X hX
  have hev : uncurry (field hb table terminal ν m) =ᶠ[𝓝 (t, horizontal X)] a := by
    filter_upwards [(isOpen_lt continuous_fst continuous_const).mem_nhds (ht.trans_lt hQ)] with q hq
    exact field_eq_finite hb table terminal ν m hν hq q.2
  have hr : residual ν a (t, horizontal X) = 0 := by
    apply image_eq_zero_of_notMem_tsupport
    intro h
    exact hX (Or.inl ⟨(t, horizontal X), h, rfl⟩)
  have hg : spatialPulse p (horizontal X) = 0 := by
    apply image_eq_zero_of_notMem_tsupport
    intro h
    exact hX (Or.inr h)
  simp only [force, lift, projection_apply,
    (eventuallyEq_residual ν hev).eq_of_nhds, hr, Pi.zero_apply, uncurry_apply_pair, impulse, hg,
    mul_zero]
  ext i
  fin_cases i <;> rfl
75
theorem force_NavierStokes (hν : 0 < ν) (p : Coord 2) (ρ : ScalarField 2)
    (hρ : ∀ t, 0 ≤ t → ∀ X, timeD ρ t X + advection (field hb table terminal ν m) ρ t X =
      ν * laplacian ρ t X + impulse p t X) (hρ0 : ∀ X, ρ 0 X = 0) :
    NavierStokes ν (liftVelocity (field hb table terminal ν m) ρ) 0
      (force hb table terminal ν m p) := by
proof · 7 lines
  have hn := triangular_reduction ν (field hb table terminal ν m) ρ (impulse p)
    (fun t _ => divergence_field hb table terminal ν m hν t) hρ
    (field_at_rest hb table terminal ν m hν (by norm_num)) hρ0
  refine ⟨?_, hn.2⟩
  intro t ht X i
  rw [force_eq_triangular hb table terminal ν m hν p ht]
  exact hn.1 t ht X i