math / data /lean /OAI /Probability /MemoryPrecision /PointwiseMain.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
6.09 kB
import Mathlib
import OAI.Probability.GaussianRegression.Main
import OAI.Probability.MemoryPrecision.DensityUniqueness
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
open NoiselessRegression
def RadialMixtureRepresentation (m : β„•) : Prop :=
βˆ€ Ξ΄ : ℝ, 0 < Ξ΄ β†’
(βˆ€ r : ℝ, 0 < r β†’ 0 ≀ RadialMixture m Ξ΄ r) ∧
Measurable (RadialMixture m δ) ∧
(∫ r in Set.Ioi 0, RadialMixture m δ r) = 1 ∧
(βˆ€ y : Space m, GaussianKernel m Ξ΄ y =
∫ r in Set.Ioi β€–yβ€–, RadialMixture m Ξ΄ r / (UnitBallVolume m * r^m))
def FullRankDensityFormula {d : β„•}
(ΞΌ : @Measure (Space d)
(WithLp.measurableSpace
(@OfNat.ofNat ℝβ‰₯0∞ 2
(@instOfNatAtLeastTwo ℝβ‰₯0∞ 2 ENNReal.instAddCommMonoidWithOne.toNatCast
(Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))) (Fin d β†’ ℝ)))
(m : β„•) : Prop :=
let exponent : ℝβ‰₯0∞ := @OfNat.ofNat ℝβ‰₯0∞ 2
(@instOfNatAtLeastTwo ℝβ‰₯0∞ 2 ENNReal.instAddCommMonoidWithOne.toNatCast
(Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))
βˆ€ A : Fin m β†’ Space d,
@LinearIndependent (Fin m) ℝ (Space d) A Real.commRing.toSemiring
(WithLp.instAddCommGroup exponent (Fin d β†’ ℝ)).toAddCommMonoid
(WithLp.instModule (p := exponent) (K := ℝ) (V := Fin d β†’ ℝ)) β†’
(volume : Measure (Fin m β†’ ℝ)).withDensity
(fun y => ENNReal.ofReal (PointwiseDensity ΞΌ m (A,y))) =
@Measure.map (Space d) (Fin m β†’ ℝ)
(WithLp.measurableSpace exponent (Fin d β†’ ℝ)) inferInstance
(fun signal => fun index => @inner ℝ (Space d)
(@InnerProductSpace.toInner ℝ (Space d) _
(PiLp.seminormedAddCommGroup exponent (fun _ : Fin d => ℝ))
(PiLp.innerProductSpace (π•œ := ℝ) (fun _ : Fin d => ℝ)))
signal (A index)) ΞΌ
def PointwiseDensityProperties {d : β„•}
(ΞΌ : @Measure (Space d)
(WithLp.measurableSpace
(@OfNat.ofNat ℝβ‰₯0∞ 2
(@instOfNatAtLeastTwo ℝβ‰₯0∞ 2 ENNReal.instAddCommMonoidWithOne.toNatCast
(Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))) (Fin d β†’ ℝ)))
(m p : β„•) (H Ξ² R : ℝ) : Prop :=
letI : MeasurableSpace (Space d) := WithLp.measurableSpace
(@OfNat.ofNat ℝβ‰₯0∞ 2
(@instOfNatAtLeastTwo ℝβ‰₯0∞ 2 ENNReal.instAddCommMonoidWithOne.toNatCast
(Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))) (Fin d β†’ ℝ)
let reference : Measure ((Fin m β†’ Space d) Γ— (Fin m β†’ ℝ)) := MatrixLabelReference d m
RadialMixtureRepresentation m ∧
(βˆ€ x, 0 ≀ PointwiseDensity ΞΌ m x) ∧
Measurable (PointwiseDensity μ m) ∧
FullRankDensityFormula μ m ∧
reference.withDensity (fun x => ENNReal.ofReal (PointwiseDensity ΞΌ m x)) =
ProjectionLaw μ m ∧
(βˆ€ F : ((Fin m β†’ Space d) Γ— (Fin m β†’ ℝ)) β†’ ℝ,
Measurable F β†’ (βˆ€ x, 0 ≀ F x) β†’
reference.withDensity (fun x => ENNReal.ofReal (F x)) =
ProjectionLaw ΞΌ m β†’ PointwiseDensity ΞΌ m =ᡐ[reference] F) ∧
(∫⁻ x, ENNReal.ofReal (PointwiseDensity ΞΌ m x)^p βˆ‚reference) ≀
ENNReal.ofReal (ProjectionNormScale m p H Ξ² R)^p
def PointwiseDensityStatement : Prop :=
let two : ℝ := @OfNat.ofNat ℝ 2 (@instOfNatAtLeastTwo ℝ 2 Real.commRing.toNatCast
(Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))
let exponent : ℝβ‰₯0∞ := @OfNat.ofNat ℝβ‰₯0∞ 2
(@instOfNatAtLeastTwo ℝβ‰₯0∞ 2 ENNReal.instAddCommMonoidWithOne.toNatCast
(Mathlib.Meta.NormNum.instAtLeastTwo (nat_lit 0)))
βˆ€ d m p : β„•, 2 ≀ d β†’ 1 ≀ m β†’ m < d β†’ 2 ≀ p β†’
βˆ€ Ξ² H R : ℝ, (m : ℝ)+(p : ℝ)-two < Ξ² β†’ 0 < H β†’ 0 < R β†’
βˆ€ z : Space d,
βˆ€ ΞΌ : @Measure (Space d) (WithLp.measurableSpace exponent (Fin d β†’ ℝ)),
IsFiniteMeasure ΞΌ β†’
@Measure.support (Space d)
(PiLp.topologicalSpace (p := exponent) (Ξ² := fun _ : Fin d => ℝ))
(WithLp.measurableSpace exponent (Fin d β†’ ℝ)) ΞΌ βŠ†
@Metric.closedBall (Space d)
(PiLp.instPseudoMetricSpace (p := exponent) (Ξ² := fun _ : Fin d => ℝ)) z R β†’
AmbientBallBound ΞΌ H Ξ² β†’
ΞΌ β‰ͺ UniformSphere d β†’ PointwiseDensityProperties ΞΌ m p H Ξ² R
theorem pointwise_density : PointwiseDensityStatement := by
intro d m p hd hm hmd hp Ξ² H R hgap hH hR z ΞΌ hΞΌ hs hb hac
let : IsFiniteMeasure ΞΌ := hΞΌ
obtain ⟨F,hFm,hF0,hden,hFs,hFnorm⟩ :=
exact_finite_density d m p hp hm Ξ² H R hgap hH hR z ΞΌ hs hb
have he := pointwiseDensity_ae_eq hm ΞΌ F hFm hF0 hden
refine ⟨?_, PointwiseDensity_nonneg μ m, measurable_PointwiseDensity μ m,
?_, ?_, pointwiseDensity_ae_eq hm μ, ?_⟩
Β· intro Ξ΄ hΞ΄
exact ⟨fun r hr => radialMixture_nonneg m δ hr, radialMixture_measurable m δ,
radialMixture_integral m hm hδ, radialMixture_tail m hm hδ⟩
Β· intro A hA
exact pointwiseDensity_fullRank hd hm hmd ΞΌ hac A hA
Β· exact (withDensity_congr_ae (he.fun_comp ENNReal.ofReal)).trans hden
Β· have hp0 : (p:ℝ) β‰  0 := by exact_mod_cast (by omega : p β‰  0)
have hpE : (p:ℝβ‰₯0∞) β‰  0 := by exact_mod_cast (by omega : p β‰  0)
have hpow := ENNReal.rpow_le_rpow hFnorm (show 0 ≀ (p:ℝ) by positivity)
rw [eLpNorm_eq_lintegral_rpow_enorm_toReal hpE (by finiteness)
hFm.aestronglyMeasurable] at hpow
simp only [ENNReal.toReal_natCast] at hpow
rw [← ENNReal.rpow_mul, one_div_mul_cancel hp0, ENNReal.rpow_one] at hpow
simp only [ENNReal.rpow_natCast] at hpow
have hi : (fun x => ENNReal.ofReal (PointwiseDensity μ m x)^p) =ᡐ[MatrixLabelReference d m]
(fun x => β€–F xβ€–β‚‘^p) := by
filter_upwards [he] with x hx
rw [hx, Real.enorm_eq_ofReal (hF0 x)]
rw [lintegral_congr_ae hi]
exact hpow
end MemoryPrecision
end
end OAI