roseking's picture
Add lean source and binary files (part 91)
caec230 verified
Raw History Blame Contribute Delete
6.57 kB
21
def driftData (hν : 0 < ν) (i : Fin 2) : MildScalar.SupportedData :=
body · 3 lines
  ⟨fun t X => field hb table terminal ν m t X i,
    (contDiff_apply ℝ ℝ i).comp (contDiff_field hb table terminal ν m hν),
    localSupport_field hb table terminal ν m hν i⟩
26
@[simp] theorem driftData_scalar (hν : 0 < ν) (i : Fin 2) (t : ℝ) (X : Coord 2) :
    (driftData hb table terminal ν m hν i).scalar t X = field hb table terminal ν m t X i := rfl
29
def scalarSolution (hν : 0 < ν) (p : Coord 2) : ScalarField 2 :=
body · 1 line
  MildScalar.scalar hν (driftData hb table terminal ν m hν) (impulseData p)
32
theorem contDiff_scalarSolution (hν : 0 < ν) (p : Coord 2) :
    ContDiff ℝ ∞ (uncurry (scalarSolution hb table terminal ν m hν p)) :=
proof · 1 line
  MildScalar.contDiff_scalar hν _ _ (impulseData_nonpos p)
36
theorem scalarSolution_C1Tails (hν : 0 < ν) (p : Coord 2) :
    C1Tails (scalarSolution hb table terminal ν m hν p) :=
proof · 1 line
  MildScalar.scalar_C1Tails hν _ _
40
theorem scalarSolution_D_Tails (hν : 0 < ν) (p : Coord 2) (i : Fin 2) :
    ContinuousTails (spatialD i (scalarSolution hb table terminal ν m hν p)) :=
proof · 1 line
  MildScalar.scalar_D_Tails hν _ _ i
44
theorem scalarSolution_DD_Tails (hν : 0 < ν) (p : Coord 2) (i j : Fin 2) :
    ContinuousTails (spatialD j (spatialD i (scalarSolution hb table terminal ν m hν p))) :=
proof · 1 line
  MildScalar.scalar_DD_Tails hν _ _ i j
48
theorem scalarSolution_equation (hν : 0 < ν) (p : Coord 2) {t : ℝ} (ht : 0 ≤ t) (X : Coord 2) :
    timeD (scalarSolution hb table terminal ν m hν p) t X +
      advection (field hb table terminal ν m) (scalarSolution hb table terminal ν m hν p) t X =
        ν * laplacian (scalarSolution hb table terminal ν m hν p) t X + impulse p t X := by
proof · 2 lines
  exact MildScalar.scalar_equation hν (driftData hb table terminal ν m hν) (impulseData p)
    (fun t _ X => divergence_field hb table terminal ν m hν t X) ht X
55
@[simp] theorem scalarSolution_zero (hν : 0 < ν) (p X : Coord 2) :
    scalarSolution hb table terminal ν m hν p 0 X = 0 :=
proof · 1 line
  MildScalar.scalar_zero hν _ _ X
59
theorem scalarSolution_properties (hν : 0 < ν) (p : Coord 2) :
    (∀ t ≥ 0, ∀ X, 0 ≤ scalarSolution hb table terminal ν m hν p t X) ∧
    (∀ t, Integrable (scalarSolution hb table terminal ν m hν p t)) ∧
    (∀ t ≥ 0, (∫ X, scalarSolution hb table terminal ν m hν p t X) = step t) :=
proof · 7 lines
  scalar_properties_of_C1Tails hb table terminal ν m hν p
    (contDiff_scalarSolution hb table terminal ν m hν p)
    (scalarSolution_C1Tails hb table terminal ν m hν p)
    (scalarSolution_D_Tails hb table terminal ν m hν p)
    (scalarSolution_DD_Tails hb table terminal ν m hν p)
    (fun _ ht => scalarSolution_equation hb table terminal ν m hν p ht)
    (scalarSolution_zero hb table terminal ν m hν p)
71
def velocity (hν : 0 < ν) (p : Coord 2) : VectorField 3 :=
body · 1 line
  liftVelocity (field hb table terminal ν m) (scalarSolution hb table terminal ν m hν p)
74
theorem contDiff_velocity (hν : 0 < ν) (p : Coord 2) :
    ContDiff ℝ ∞ (uncurry (velocity hb table terminal ν m hν p)) := by
proof · 4 lines
  convert JointCalculus.contDiff_lift (contDiff_field hb table terminal ν m hν)
    (contDiff_scalarSolution hb table terminal ν m hν p) using 1
  funext q
  simp only [uncurry, velocity, liftVelocity, JointCalculus.lift, JointCalculus.projection_apply]
81
theorem velocity_comparisonClass (hν : 0 < ν) (p : Coord 2) :
    Cylinder.ComparisonClass
      (fun t x => velocity hb table terminal ν m hν p t (Cylinder.join x)) (fun _ _ => 0) :=
proof · 5 lines
  comparisonClass_of_scalar_tails hb table terminal ν m hν
    (contDiff_scalarSolution hb table terminal ν m hν p)
    (scalarSolution_C1Tails hb table terminal ν m hν p)
    (scalarSolution_D_Tails hb table terminal ν m hν p)
    (scalarSolution_DD_Tails hb table terminal ν m hν p)
90
theorem velocity_NavierStokes (hν : 0 < ν) (p : Coord 2) :
    NavierStokes ν (velocity hb table terminal ν m hν p) (fun _ _ => 0)
      (force hb table terminal ν m p) :=
proof · 3 lines
  force_NavierStokes hb table terminal ν m hν p _
    (fun _ ht => scalarSolution_equation hb table terminal ν m hν p ht)
    (scalarSolution_zero hb table terminal ν m hν p)
97
theorem velocity_unique (hν : 0 < ν) (p : Coord 2) {v : VectorField 3} {q : ScalarField 3}
    (hv : Cylinder.ComparisonClass (fun t x => v t (Cylinder.join x))
      (fun t x => q t (Cylinder.join x)))
    (hNS : NavierStokes ν v q (force hb table terminal ν m p)) :
    ∀ t ≥ 0, (∀ x, v t x = velocity hb table terminal ν m hν p t x) ∧ (∀ x, q t x = 0) :=
proof · 3 lines
  Cylinder.comparison_unique_coordinates hν.le
    (velocity_comparisonClass hb table terminal ν m hν p) hv
    (velocity_NavierStokes hb table terminal ν m hν p) hNS
106
theorem velocity_detection (hν : 0 < ν) (c₀ : Configuration (Fin N))
    (hm : 1 ≤ m) (hc₀ : c₀.leftStack < capacity b m 0 ∧ c₀.rightStack < capacity b m 0)
    (hdir : IncomingDirection table) (hin : IncomingRule table)
    (hterm : NoOutgoing table terminal) (hcont : Continues hb table terminal c₀)
    (hinit : c₀.state ≠ terminal) :
    Observation.planeEvent
      (velocity hb table terminal ν m hν (point hb table terminal ν m c₀ 0)) ↔
        Reaches hb table terminal c₀ :=
proof · 7 lines
  detection_of_C1Tails hb table terminal ν m hν c₀
    (contDiff_scalarSolution hb table terminal ν m hν _)
    (scalarSolution_C1Tails hb table terminal ν m hν _)
    (scalarSolution_D_Tails hb table terminal ν m hν _)
    (scalarSolution_DD_Tails hb table terminal ν m hν _)
    (fun _ ht => scalarSolution_equation hb table terminal ν m hν _ ht)
    (scalarSolution_zero hb table terminal ν m hν _) hm hc₀ hdir hin hterm hcont hinit