Download data/lean/OAI/Probability/LogConcave/LowerBounds/SpectrumOperator.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.43 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/LowerBounds/SpectrumOperator.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LogConcave/LowerBounds/SpectrumOperator.lean
-
curl -L -o SpectrumOperator.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/LowerBounds/SpectrumOperator.lean
7.43 kB
| import Mathlib | |
| import OAI.Probability.LogConcave.LowerBounds.WeightedEvaluation | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| open MeasureTheory Filter | |
| open scoped ENNReal NNReal Topology | |
| section LowerProof | |
| open Matrix Topology TopologicalSpace ProbabilityTheory Classical WithLp | |
| open scoped Matrix.Norms.Elementwise | |
| open WithLp | |
| open MeasureTheory ProbabilityTheory | |
| open scoped ENNReal NNReal | |
| open Matrix | |
| open Polynomial | |
| open scoped BigOperators | |
| namespace LogConcaveSampling.LowerBound | |
| theorem diagonalStatistic_eq_dotProduct {d : β} (c u : Fin d β β) : | |
| diagonalStatistic c u = dotProduct u (Matrix.diagonal c *α΅₯ u) := by | |
| simp only [diagonalStatistic, Matrix.mulVec_diagonal, dotProduct] | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| theorem normStatistic_eq_dotProduct {d : β} (u : Fin d β β) : | |
| diagonalStatistic (fun _ => 1) u = dotProduct u u := by | |
| simp [diagonalStatistic, dotProduct, pow_two] | |
| theorem separationThreshold_eq {d q : β} (hd : 0 < d) : | |
| 2 * blockTolerance d q * (2*d) = separationThreshold d q := by | |
| have hdr : (0 : β) < d := by exact_mod_cast hd | |
| have hs := Real.sq_sqrt hdr.le | |
| have hsn : Real.sqrt (d : β) β 0 := by positivity | |
| unfold blockTolerance separationThreshold | |
| field_simp | |
| nlinarith | |
| theorem algorithm_span_separation_bound {Ξ© : Type*} [MeasurableSpace Ξ©] | |
| {P : Measure Ξ©} [IsProbabilityMeasure P] {d q : β} | |
| (hqd : 4*q+1 < 2*d) (ht : blockTolerance d q β€ 1/2) | |
| {rows : Ξ© β Fin d β Fin (q+1) β β} | |
| (hrows : HasLaw rows (gaussianRows d (q+1)) P) (U : Ξ© β Fin d β β) | |
| (hU : βα΅ Ο βP, U Ο β krylovSpace (rows Ο)) : | |
| P.real {Ο | U Ο β separationEvent d q} β€ 1/100 := by | |
| obtain β¨G,hG,hm,hgoodβ© := lower_span_statistic hqd ht | |
| have hsub : {Ο | U Ο β separationEvent d q} β€α΅[P] {Ο | rows Ο β GαΆ} := by | |
| filter_upwards [hU] with Ο hu | |
| intro hsep | |
| change rows Ο β G | |
| intro hg | |
| have hstat := hgood (rows Ο) hg (U Ο) hu | |
| rw [β diagonalStatistic_eq_dotProduct, β normStatistic_eq_dotProduct] at hstat | |
| have hn := hsep.1 | |
| have hs := hsep.2 | |
| have hbound : 2 * blockTolerance d q * diagonalStatistic (fun _ => 1) (U Ο) β€ | |
| separationThreshold d q := by | |
| rw [β separationThreshold_eq (by omega : 0 < d)] | |
| exact mul_le_mul_of_nonneg_left hn (mul_nonneg (by norm_num) (blockTolerance_pos (q := q) (by omega : 0 < d)).le) | |
| exact (not_lt_of_ge (hstat.trans hbound)) hs | |
| have hmono := ENNReal.toReal_mono (measure_ne_top P {Ο | rows Ο β GαΆ}) | |
| (measure_mono_ae hsub) | |
| change P.real {Ο | U Ο β separationEvent d q} β€ P.real {Ο | rows Ο β GαΆ} at hmono | |
| have hlaw : P.real {Ο | rows Ο β GαΆ} = (gaussianRows d (q+1)).real GαΆ := | |
| hrows.measureReal_eq hG.compl | |
| rw [hlaw, measureReal_compl hG, probReal_univ] at hmono | |
| linarith | |
| end LogConcaveSampling.LowerBound | |
| namespace LogConcaveSampling.LowerBound | |
| open scoped RealInnerProductSpace | |
| open Matrix WithLp | |
| def spectrumOperator (d : β) : Point d βL[β] Point d := | |
| Matrix.toEuclideanCLM (n := Fin d) (π := β) (Matrix.diagonal (fun k : Fin d => eigenvalue d k)) | |
| @[simp] theorem spectrumOperator_apply {d : β} (x : Point d) (k : Fin d) : | |
| spectrumOperator d x k = eigenvalue d k * x k := by | |
| change (Matrix.diagonal (fun k : Fin d => eigenvalue d k) *α΅₯ ofLp x) k = _ | |
| exact Matrix.mulVec_diagonal _ _ _ | |
| def quadraticOperator {d : β} (O : Rotations d) : Point d βL[β] Point d := | |
| (rotationIsometry O).toContinuousLinearEquiv.toContinuousLinearMap.comp | |
| ((spectrumOperator d).comp (rotationIsometry O).symm.toContinuousLinearEquiv.toContinuousLinearMap) | |
| def quadraticPotential {d : β} (O : Rotations d) (x : Point d) : β := | |
| inner β x (quadraticOperator O x) / 2 | |
| lemma spectrumOperator_symmetric (d : β) : | |
| (spectrumOperator d).toLinearMap.IsSymmetric := by | |
| intro x y | |
| change inner β (spectrumOperator d x) y = inner β x (spectrumOperator d y) | |
| simp only [PiLp.inner_apply, Real.inner_apply, spectrumOperator_apply] | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| ring | |
| lemma quadraticOperator_symmetric {d : β} (O : Rotations d) : | |
| (quadraticOperator O).toLinearMap.IsSymmetric := by | |
| intro x y | |
| change inner β ((rotationIsometry O) (spectrumOperator d ((rotationIsometry O).symm x))) y = | |
| inner β x ((rotationIsometry O) (spectrumOperator d ((rotationIsometry O).symm y))) | |
| rw [β (rotationIsometry O).apply_symm_apply y, β (rotationIsometry O).apply_symm_apply x] | |
| simp only [LinearIsometryEquiv.symm_apply_apply, LinearIsometryEquiv.inner_map_map] | |
| exact spectrumOperator_symmetric d _ _ | |
| lemma quadraticOperator_bounds {d : β} (O : Rotations d) (x : Point d) : | |
| βxβ^2 β€ inner β x (quadraticOperator O x) β§ | |
| inner β x (quadraticOperator O x) β€ 2 * βxβ^2 := by | |
| let y := (rotationIsometry O).symm x | |
| have hinner : inner β x (quadraticOperator O x) = | |
| β k : Fin d, eigenvalue d k * (y k)^2 := by | |
| change inner β x ((rotationIsometry O) (spectrumOperator d y)) = _ | |
| rw [β (rotationIsometry O).apply_symm_apply x] | |
| simp only [LinearIsometryEquiv.inner_map_map, PiLp.inner_apply, Real.inner_apply, | |
| spectrumOperator_apply] | |
| apply Finset.sum_congr rfl | |
| intro k _ | |
| dsimp [y] | |
| ring | |
| have hnorm : βxβ^2 = β k : Fin d, (y k)^2 := by | |
| rw [β (rotationIsometry O).symm.norm_map x, EuclideanSpace.norm_sq_eq] | |
| simp only [Real.norm_eq_abs, sq_abs] | |
| rfl | |
| rw [hinner, hnorm, Finset.mul_sum] | |
| constructor | |
| Β· apply Finset.sum_le_sum | |
| intro k _ | |
| have hb := (eigenvalue_bounds d k).1 | |
| nlinarith [sq_nonneg (y k)] | |
| Β· apply Finset.sum_le_sum | |
| intro k _ | |
| exact mul_le_mul_of_nonneg_right (eigenvalue_bounds d k).2 (sq_nonneg _) | |
| lemma quadraticPotential_hasGradientAt {d : β} (O : Rotations d) (x : Point d) : | |
| HasGradientAt (quadraticPotential O) (quadraticOperator O x) x := by | |
| apply hasGradientAt_iff_hasFDerivAt.mpr | |
| have hd := ((hasFDerivAt_id x).inner β (quadraticOperator O).hasFDerivAt).const_smul (1 / 2 : β) | |
| convert! hd using 1 | |
| Β· ext y | |
| simp only [quadraticPotential, Pi.smul_apply, smul_eq_mul, id_eq] | |
| ring | |
| ext y | |
| have hs := quadraticOperator_symmetric O x y | |
| change inner β (quadraticOperator O x) y = inner β x (quadraticOperator O y) at hs | |
| change inner β (quadraticOperator O x) y = | |
| (1 / 2 : β) * (inner β x (quadraticOperator O y) + inner β y (quadraticOperator O x)) | |
| rw [β hs, real_inner_comm y (quadraticOperator O x)] | |
| ring | |
| @[simp] theorem quadraticPotential_gradient {d : β} (O : Rotations d) : | |
| gradient (quadraticPotential O) = quadraticOperator O := | |
| gradient_eq (quadraticPotential_hasGradientAt O) | |
| theorem quadraticPotential_admissible {d : β} (O : Rotations d) : | |
| Admissible (quadraticPotential O) := by | |
| refine β¨?_, ?_, ?_, ?_β© | |
| Β· exact (contDiff_id.inner β (quadraticOperator O).contDiff).div_const 2 | |
| Β· simp [quadraticPotential] | |
| Β· simp | |
| Β· intro x v | |
| rw [quadraticPotential_gradient, (quadraticOperator O).fderiv] | |
| exact quadraticOperator_bounds O v | |
| theorem quadratic_firstOrderReply {d : β} (O : Rotations d) (x : Point d) : | |
| firstOrderReply (quadraticPotential O) x = | |
| (inner β x (quadraticOperator O x) / 2, quadraticOperator O x) := by | |
| simp [firstOrderReply, quadraticPotential] | |
| end LogConcaveSampling.LowerBound | |
| end LowerProof | |
| end | |
| end | |
| end | |
| end OAI | |