math / data /lean /OAI /Analysis /Calculus /Current /Operations.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.13 kB
import OAI.Analysis.Calculus.Current.Cancellation
namespace OAI.Analysis.Calculus.Current
noncomputable section
theorem barD_add {d : β„•} (f g : (Index d β†’ β„‚) β†’ β„‚) (z : Index d β†’ β„‚)
(hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Index d) :
barD (fun w => f w + g w) z a = barD f z a + barD g z a := by
have h1 := (hasDerivAt_function_line f z (Pi.single a 1) hf).fun_add
(hasDerivAt_function_line g z (Pi.single a 1) hg)
have hi := (hasDerivAt_function_line f z (Pi.single a Complex.I) hf).fun_add
(hasDerivAt_function_line g z (Pi.single a Complex.I) hg)
simp only [barD, h1.deriv, hi.deriv,
deriv_imaginaryLine f z _ hf, deriv_imaginaryLine g z _ hg]
ring
theorem barD_sub {d : β„•} (f g : (Index d β†’ β„‚) β†’ β„‚) (z : Index d β†’ β„‚)
(hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Index d) :
barD (fun w => f w - g w) z a = barD f z a - barD g z a := by
have h1 := (hasDerivAt_function_line f z (Pi.single a 1) hf).fun_sub
(hasDerivAt_function_line g z (Pi.single a 1) hg)
have hi := (hasDerivAt_function_line f z (Pi.single a Complex.I) hf).fun_sub
(hasDerivAt_function_line g z (Pi.single a Complex.I) hg)
simp only [barD, h1.deriv, hi.deriv,
deriv_imaginaryLine f z _ hf, deriv_imaginaryLine g z _ hg]
ring
theorem barD_const {d : β„•} (c : β„‚) (z : Index d β†’ β„‚) (a : Index d) :
barD (fun _ => c) z a = 0 := by simp [barD]
theorem barD_mul_const {d : β„•} (f : (Index d β†’ β„‚) β†’ β„‚) (c : β„‚) (z : Index d β†’ β„‚)
(hf : DifferentiableAt ℝ f z) (a : Index d) :
barD (fun w => f w * c) z a = barD f z a * c := by
rw [barD_mul _ _ z hf (differentiableAt_const c), barD_const]
ring
theorem complexBarDirectional_mul {d : β„•} (f g : (Index d β†’ β„‚) β†’ β„‚)
(z V : Index d β†’ β„‚) (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) :
complexBarDirectional (fun w => f w * g w) z V =
complexBarDirectional f z V * g z + f z * complexBarDirectional g z V := by
rw [complexBarDirectional_eq_sum _ z V (hf.fun_mul hg),
complexBarDirectional_eq_sum _ z V hf, complexBarDirectional_eq_sum _ z V hg]
simp_rw [barD_mul _ _ z hf hg]
simp only [Finset.sum_mul, Finset.mul_sum, ← Finset.sum_add_distrib]
apply Finset.sum_congr rfl
intro a _
ring
theorem gaussianField_swap {d : β„•} (ΞΊ ΞΊ' : ℝ) (v v' : Fin d β†’ ℝ) :
gaussianField ΞΊ ΞΊ' v v' = gaussianField ΞΊ' ΞΊ v' v := by
funext z
unfold gaussianField gaussianPair gaussianLog
congr 2
ring
theorem differentiableAt_gaussianField_complex {d : β„•} (ΞΊ ΞΊ' : ℝ) (v v' : Fin d β†’ ℝ)
(z : Index d β†’ β„‚) (hY : z none β‰  0) :
DifferentiableAt ℝ (fun w => (gaussianField ΞΊ ΞΊ' v v' w : β„‚)) z :=
Complex.ofRealCLM.differentiableAt.comp z
(differentiableAt_gaussianField ΞΊ ΞΊ' v v' z hY)
/-- Product rule for a weighted vector, retaining the actual differential
operator on the arbitrary smooth scalar factor. -/
theorem weighted_tangentField_product_divergence {d : β„•} (ΞΊ ΞΊ' : ℝ)
(v v' : Fin d β†’ ℝ) (f : (Index d β†’ β„‚) β†’ β„‚)
(z : Index d β†’ β„‚) (hY : z none β‰  0) (hf : DifferentiableAt ℝ f z) :
(βˆ‘ a, barD (fun w => (star (tangentField v w a) *
(gaussianField ΞΊ ΞΊ' v v' w : β„‚)) * f w) z a) =
((gaussianField ΞΊ ΞΊ' v v' z : β„‚) * movingUnit z * (ΞΊ' : β„‚) *
βˆ‘ a, phaseRow (fun i => (v' i : β„‚)) a * tangentField v z a) * f z +
(gaussianField ΞΊ ΞΊ' v v' z : β„‚) * complexBarDirectional f z (tangentField v z) := by
have hg := differentiableAt_gaussianField_complex ΞΊ ΞΊ' v v' z hY
have ha (a : Index d) := barD_mul
(fun w => star (tangentField v w a) * (gaussianField ΞΊ ΞΊ' v v' w : β„‚)) f z
(((differentiableAt_tangentField v z hY a).star).fun_mul hg) hf a
simp_rw [ha]
rw [Finset.sum_add_distrib, ← Finset.sum_mul,
weighted_tangentField_divergence ΞΊ ΞΊ' v v' z hY,
complexBarDirectional_eq_sum _ z _ hf]
congr 1
simp only [Finset.mul_sum]
apply Finset.sum_congr rfl
intro a _
ring
end
end OAI.Analysis.Calculus.Current