File size: 6,085 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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