File size: 2,609 Bytes
c4cdbbd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Probability.InvariantIsing.Core.FiniteIndexDistribution

namespace OAI

/-! Joint finite random labels give exact nonnegative transport plans. -/
noncomputable section
open MeasureTheory Set
open scoped BigOperators Classical
namespace InvariantIsing

variable {Ω A B : Type*} [MeasurableSpace Ω] [Fintype A] [Fintype B]
  [MeasurableSpace A] [MeasurableSingletonClass A]
  [MeasurableSpace B] [MeasurableSingletonClass B]

def finiteIndexCoupling (P : Measure Ω) (g : Ω → A) (h : Ω → B) (a : A) (b : B) : ℝ :=
  P.real ((g ⁻¹' {a}) ∩ (h ⁻¹' {b}))

omit [Fintype A] [MeasurableSpace A] [MeasurableSingletonClass A] in
lemma finiteIndexCoupling_row (P : Measure Ω) [IsProbabilityMeasure P]
    (g : Ω → A) (h : Ω → B) (hh : Measurable h) (a : A) :
    ∑ b, finiteIndexCoupling P g h a b=finiteIndexWeight P g a := by
  have hs := sum_measureReal_preimage_singleton (μ := P.restrict (g ⁻¹' {a}))
    Finset.univ (f := h) (fun b _ => hh (measurableSet_singleton b))
  simp only [measureReal_restrict_apply (hh (measurableSet_singleton _)),
    Finset.coe_univ,preimage_univ,measureReal_restrict_apply_univ] at hs
  simpa only [finiteIndexCoupling,finiteIndexWeight,inter_comm] using hs

omit [Fintype B] [MeasurableSpace B] [MeasurableSingletonClass B] in
lemma finiteIndexCoupling_col (P : Measure Ω) [IsProbabilityMeasure P]
    (g : Ω → A) (h : Ω → B) (hg : Measurable g) (b : B) :
    ∑ a, finiteIndexCoupling P g h a b=finiteIndexWeight P h b := by
  simpa only [finiteIndexCoupling,inter_comm] using finiteIndexCoupling_row P h g hg b

lemma finiteIndexCoupling_integral (P : Measure Ω) [IsProbabilityMeasure P]
    (g : Ω → A) (h : Ω → B) (hg : Measurable g) (hh : Measurable h)
    (f : A → B → ℝ) :
    (∫ x, f (g x) (h x) ∂P)=∑ a, ∑ b, finiteIndexCoupling P g h a b*f a b := by
  let T := fun a b => (g ⁻¹' {a}) ∩ (h ⁻¹' {b})
  have hT a b : MeasurableSet (T a b) :=
    (hg (measurableSet_singleton a)).inter (hh (measurableSet_singleton b))
  have hf : (fun x => f (g x) (h x))=
      fun x => ∑ a, ∑ b, (T a b).indicator (fun _ => f a b) x := by
    funext x
    simp [T,Set.indicator_apply,ite_and]
  rw [hf,integral_finsetSum]
  · apply Finset.sum_congr rfl
    intro a _
    rw [integral_finsetSum]
    · apply Finset.sum_congr rfl
      intro b _
      rw [integral_indicator_const _ (hT a b)]
      rfl
    · intro b _
      exact (integrable_const _).indicator (hT a b)
  · intro a _
    exact integrable_finsetSum _ (fun b _ => (integrable_const _).indicator (hT a b))

end InvariantIsing

end

end OAI