File size: 4,361 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
import Mathlib
import OAI.Probability.Perceptron.Interpolation.GibbsOverlapArray

namespace OAI

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

def compactJointMonomial (p d : β„•) : CompactJointOverlap →ᡇ ℝ :=
  BoundedContinuousFunction.mkOfCompact ⟨fun x : CompactJointOverlap => (x.2:ℝ)^d*(x.1:ℝ)^p,by fun_prop⟩

@[simp] lemma compactJointMonomial_apply (p d : β„•) (x : CompactJointOverlap) :
    compactJointMonomial p d x = (x.2:ℝ)^d*(x.1:ℝ)^p := rfl

lemma compactJointMonomial_zero : compactJointMonomial 0 0 = 1 := by ext x; simp

lemma compactJointMonomial_add (p d p' d' : β„•) :
    compactJointMonomial (p+p') (d+d') = compactJointMonomial p d * compactJointMonomial p' d' := by
  ext x
  simp only [compactJointMonomial_apply,BoundedContinuousFunction.mul_apply,pow_add]
  ring

lemma compactJointMonomial_separates (x y : CompactJointOverlap) (h : x≠y) :
    βˆƒ p d, compactJointMonomial p d x β‰  compactJointMonomial p d y := by
  by_contra hn
  push Not at hn
  apply h
  apply Prod.ext <;> apply Subtype.ext
  Β· simpa using hn 1 0
  Β· simpa using hn 0 1

lemma compactJointMonomial_abs_le (p d : β„•) (x : CompactJointOverlap) :
    |compactJointMonomial p d x|≀1 := by
  rw [compactJointMonomial_apply,abs_mul,abs_pow,abs_pow,abs_of_nonneg x.2.property.1]
  exact (mul_le_of_le_one_left (by positivity)
    (pow_le_oneβ‚€ x.2.property.1 x.2.property.2)).trans
    (pow_le_oneβ‚€ (abs_nonneg _) (abs_le.mpr x.1.property))

lemma compactJoint_monomials_determine (P Q : Measure CompactJointOverlap)
    [IsFiniteMeasure P] [IsFiniteMeasure Q]
    (h : βˆ€ p d, (∫ x, compactJointMonomial p d x βˆ‚P) = ∫ x, compactJointMonomial p d x βˆ‚Q) : P=Q := by
  apply measure_eq_of_additive_test_family (fun a : β„•Γ—β„• => compactJointMonomial a.1 a.2)
    compactJointMonomial_zero (fun a b => compactJointMonomial_add _ _ _ _)
  Β· intro x y hxy
    obtain ⟨p,d,hpd⟩ := compactJointMonomial_separates x y hxy
    exact ⟨(p,d),hpd⟩
  Β· exact fun a => h a.1 a.2

lemma sourceJointOverlap_symm {N k : β„•} (x y : NormalizedSpin NΓ—IndexedLeaf k) :
    sourceJointOverlap x y = sourceJointOverlap y x := by
  apply Prod.ext <;> apply Subtype.ext
  Β· exact real_inner_comm _ _
  Β· simp only [sourceJointOverlap,indexedCommonDepth_comm k y.2 x.2]

lemma sourceGibbsArray_eq (n k : β„•) (f : ℝ →ᡇ ℝ) (p d : Fin (n+1) β†’ β„•)
    (h : Fin (k+1) β†’ ℝ) (u : Fin (n+1) β†’ ℝ) (z : Fin k β†’ ℝ) (t : ℝβ‰₯0) :
    sourceGibbsArrayLaw n k f p d h u z t =
      gibbsOverlapArrayLaw (sourceFullSpinLeafKernel n k)
        ((sourceBaseDataLaw n k z t).prod countableGaussianLaw)
        (sourceCouplingHamiltonian n k f p d h u)
        (sourceCouplingHamiltonian_measurable n k f p d h u)
        sourceJointOverlap (sourceJointOverlap_measurable (n+1) k) := rfl

lemma source_compact_gg_defect (n k : β„•) (f : ℝ →ᡇ ℝ) (p d : Fin (n+1) β†’ β„•)
    (h : Fin (k+1) β†’ ℝ) (hh0 : βˆ€ l, 0≀h l) (hh : Monotone h)
    (u : Fin (n+1) β†’ ℝ) (j : Fin (n+1)) (z : Fin k β†’ ℝ) (t : ℝβ‰₯0)
    (r : β„•) (i : Fin r) (G : CompactBlock CompactJointOverlap r →ᡇ ℝ) :
    compactGGDefect (sourceGibbsArrayLaw n k f p d h u z t) r i G (compactJointMonomial (p j) (d j)) =
      -kernelGGDefect (sourceFullSpinLeafKernel n k)
        ((sourceBaseDataLaw n k z t).prod countableGaussianLaw)
        (sourceCouplingHamiltonian n k f p d h u) (sourceJointMonomial p d j)
        (((k:ℝ)/(k+1:β„•))^(d j)) r i
        (fun x => G (fun a b => sourceJointOverlap (x a) (x b))) := by
  rw [sourceGibbsArray_eq]
  have he := sourceCoupling_all_exp_ae n k f p d h hh0 hh u 0 z t
  have hexp : βˆ€α΅ a βˆ‚(sourceBaseDataLaw n k z t).prod countableGaussianLaw,
      Integrable (fun x => Real.exp (sourceCouplingHamiltonian n k f p d h u a x))
        (sourceFullSpinLeafKernel n k a) := by
    filter_upwards [he] with a ha
    simpa only [sourceFullSpinLeafKernel,Kernel.comap_apply,zero_mul,add_zero] using ha 0
  apply compactGGDefect_gibbsOverlapArray _ _ _ _ _ _ hexp r i G (compactJointMonomial (p j) (d j))
  Β· exact sourceJointMonomial_diagonal p d j
  Β· intro x y
    rw [sourceJointOverlap_symm x y]

end SphericalPerceptronFreeEnergy

end

end OAI