Download lean/OAI/MathematicalPhysics/NavierStokes/BalancedTransport/Model.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 7.47 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/MathematicalPhysics/NavierStokes/BalancedTransport/Model.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/MathematicalPhysics/NavierStokes/BalancedTransport/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/MathematicalPhysics/NavierStokes/BalancedTransport/Model.lean
7.47 kB
Lean 4 · 51
declarations statementsfull
inductive Direction where body · 2 lines
| stay | left | right
deriving DecidableEqinstance : Fintype Direction := body · 1 line
⟨{.stay, .left, .right}, by intro d; cases d <;> simp⟩structure Transition (Q Γ : Type*) where body · 3 lines
state : Q
write : Γ
move : Directionstructure FiniteMachine where body · 6 lines
states : ℕ
symbols : ℕ
initial : Fin (states + 1)
blank : Fin (symbols + 1)
transition : Fin (states + 1) → Fin (symbols + 1) →
Option (Recorder.Transition (Fin (states + 1)) (Fin (symbols + 1)))abbrev Input (M : FiniteMachine) := List (Fin (M.symbols + 1)) structure TapeConfiguration (M : FiniteMachine) where body · 3 lines
state : Fin (M.states + 1)
head : ℤ
tape : ℤ → Fin (M.symbols + 1)def initialConfiguration (M : FiniteMachine) (w : Input M) : TapeConfiguration M := body · 1 line
⟨M.initial, 0, fun z => if 0 ≤ z then w[z.toNat]?.getD M.blank else M.blank⟩def machineStep (M : FiniteMachine) (c : TapeConfiguration M) : Option (TapeConfiguration M) := body · 3 lines
(M.transition c.state (c.tape c.head)).map fun v =>
⟨v.state, c.head + (match v.move with | .stay => 0 | .left => -1 | .right => 1),
Function.update c.tape c.head v.write⟩def Halts (M : FiniteMachine) (w : Input M) : Prop := body · 2 lines
∃ c, Relation.ReflTransGen (fun c d => machineStep M c = some d)
(initialConfiguration M w) c ∧ machineStep M c = nonedef Recorder.Direction.number : Recorder.Direction → ℕ body · 3 lines
| .stay => 0
| .left => 1
| .right => 2def FiniteMachine.code (M : FiniteMachine) : ℕ := body · 4 lines
Encodable.encode (M.states, M.symbols, M.initial.val, M.blank.val,
(List.finRange (M.states + 1)).map fun q =>
(List.finRange (M.symbols + 1)).map fun a =>
(M.transition q a).map fun v => (v.state.val, v.write.val, v.move.number))def inputCode (M : FiniteMachine) (w : Input M) : ℕ := body · 1 line
Encodable.encode (M.code, w.map Fin.val)abbrev Space := Fin 3 → ℝ abbrev Field (F : Type*) := ℝ → Space → F abbrev Velocity := Field Space abbrev Pressure := Field ℝ abbrev Family (F : Type*) := (M : FiniteMachine) → Input M → F abbrev MaterialFlow := ℝ → Space → Space abbrev MultiIndex := List (Option (Fin 3)) abbrev RationalPoint := ℚ × (Fin 3 → ℚ) def timeD (v : Field F) : Field F := body · 1 line
fun t x => derivWithin (fun s => v s x) (Set.Ici 0) tdef spaceD (i : Fin 3) (v : Field F) : Field F := body · 1 line
fun t x => fderiv ℝ (v t) x (Pi.single i 1)def mixedD : MultiIndex → Field F → Field F body · 3 lines
| [], v => v
| none :: a, v => timeD (mixedD a v)
| some i :: a, v => spaceD i (mixedD a v)def spatialD : List (Fin 3) → Field F → Field F body · 2 lines
| [], v => v
| i :: a, v => spaceD i (spatialD a v)def Smooth (v : Field F) : Prop := body · 1 line
ContDiffOn ℝ (⊤ : ℕ∞) (fun z : ℝ × Space => v z.1 z.2) (Set.Ici 0 ×ˢ Set.univ)def BoundedMixed (v : Field F) : Prop := body · 1 line
∀ a : MultiIndex, ∃ C : ℝ, 0 ≤ C ∧ ∀ t, 0 ≤ t → ∀ x, ‖mixedD a v t x‖ ≤ Cdef CH (k : ℕ) (v : Field F) : Prop := body · 4 lines
∀ a : List (Fin 3), a.length ≤ k →
∃ V : ℝ → Lp F 2 (volume : Measure Space),
ContinuousOn V (Set.Ici 0) ∧
∀ t, 0 ≤ t → (V t : Space → F) =ᵐ[volume] spatialD a v tdef C1L2 (v : Field F) : Prop := body · 6 lines
∃ V W : ℝ → Lp F 2 (volume : Measure Space),
ContinuousOn V (Set.Ici 0) ∧ ContinuousOn W (Set.Ici 0) ∧
∀ t, 0 ≤ t →
(V t : Space → F) =ᵐ[volume] v t ∧
(W t : Space → F) =ᵐ[volume] timeD v t ∧
HasDerivWithinAt V (W t) (Set.Ici 0) tdef div (u : Velocity) (t : ℝ) (x : Space) : ℝ := body · 1 line
∑ i, spaceD i u t x idef laplacian (u : Velocity) : Velocity := body · 1 line
fun t x => ∑ i, spaceD i (spaceD i u) t xdef convection (u : Velocity) : Velocity := body · 1 line
fun t x => ∑ i, (u t x i) • spaceD i u t xdef gradient (p : Pressure) (t : ℝ) (x : Space) : Space := body · 1 line
fun i => spaceD i p t xdef affineForce (f₀ f₁ : Velocity) (ν : ℝ) : Velocity := body · 1 line
fun t x => f₀ t x + ν • f₁ t xdef inertialCoefficient (u : Velocity) : Velocity := body · 1 line
fun t x => timeD u t x + convection u t xdef viscousCoefficient (u : Velocity) : Velocity := body · 1 line
fun t x => -laplacian u t xdef ZeroDataSolution (ν : ℝ) (f u : Velocity) (p : Pressure) : Prop := body · 6 lines
Smooth u ∧ Smooth p ∧
(∀ x, u 0 x = 0) ∧
(∀ t, 0 ≤ t → ∀ x, div u t x = 0) ∧
(∀ t, 0 ≤ t → ∀ x,
timeD u t x + convection u t x =
-gradient p t x + ν • laplacian u t x + f t x)def BoundedOnFiniteSlabs (u : Velocity) : Prop := body · 3 lines
∀ T : ℝ, 0 ≤ T → ∃ C : ℝ, 0 ≤ C ∧
∀ t ∈ Set.Icc (0 : ℝ) T, ∀ x,
‖u t x‖ ≤ C ∧ ∀ i : Fin 3, ‖spaceD i u t x‖ ≤ Cdef ComparisonClass (u : Velocity) (p : Pressure) : Prop := body · 2 lines
CH 2 u ∧ C1L2 u ∧ BoundedOnFiniteSlabs u ∧
∃ c : ℝ → ℝ, CH 1 (fun t x => p t x - c t)def UniqueInComparison (ν : ℝ) (f U : Velocity) : Prop := body · 3 lines
∀ u p, ZeroDataSolution ν f u p → ComparisonClass u p →
(∀ t, 0 ≤ t → ∀ x, u t x = U t x) ∧
(∀ t, 0 ≤ t → ∀ x y, p t x = p t y)def CommonCompactSupport (U f₀ f₁ : Velocity) : Prop := body · 2 lines
∃ K : Set Space, IsCompact K ∧
∀ t, 0 ≤ t → ∀ x, x ∉ K → U t x = 0 ∧ f₀ t x = 0 ∧ f₁ t x = 0def PeriodicAfterOne (v : Velocity) : Prop := body · 1 line
∀ t, 1 ≤ t → ∀ x, v (t + 1) x = v t xdef IsMaterialFlow (u : Velocity) (X : MaterialFlow) : Prop := body · 2 lines
(∀ a, X 0 a = a) ∧
∀ a t, 0 ≤ t → HasDerivWithinAt (fun s => X s a) (u t (X t a)) (Set.Ici 0) tdef fixedLabel : Space := ![4, 0, 0] def observer : Set Space := body · 1 line
Set.pi Set.univ (fun _ : Fin 3 => Set.Ioo (-1 : ℝ) 2)def rationalSpace (x : Fin 3 → ℚ) : Space := fun i => (x i : ℝ) def error (n : ℕ) : ℝ := (2 : ℝ)⁻¹ ^ n def EffectiveFamily (v : Family Velocity) : Prop := body · 11 lines
∃ E : (ℕ × MultiIndex × RationalPoint × ℕ) → (Fin 3 → ℚ),
∃ b : (ℕ × MultiIndex) → ℕ,
∃ R : ℕ → ℕ,
Computable E ∧ Computable b ∧ Computable R ∧
(∀ M w a z n, 0 ≤ z.1 → ∀ i,
|(E (inputCode M w, a, z, n) i : ℝ) -
mixedD a (v M w) (z.1 : ℝ) (rationalSpace z.2) i| ≤ error n) ∧
(∀ M w a t, 0 ≤ t → ∀ x,
‖mixedD a (v M w) t x‖ ≤ (b (inputCode M w, a) : ℝ)) ∧
(∀ M w t, 0 ≤ t → ∀ x,
(R (inputCode M w) : ℝ) < ‖x‖ → v M w t x = 0)def EffectiveFieldIn (O : Set (ℕ →. ℕ)) (v : Velocity) : Prop := body · 7 lines
∃ E : (MultiIndex × RationalPoint × ℕ) → (Fin 3 → ℚ),
∃ b : MultiIndex → ℕ,
ComputableIn O E ∧ ComputableIn O b ∧
(∀ a z n, 0 ≤ z.1 → ∀ i,
|(E (a, z, n) i : ℝ) -
mixedD a v (z.1 : ℝ) (rationalSpace z.2) i| ≤ error n) ∧
(∀ a t, 0 ≤ t → ∀ x, ‖mixedD a v t x‖ ≤ (b a : ℝ))def RealName (name : ℕ → ℚ) (x : ℝ) : Prop := body · 1 line
∀ n, |(name n : ℝ) - x| ≤ error ndef ComputableReal (x : ℝ) : Prop := body · 1 line
∃ name : ℕ → ℚ, Computable name ∧ RealName name xdef nameOracle (name : ℕ → ℚ) : ℕ →. ℕ := body · 1 line
fun n => Part.some (Encodable.encode (name n))Outline
- inductive
Direction8 - instance
12 - structure
Transition15 - structure
FiniteMachine26 - abbrev
Input34 - structure
TapeConfiguration36 - def
initialConfiguration41 - def
machineStep44 - def
Halts49 - def
Recorder.Direction.number53 - def
FiniteMachine.code58 - def
inputCode64 - abbrev
Space67 - abbrev
Field69 - abbrev
Velocity71 - abbrev
Pressure73 - abbrev
Family75 - abbrev
MaterialFlow77 - abbrev
MultiIndex79 - abbrev
RationalPoint81 - def
timeD92 - def
spaceD95 - def
mixedD98 - def
spatialD103 - def
Smooth107 - def
BoundedMixed110 - def
CH113 - def
C1L2119 - def
div127 - def
laplacian130 - def
convection133 - def
gradient136 - def
affineForce139 - def
inertialCoefficient142 - def
viscousCoefficient145 - def
ZeroDataSolution148 - def
BoundedOnFiniteSlabs156 - def
ComparisonClass161 - def
UniqueInComparison165 - def
CommonCompactSupport170 - def
PeriodicAfterOne174 - def
IsMaterialFlow177 - def
fixedLabel181 - def
observer183 - def
rationalSpace186 - def
error188 - def
EffectiveFamily190 - def
EffectiveFieldIn203 - def
RealName212 - def
ComputableReal215 - def
nameOracle218