Download data/lean/OAI/MathematicalPhysics/SheetFlows/DirectForce.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/SheetFlows/DirectForce.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/SheetFlows/DirectForce.lean
-
curl -L -o DirectForce.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/SheetFlows/DirectForce.lean
8.4 kB
| import Mathlib | |
| import OAI.MathematicalPhysics.SheetFlows.Model | |
| namespace OAI | |
| /-! SheetFlows direct force. -/ | |
| section | |
| noncomputable section | |
| open Set MeasureTheory | |
| open scoped BigOperators | |
| namespace Solenoidal | |
| @[simp] theorem spatialPartial_zero (j : Fin 3) : spatialPartial (0 : Field) j = 0 := by | |
| funext t x | |
| simp [spatialPartial] | |
| @[simp] theorem timePartial_zero : timePartial (0 : Field) = 0 := by | |
| funext t x | |
| simp [timePartial] | |
| @[simp] theorem laplacian_zero : laplacian (0 : Field) = 0 := by | |
| funext t x | |
| simp [laplacian] | |
| @[simp] theorem gradient_zero : gradient (0 : Pressure) = 0 := by | |
| funext t x j | |
| simp [gradient] | |
| @[simp] theorem advection_zero : advection (0 : Field) = 0 := by | |
| funext t x | |
| simp [advection] | |
| @[simp] theorem mixedDerivative_zero (Ξ± : List (Fin 4)) : | |
| mixedDerivative (0 : Field) Ξ± = 0 := by | |
| induction Ξ± with | |
| | nil => rfl | |
| | cons j Ξ± ih => | |
| funext z | |
| simp [mixedDerivative, ih] | |
| theorem zero_spatially_periodic : SpatiallyPeriodic (0 : Field) := by | |
| intro t x k | |
| rfl | |
| theorem zero_smooth : Smooth (0 : Field) := contDiff_const | |
| theorem zero_mean_zero : MeanZero (0 : Field) := by | |
| intro t | |
| simp | |
| theorem zero_divergence_free : DivergenceFree (0 : Field) := by | |
| intro t x | |
| simp [divergence] | |
| theorem zero_one_periodic : OnePeriodic (0 : Field) := by | |
| intro t x | |
| rfl | |
| theorem zero_integer_collars : IntegerCollars (0 : Field) := by | |
| refine β¨1, zero_lt_one, ?_β© | |
| intro n t x _ | |
| rfl | |
| theorem rational_computable (q : β) : ComputableReal (q : β) := by | |
| refine β¨Nat.Partrec.Code.const (Encodable.encode q), ?_β© | |
| intro n | |
| refine β¨q, ?_, ?_β© | |
| Β· simp [Nat.Partrec.Code.eval_const] | |
| Β· simp | |
| theorem zero_effective : Effective (0 : Field) := by | |
| refine β¨Nat.Partrec.Code.const (@Encodable.encode (Fin 3 β β) Encodable.finArrow 0), ?_β© | |
| intro Ξ± c z _ Ξ΅ hΞ΅ | |
| refine β¨0, ?_, ?_β© | |
| Β· simp [Nat.Partrec.Code.eval_const] | |
| Β· simpa using (show (0 : β) < (Ξ΅ : β) by exact_mod_cast hΞ΅) | |
| theorem zero_effective_bounds : EffectiveBounds (0 : Field) := by | |
| refine β¨Nat.Partrec.Code.const (Encodable.encode (0 : β)), ?_β© | |
| intro Ξ± | |
| refine β¨0, ?_, le_rfl, ?_β© | |
| Β· simp [Nat.Partrec.Code.eval_const] | |
| Β· intro z | |
| simp | |
| theorem EffectiveBounds.bounded {u : Field} (h : EffectiveBounds u) | |
| (Ξ± : List (Fin 4)) : | |
| β B : β, 0 β€ B β§ β z : SpaceTime, βmixedDerivative u Ξ± zβ β€ B := by | |
| obtain β¨e, heβ© := h | |
| obtain β¨B, _, hB, hboundβ© := he Ξ± | |
| exact β¨(B : β), by exact_mod_cast hB, hboundβ© | |
| theorem zero_classical_solution (Ξ½ : β) : | |
| ClassicalSolution Ξ½ (0 : Field) 0 (0 : Pressure) where | |
| spatial_periodic_u := zero_spatially_periodic | |
| spatial_periodic_p := by intro t x k; rfl | |
| continuous_u := fun _ _ => continuous_const.continuousOn | |
| differentiable_t := fun _ _ _ => differentiableWithinAt_const _ | |
| continuous_t := by | |
| intro T _ | |
| rw [timePartial_zero] | |
| exact continuous_const.continuousOn | |
| differentiable_x := fun _ _ => differentiable_const _ | |
| continuous_x := by | |
| intro T _ j | |
| simp only [spatialPartial_zero] | |
| exact continuous_const.continuousOn | |
| differentiable_xx := by | |
| intro t _ j | |
| rw [spatialPartial_zero] | |
| exact differentiable_const _ | |
| continuous_xx := by | |
| intro T _ i j | |
| simp only [spatialPartial_zero] | |
| exact continuous_const.continuousOn | |
| continuous_p := fun _ _ => continuous_const.continuousOn | |
| differentiable_p := fun _ _ => differentiable_const _ | |
| continuous_px := by | |
| intro T _ | |
| rw [gradient_zero] | |
| exact continuous_const.continuousOn | |
| pressure_mean_zero := by intro t _; simp | |
| incompressible := fun t _ x => zero_divergence_free t x | |
| initial := fun _ => rfl | |
| equation := by intro t _ x; simp | |
| theorem zero_material_flow : MaterialFlow (0 : Field) (fun _ a => a) := by | |
| refine β¨fun _ => rfl, fun _ => continuous_const.continuousOn, ?_β© | |
| intro a t _ | |
| exact hasDerivWithinAt_const t (Set.Ici 0) a | |
| def directForce (Ξ½ : β) (u : Field) : Field := | |
| fun t x => timePartial u t x - Ξ½ β’ laplacian u t x | |
| theorem directForce_equation (Ξ½ : β) (u : Field) | |
| (hadv : β t x, advection u t x = 0) (t : β) (x : Space) : | |
| timePartial u t x + advection u t x = | |
| -gradient (0 : Pressure) t x + Ξ½ β’ laplacian u t x + directForce Ξ½ u t x := by | |
| simp only [hadv, add_zero, gradient_zero, Pi.zero_apply, neg_zero, zero_add, directForce] | |
| abel | |
| def eraseAxis (i : Fin 3) : Space βL[β] Space := | |
| ContinuousLinearMap.id β Space - | |
| (ContinuousLinearMap.proj (R := β) (Ο := fun _ : Fin 3 => β) i).smulRight (basis i) | |
| @[simp] theorem eraseAxis_apply (i : Fin 3) (x : Space) : | |
| eraseAxis i x = x - x i β’ basis i := rfl | |
| @[simp] theorem eraseAxis_basis (i : Fin 3) : eraseAxis i (basis i) = 0 := by | |
| simp [eraseAxis, basis] | |
| def axialField (i : Fin 3) (a : β β Space β β) : Field := | |
| fun t x => a t (eraseAxis i x) β’ basis i | |
| theorem fderiv_axialField (i : Fin 3) (a : β β Space β β) (t : β) (x : Space) | |
| (ha : DifferentiableAt β (a t) (eraseAxis i x)) : | |
| fderiv β (axialField i a t) x = | |
| ((fderiv β (a t) (eraseAxis i x)).comp (eraseAxis i)).smulRight (basis i) := by | |
| exact ((ha.hasFDerivAt.comp x (eraseAxis i).hasFDerivAt).smul_const (basis i)).fderiv | |
| theorem divergence_axialField (i : Fin 3) (a : β β Space β β) (t : β) (x : Space) | |
| (ha : DifferentiableAt β (a t) (eraseAxis i x)) : | |
| divergence (axialField i a) t x = 0 := by | |
| unfold divergence | |
| apply Finset.sum_eq_zero | |
| intro j _ | |
| dsimp [spatialPartial] | |
| rw [fderiv_axialField i a t x ha] | |
| by_cases h : j = i | |
| Β· subst j | |
| simp only [ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.comp_apply, | |
| eraseAxis_basis, map_zero, zero_smul, Pi.zero_apply] | |
| Β· simp [ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.comp_apply, basis, | |
| Pi.single_eq_of_ne h] | |
| theorem advection_axialField (i : Fin 3) (a : β β Space β β) (t : β) (x : Space) | |
| (ha : DifferentiableAt β (a t) (eraseAxis i x)) : | |
| advection (axialField i a) t x = 0 := by | |
| dsimp [advection] | |
| rw [fderiv_axialField i a t x ha] | |
| simp only [ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.comp_apply, | |
| axialField, map_smul, eraseAxis_basis, smul_zero, map_zero, zero_smul] | |
| theorem axialField_divergence_free (i : Fin 3) (a : β β Space β β) | |
| (ha : β t, Differentiable β (a t)) : DivergenceFree (axialField i a) := by | |
| intro t x | |
| exact divergence_axialField i a t x (ha t _) | |
| def pulseField (i : Fin 3) (Ξ² : β β β) (g : Space β β) : Field := | |
| fun t x => Ξ² t β’ (g (eraseAxis i x) β’ basis i) | |
| def pulseTrajectory (i : Fin 3) (A : β β β) (g : Space β β) | |
| (a : Space) (t : β) : Space := | |
| a + (A t * g (eraseAxis i a)) β’ basis i | |
| @[simp] theorem eraseAxis_pulseTrajectory (i : Fin 3) (A : β β β) | |
| (g : Space β β) (a : Space) (t : β) : | |
| eraseAxis i (pulseTrajectory i A g a t) = eraseAxis i a := by | |
| simp only [pulseTrajectory, map_add, map_smul, eraseAxis_basis, smul_zero, add_zero] | |
| theorem pulseTrajectory_hasDerivAt (i : Fin 3) (A Ξ² : β β β) (g : Space β β) | |
| (a : Space) (t : β) (hA : HasDerivAt A (Ξ² t) t) : | |
| HasDerivAt (pulseTrajectory i A g a) | |
| (pulseField i Ξ² g t (pulseTrajectory i A g a t)) t := by | |
| have h := (hasDerivAt_const t a).add | |
| ((hA.mul_const (g (eraseAxis i a))).smul_const (basis i)) | |
| rw [pulseField, eraseAxis_pulseTrajectory] | |
| change HasDerivAt (fun s => a + (A s * g (eraseAxis i a)) β’ basis i) | |
| (Ξ² t β’ (g (eraseAxis i a) β’ basis i)) t | |
| convert h using 1 | |
| first | rfl | simp [smul_smul] | |
| theorem pulse_material_flow (i : Fin 3) (A Ξ² : β β β) (g : Space β β) | |
| (hAβ : A 0 = 0) (hA : β t, 0 β€ t β HasDerivAt A (Ξ² t) t) : | |
| MaterialFlow (pulseField i Ξ² g) (fun t a => pulseTrajectory i A g a t) := by | |
| refine β¨?_, ?_, ?_β© | |
| Β· intro a | |
| simp [pulseTrajectory, hAβ] | |
| Β· intro a t ht | |
| exact (pulseTrajectory_hasDerivAt i A Ξ² g a t (hA t ht)).continuousAt.continuousWithinAt | |
| Β· intro a t ht | |
| exact (pulseTrajectory_hasDerivAt i A Ξ² g a t (hA t ht)).hasDerivWithinAt | |
| theorem pulseTrajectory_endpoint (i : Fin 3) (A : β β β) (g : Space β β) | |
| (a : Space) (T : β) (hT : A T = 1) : | |
| pulseTrajectory i A g a T = a + g (eraseAxis i a) β’ basis i := by | |
| simp [pulseTrajectory, hT] | |
| end Solenoidal | |
| end | |
| end | |
| end OAI | |