Imports
/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ module public import Mathlib.Analysis.InnerProductSpace.Dual public import Mathlib.MeasureTheory.Function.L2Space public import Mathlib.MeasureTheory.Measure.Haar.OfBasis public import Physlib.Meta.TODO.Basic

Hilbert space for one dimension quantum mechanics

TODO "Remove 1d Hilbert space once dependencies are moved over to SpaceDHilbertSpace."@[expose] public section

The Hilbert space for a one dimensional quantum system is defined as the space of almost-everywhere equal equivalence classes of square integrable functions from to .

abbrev HilbertSpace := MeasureTheory.Lp (α := ) 2

The anti-linear map from the Hilbert space to it's dual.

def toBra : HilbertSpace →ₛₗ[starRingEnd ] StrongDual HilbertSpace := InnerProductSpace.toDual HilbertSpace
@[simp] lemma toBra_apply (f g : HilbertSpace) : toBra f g = f, g⟫_ := rfl

The anti-linear map, toBra, taking a ket to it's corresponding bra is surjective.

lemma toBra_surjective : Function.Surjective toBra := (InnerProductSpace.toDual HilbertSpace).surjective

The anti-linear map, toBra, taking a ket to it's corresponding bra is injective.

lemma toBra_injective : Function.Injective toBra := Function.Injective toBra f:HilbertSpaceg:HilbertSpaceh:toBra f = toBra gf = g All goals completed! 🐙

Member of the Hilbert space as a property

The proposition MemHS f for a function f : ℝ → ℂ is defined to be true if the function f can be lifted to the Hilbert space.

def MemHS (f : ) : Prop := MemLp f 2 MeasureTheory.volume
lemma aeStronglyMeasurable_of_memHS {f : } (h : MemHS f) : AEStronglyMeasurable f := h.1

A function f satisfies MemHS f if and only if it is almost everywhere strongly measurable, and square integrable.

f: h1:AEStronglyMeasurable f volume∫⁻ (a : ), f a‖ₑ ^ ENNReal.toReal 2 < Integrable (fun x => f x ^ 2) volume f: h1:AEStronglyMeasurable f volume∫⁻ (a : ), f a‖ₑ ^ 2 < AEStronglyMeasurable (fun x => f x ^ 2) volume HasFiniteIntegral (fun x => f x ^ 2) volume f: h1:AEStronglyMeasurable f volumeh0:AEStronglyMeasurable (fun x => f x ^ 2) volume∫⁻ (a : ), f a‖ₑ ^ 2 < AEStronglyMeasurable (fun x => f x ^ 2) volume HasFiniteIntegral (fun x => f x ^ 2) volume All goals completed! 🐙
AEStronglyMeasurable (fun x => 0) volume Integrable (fun x => 0 ^ 2) volume AEStronglyMeasurable (fun x => 0) volume All goals completed! 🐙@[simp] lemma zero_fun_memHS : MemHS (fun _ : => (0 : )) := zero_memHSlemma memHS_add {f g : } (hf : MemHS f) (hg : MemHS g) : MemHS (f + g) := MeasureTheory.MemLp.add hf hglemma memHS_smul {f : } {c : } (hf : MemHS f) : MemHS (c f) := MeasureTheory.MemLp.const_smul hf clemma memHS_of_ae {g : } (f : ) (hf : MemHS f) (hfg : f =ᵐ[MeasureTheory.volume] g) : MemHS g := MemLp.ae_eq hfg hf

Construction of elements of the Hilbert space

lemma aeEqFun_mk_mem_iff (f : ) (hf : AEStronglyMeasurable f volume) : AEEqFun.mk f hf HilbertSpace MemHS f := f: hf:AEStronglyMeasurable f volumeAEEqFun.mk f hf HilbertSpace MemHS f f: hf:AEStronglyMeasurable f volumeMemLp (↑(AEEqFun.mk f hf)) 2 volume MemHS f All goals completed! 🐙

Given a function f : ℝ → ℂ such that MemHS f is true via hf, then HilbertSpace.mk hf is the element of the HilbertSpace defined by f.

def mk {f : } (hf : MemHS f) : HilbertSpace := AEEqFun.mk f hf.1, (aeEqFun_mk_mem_iff f hf.1).mpr hf
f:HilbertSpaceAEEqFun.mk f HilbertSpace f:HilbertSpacehf:f = AEEqFun.mk f AEEqFun.mk f HilbertSpace All goals completed! 🐙lemma mk_surjective (f : HilbertSpace) : (g : ), (hg : MemHS g), mk hg = f := f:HilbertSpace g, (hg : MemHS g), mk hg = f f:HilbertSpacemk = f All goals completed! 🐙lemma coe_mk_ae {f : } (hf : MemHS f) : (mk hf : ) =ᵐ[MeasureTheory.volume] f := AEEqFun.coeFn_mk f hf.1lemma inner_mk_mk {f g : } {hf : MemHS f} {hg : MemHS g} : inner (mk hf) (mk hg) = x : , starRingEnd (f x) * g x := f: g: hf:MemHS fhg:MemHS gmk hf, mk hg⟫_ = (x : ), (starRingEnd ) (f x) * g x f: g: hf:MemHS fhg:MemHS g(fun a => (mk hf) a, (mk hg) a⟫_) =ᵐ[volume] fun a => (starRingEnd ) (f a) * g a filter_upwards [coe_mk_ae hf, coe_mk_ae hg] with _ f: g: hf✝:MemHS fhg:MemHS ga✝:hf:(mk hf✝) a✝ = f a✝(mk hg) a✝ = g a✝ (mk hf✝) a✝, (mk hg) a✝⟫_ = (starRingEnd ) (f a✝) * g a✝ f: g: hf✝:MemHS fhg✝:MemHS ga✝:hf:(mk hf✝) a✝ = f a✝hg:(mk hg✝) a✝ = g a✝(mk hf✝) a✝, (mk hg✝) a✝⟫_ = (starRingEnd ) (f a✝) * g a✝ All goals completed! 🐙@[simp] lemma eLpNorm_mk {f : } {hf : MemHS f} : eLpNorm (mk hf) 2 volume = eLpNorm f 2 volume := MeasureTheory.eLpNorm_congr_ae (coe_mk_ae hf)lemma mem_iff' {f : } (hf : MeasureTheory.AEStronglyMeasurable f MeasureTheory.volume) : MeasureTheory.AEEqFun.mk f hf HilbertSpace MeasureTheory.Integrable (fun x => f x ^ 2) := f: hf:AEStronglyMeasurable f volumeAEEqFun.mk f hf HilbertSpace Integrable (fun x => f x ^ 2) volume f: hf:AEStronglyMeasurable f volumeAEStronglyMeasurable (↑(AEEqFun.mk f hf)) volume eLpNorm f 2 volume < Integrable (fun x => f x ^ 2) volume f: hf:AEStronglyMeasurable f volumeh1:AEStronglyMeasurable (↑(AEEqFun.mk f hf)) volumeAEStronglyMeasurable (↑(AEEqFun.mk f hf)) volume eLpNorm f 2 volume < Integrable (fun x => f x ^ 2) volume f: hf:AEStronglyMeasurable f volumeh1:AEStronglyMeasurable (↑(AEEqFun.mk f hf)) volume∫⁻ (a : ), f a‖ₑ ^ 2 < AEStronglyMeasurable (fun x => f x ^ 2) volume HasFiniteIntegral (fun x => f x ^ 2) volume f: hf:AEStronglyMeasurable f volumeh1:AEStronglyMeasurable (↑(AEEqFun.mk f hf)) volumeh0:AEStronglyMeasurable (fun x => f x ^ 2) volume∫⁻ (a : ), f a‖ₑ ^ 2 < AEStronglyMeasurable (fun x => f x ^ 2) volume HasFiniteIntegral (fun x => f x ^ 2) volume All goals completed! 🐙lemma mk_add {f g : } {hf : MemHS f} {hg : MemHS g} : mk (memHS_add hf hg) = mk hf + mk hg := rfllemma mk_smul {f : } {c : } {hf : MemHS f} : mk (memHS_smul (c := c) hf) = c mk hf := rfllemma mk_eq_iff {f g : } {hf : MemHS f} {hg : MemHS g} : mk hf = mk hg f =ᵐ[volume] g := f: g: hf:MemHS fhg:MemHS gmk hf = mk hg f =ᵐ[volume] g All goals completed! 🐙lemma ext_iff {f g : HilbertSpace} : f = g (f : ) =ᶠ[ae volume] (g : ) := f:HilbertSpaceg:HilbertSpacef = g f =ᵐ[volume] g All goals completed! 🐙