Download data/lean/OAI/MathematicalPhysics/RapidForcing/ParticlePaths.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.29 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/RapidForcing/ParticlePaths.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/RapidForcing/ParticlePaths.lean
-
curl -L -o ParticlePaths.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/RapidForcing/ParticlePaths.lean
6.29 kB
| import OAI.MathematicalPhysics.RapidForcing.CurlDerivatives | |
| import OAI.MathematicalPhysics.RapidForcing.JointSmoothness | |
| namespace OAI | |
| open scoped BigOperators ENNReal Topology | |
| open Set MeasureTheory | |
| namespace RapidForcing | |
| lemma curl_affine_cross (a c x : Space) : | |
| curl (fun y => (1 / 2 : β) β’ cross a (y - c)) x = a := by | |
| let v : Space β Space := fun y => (1 / 2 : β) β’ cross a (y - c) | |
| have hv : DifferentiableAt β v x := by | |
| have h : ContDiff β 1 v := by | |
| apply (contDiff_piLp 2).mpr | |
| intro i | |
| fin_cases i <;> dsimp [v, cross, vec] <;> fun_prop | |
| exact h.differentiable (by norm_num) x | |
| have hf (i j : Fin 3) (b : Space) : | |
| fderiv β (fun y : Space => (1 / 2 : β) * | |
| (a i * (y j - c j) - a j * (y i - c i))) x b = | |
| (1 / 2 : β) * (a i * b j - a j * b i) := by | |
| have h := (((((EuclideanSpace.proj j : Space βL[β] β).hasFDerivAt (x := x)).sub_const (c j)).const_mul (a i)).sub | |
| ((((EuclideanSpace.proj i : Space βL[β] β).hasFDerivAt (x := x)).sub_const (c i)).const_mul (a j))).const_mul (1 / 2 : β) | |
| have hf := congrArg (fun L : Space βL[β] β => L b) h.fderiv | |
| simpa [PiLp.proj_apply, Pi.sub_apply] using hf | |
| change curl v x = a | |
| ext k | |
| fin_cases k | |
| Β· change (fderiv β v x (basis 1)) 2 - (fderiv β v x (basis 2)) 1 = a 0 | |
| rw [β fderiv_coordinate hv 2, β fderiv_coordinate hv 1] | |
| change fderiv β (fun y : Space => (1 / 2 : β) * | |
| (a 0 * (y 1 - c 1) - a 1 * (y 0 - c 0))) x (basis 1) - | |
| fderiv β (fun y : Space => (1 / 2 : β) * | |
| (a 2 * (y 0 - c 0) - a 0 * (y 2 - c 2))) x (basis 2) = _ | |
| rw [hf, hf] | |
| simp [basis] | |
| ring | |
| Β· change (fderiv β v x (basis 2)) 0 - (fderiv β v x (basis 0)) 2 = a 1 | |
| rw [β fderiv_coordinate hv 0, β fderiv_coordinate hv 2] | |
| change fderiv β (fun y : Space => (1 / 2 : β) * | |
| (a 1 * (y 2 - c 2) - a 2 * (y 1 - c 1))) x (basis 2) - | |
| fderiv β (fun y : Space => (1 / 2 : β) * | |
| (a 0 * (y 1 - c 1) - a 1 * (y 0 - c 0))) x (basis 0) = _ | |
| rw [hf, hf] | |
| simp [basis] | |
| ring | |
| Β· change (fderiv β v x (basis 0)) 1 - (fderiv β v x (basis 1)) 0 = a 2 | |
| rw [β fderiv_coordinate hv 1, β fderiv_coordinate hv 0] | |
| change fderiv β (fun y : Space => (1 / 2 : β) * | |
| (a 2 * (y 0 - c 0) - a 0 * (y 2 - c 2))) x (basis 0) - | |
| fderiv β (fun y : Space => (1 / 2 : β) * | |
| (a 1 * (y 2 - c 2) - a 2 * (y 1 - c 1))) x (basis 1) = _ | |
| rw [hf, hf] | |
| simp [basis] | |
| ring | |
| lemma curl_congr_of_eventuallyEq {v w : Space β Space} {x : Space} | |
| (h : v =αΆ [π x] w) : curl v x = curl w x := by | |
| unfold curl | |
| rw [h.fderiv_eq] | |
| lemma zeta_scaled_eventually_one (Ξ΄ : β) (c : Space) : | |
| βαΆ y in π c, ΞΆ (Ξ΄β»ΒΉ β’ (y - c)) = 1 := by | |
| have ho : IsOpen {y : Space | βΞ΄β»ΒΉ β’ (y - c)β < (1 / 16 : β)} := | |
| isOpen_lt (by fun_prop) continuous_const | |
| have he : βαΆ y in π c, βΞ΄β»ΒΉ β’ (y - c)β < (1 / 16 : β) := | |
| ho.mem_nhds (by simp) | |
| filter_upwards [he] with y hy | |
| exact zeta_one (fun i => (PiLp.norm_apply_le (Ξ΄β»ΒΉ β’ (y - c)) i).trans hy.le) | |
| theorem movingCurl_at_center (c : β β Space) (Ξ΄ Ο : β) : | |
| movingCurl c Ξ΄ Ο (c Ο) = deriv c Ο := by | |
| unfold movingCurl | |
| calc | |
| _ = curl (fun y => (1 / 2 : β) β’ cross (deriv c Ο) (y - c Ο)) (c Ο) := by | |
| apply curl_congr_of_eventuallyEq | |
| filter_upwards [zeta_scaled_eventually_one Ξ΄ (c Ο)] with y hy | |
| rw [hy, one_smul] | |
| _ = _ := curl_affine_cross _ _ _ | |
| lemma other_addressCurl_zero (M : Machine) (w : M.Input) (n m m' : β) | |
| (hne : m' β m) (Ο : β) : | |
| movingCurl (addressPath M (M.scaleData w) n m') ((M.scaleData w).Ξ΄ n) Ο | |
| (addressPath M (M.scaleData w) n m Ο) = 0 := by | |
| apply image_eq_zero_of_notMem_tsupport | |
| intro hx | |
| have h := abs_le.mp (addressCurl_tsupport_subset_box M w n m' Ο hx 1) | |
| have h' := abs_le.mp (addressPath_bound M w n m Ο 1) | |
| have hb := (M.scaleData w).b_lt_delta_div_eight n | |
| have hΞ΄ := (M.scaleData w).delta_pos n | |
| simp only [addressCenter, vec_one_coord] at h h' | |
| rcases lt_or_gt_of_ne hne with hm | hm | |
| Β· have hg : (m' : β) + 1 β€ (m : β) := by exact_mod_cast hm | |
| nlinarith | |
| Β· have hg : (m : β) + 1 β€ (m' : β) := by exact_mod_cast hm | |
| nlinarith | |
| lemma addressedVelocity_on_step (M : Machine) (w : M.Input) (n : β) {t : β} | |
| (ht : t β Icc (1 + (n : β)) (2 + (n : β))) : | |
| addressedVelocity M w t = stepVelocity M w n t := by | |
| rw [addressedVelocity_eq_finite M w (n + 2) (by push_cast; linarith [ht.2])] | |
| rw [loadingVelocity_right_collar M w (by have := Nat.cast_nonneg (Ξ± := β) n; linarith [ht.1]), | |
| zero_add] | |
| apply Finset.sum_eq_single n | |
| Β· intro j _ hj | |
| rcases lt_or_gt_of_ne hj with hj | hj | |
| Β· apply stepVelocity_right_collar | |
| have : (j : β) + 1 β€ (n : β) := by exact_mod_cast hj | |
| linarith [ht.1] | |
| Β· apply stepVelocity_left_collar | |
| have : (n : β) + 1 β€ (j : β) := by exact_mod_cast hj | |
| linarith [ht.2] | |
| Β· intro hn | |
| exact (hn (Finset.mem_range.mpr (by omega))).elim | |
| theorem addressedVelocity_at_addressPath (M : Machine) (w : M.Input) (n m : β) | |
| (hm : m β€ (M.scaleData w).D n) {Ο : β} (hΟ : Ο β Icc (0 : β) 1) : | |
| addressedVelocity M w (1 + (n : β) + Ο) (addressPath M (M.scaleData w) n m Ο) = | |
| deriv (addressPath M (M.scaleData w) n m) Ο := by | |
| rw [addressedVelocity_on_step M w n (by constructor <;> linarith [hΟ.1, hΟ.2])] | |
| unfold stepVelocity | |
| rw [show 1 + (n : β) + Ο - 1 - (n : β) = Ο by ring] | |
| calc | |
| _ = movingCurl (addressPath M (M.scaleData w) n m) ((M.scaleData w).Ξ΄ n) Ο | |
| (addressPath M (M.scaleData w) n m Ο) := by | |
| apply Finset.sum_eq_single m | |
| Β· intro m' _ hne | |
| exact other_addressCurl_zero M w n m m' hne Ο | |
| Β· intro hnm | |
| exact (hnm (Finset.mem_range.mpr (by omega))).elim | |
| _ = _ := movingCurl_at_center _ _ _ | |
| theorem addressedVelocity_at_loadingPath (M : Machine) (w : M.Input) {t : β} (ht : t β€ 1) : | |
| let c := fun s => ΞΈ s β’ vec (-1) ((M.scaleData w).Ξ΄ 0 * (M.initialDigit w : β)) 0 | |
| addressedVelocity M w t (c t) = deriv c t := by | |
| dsimp | |
| unfold addressedVelocity | |
| rw [ite_eq_left ht] | |
| exact movingCurl_at_center _ _ _ | |
| end RapidForcing | |
| end OAI | |