math / data /lean /OAI /MathematicalPhysics /NavierStokes /ForcedComputation /Programs /FinitePhaseEvaluation.lean
Download data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/FinitePhaseEvaluation.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.22 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/FinitePhaseEvaluation.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/FinitePhaseEvaluation.lean
-
curl -L -o FinitePhaseEvaluation.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/FinitePhaseEvaluation.lean
4.22 kB
| import OAI.MathematicalPhysics.NavierStokes.ForcedComputation.Programs.InitializedVelocityEvaluation | |
| import OAI.MathematicalPhysics.NavierStokes.ForcedComputation.Programs.LogarithmicBounds | |
| namespace OAI | |
| /-! Finite recursive evaluation of the Euler derivative polynomials that | |
| occur in the logarithmic slowdown. -/ | |
| namespace ForcedComputation | |
| open ShearFlows | |
| open scoped ContDiff | |
| def IsFastVectorName (a : β β RationalVector) (v : Space) : Prop := | |
| β n, βv - rationalVector (a n)β β€ errorTolerance n | |
| theorem initializedVelocityTolerance_pos (n : β) : | |
| 0 < (2 : β) ^ (-(n : β€)) := by positivity | |
| def initializedVelocityName (loader body : Input) | |
| (hl : ValidInput loader) (hb : ValidInput body) (Ξ± : List (Fin 4)) | |
| (b : β β RationalSpaceTime) : β β RationalVector := fun n => | |
| evaluateInitializedVelocity loader body hl hb Ξ± b ((2 : β) ^ (-(n : β€))) (initializedVelocityTolerance_pos n) | |
| theorem initializedVelocityName_spec {loader body : Input} | |
| (hl : ValidInput loader) (hb : ValidInput body) (Ξ± : List (Fin 4)) | |
| {b : β β RationalSpaceTime} {y : SpaceTime} (hy : IsFastName b y) : | |
| IsFastVectorName (initializedVelocityName loader body hl hb Ξ± b) | |
| (mixedDerivative (initializedProgram loader body) Ξ± y) := by | |
| intro n | |
| have h := evaluateInitializedVelocity_spec hl hb Ξ± hy | |
| ((2 : β) ^ (-(n : β€))) (by positivity) | |
| simpa [initializedVelocityName, errorTolerance] using h | |
| def subtractNatName (c : β) (a b : β β RationalVector) : β β RationalVector := | |
| fun n => a (n + c + 1) - (c : β) β’ b (n + c + 1) | |
| theorem subtractNatName_spec {a b : β β RationalVector} {x y : Space} | |
| (ha : IsFastVectorName a x) (hb : IsFastVectorName b y) (c : β) : | |
| IsFastVectorName (subtractNatName c a b) (x - (c : β) β’ y) := by | |
| intro n | |
| have hcast (m : β) : rationalVector (a m - (c : β) β’ b m) = | |
| rationalVector (a m) - (c : β) β’ rationalVector (b m) := by | |
| ext j | |
| simp only [rationalVector, Pi.sub_apply, Pi.smul_apply, smul_eq_mul, | |
| Rat.cast_sub, Rat.cast_mul, Rat.cast_natCast] | |
| have hsize : (1 + (c : β)) β€ (2 : β) ^ (c + 1) := by | |
| have h := Nat.lt_two_pow_self (n := c + 1) | |
| rw [add_comm 1] | |
| exact_mod_cast h.le | |
| have ht : (1 + (c : β)) * errorTolerance (n + c + 1) β€ errorTolerance n := by | |
| calc | |
| _ β€ (2 : β) ^ (c + 1) * errorTolerance (n + c + 1) := | |
| mul_le_mul_of_nonneg_right hsize (by dsimp [errorTolerance]; positivity) | |
| _ = errorTolerance n := by | |
| simp only [errorTolerance, show n + c + 1 = n + (c + 1) by omega, | |
| pow_add, mul_inv_rev] | |
| field_simp | |
| rw [subtractNatName, hcast] | |
| have he : x - (c : β) β’ y - (rationalVector (a (n + c + 1)) - | |
| (c : β) β’ rationalVector (b (n + c + 1))) = | |
| (x - rationalVector (a (n + c + 1))) - | |
| (c : β) β’ (y - rationalVector (b (n + c + 1))) := by module | |
| rw [he] | |
| calc | |
| _ β€ βx - rationalVector (a (n + c + 1))β + | |
| β(c : β) β’ (y - rationalVector (b (n + c + 1)))β := norm_sub_le _ _ | |
| _ β€ errorTolerance (n + c + 1) + (c : β) * errorTolerance (n + c + 1) := by | |
| rw [norm_smul, Real.norm_of_nonneg (Nat.cast_nonneg c)] | |
| exact add_le_add (ha _) (mul_le_mul_of_nonneg_left (hb _) (Nat.cast_nonneg c)) | |
| _ = (1 + (c : β)) * errorTolerance (n + c + 1) := by ring | |
| _ β€ _ := ht | |
| def phaseName (r : β) (a : β β β β RationalVector) : β β β β β β RationalVector | |
| | 0, k => a k | |
| | n + 1, k => subtractNatName (r + n) (phaseName r a n (k + 1)) (phaseName r a n k) | |
| theorem phaseName_spec (r : β) {A : β β Space} (hA : ContDiff β β A) (s : β) | |
| {a : β β β β RationalVector} | |
| (ha : β k, IsFastVectorName (a k) (iteratedDeriv k A s)) (n k : β) : | |
| IsFastVectorName (phaseName r a n k) (iteratedDeriv k (phaseIter r A n) s) := by | |
| induction n generalizing k with | |
| | zero => exact ha k | |
| | succ n ih => | |
| rw [show phaseIter r A (n + 1) = | |
| phaseDerivative (r + n) (phaseIter r A n) from rfl, | |
| iteratedDeriv_phaseDerivative (r + n) k (phaseIter_smooth r hA n)] | |
| exact subtractNatName_spec (ih (k + 1)) (ih k) (r + n) | |
| end ForcedComputation | |
| end OAI | |