Buckets:
| import Mathlib | |
| import OAI.Probability.SKRatio.Matrices.MatrixCoordinates | |
| 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 | |
| noncomputable section | |
| open Set Real | |
| open scoped Topology | |
| noncomputable section | |
| open Matrix Set Filter | |
| open scoped Topology Matrix.Norms.Frobenius | |
| noncomputable section | |
| open Matrix NormedSpace ContinuousLinearMap | |
| open scoped Matrix.Norms.Frobenius | |
| noncomputable section | |
| open Matrix | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Real Set | |
| open scoped ENNReal NNReal | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory InformationTheory Real Set | |
| open scoped NNReal ENNReal | |
| noncomputable section | |
| open scoped BigOperators | |
| open MeasureTheory ProbabilityTheory | |
| open Real | |
| noncomputable section | |
| open scoped BigOperators Topology | |
| open Filter Real | |
| namespace SKRatioGaussian | |
| variable {ι : Type*} [Fintype ι] [DecidableEq ι] | |
| def matrixQuad (M : Matrix ι ι ℝ) (p : EuclideanSpace ℝ ι) : ℝ := | |
| ∑ i, ∑ k, p i * M i k * p k | |
| def matrixOperator (M : Matrix ι ι ℝ) : | |
| EuclideanSpace ℝ ι →L[ℝ] EuclideanSpace ℝ ι := | |
| M.toEuclideanLin.toContinuousLinearMap | |
| lemma matrixOperator_apply (M : Matrix ι ι ℝ) (p : EuclideanSpace ℝ ι) (i : ι) : | |
| matrixOperator M p i = ∑ k, M i k * p k := by | |
| rfl | |
| lemma matrixQuad_inner (M : Matrix ι ι ℝ) (p : EuclideanSpace ℝ ι) : | |
| matrixQuad M p = inner ℝ p (matrixOperator M p) := by | |
| simp only [PiLp.inner_apply, RCLike.inner_apply, conj_trivial, matrixOperator_apply, | |
| matrixQuad, Finset.sum_mul] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| omit [DecidableEq ι] in | |
| lemma matrixQuad_smul (M : Matrix ι ι ℝ) (p : EuclideanSpace ℝ ι) (c : ℝ) : | |
| matrixQuad M (c • p) = c^2 * matrixQuad M p := by | |
| simp only [matrixQuad, PiLp.smul_apply, smul_eq_mul, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| omit [Fintype ι] [DecidableEq ι] in | |
| lemma goeMatrix_symm (r : ℝ) (g : MatrixCoordinates ι → ℝ) : | |
| (goeMatrix r g).IsHermitian := by | |
| ext i k | |
| simp [goeMatrix, add_comm] | |
| omit [Fintype ι] [DecidableEq ι] in | |
| lemma goeMatrix_neg (r : ℝ) (g : MatrixCoordinates ι → ℝ) : | |
| goeMatrix r (-g) = -goeMatrix r g := by | |
| ext i k | |
| simp only [goeMatrix, Pi.neg_apply, Matrix.neg_apply] | |
| ring | |
| omit [DecidableEq ι] in | |
| lemma goeMatrix_quad (r : ℝ) (g : MatrixCoordinates ι → ℝ) (p : EuclideanSpace ℝ ι) : | |
| matrixQuad (goeMatrix r g) p = | |
| ∑ i, ∑ k, sqrt (2*r) * p i * p k * g (.inl (i,k)) := by | |
| have hs : (∑ i, ∑ k, p i * g (.inl (k,i)) * p k) = | |
| ∑ i, ∑ k, p i * g (.inl (i,k)) * p k := by | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| calc | |
| _ = sqrt (2*r)/2 * ((∑ i, ∑ k, p i * g (.inl (i,k)) * p k) + | |
| ∑ i, ∑ k, p i * g (.inl (k,i)) * p k) := by | |
| simp only [matrixQuad, goeMatrix, Finset.mul_sum, ← Finset.sum_add_distrib] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| _ = _ := by | |
| rw [hs] | |
| simp only [Finset.mul_sum, ← Finset.sum_add_distrib] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| lemma matrixOperator_norm_le_of_quad {M : Matrix ι ι ℝ} (hM : M.IsHermitian) | |
| {R : ℝ} (hR : 0 ≤ R) | |
| (hq : ∀ p : EuclideanSpace ℝ ι, ‖p‖ ≤ 1 → |matrixQuad M p| ≤ R) : | |
| ‖matrixOperator M‖ ≤ R := by | |
| have hs : (matrixOperator M).IsSymmetric := Matrix.isSymmetric_toEuclideanLin_iff.mpr hM | |
| rw [ContinuousLinearMap.norm_eq_iSup_rayleighQuotient (T := matrixOperator M) hs] | |
| apply ciSup_le | |
| intro p | |
| by_cases hp : p = 0 | |
| · simp [hp, ContinuousLinearMap.rayleighQuotient, hR] | |
| have hp0 : 0 < ‖p‖ := norm_pos_iff.mpr hp | |
| have hunit : ‖‖p‖⁻¹ • p‖ ≤ 1 := by | |
| rw [norm_smul, Real.norm_eq_abs, abs_inv, abs_of_pos hp0, inv_mul_cancel₀ hp0.ne'] | |
| have hh := hq (‖p‖⁻¹ • p) hunit | |
| rw [matrixQuad_smul, abs_mul, abs_pow, abs_inv, abs_of_pos hp0] at hh | |
| simpa only [ContinuousLinearMap.rayleighQuotient, ContinuousLinearMap.reApplyInnerSelf_apply, | |
| RCLike.re_to_real, real_inner_comm, ← matrixQuad_inner, abs_div, | |
| abs_pow, abs_of_pos hp0, inv_pow, div_eq_mul_inv, mul_comm, abs_mul, abs_inv] using hh | |
| end SKRatioGaussian | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 5.18 kB
- Xet hash:
- dd9921e3638e815873df6109aa6511b854be19e3282a8e387c04fb8bcf3c22b6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.