Imports
/- Copyright (c) 2026 Gregory J. Loges. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gregory J. Loges -/ module public import Mathlib.Analysis.Calculus.ContDiff.Bounds public import Mathlib.Analysis.Distribution.SchwartzSpace.Basic public import Mathlib.Analysis.InnerProductSpace.Calculus public import Mathlib.Analysis.SpecialFunctions.ExpDeriv public import Physlib.Meta.TODO.Basic

Gaussians in inner product spaces

i. Overview

In this module we define Gaussians as Schwartz maps in general inner product spaces.

The most general Gaussian constructed is exp (-2⁻¹ * ‖B⁻¹ (x - x₀)‖ ^ 2) (mean x₀ and covariance BᵀB) as a Schwartz map 𝓢(E, 𝕜), where B : D ≃L[ℝ] E is a linear equivalence of inner product spaces. This is accomplished by first constructing the Gaussian exp (-2⁻¹ * ‖x‖ ^ 2) as a Schwartz map 𝓢(E, ℝ) using explicit bounds on the derivatives of ‖x‖ ^ 2 = innerSL ℝ x x and limiting properties of the real exponential, then composing with an invertible affine transformation.

The Gaussians are left unnormalized since the appropriate condition will depend on context and whether E is finite- or infinite-dimensional. For example, the normalization conditions when interpreted as a probability density function vs. as a quantum state require different pre-factors.

For some relevant Gaussian integrals see Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.

ii. Key results

    gaussian 𝕜 B x₀ : Given a linear equivalence B : D ≃L[ℝ] E and mean x₀ : E, the Gaussian exp (-2⁻¹ * ‖B⁻¹ (x - x₀)‖ ^ 2) centered on x₀ as a Schwartz map 𝓢(E, 𝕜).

    gaussian₀ 𝕜 B : Given a linear equivalence B : D ≃L[ℝ] E of inner product spaces, the Gaussian exp (-2⁻¹ * ‖B⁻¹ x‖ ^ 2) centered on the origin as a Schwartz map 𝓢(E, 𝕜).

    stdGaussian E 𝕜 : The standard Gaussian exp (-2⁻¹ * ‖x‖ ^ 2) as a Schwartz map 𝓢(E, 𝕜).

iii. Table of contents

    A. Standard, real-valued

    B. General, RCLike-valued

iv. References

@[expose] public sectionTODO "Provide functionality for multiplying by exponential functions like `exp ⟪v, x⟫` (which does not have temperate growth) to obtain another Schwartz map (smulLeftExp?) and prove that this is equal to a shifted/rescaled Gaussian with the same covariance."

A. Standard, real-valued

Crude bounds on the norms of iterated Fréchet derivatives of innerSL ℝ in the form required by norm_iteratedFDeriv_comp_le.

E:Type u_2inst✝¹:NormedAddCommGroup Einst✝:InnerProductSpace Ex:En:hn:1 nh_id₁:iteratedFDeriv 1 id x 1h_id: k 2, iteratedFDeriv k id x = 0hn':2 < n0 (2 + x ^ 2) ^ n All goals completed! 🐙
s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0) C > 0, x 0, x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) C s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1 C > 0, x 0, x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) C s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1M:hgM: (b_1 : ), M b_1 b b_1 < 1 C > 0, x 0, x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) C s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1M:hgM: (b_1 : ), M b_1 b b_1 < 1x₀:hx₀:x₀ Set.Icc 0 |M|hx₀':IsMaxOn b (Set.Icc 0 |M|) x₀ C > 0, x 0, x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) C refine max (b x₀) 1, s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1M:hgM: (b_1 : ), M b_1 b b_1 < 1x₀:hx₀:x₀ Set.Icc 0 |M|hx₀':IsMaxOn b (Set.Icc 0 |M|) x₀max (b x₀) 1 > 0 All goals completed! 🐙, fun x hx ?_ s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1M:hgM: (b_1 : ), M b_1 b b_1 < 1x₀:hx₀:x₀ Set.Icc 0 |M|hx₀':IsMaxOn b (Set.Icc 0 |M|) x₀x:hx:x 0hxM:x |M|x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) max (b x₀) 1s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1M:hgM: (b_1 : ), M b_1 b b_1 < 1x₀:hx₀:x₀ Set.Icc 0 |M|hx₀':IsMaxOn b (Set.Icc 0 |M|) x₀x:hx:x 0hxM:¬x |M|x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) max (b x₀) 1 s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1M:hgM: (b_1 : ), M b_1 b b_1 < 1x₀:hx₀:x₀ Set.Icc 0 |M|hx₀':IsMaxOn b (Set.Icc 0 |M|) x₀x:hx:x 0hxM:x |M|x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) max (b x₀) 1 All goals completed! 🐙 s:hs:0 sn:b: := fun x => x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x)hb:Continuous bhtop:Tendsto b atTop (nhds 0)htail:∀ᶠ (x : ) in atTop, b x < 1M:hgM: (b_1 : ), M b_1 b b_1 < 1x₀:hx₀:x₀ Set.Icc 0 |M|hx₀':IsMaxOn b (Set.Icc 0 |M|) x₀x:hx:x 0hxM:¬x |M|x ^ s * (2 + x) ^ n * rexp (-2⁻¹ * x) max (b x₀) 1 All goals completed! 🐙

B. General, RCLike-valued

The (unnormalized) 𝕜-valued Gaussian exp (-2⁻¹ * ‖B⁻¹ (x - x₀)‖ ^ 2) as a Schwartz map.

def gaussian : 𝓢(E, 𝕜) := compSubConstCLM 𝕜 x₀ (((realStdGaussian D).postcompCLM ofRealCLM).compCLMOfContinuousLinearEquiv 𝕜 B.symm)
@[simp] lemma gaussian_apply : gaussian 𝕜 B x₀ x = ofReal (rexp (-2⁻¹ * B.symm (x - x₀) ^ 2)) := rfl

The (unnormalized) 𝕜-valued Gaussian exp (-2⁻¹ * ‖B⁻¹ x‖ ^ 2) as a Schwartz map.

abbrev gaussian₀ : 𝓢(E, 𝕜) := gaussian 𝕜 B 0