File size: 3,654 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | import Mathlib
import OAI.Probability.GaussianRegression.Main
import OAI.Probability.MemoryPrecision.KernelModel
import OAI.Probability.MemoryPrecision.WeightedImage
import OAI.Probability.MemoryPrecision.WeightedSelection
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
abbrev Sphere (d : β) := Metric.sphere (0 : Space d) 1
def SpherePrior (d : β) : Measure (Sphere d) :=
MemoryPrecision.Kernel.UniformSphere d
def SphereBallBound {d : β} (h : Sphere d β ββ₯0β) (H Ξ± : β) : Prop :=
β z : Space d, β r : β, 0 < r β
(β«β» s in {s : Sphere d | dist s.val z β€ r}, h s βSpherePrior d) β€
ENNReal.ofReal (H * r^Ξ±)
def SphereBlock {d m N : β} (h : Fin N β Sphere d β ββ₯0β)
(g : Fin N β ((Fin m β Space d) Γ (Fin m β β)) β ββ₯0β)
(s : Sphere d) : ββ₯0β :=
WeightedBlock Subtype.val h g s
def CoefficientStepStatement : Prop :=
let two : β := @OfNat.ofNat β 2 (@instOfNatAtLeastTwo β 2 Real.commRing.toNatCast
(Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))
β C : β, 1 β€ C β§ β d m N : β, 16 β€ d β
1 β€ m β m β€ d/8 β 1 β€ N β
β Ξ± H : β, ((d:β)-1)/two β€ Ξ± β Ξ± β€ (d:β)/two β 0 < H β
β h : Fin N β Sphere d β ββ₯0β,
(β w, Measurable (h w)) β (β w s, h w s β€ 1) β
(β w, SphereBallBound (h w) H Ξ±) β
β g : Fin N β ((Fin m β Space d) Γ (Fin m β β)) β ββ₯0β,
(β w, Measurable (g w)) β (β x, β w, g w x β€ 1) β
SphereBallBound (SphereBlock h g) (C^d * (N:β)^(1/((d/8:β):β)) * H) Ξ±
theorem coefficient_step : CoefficientStepStatement := by
refine β¨1344, by norm_num, ?_β©
intro d m N hd hm hmp hN Ξ± H hΞ±lo hΞ±hi hH h hh hh1 hb g hg hgsum z r hr
have : NeZero d := β¨by omegaβ©
have : IsProbabilityMeasure (SpherePrior d) :=
(show IsProbabilityMeasure (NoiselessRegression.sphereLaw (E := Space d)) from inferInstance)
let Ξ½ (w : Fin N) := ((SpherePrior d).withDensity (h w)).map Subtype.val
let (w : Fin N) : IsFiniteMeasure (Ξ½ w) :=
weighted_image_finite (SpherePrior d) Subtype.val (h w) (hh1 w)
have hΞ½ (w) : AmbientBallBound (Ξ½ w) H Ξ± := by
intro x Ο hΟ
rw [show Ξ½ w = ((SpherePrior d).withDensity (h w)).map Subtype.val from rfl,
weighted_image_ball _ measurable_subtype_coe]
exact hb w x Ο hΟ
have hp : 2 β€ d/8 := by omega
have hmd : m β€ d := hmp.trans (Nat.div_le_self _ _)
have hgap : (m:β)+((d/8:β):β)-2 < Ξ± := by
have hm' : (m:β) β€ (d/8:β) := by exact_mod_cast hmp
have hp' : ((d/8:β):β)*8 β€ d := by exact_mod_cast Nat.div_mul_le_self d 8
have hd' : (16:β) β€ d := by exact_mod_cast hd
linarith
have hJ := fun j hj => (specialized_J_bound d m (d/8) hd rfl hm hmp Ξ± hΞ±lo hΞ±hi j hj).2.2
have hsel := localized_weighted_selection Ξ½ hp hm hmd (by norm_num : (1:β) β€ 7)
hH hgap hJ hΞ½ g hg hgsum z hr
have he := weightedBlock_mass_identity (SpherePrior d) measurable_subtype_coe hh hh1 hg
(show MeasurableSet (Metric.closedBall z r) from Metric.isClosed_closedBall.measurableSet)
change (β«β» s in Subtype.val β»ΒΉ' Metric.closedBall z r,
WeightedBlock Subtype.val h g s βSpherePrior d) β€ _
rw [he]
convert hsel using 1
norm_num [Ξ½, mul_assoc]
end MemoryPrecision
end
end OAI
|