Download data/lean/OAI/MathematicalPhysics/SheetFlows/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.5 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/SheetFlows/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/SheetFlows/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/SheetFlows/Model.lean
6.5 kB
| import Mathlib | |
| namespace OAI | |
| /-! SheetFlows model. -/ | |
| noncomputable section | |
| open Set MeasureTheory | |
| open scoped BigOperators | |
| namespace Solenoidal | |
| abbrev Plane := Fin 2 β β | |
| abbrev Space := Fin 3 β β | |
| abbrev SpaceTime := β Γ Space | |
| abbrev Field := β β Space β Space | |
| abbrev Pressure := β β Space β β | |
| abbrev Torus := Fin 3 β AddCircle (10 : β) | |
| def toTorus (x : Space) : Torus := fun i => (x i : AddCircle (10 : β)) | |
| def sheet (y : Plane) : Space := ![y 0, y 1, 2] | |
| structure Rectangle where | |
| lower : Fin 2 β β | |
| upper : Fin 2 β β | |
| positive : β j, lower j < upper j | |
| namespace Rectangle | |
| def carrier (R : Rectangle) : Set Plane := | |
| {y | β j, (R.lower j : β) β€ y j β§ y j β€ (R.upper j : β)} | |
| def center (R : Rectangle) : Plane := | |
| fun j => ((R.lower j : β) + (R.upper j : β)) / 2 | |
| def halfWidth (R : Rectangle) : Plane := | |
| fun j => ((R.upper j : β) - (R.lower j : β)) / 2 | |
| def inCodingSquare (R : Rectangle) : Prop := | |
| β j, 2 β€ R.lower j β§ R.upper j β€ 3 | |
| end Rectangle | |
| def SeparatelySeparated {N : β} (R : Fin N β Rectangle) : Prop := | |
| β i j, i β j β β Ξ΄ : β, 0 < Ξ΄ β§ | |
| β x β (R i).carrier, β y β (R j).carrier, Ξ΄ β€ βx - yβ | |
| def diagonalMap (P Q : Rectangle) (r : Fin 2 β β) (y : Plane) : Plane := | |
| fun j => Q.center j + (r j : β) * (y j - P.center j) | |
| structure SheetData (N : β) where | |
| source : Fin N β Rectangle | |
| target : Fin N β Rectangle | |
| source_inside : β i, (source i).inCodingSquare | |
| target_inside : β i, (target i).inCodingSquare | |
| source_separated : SeparatelySeparated source | |
| target_separated : SeparatelySeparated target | |
| ratio : Fin N β Fin 2 β β | |
| ratio_positive : β i j, 0 < ratio i j | |
| image_eq : β i, | |
| diagonalMap (source i) (target i) (ratio i) '' (source i).carrier = | |
| (target i).carrier | |
| def deck (k : Fin 3 β β€) : Space := fun j => 10 * (k j : β) | |
| def SpatiallyPeriodic {E : Type*} (g : β β Space β E) : Prop := | |
| β t x k, g t (x + deck k) = g t x | |
| def fundamentalCell : Set Space := | |
| Set.pi Set.univ (fun _ => Set.Ico (0 : β) 10) | |
| def basis (j : Fin 3) : Space := Pi.single j 1 | |
| def spatialPartial (u : Field) (j : Fin 3) : Field := | |
| fun t x => fderiv β (u t) x (basis j) | |
| def timePartial (u : Field) : Field := | |
| fun t x => derivWithin (fun s => u s x) (Set.Ici 0) t | |
| def divergence (u : Field) (t : β) (x : Space) : β := | |
| β j : Fin 3, spatialPartial u j t x j | |
| def laplacian (u : Field) : Field := | |
| fun t x => β j : Fin 3, spatialPartial (spatialPartial u j) j t x | |
| def advection (u : Field) : Field := | |
| fun t x => fderiv β (u t) x (u t x) | |
| def gradient (p : Pressure) : Field := | |
| fun t x j => fderiv β (p t) x (basis j) | |
| def DivergenceFree (u : Field) : Prop := β t x, divergence u t x = 0 | |
| def MeanZero (u : Field) : Prop := | |
| β t, (β« x in fundamentalCell, u t x) = 0 | |
| def Smooth (u : Field) : Prop := | |
| ContDiff β (β€ : ββ) (fun z : SpaceTime => u z.1 z.2) | |
| def OnePeriodic (u : Field) : Prop := β t x, u (t + 1) x = u t x | |
| def IntegerCollars (u : Field) : Prop := | |
| β Ξ΅ : β, 0 < Ξ΅ β§ β n : β€, β t x, |t - (n : β)| < Ξ΅ β u t x = 0 | |
| def cylinder (T : β) : Set SpaceTime := Set.Icc 0 T ΓΛ’ Set.univ | |
| structure ClassicalSolution (Ξ½ : β) (f u : Field) (p : Pressure) : Prop where | |
| spatial_periodic_u : SpatiallyPeriodic u | |
| spatial_periodic_p : SpatiallyPeriodic p | |
| continuous_u : β T, 0 β€ T β | |
| ContinuousOn (fun z : SpaceTime => u z.1 z.2) (cylinder T) | |
| differentiable_t : β t, 0 β€ t β β x, | |
| DifferentiableWithinAt β (fun s => u s x) (Set.Ici 0) t | |
| continuous_t : β T, 0 β€ T β | |
| ContinuousOn (fun z : SpaceTime => timePartial u z.1 z.2) (cylinder T) | |
| differentiable_x : β t, 0 β€ t β Differentiable β (u t) | |
| continuous_x : β T, 0 β€ T β β j, | |
| ContinuousOn (fun z : SpaceTime => spatialPartial u j z.1 z.2) (cylinder T) | |
| differentiable_xx : β t, 0 β€ t β β j, | |
| Differentiable β (spatialPartial u j t) | |
| continuous_xx : β T, 0 β€ T β β i j, | |
| ContinuousOn (fun z : SpaceTime => spatialPartial (spatialPartial u i) j z.1 z.2) | |
| (cylinder T) | |
| continuous_p : β T, 0 β€ T β | |
| ContinuousOn (fun z : SpaceTime => p z.1 z.2) (cylinder T) | |
| differentiable_p : β t, 0 β€ t β Differentiable β (p t) | |
| continuous_px : β T, 0 β€ T β | |
| ContinuousOn (fun z : SpaceTime => gradient p z.1 z.2) (cylinder T) | |
| pressure_mean_zero : β t, 0 β€ t β (β« x in fundamentalCell, p t x) = 0 | |
| incompressible : β t, 0 β€ t β β x, divergence u t x = 0 | |
| initial : β x, u 0 x = 0 | |
| equation : β t, 0 β€ t β β x, | |
| timePartial u t x + advection u t x = | |
| -gradient p t x + Ξ½ β’ laplacian u t x + f t x | |
| def MaterialFlow (u : Field) (X : β β Space β Space) : Prop := | |
| (β a, X 0 a = a) β§ | |
| (β a, ContinuousOn (fun t => X t a) (Set.Ici 0)) β§ | |
| (β a t, 0 β€ t β | |
| HasDerivWithinAt (fun s => X s a) (u t (X t a)) (Set.Ici 0) t) | |
| def spacetimeBasis : Fin 4 β SpaceTime := | |
| ![(1, 0), (0, basis 0), (0, basis 1), (0, basis 2)] | |
| def mixedDerivative (u : Field) : List (Fin 4) β SpaceTime β Space | |
| | [] => fun z => u z.1 z.2 | |
| | j :: Ξ± => fun z => fderiv β (mixedDerivative u Ξ±) z (spacetimeBasis j) | |
| def flatten (z : SpaceTime) : Fin 4 β β := ![z.1, z.2 0, z.2 1, z.2 2] | |
| def NamesReal (c : Nat.Partrec.Code) (r : β) : Prop := | |
| β n : β, β q : β, Encodable.encode q β c.eval n β§ | |
| |(q : β) - r| β€ (1 / 2 : β) ^ n | |
| def ComputableReal (r : β) : Prop := β c, NamesReal c r | |
| def NamesPoint (c : Nat.Partrec.Code) (z : SpaceTime) : Prop := | |
| β n : β, β q : Fin 4 β β, | |
| @Encodable.encode (Fin 4 β β) Encodable.finArrow q β c.eval n β§ | |
| β(fun j => (q j : β)) - flatten zβ β€ (1 / 2 : β) ^ n | |
| def Effective (u : Field) : Prop := | |
| β e : Nat.Partrec.Code, β Ξ± : List (Fin 4), β c : Nat.Partrec.Code, | |
| β z : SpaceTime, NamesPoint c z β β Ξ΅ : β, 0 < Ξ΅ β | |
| β q : Fin 3 β β, | |
| @Encodable.encode (Fin 3 β β) Encodable.finArrow q β | |
| e.eval (Encodable.encode (Ξ±, c, Ξ΅)) β§ | |
| β(fun j => (q j : β)) - mixedDerivative u Ξ± zβ < (Ξ΅ : β) | |
| def EffectiveBounds (u : Field) : Prop := | |
| β e : Nat.Partrec.Code, β Ξ± : List (Fin 4), β B : β, | |
| Encodable.encode B β e.eval (Encodable.encode Ξ±) β§ 0 β€ B β§ | |
| β z : SpaceTime, βmixedDerivative u Ξ± zβ β€ (B : β) | |
| end Solenoidal | |
| end | |
| end OAI | |