File size: 3,380 Bytes
4a56cd6 | 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 | import Mathlib
namespace OAI
/-! Solid boxes, effective space-time fields and global-flow delivery. -/
noncomputable section
open scoped Topology
open scoped BigOperators ContDiff
open scoped BigOperators ContDiff
namespace BoxTransport.Routing
abbrev Space := Fin 3 β β
abbrev RationalSpace := Fin 3 β β
abbrev SpaceTime := β Γ Space
abbrev RationalSpaceTime := β Γ RationalSpace
abbrev Field := SpaceTime β Space
abbrev Axis := Option (Fin 3)
def coordinateVector (j : Fin 3) : Space := Pi.single j 1
def coordinateDirection : Axis β SpaceTime
| none => (1, 0)
| some j => (0, coordinateVector j)
def realPoint (q : RationalSpace) : Space := fun j => (q j : β)
def realSpaceTime (q : RationalSpaceTime) : SpaceTime := (q.1, realPoint q.2)
def realBox (c r : Space) : Set Space :=
{x | β j, |x j - c j| β€ r j}
def solidBox (a h : RationalSpace) : Set Space :=
realBox (realPoint a) (realPoint h)
def prescribedAffine (a b h k : RationalSpace) (x : Space) : Space :=
fun j => (b j : β) + ((k j / h j : β) : β) * (x j - (a j : β))
noncomputable def mixedDerivative : List Axis β Field β Field
| [], U => U
| j :: js, U => fun p => fderiv β (mixedDerivative js U) p (coordinateDirection j)
abbrev RationalCode := β Γ β Γ β
def rationalValue (q : RationalCode) : β := ((q.1 : β) - q.2.1) / (q.2.2 + 1)
abbrev RationalPointCode := RationalCode Γ RationalCode Γ RationalCode Γ RationalCode
def codeSpaceTime (q : RationalPointCode) : SpaceTime :=
((rationalValue q.1 : β), ![(rationalValue q.2.1 : β),
(rationalValue q.2.2.1 : β), (rationalValue q.2.2.2 : β)])
abbrev EvaluationRequest := List Axis Γ RationalPointCode Γ β Γ Fin 3
def Effective (U : Field) : Prop :=
β eval : EvaluationRequest β RationalCode,
β modulus : List Axis Γ β β β,
β bound : List Axis β β,
Computable eval β§ Computable modulus β§ Computable bound β§
(β (ds : List Axis) (q : RationalPointCode) (n : β) (p : SpaceTime),
βp - codeSpaceTime qβ β€ ((modulus (ds, n) : β) + 1)β»ΒΉ β
β j : Fin 3,
|mixedDerivative ds U p j - (rationalValue (eval (ds, q, n, j)) : β)| β€
((n : β) + 1)β»ΒΉ) β§
(β (ds : List Axis) (p : SpaceTime) (j : Fin 3),
|mixedDerivative ds U p j| β€ (bound ds : β))
noncomputable def spatialDivergence (U : Field) (t : β) (x : Space) : β :=
β j : Fin 3, (fderiv β (fun y => U (t, y)) x (coordinateVector j)) j
def AdmissibleField (U : Field) : Prop :=
ContDiff β β U β§ HasCompactSupport U β§ Effective U β§
(β t x, spatialDivergence U t x = 0) β§
(β (t : β) (x : Space), t β Set.Icc (1 / 4 : β) (3 / 4 : β) β U (t, x) = 0)
def IsGlobalFlow (U : Field) (Ξ¦ : β β Space β Space) : Prop :=
(β x, Ξ¦ 0 x = x) β§
(β t x, HasDerivAt (fun s => Ξ¦ s x) (U (t, Ξ¦ t x)) t) β§
(β (x : Space) (Ξ³ : β β Space), Ξ³ 0 = x β
(β t, HasDerivAt Ξ³ (U (t, Ξ³ t)) t) β β t, Ξ³ t = Ξ¦ t x)
def Delivers {n : β} (a b h k : Fin n β RationalSpace)
(Ξ¦ : β β Space β Space) : Prop :=
β i, β O : Set Space, IsOpen O β§ solidBox (a i) (h i) β O β§
β x β O, Ξ¦ 1 x = prescribedAffine (a i) (b i) (h i) (k i) x
end BoxTransport.Routing
end
end OAI
|