Download data/lean/OAI/Analysis/Calculus/Current/Quaternion.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.85 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Calculus/Current/Quaternion.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/Calculus/Current/Quaternion.lean
-
curl -L -o Quaternion.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Calculus/Current/Quaternion.lean
6.85 kB
| import OAI.Analysis.Calculus.Current.WaveDivergence | |
| namespace OAI.Analysis.Calculus.Current | |
| noncomputable section | |
| def quaternionPair (C E : β) : Quaternion β := complexK C + complexK E * qi | |
| def qj : Quaternion β := β¨0, 0, 1, 0β© | |
| theorem hasDerivAt_complexK {f : β β β} {f' : β} {t : β} | |
| (h : HasDerivAt f f' t) : | |
| HasDerivAt (fun s => complexK (f s)) (complexK f') t := by | |
| have hr := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t h | |
| have hi := Complex.imCLM.hasFDerivAt.comp_hasDerivAt t h | |
| have hh := (hr.smul_const (1 : Quaternion β)).fun_add | |
| (hi.smul_const (complexK Complex.I)) | |
| convert hh using 1 | |
| Β· funext s | |
| ext <;> simp [complexK] | |
| Β· ext <;> simp [complexK] | |
| theorem hasDerivAt_quaternionPair {C E : β β β} {C' E' : β} {t : β} | |
| (hC : HasDerivAt C C' t) (hE : HasDerivAt E E' t) : | |
| HasDerivAt (fun s => quaternionPair (C s) (E s)) (quaternionPair C' E') t := | |
| (hasDerivAt_complexK hC).fun_add ((hasDerivAt_complexK hE).mul_const qi) | |
| theorem deriv_quaternionPair {C E : β β β} {t : β} | |
| (hC : DifferentiableAt β C t) (hE : DifferentiableAt β E t) : | |
| deriv (fun s => quaternionPair (C s) (E s)) t = | |
| quaternionPair (deriv C t) (deriv E t) := | |
| (hasDerivAt_quaternionPair hC.hasDerivAt hE.hasDerivAt).deriv | |
| theorem quaternionPair_divergence_algebra (C0 E0 Cr Er Ci Ei : β) : | |
| quaternionPair C0 E0 - qi * quaternionPair Cr Er - qj * quaternionPair Ci Ei = | |
| quaternionPair (C0 + (star Er + Complex.I * star Ei)) | |
| (E0 - (star Cr + Complex.I * star Ci)) := by | |
| ext <;> simp [quaternionPair, complexK, qi, qj] <;> ring | |
| theorem barD_star {d : β} (f : (Index d β β) β β) (z : Index d β β) | |
| (hf : DifferentiableAt β f z) (a : Index d) : | |
| barD (fun w => star (f w)) z a = | |
| star (deriv (fun t : β => f (imaginaryLine z (Pi.single a 1) t)) 0) + | |
| Complex.I * star (deriv (fun t : β => f (imaginaryLine z (Pi.single a Complex.I) t)) 0) := by | |
| have h1 := hasDerivAt_function_line f z (Pi.single a 1) hf | |
| have hi := hasDerivAt_function_line f z (Pi.single a Complex.I) hf | |
| simp only [barD, h1.star.deriv, hi.star.deriv, h1.deriv, hi.deriv] | |
| def quaternionRealD {d : β} (F : (Index d β β) β (Index d β β) β Quaternion β) | |
| (x : Index d β β) (z : Index d β β) (a : Index d) : Quaternion β := | |
| deriv (fun t : β => F (realLine x a t) z) 0 | |
| def quaternionImagD {d : β} (F : (Index d β β) β (Index d β β) β Quaternion β) | |
| (x : Index d β β) (z : Index d β β) (a : Index d) (c : β) : Quaternion β := | |
| deriv (fun t : β => F x (imaginaryLine z (Pi.single a c) t)) 0 | |
| /-- The three-real-slot Fueter divergence for a quaternion-valued column. -/ | |
| def quaternionDivergence {d : β} | |
| (F : Index d β (Index d β β) β (Index d β β) β Quaternion β) | |
| (x : Index d β β) (z : Index d β β) : Quaternion β := | |
| β a, (quaternionRealD (F a) x z a - qi * quaternionImagD (F a) x z a 1 - | |
| qj * quaternionImagD (F a) x z a Complex.I) | |
| theorem quaternionDivergence_split {d : β} | |
| (C E : Index d β (Index d β β) β (Index d β β) β β) | |
| (x : Index d β β) (z : Index d β β) | |
| (hCr : β a, DifferentiableAt β (fun t : β => C a (realLine x a t) z) 0) | |
| (hEr : β a, DifferentiableAt β (fun t : β => E a (realLine x a t) z) 0) | |
| (hCi : β a, DifferentiableAt β (C a x) z) | |
| (hEi : β a, DifferentiableAt β (E a x) z) : | |
| quaternionDivergence (fun a x z => quaternionPair (C a x z) (E a x z)) x z = | |
| quaternionPair | |
| (β a, (realD (fun q => C a q z) x a + barD (fun w => star (E a x w)) z a)) | |
| (β a, (realD (fun q => E a q z) x a - barD (fun w => star (C a x w)) z a)) := by | |
| have ha (a : Index d) : | |
| quaternionRealD (fun x z => quaternionPair (C a x z) (E a x z)) x z a - | |
| qi * quaternionImagD (fun x z => quaternionPair (C a x z) (E a x z)) x z a 1 - | |
| qj * quaternionImagD (fun x z => quaternionPair (C a x z) (E a x z)) x z a Complex.I = | |
| quaternionPair (realD (fun q => C a q z) x a + barD (fun w => star (E a x w)) z a) | |
| (realD (fun q => E a q z) x a - barD (fun w => star (C a x w)) z a) := by | |
| unfold quaternionRealD quaternionImagD realD | |
| rw [deriv_quaternionPair (hCr a) (hEr a), | |
| deriv_quaternionPair (hasDerivAt_function_line _ z _ (hCi a)).differentiableAt | |
| (hasDerivAt_function_line _ z _ (hEi a)).differentiableAt, | |
| deriv_quaternionPair (hasDerivAt_function_line _ z _ (hCi a)).differentiableAt | |
| (hasDerivAt_function_line _ z _ (hEi a)).differentiableAt, | |
| quaternionPair_divergence_algebra, barD_star _ z (hEi a), barD_star _ z (hCi a)] | |
| unfold quaternionDivergence | |
| simp_rw [ha] | |
| simp only [quaternionPair, map_sum, map_add, map_sub, Finset.sum_add_distrib, | |
| Finset.sum_sub_distrib, sub_mul, Finset.sum_mul] | |
| def wavePairedQuaternion {d : β} (ΞΊ ΞΊ' cR cI : β) (v v' : Fin d β β) | |
| (x : Index d β β) (z : Index d β β) (a b : Index d) : Quaternion β := | |
| quaternionPair (wavePairedC ΞΊ ΞΊ' cR cI v v' x z a b) | |
| (wavePairedE ΞΊ ΞΊ' cR cI v v' x z a b) | |
| /-- The actual quaternionic divergence of each oscillatory Hermitian pair is zero. -/ | |
| theorem wavePairedQuaternion_divergence {d : β} (ΞΊ ΞΊ' cR cI : β) (v v' : Fin d β β) | |
| (x : Index d β β) (z : Index d β β) (hY : z none β 0) (b : Index d) : | |
| quaternionDivergence (fun a => fun q w => wavePairedQuaternion ΞΊ ΞΊ' cR cI v v' q w a b) | |
| x z = 0 := by | |
| have hCr (a : Index d) : DifferentiableAt β | |
| (fun t : β => wavePairedC ΞΊ ΞΊ' cR cI v v' (realLine x a t) z a b) 0 := | |
| ((hasDerivAt_phaseF_line cR cI (phaseDifference ΞΊ ΞΊ' v v') x a).ofReal_comp.const_mul | |
| (pairedC ΞΊ ΞΊ' v v' z a b)).differentiableAt | |
| have hEr (a : Index d) : DifferentiableAt β | |
| (fun t : β => wavePairedE ΞΊ ΞΊ' cR cI v v' (realLine x a t) z a b) 0 := | |
| ((hasDerivAt_phaseG_line cR cI (phaseDifference ΞΊ ΞΊ' v v') x a).ofReal_comp.const_mul | |
| (pairedE ΞΊ ΞΊ' v v' z a b)).differentiableAt | |
| have hCi (a : Index d) : DifferentiableAt β | |
| (fun w => wavePairedC ΞΊ ΞΊ' cR cI v v' x w a b) z := | |
| (differentiableAt_pairedC ΞΊ ΞΊ' v v' z hY a b).mul_const _ | |
| have hEi (a : Index d) : DifferentiableAt β | |
| (fun w => wavePairedE ΞΊ ΞΊ' cR cI v v' x w a b) z := | |
| (differentiableAt_pairedE ΞΊ ΞΊ' v v' z hY a b).mul_const _ | |
| rw [show (fun a q w => wavePairedQuaternion ΞΊ ΞΊ' cR cI v v' q w a b) = | |
| (fun a q w => quaternionPair (wavePairedC ΞΊ ΞΊ' cR cI v v' q w a b) | |
| (wavePairedE ΞΊ ΞΊ' cR cI v v' q w a b)) from rfl, | |
| quaternionDivergence_split _ _ x z hCr hEr hCi hEi, | |
| wavePaired_divergence_first ΞΊ ΞΊ' cR cI v v' x z hY, | |
| wavePaired_divergence_second ΞΊ ΞΊ' cR cI v v' x z hY] | |
| simp [quaternionPair] | |
| end | |
| end OAI.Analysis.Calculus.Current | |