File size: 3,927 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
import Mathlib
import OAI.Probability.Perceptron.Pressure.EnrichedConcentration
import OAI.Probability.Perceptron.Pressure.EnrichedPatternMean
import OAI.Probability.Perceptron.Variational.MeasurableVariance

namespace OAI

noncomputable section
open MeasureTheory ProbabilityTheory Filter Set
open scoped Topology NNReal ENNReal BigOperators BoundedContinuousFunction
namespace SphericalPerceptronFreeEnergy

def finitePatternRowsLaw (N M : β„•) : Measure (Fin M β†’ Fin N β†’ ℝ) :=
  Measure.pi fun _ : Fin M => Measure.pi fun _ : Fin N => gaussianReal 0 1

instance (N M : β„•) : IsProbabilityMeasure (finitePatternRowsLaw N M) := by
  unfold finitePatternRowsLaw
  infer_instance

lemma enrichedExpectedLog_memLp (n M k : β„•) (f : ℝ →ᡇ ℝ)
    (p d : Fin (n+1) β†’ β„•) (u : Fin (n+1) β†’ ℝ) (h : Fin (k+1) β†’ ℝ) (z : Fin k β†’ ℝ)
    (hz : StrictMono z) (hz0 : βˆ€ i, 0<z i) (hz1 : βˆ€ i, z i<1) :
    MemLp (enrichedExpectedLog n M k f p d u h z) 2 (finitePatternRowsLaw (n+1) M) := by
  obtain ⟨C,hC⟩ := enrichedExpectedLog_bounded n M k f p d u h z hz hz0 hz1
  exact MemLp.of_bound (enrichedExpectedLog_measurable n M k f p d u h z).aestronglyMeasurable
    C (ae_of_all _ hC)

lemma enrichedExpectedLog_variance (n M k : β„•) (f : ℝ →ᡇ ℝ)
    (p d : Fin (n+1) β†’ β„•) (u : Fin (n+1) β†’ ℝ) (h : Fin (k+1) β†’ ℝ) (z : Fin k β†’ ℝ)
    (hz : StrictMono z) (hz0 : βˆ€ i, 0<z i) (hz1 : βˆ€ i, z i<1) :
    variance (enrichedExpectedLog n M k f p d u h z) (finitePatternRowsLaw (n+1) M) ≀
      (M:ℝ)*(2*β€–fβ€–)^2 := by
  obtain ⟨C,hC⟩ := enrichedExpectedLog_bounded n M k f p d u h z hz hz0 hz1
  exact variance_pi_le_of_measurable_bounded_differences
    (Measure.pi fun _ : Fin (n+1) => gaussianReal 0 1) M
    (enrichedExpectedLog_measurable n M k f p d u h z) hC
    (enrichedExpectedLog_update n M k f p d u h z hz hz0 hz1)

def enrichedFixedCountLog (n M k : β„•) (f : ℝ →ᡇ ℝ)
    (p d : Fin (n+1) β†’ β„•) (u : Fin (n+1) β†’ ℝ) (h : Fin (k+1) β†’ ℝ)
    (a : (Fin M β†’ Fin (n+1) β†’ ℝ) Γ—
        (EnrichedMark (n+1) (n+1) p Γ— DecoratedCascade (EnrichedMark (n+1) (n+1) p) k)) : ℝ :=
  enrichedCascadeLog n M k f a.1 p d u h a.2

lemma enrichedFixedCountLog_variance (n M k : β„•) (f : ℝ →ᡇ ℝ)
    (p d : Fin (n+1) β†’ β„•) (u : Fin (n+1) β†’ ℝ) (h : Fin (k+1) β†’ ℝ) (z : Fin k β†’ ℝ)
    (hz : StrictMono z) (hz0 : βˆ€ i, 0<z i) (hz1 : βˆ€ i, z i<1) :
    let ΞΌ := (finitePatternRowsLaw (n+1) M).prod (enrichedDisorderLaw n k p z)
    MemLp (enrichedFixedCountLog n M k f p d u h) 2 μ ∧
      variance (enrichedFixedCountLog n M k f p d u h) ΞΌ ≀
        cascadeLogFluctuationConstant k z+(Real.pi^2/8)*
          ((enrichedFeatureBound (n+1) u:ℝ)*β€–enrichedRootMap p d hβ€–)^2+(M:ℝ)*(2*β€–fβ€–)^2 := by
  let ΞΌ := finitePatternRowsLaw (n+1) M
  let Ξ½ := enrichedDisorderLaw n k p z
  let F := enrichedFixedCountLog n M k f p d u h
  let G := enrichedExpectedLog n M k f p d u h z
  let K := cascadeLogFluctuationConstant k z+(Real.pi^2/8)*
    ((enrichedFeatureBound (n+1) u:ℝ)*β€–enrichedRootMap p d hβ€–)^2
  have hG : MemLp G 2 ΞΌ := enrichedExpectedLog_memLp n M k f p d u h z hz hz0 hz1
  have hs (g : Fin M β†’ Fin (n+1) β†’ ℝ) :
      MemLp (fun a => F (g,a)) 2 Ξ½ ∧ variance (fun a => F (g,a)) Ξ½ ≀ K :=
    enrichedCascadeLog_fixed_patterns_variance n M k f g p d u h z hz hz0 hz1
  have hp : MemLp F 2 (ΞΌ.prod Ξ½) := memLp_prod_of_conditional_square ΞΌ Ξ½
    (enrichedCascadeLog_parameters_measurable n M k f p d u h z) hG K (fun g => (hs g).1)
    (fun g => by
      have hv := (hs g).2
      rw [variance_eq_integral (hs g).1.aestronglyMeasurable.aemeasurable] at hv
      exact hv)
  refine ⟨hp,?_⟩
  exact variance_prod_le_memLp ΞΌ Ξ½ hp (fun g => (hs g).1) hG (fun g => (hs g).2)
    (enrichedExpectedLog_variance n M k f p d u h z hz hz0 hz1)

end SphericalPerceptronFreeEnergy
end

end OAI