Download data/lean/ComparatorChallenges/BalancedBoxRouting.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.72 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/BalancedBoxRouting.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/ComparatorChallenges/BalancedBoxRouting.lean
-
curl -L -o BalancedBoxRouting.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/BalancedBoxRouting.lean
3.72 kB
| import Mathlib | |
| namespace OAI | |
| 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 | |
| theorem balanced_box_routing | |
| (n : β) (a b h k : Fin n β RationalSpace) | |
| (hh : β i j, 0 < h i j) (hk : β i j, 0 < k i j) | |
| (ha : Pairwise fun i j => Disjoint (solidBox (a i) (h i)) (solidBox (a j) (h j))) | |
| (hb : Pairwise fun i j => Disjoint (solidBox (b i) (k i)) (solidBox (b j) (k j))) | |
| (hvol : β i, β j : Fin 3, k i j / h i j = 1) : | |
| β U : Field, β Ξ¦ : β β Space β Space, | |
| AdmissibleField U β§ IsGlobalFlow U Ξ¦ β§ Delivers a b h k Ξ¦ := by | |
| sorry | |
| end BoxTransport.Routing | |
| end OAI | |