declaration: theorem SciLean.gaussian.arg_μx.CDifferentiableAt_rule {R : Type u_1} [SciLean.RealScalar R] {W : Type u_2} [SciLean.Vec R W] {U : Type u_3} [SciLean.SemiHilbert R U] (w : W) (μ : W → U) (σ : R) (x : W → U) (hμ : SciLean.CDifferentiableAt R μ w) (hx : SciLean.CDifferentiableAt R x w) : SciLean.CDifferentiableAt R (fun w => SciLean.gaussian (μ w) σ (x w)) w


SciLean.gaussian

declaration: def SciLean.gaussian {R : Type u_1} [SciLean.RealScalar R] {U : Type u_2} [SciLean.SemiHilbert R U] (μ : U) (σ : R) (x : U) : R


declaration: theorem SciLean.gaussian.arg_μx.CDifferentiable_rule {R : Type u_1} [SciLean.RealScalar R] {W : Type u_2} [SciLean.Vec R W] {U : Type u_3} [SciLean.SemiHilbert R U] (μ : W → U) (σ : R) (x : W → U) (hμ : SciLean.CDifferentiable R μ) (hx : SciLean.CDifferentiable R x) : SciLean.CDifferentiable R fun w => SciLean.gaussian (μ w) σ (x w)


declaration:
theorem SciLean.gaussian.arg_μx.cderiv_rule {R : Type u_1} [SciLean.RealScalar R] {W : Type u_2} [SciLean.Vec R W] {U : Type u_3} [SciLean.SemiHilbert R U] (μ : W → U) (σ : R) (x : W → U) (hμ : SciLean.CDifferentiable R μ) (hx : SciLean.CDifferentiable R x) : (SciLean.fwdDeriv R fun w => SciLean.gaussian (μ w) σ (x w)) = fun w dw =>
  let μdμ := SciLean.fwdDeriv R μ w dw;
  let xdx := SciLean.fwdDeriv R x w dw;
  let xdx' := σ⁻¹ • (xdx - μdμ);
  let g := SciLean.gaussian μdμ.1 σ xdx.1;
  (g, -⟪xdx'.1, xdx'.2⟫_R * g)


declaration: theorem SciLean.gaussian.arg_μσx.CDifferentiableAt_rule {R : Type u_1} [SciLean.RealScalar R] {W : Type u_2} [SciLean.Vec R W] {U : Type u_3} [SciLean.SemiHilbert R U] (w : W) (μ : W → U) (σ : W → R) (x : W → U) (hμ : SciLean.CDifferentiableAt R μ w) (hσ : SciLean.CDifferentiableAt R σ w) (hx : SciLean.CDifferentiableAt R x w) (hσ' : σ w ≠ 0) : SciLean.CDifferentiableAt R (fun w => SciLean.gaussian (μ w) (σ w) (x w)) w


declaration:
theorem SciLean.log_gaussian {R : Type u_1} [SciLean.RealScalar R] {U : Type u_2} [SciLean.SemiHilbert R U] (μ : U) (σ : R) (x : U) : SciLean.Scalar.log (SciLean.gaussian μ σ x) =
  let x' := σ⁻¹ • (x - μ);
  -‖x'‖₂² / 2 - SciLean.Scalar.log σ - SciLean.Scalar.log (SciLean.Scalar.sqrt (2 * SciLean.RealScalar.pi))


declaration: theorem SciLean.gaussian.arg_μσx.CDifferentiable_rule {R : Type u_1} [SciLean.RealScalar R] {W : Type u_2} [SciLean.Vec R W] (μ : W → R) (σ : W → R) (x : W → R) (hμ : SciLean.CDifferentiable R μ) (hσ : SciLean.CDifferentiable R σ) (hx : SciLean.CDifferentiable R x) (hσ' : ∀ (w : W), σ w ≠ 0) : SciLean.CDifferentiable R fun w => SciLean.gaussian (μ w) (σ w) (x w)