math / data /lean /OAI /Probability /SKRatio /Matrices /EntryLM.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
6.12 kB
import Mathlib
import OAI.Probability.SKRatio.Matrices.Imaginary
namespace OAI
section
section
noncomputable section
open MeasureTheory ProbabilityTheory InformationTheory Real Set
open scoped NNReal ENNReal
open Filter
open scoped Topology
noncomputable section
open Matrix Real
open scoped BigOperators Matrix.Norms.Frobenius ENNReal NNReal
noncomputable section
open Matrix Real
open scoped BigOperators Matrix.Norms.Frobenius NNReal
noncomputable section
open MeasureTheory ProbabilityTheory Real Set Filter
open MeasureTheory.Measure
open scoped ENNReal NNReal MeasureTheory Topology
open MeasureTheory
noncomputable section
noncomputable section
open MeasureTheory Set NormedSpace
open scoped Topology
noncomputable section
open Matrix Real
open scoped BigOperators Matrix.Norms.Frobenius
namespace SKRatioGaussian.ComplexMatrix
open MeasureTheory Set NormedSpace
open scoped Topology FourierTransform SchwartzMap
variable {ΞΉ : Type*} [Fintype ΞΉ] [DecidableEq ΞΉ]
local instance : ContinuousENorm (Matrix ΞΉ ΞΉ β„‚) :=
@SeminormedAddGroup.toContinuousENorm _ Matrix.frobeniusSeminormedAddCommGroup.toSeminormedAddGroup
local instance : TopologicalSpace.PseudoMetrizableSpace (Matrix ΞΉ ΞΉ β„‚) :=
inferInstanceAs (TopologicalSpace.PseudoMetrizableSpace (ΞΉ β†’ ΞΉ β†’ β„‚))
def entryLM (i j : ΞΉ) : Matrix ΞΉ ΞΉ β„‚ β†’β‚—[β„‚] β„‚ where
toFun := fun M => M i j
map_add' := by intros; rfl
map_smul' := by intros; rfl
def entryCLM (i j : ΞΉ) : Matrix ΞΉ ΞΉ β„‚ β†’L[β„‚] β„‚ := (entryLM i j).toContinuousLinearMap
lemma integral_entry {F : ℝ β†’ Matrix ΞΉ ΞΉ β„‚} (hF : Integrable F) (i j : ΞΉ) :
(∫ t : ℝ, F t) i j = ∫ t : ℝ, F t i j := by
exact ((entryCLM i j).integral_comp_comm hF).symm
def conjugate (U : unitary (Matrix ΞΉ ΞΉ β„‚)) : Matrix ΞΉ ΞΉ β„‚ ≃⋆ₐ[β„‚] Matrix ΞΉ ΞΉ β„‚ :=
Unitary.conjStarAlgAut β„‚ _ U
def conjugateCLM (U : unitary (Matrix ΞΉ ΞΉ β„‚)) : Matrix ΞΉ ΞΉ β„‚ β†’L[β„‚] Matrix ΞΉ ΞΉ β„‚ :=
(conjugate U).toAlgEquiv.toLinearMap.toContinuousLinearMap
lemma conjugate_exp (U : unitary (Matrix ΞΉ ΞΉ β„‚)) (M : Matrix ΞΉ ΞΉ β„‚) :
conjugate U (exp M) = exp (conjugate U M) := by
exact NormedSpace.map_exp (conjugate U).toRingHom (conjugateCLM U).continuous M
lemma conjugate_imaginary (U : unitary (Matrix ΞΉ ΞΉ β„‚)) (t : ℝ) (M : Matrix ΞΉ ΞΉ β„‚) :
conjugate U (imaginary t M) = imaginary t (conjugate U M) := by
exact (conjugate U).map_smul' _ _
lemma kernelMatrix_conjugate {g : ℝ β†’ β„‚} (hg : Integrable g) (U : unitary (Matrix ΞΉ ΞΉ β„‚))
(M : Matrix ΞΉ ΞΉ β„‚) (hM : Mα΄΄ = M) :
kernelMatrix g (conjugate U M) = conjugate U (kernelMatrix g M) := by
have hi := (conjugateCLM U).integral_comp_comm (kernel_integrable hg M hM)
change _ = (conjugateCLM U) (∫ t : ℝ, g t β€’ exp (imaginary t M))
calc
_ = ∫ t : ℝ, (conjugateCLM U) (g t β€’ exp (imaginary t M)) := by
apply integral_congr_ae
filter_upwards [] with t
change g t β€’ exp (imaginary t (conjugate U M)) = conjugate U (g t β€’ exp (imaginary t M))
rw [map_smul,conjugate_exp,conjugate_imaginary]
_ = _ := hi
lemma kernelMatrix_diagonal {g : ℝ β†’ β„‚} (hg : Integrable g) (x : ΞΉ β†’ ℝ) :
kernelMatrix g (diagonal (fun i => (x i : β„‚))) =
diagonal (fun i => ∫ t : ℝ, g t * Complex.exp ((t : β„‚)*Complex.I*(x i : β„‚))) := by
have hD : (diagonal (fun i => (x i : β„‚)))α΄΄ = diagonal (fun i => (x i : β„‚)) := by
simp [Matrix.diagonal_conjTranspose]
ext i j
rw [kernelMatrix,integral_entry (kernel_integrable hg _ hD)]
have hexp (t : ℝ) : exp (imaginary t (diagonal (fun i => (x i : β„‚)))) =
diagonal (fun i => Complex.exp ((t : β„‚)*Complex.I*(x i : β„‚))) := by
rw [imaginary,← diagonal_smul,Matrix.exp_diagonal]
congr 1
ext i
rw [Pi.coe_exp,← Complex.exp_eq_exp_β„‚]
rfl
simp_rw [hexp,Matrix.smul_apply,smul_eq_mul]
by_cases hij : i = j
Β· subst j; simp
Β· simp [hij]
noncomputable def schwartzMatrix (f : 𝓒(ℝ, β„‚)) (M : Matrix ΞΉ ΞΉ β„‚) : Matrix ΞΉ ΞΉ β„‚ :=
kernelMatrix ((𝓕 f : 𝓒(ℝ,β„‚)) : ℝ β†’ β„‚) ((2*Real.pi : ℝ) β€’ M)
lemma fourier_scalar_inverse (f : 𝓒(ℝ, β„‚)) (x : ℝ) :
(∫ t : ℝ, (𝓕 f) t * Complex.exp ((t : β„‚)*Complex.I*((2*Real.pi*x : ℝ) : β„‚))) = f x := by
have hh := congrArg (fun g : 𝓒(ℝ,β„‚) => g x) (show (𝓕⁻ (𝓕 f : 𝓒(ℝ,β„‚)) : 𝓒(ℝ,β„‚)) = f from FourierTransform.fourierInv_fourier_eq f)
rw [SchwartzMap.fourierInv_coe,Real.fourierInv_eq'] at hh
rw [← hh]
apply integral_congr_ae
filter_upwards [] with t
simp only [smul_eq_mul,Real.inner_apply]
conv_lhs => rw [mul_comm]
congr 1
congr 1
push_cast
ring
lemma schwartzMatrix_diagonal (f : 𝓒(ℝ,β„‚)) (x : ΞΉ β†’ ℝ) :
schwartzMatrix f (diagonal (fun i => (x i : β„‚))) = diagonal (fun i => f (x i)) := by
rw [schwartzMatrix,← diagonal_smul]
have heq : (2*Real.pi : ℝ) β€’ (fun i => (x i : β„‚)) = fun i => ((2*Real.pi*x i : ℝ) : β„‚) := by
ext i; simp
rw [heq,kernelMatrix_diagonal (𝓕 f).integrable]
congr 1
ext i
exact fourier_scalar_inverse f (x i)
lemma schwartzMatrix_conjugate (f : 𝓒(ℝ,β„‚)) (U : unitary (Matrix ΞΉ ΞΉ β„‚))
(M : Matrix ΞΉ ΞΉ β„‚) (hM : Mα΄΄ = M) :
schwartzMatrix f (conjugate U M) = conjugate U (schwartzMatrix f M) := by
have heq : (2*Real.pi : ℝ) β€’ conjugate U M = conjugate U ((2*Real.pi : ℝ) β€’ M) := by
simp [conjugate,Unitary.conjStarAlgAut_apply]
rw [schwartzMatrix,heq]
exact kernelMatrix_conjugate (𝓕 f).integrable U _ (by simp [hM])
lemma schwartzMatrix_spectral (f : 𝓒(ℝ,β„‚)) (M : Matrix ΞΉ ΞΉ β„‚) (hM : M.IsHermitian) :
schwartzMatrix f M = conjugate hM.eigenvectorUnitary (diagonal (fun i => f (hM.eigenvalues i))) := by
conv_lhs => rw [hM.spectral_theorem]
change schwartzMatrix f (conjugate hM.eigenvectorUnitary (diagonal (fun i => (hM.eigenvalues i : β„‚)))) = _
rw [schwartzMatrix_conjugate f _ _ (by simp [Matrix.diagonal_conjTranspose]),schwartzMatrix_diagonal]
end SKRatioGaussian.ComplexMatrix
end
end
end
end
end
end
end
end
end
end OAI