cfahlgren1/math / lean /OAI /Probability /SKRatio /Matrices /GoeMatrixQuadCoeff.lean
cfahlgren1's picture
download
raw
6.02 kB
import Mathlib
import OAI.Probability.SKRatio.Matrices.DiagonalTMemLp
import OAI.Probability.SKRatio.Matrices.MatrixQuad
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
section GOEEvents
variable {ι : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι]
omit [DecidableEq ι] [Nonempty ι] in
lemma goeMatrix_quad_coeff (r : ℝ) (g : MatrixCoordinates ι → ℝ)
(p : EuclideanSpace ℝ ι) :
matrixQuad (goeMatrix r g) p = ∑ k, quadraticCoeff r p k * g k := by
rw [goeMatrix_quad, Fintype.sum_sum_type]
simp only [quadraticCoeff, zero_mul, Finset.sum_const_zero, add_zero,
Fintype.sum_prod_type]
omit [DecidableEq ι] [Nonempty ι] in
lemma diagonal_affine_matrix (r z q : ℝ) (a : ι → ℝ)
(g : MatrixCoordinates ι → ℝ) (p : UnitBall ι) :
gaussianAffine (diagonalOffset a z q)
(fun p k => z * quadraticCoeff r (diagonalSqrt a p) k) g p =
z * matrixQuad (goeMatrix r g) (diagonalSqrt a p) -
z^2*q*‖diagonalSqrt a p‖^2 := by
rw [goeMatrix_quad_coeff]
simp only [gaussianAffine, diagonalOffset, Finset.mul_sum]
simp_rw [mul_assoc]
ring
omit [Fintype ι] [DecidableEq ι] [Nonempty ι] in
lemma diagonalSqrt_one (p : EuclideanSpace ℝ ι) :
diagonalSqrt (fun _ : ι => 1) p = p := by
ext i
simp [diagonalSqrt]
omit [DecidableEq ι] [Nonempty ι] in
lemma goe_quad_le_top (r : ℝ) (g : MatrixCoordinates ι → ℝ)
(p : EuclideanSpace ℝ ι) (hp : ‖p‖ ≤ 1) :
matrixQuad (goeMatrix r g) p ≤ diagonalProcess r (fun _ : ι => 1) 1 0 g := by
let p' : UnitBall ι := ⟨p, by simpa only [Metric.mem_closedBall, dist_zero_right] using hp⟩
have h := gaussianAffine_le_gaussianSup (continuous_diagonalOffset (fun _ : ι => 1) 1 0)
(continuous_diagonalCoeff (continuous_quadraticCoeff r) (fun _ : ι => 1) 1) g p'
rw [diagonal_affine_matrix, diagonalSqrt_one] at h
simpa only [one_mul, mul_zero, zero_mul, sub_zero, diagonalProcess, p'] using h
omit [DecidableEq ι] [Nonempty ι] in
lemma matrixQuad_neg (M : Matrix ι ι ℝ) (p : EuclideanSpace ℝ ι) :
matrixQuad (-M) p = -matrixQuad M p := by
simp [matrixQuad, Finset.sum_neg_distrib]
omit [Nonempty ι] in
lemma goe_norm_le_of_top {r R : ℝ} (hR : 0 ≤ R) (g : MatrixCoordinates ι → ℝ)
(hpos : diagonalProcess r (fun _ : ι => 1) 1 0 g ≤ R)
(hneg : diagonalProcess r (fun _ : ι => 1) 1 0 (-g) ≤ R) :
‖matrixOperator (goeMatrix r g)‖ ≤ R := by
apply matrixOperator_norm_le_of_quad (goeMatrix_symm r g) hR
intro p hp
apply abs_le.mpr
constructor
· have h := (goe_quad_le_top r (-g) p hp).trans hneg
rw [goeMatrix_neg, matrixQuad_neg] at h
linarith
· exact (goe_quad_le_top r g p hp).trans hpos
theorem goe_norm_tail {j ε : ℝ} (hj : 0 < j) (hε : 0 ≤ ε) :
(gaussianCoordinates (MatrixCoordinates ι)).real
{g | 2*sqrt j+ε < ‖matrixOperator (goeMatrix (j/(Fintype.card ι:ℝ)) g)‖} ≤
2*Real.exp (-ε^2*(Fintype.card ι:ℝ)/(π^2*j)) := by
let r := j/(Fintype.card ι:ℝ)
let R := 2*sqrt j+ε
let P := diagonalProcess r (fun _ : ι => 1) 1 0
let E : Set (MatrixCoordinates ι → ℝ) := {g | R < P g}
have hc : Continuous P := continuous_gaussianSup
(continuous_diagonalOffset (fun _ : ι => 1) 1 0)
(continuous_diagonalCoeff (continuous_quadraticCoeff r) (fun _ : ι => 1) 1)
have hm : MeasurableSet E := measurableSet_lt measurable_const hc.measurable
have hp := goe_top_tail (ι := ι) hj hε
have hn : (gaussianCoordinates (MatrixCoordinates ι)).real {g | R < P (-g)} =
(gaussianCoordinates (MatrixCoordinates ι)).real E := by
exact congrArg ENNReal.toReal (gaussianCoordinates_preserving_neg.measure_preimage hm.nullMeasurableSet)
have hs : {g : MatrixCoordinates ι → ℝ | R < ‖matrixOperator (goeMatrix r g)‖} ⊆ E ∪ {g | R < P (-g)} := by
intro g hg
by_contra hh
have hh' : ¬ R < P g ∧ ¬ R < P (-g) := by simpa only [Set.mem_union, E, Set.mem_ofPred_eq, not_or] using hh
exact (not_lt_of_ge (goe_norm_le_of_top (by dsimp [R]; positivity) g
(le_of_not_gt hh'.1) (le_of_not_gt hh'.2))) hg
calc
_ ≤ (gaussianCoordinates (MatrixCoordinates ι)).real (E ∪ {g | R < P (-g)}) := measureReal_mono hs
_ ≤ (gaussianCoordinates (MatrixCoordinates ι)).real E +
(gaussianCoordinates (MatrixCoordinates ι)).real {g | R < P (-g)} := measureReal_union_le _ _
_ = 2*(gaussianCoordinates (MatrixCoordinates ι)).real E := by rw [hn]; ring
_ ≤ _ := mul_le_mul_of_nonneg_left hp (by norm_num)
end GOEEvents
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:
6.02 kB
·
Xet hash:
5b8576358e89fc3d87a32a2769da99fffb135bbb85a504cc0a58a840a3c326fa

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.