Download data/lean/OAI/Probability/SKRatio/Dynamics/TestHistogram.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.37 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKRatio/Dynamics/TestHistogram.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SKRatio/Dynamics/TestHistogram.lean
-
curl -L -o TestHistogram.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKRatio/Dynamics/TestHistogram.lean
3.37 kB
| import Mathlib | |
| import OAI.Probability.SKRatio.Dynamics.StepMass | |
| namespace OAI | |
| section | |
| noncomputable section | |
| open scoped BigOperators | |
| open Filter MeasureTheory ProbabilityTheory | |
| open scoped Topology NNReal ENNReal | |
| open Filter MeasureTheory ProbabilityTheory | |
| open scoped Topology NNReal ENNReal | |
| open MeasureTheory Filter | |
| open scoped Topology NNReal ENNReal | |
| open MeasureTheory Filter ProbabilityTheory | |
| open scoped Topology NNReal ENNReal | |
| open MeasureTheory Filter | |
| open scoped Topology | |
| open MeasureTheory Filter ProbabilityTheory | |
| open scoped Topology NNReal ENNReal | |
| namespace SKRatioClock.Clock | |
| lemma measurable_stepMass (p : β β β) : Measurable (stepMass p) := by | |
| unfold stepMass | |
| exact Measurable.tsum (fun _ => measurable_const.indicator measurableSet_Ico) | |
| lemma stepMass_abs_le {a : β β β} {B : β} (hB : 0 β€ B) (ha : β j, |a j| β€ B) | |
| (x : β) : |stepMass a x| β€ B := by | |
| by_cases hx : 0 β€ x | |
| Β· rw [stepMass_of_nonneg _ hx] | |
| exact ha _ | |
| Β· rw [stepMass_of_neg _ (lt_of_not_ge hx),abs_zero] | |
| exact hB | |
| lemma stepMass_mul (p a : β β β) (x : β) : | |
| stepMass p x*stepMass a x=stepMass (fun j => p j*a j) x := by | |
| by_cases hx : 0 β€ x | |
| Β· simp only [stepMass_of_nonneg _ hx] | |
| Β· simp only [stepMass_of_neg _ (lt_of_not_ge hx),mul_zero] | |
| lemma summable_mul_bounded {p a : β β β} {B : β} (hp : Summable p) | |
| (ha : β j, |a j| β€ B) : Summable (fun j => p j*a j) := by | |
| apply Summable.of_norm_bounded (hp.abs.mul_right B) | |
| intro j | |
| simpa only [Real.norm_eq_abs,abs_mul] using mul_le_mul_of_nonneg_left (ha j) (abs_nonneg (p j)) | |
| lemma integral_histogram_summable {p : β β β} (hp : Summable p) (q : β) {n : β} | |
| (hn : 0 < n) : β« x : β, histogram q n p x = β' j, p j := by | |
| have hs : Real.sqrt (n:β) β 0 := by positivity | |
| unfold histogram | |
| rw [integral_const_mul] | |
| have hh : (fun x : β => stepMass p (q*n+x*Real.sqrt n)) = | |
| (fun x : β => (fun t => stepMass p (t+q*n)) (Real.sqrt n*x)) := by | |
| ext x | |
| congr 1 | |
| ring | |
| rw [hh,Measure.integral_comp_mul_left (fun t : β => stepMass p (t+q*n)) | |
| (Real.sqrt (n:β)),integral_add_right_eq_self,integral_stepMass hp,smul_eq_mul, | |
| abs_of_nonneg (inv_nonneg.mpr (Real.sqrt_nonneg _)),β mul_assoc,mul_inv_cancelβ hs,one_mul] | |
| noncomputable def testHistogram (q : β) (n : β) (a : β β β) (x : β) : β := | |
| stepMass a (q*n+x*Real.sqrt n) | |
| lemma measurable_testHistogram (q : β) (n : β) (a : β β β) : | |
| Measurable (testHistogram q n a) := by | |
| apply (measurable_stepMass a).comp | |
| fun_prop | |
| lemma testHistogram_bound {a : β β β} {B : β} (hB : 0 β€ B) (ha : β j, |a j| β€ B) | |
| (q : β) (n : β) (x : β) : |testHistogram q n a x| β€ B := | |
| stepMass_abs_le hB ha _ | |
| lemma integral_histogram_test {p a : β β β} {B : β} (hp : Summable p) | |
| (ha : β j, |a j| β€ B) (q : β) {n : β} (hn : 0 < n) : | |
| (β« x : β, histogram q n p x*testHistogram q n a x) = β' j, p j*a j := by | |
| have he (x : β) : histogram q n p x*testHistogram q n a x = | |
| histogram q n (fun j => p j*a j) x := by | |
| unfold histogram testHistogram | |
| rw [mul_assoc,stepMass_mul] | |
| simp_rw [he] | |
| exact integral_histogram_summable (summable_mul_bounded hp ha) q hn | |
| end SKRatioClock.Clock | |
| open MeasureTheory Filter ProbabilityTheory | |
| open scoped Topology NNReal ENNReal | |
| end | |
| end | |
| end OAI | |