Download data/lean/OAI/Probability/SKRatio/Matrices/EntryLM.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.12 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKRatio/Matrices/EntryLM.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SKRatio/Matrices/EntryLM.lean
-
curl -L -o EntryLM.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKRatio/Matrices/EntryLM.lean
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 | |