Download data/lean/OAI/Probability/MemoryPrecision/KernelEllipsoid.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MemoryPrecision/KernelEllipsoid.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/MemoryPrecision/KernelEllipsoid.lean
-
curl -L -o KernelEllipsoid.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MemoryPrecision/KernelEllipsoid.lean
6.8 kB
| import Mathlib | |
| import OAI.Probability.GaussianRegression.Main | |
| import OAI.Probability.MemoryPrecision.EllipsoidSuccess | |
| namespace OAI | |
| open MeasureTheory ProbabilityTheory Set Filter EuclideanGeometry | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology Pointwise | |
| noncomputable section | |
| universe u v | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology Pointwise | |
| namespace MemoryPrecision.Kernel | |
| open MemoryPrecision Policy | |
| lemma chord_real_coefficient {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Ξ© β Policy d M T) (Ο : Measure Ξ©) [IsProbabilityMeasure Ο] | |
| (hL : Admissible L Ο (UniformSphere d)) (hd : 16 β€ d) {Ξ΅ : β} (hΞ΅ : 0 < Ξ΅) | |
| {Ξ± : β} (hΞ±lo : ((d:β)-1)/2 β€ Ξ±) (hΞ±hi : Ξ± β€ (d:β)/2) : | |
| ChordSuccess L Ο (UniformSphere d) Ξ΅ β€ ENNReal.ofReal | |
| ((T+1:β) * ((3*4^d:β)*Ξ΅^((d:β)-1-Ξ±) * RealStep d (2^M)^BlockCount T (d/8))) := by | |
| apply (Policy.chord_real_bound L Ο hL hd hΞ΅ hΞ±lo hΞ±hi).trans_eq | |
| rw [ENNReal.ofReal_mul (by positivity : (0:β) β€ T+1)] | |
| congr 1 | |
| simp [ENNReal.ofReal_add] | |
| lemma chord_half_sphere_bound {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Ξ© β Policy d M T) (Ο : Measure Ξ©) [IsProbabilityMeasure Ο] | |
| (hL : Admissible L Ο (UniformSphere d)) (hd : 16 β€ d) {Ξ΅ : β} (hΞ΅ : 0 < Ξ΅) (hΞ΅1 : Ξ΅ β€ 1/10) : | |
| ChordSuccess L Ο (UniformSphere d) Ξ΅ β€ ENNReal.ofReal | |
| (4^d * Ξ΅^(((d:β)-1)/2) * | |
| (SuccessConstant^d * (((d/8+2)*2^M:β):β)^(1/((d/8:β):β)))^BlockCount T (d/8)) := by | |
| by_cases hT : T = 0 | |
| Β· subst T | |
| simp only [blockCount_zero, pow_zero, mul_one] | |
| exact (Policy.chord_zero_bound L Ο hL (by omega) hΞ΅).trans | |
| (ENNReal.ofReal_le_ofReal (terminal_angular_zero_bound hd hΞ΅ hΞ΅1)) | |
| Β· have hb := chord_real_coefficient L Ο hL hd hΞ΅ (le_refl (((d:β)-1)/2)) (by linarith) | |
| have he : (d:β)-1-((d:β)-1)/2 = ((d:β)-1)/2 := by ring | |
| rw [he] at hb | |
| apply hb.trans (ENNReal.ofReal_le_ofReal ?_) | |
| have hN : 1 β€ 2^M := one_le_powβ (by norm_num) | |
| have hNK : 2^M β€ (d/8+2)*2^M := by | |
| simp | |
| have hs := stopping_step_bound_three hd hN hNK (by omega : 0 < T) | |
| calc | |
| _ = (4^d * Ξ΅^(((d:β)-1)/2)) * (3*((T+1:β)*RealStep d (2^M)^BlockCount T (d/8))) := by ring | |
| _ β€ _ := mul_le_mul_of_nonneg_left hs (by positivity) | |
| lemma chord_half_ambient_bound {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Ξ© β Policy d M T) (Ο : Measure Ξ©) [IsProbabilityMeasure Ο] | |
| (hL : Admissible L Ο (UniformSphere d)) (hd : 16 β€ d) {Ξ΅ : β} (hΞ΅ : 0 < Ξ΅) : | |
| ChordSuccess L Ο (UniformSphere d) Ξ΅ β€ ENNReal.ofReal | |
| (12^d * Ξ΅^((d:β)/2-1) * | |
| (SuccessConstant^d * (((2*(d/8)+4)*2^M:β):β)^(1/((d/8:β):β)))^BlockCount T (d/8)) := by | |
| have hb := chord_real_coefficient L Ο hL hd hΞ΅ (by linarith : ((d:β)-1)/2 β€ (d:β)/2) le_rfl | |
| have he : (d:β)-1-(d:β)/2 = (d:β)/2-1 := by ring | |
| rw [he] at hb | |
| apply hb.trans (ENNReal.ofReal_le_ofReal ?_) | |
| have hN : 1 β€ 2^M := one_le_powβ (by norm_num) | |
| have hNK : 2^M β€ (2*(d/8)+4)*2^M := by | |
| simp | |
| have hR := realStep_pos d hN | |
| have hs := stopping_step_bound hd hN hNK T | |
| have hSp := stepConstant_pos | |
| have hK : 2*StepConstant β€ SuccessConstant := by dsimp [SuccessConstant]; linarith | |
| have hroot : 0 β€ (((2*(d/8)+4)*2^M:β):β)^(1/((d/8:β):β)) := by positivity | |
| have hbase := mul_le_mul_of_nonneg_right (pow_le_pow_leftβ (by positivity : 0 β€ 2*StepConstant) hK d) hroot | |
| have hpow := pow_le_pow_leftβ (by positivity : 0 β€ (2*StepConstant)^d * | |
| (((2*(d/8)+4)*2^M:β):β)^(1/((d/8:β):β))) hbase (BlockCount T (d/8)) | |
| calc | |
| _ = ((3*4^d:β)*Ξ΅^((d:β)/2-1))*((T+1:β)*RealStep d (2^M)^BlockCount T (d/8)) := by ring | |
| _ β€ _ := mul_le_mul | |
| (mul_le_mul_of_nonneg_right (cap_constant_le (by omega : 1 β€ d)) (by positivity)) | |
| (hs.trans hpow) (by positivity) (by positivity) | |
| end MemoryPrecision.Kernel | |
| namespace MemoryPrecision.Kernel | |
| open Policy | |
| def BlockCount (T p : β) : β := β(T:β)/(p:β)ββ | |
| def SourceEllipsoidStatement : Prop := | |
| let two : β := @OfNat.ofNat β 2 (@instOfNatAtLeastTwo β 2 Real.commRing.toNatCast | |
| (Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0))) | |
| let four : β := @OfNat.ofNat β 4 (@instOfNatAtLeastTwo β 4 Real.commRing.toNatCast | |
| (Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 2))) | |
| let ten : β := @OfNat.ofNat β 10 (@instOfNatAtLeastTwo β 10 Real.commRing.toNatCast | |
| (Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 8))) | |
| β C Cβ : β, 1 β€ C β§ 1 β€ Cβ β§ | |
| β d M T : β, 16 β€ d β β Ξ΅ : β, 0 < Ξ΅ β Ξ΅ β€ 1/ten β | |
| β (Ξ© : Type u) [MeasurableSpace Ξ©] (Ο : Measure Ξ©), IsProbabilityMeasure Ο β | |
| β K : Ξ© β Policy d M T, Policy.Admissible K Ο (UniformSphere d) β | |
| Policy.Success K Ο (UniformSphere d) Ξ΅ β€ min 1 (ENNReal.ofReal | |
| (four^d * Ξ΅^(((d:β)-1)/two) * | |
| (C^d * (((d/8+2)*2^M : β):β)^(1/((d/8:β):β)))^(BlockCount T (d/8)))) β§ | |
| Policy.ChordSuccess K Ο (UniformSphere d) Ξ΅ β€ min 1 (ENNReal.ofReal | |
| (Cβ^d * Ξ΅^((d:β)/two-1) * | |
| (C^d * (((2*(d/8)+4)*2^M : β):β)^(1/((d/8:β):β)))^(BlockCount T (d/8)))) β§ | |
| {x : Sphere d Γ Sphere d | Real.arccos (@inner β (Vector d) | |
| (@InnerProductSpace.toInner β (Vector d) _ | |
| (PiLp.seminormedAddCommGroup | |
| (@OfNat.ofNat ββ₯0β 2 | |
| (@instOfNatAtLeastTwo ββ₯0β 2 ENNReal.instAddCommMonoidWithOne.toNatCast | |
| (Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))) | |
| (fun _ : Fin d => β)) | |
| (PiLp.innerProductSpace (π := β) (fun _ : Fin d => β))) | |
| x.2.val x.1.val) β€ Ξ΅} β | |
| {x | @Dist.dist (Vector d) | |
| (PiLp.instDist (p := @OfNat.ofNat ββ₯0β 2 | |
| (@instOfNatAtLeastTwo ββ₯0β 2 ENNReal.instAddCommMonoidWithOne.toNatCast | |
| (Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))) | |
| (Ξ± := fun _ : Fin d => β)) x.2.val x.1.val β€ Ξ΅} | |
| theorem source_ellipsoid_success : SourceEllipsoidStatement := by | |
| refine β¨MemoryPrecision.SuccessConstant, 12, MemoryPrecision.successConstant_one, by norm_num, ?_β© | |
| intro d M T hd Ξ΅ hΞ΅ hΞ΅1 Ξ© _ Ο hΟ L hL | |
| have : IsProbabilityMeasure Ο := hΟ | |
| let : NeZero d := β¨by omegaβ© | |
| refine β¨le_min (Policy.success_le_one L Ο (UniformSphere d) Ξ΅) ?_, | |
| le_min (Policy.chordSuccess_le_one L Ο (UniformSphere d) Ξ΅) ?_, ?_β© | |
| Β· exact (Policy.success_le_chord L Ο (UniformSphere d) Ξ΅).trans | |
| (chord_half_sphere_bound L Ο hL hd hΞ΅ hΞ΅1) | |
| Β· exact chord_half_ambient_bound L Ο hL hd hΞ΅ | |
| Β· intro x hx | |
| exact (NoiselessRegression.chord_le_arccos x.2 x.1).trans hx | |
| end MemoryPrecision.Kernel | |
| end | |
| end OAI | |