File size: 2,867 Bytes
f205175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import Mathlib
import OAI.Probability.CriticalPercolation.Entropy.FreshSet

namespace OAI

section
section
open Set MeasureTheory ProbabilityTheory
open Real
open Set Real
open scoped Topology
open scoped BigOperators
open Set
open Set MeasureTheory
open scoped Classical
open Set MeasureTheory Real
open scoped Interval

namespace CriticalPercolation.Priority
variable {I : Type*} [Fintype I]

instance : NullSingletonClass uniform01 := by
  unfold uniform01
  infer_instance

lemma ae_eval_ne (i j : I) (hji : j ≠ i) :
    ∀ᵐ u : I → ℝ ∂law, u i ≠ u j := by
  have hj : ∀ t : ℝ, ∀ᵐ v : {k : I // k ≠ i} → ℝ ∂law,
      t ≠ v ⟨j,hji⟩ := by
    intro t
    apply ae_iff.mpr
    have hz := Measure.pi_eval_preimage_null
      (fun _ : {k : I // k ≠ i} => uniform01)
      (i := ⟨j,hji⟩) (measure_singleton t)
    have he : {v : {k : I // k ≠ i} → ℝ | ¬t ≠ v ⟨j,hji⟩} =
        (Function.eval ⟨j,hji⟩ : ({k : I // k ≠ i} → ℝ) → ℝ) ⁻¹' {t} := by
      ext v
      simp [eq_comm]
    change law {v : {k : I // k ≠ i} → ℝ | ¬t ≠ v ⟨j,hji⟩} = 0
    rw [he]
    exact hz
  have hp : ∀ᵐ z : ℝ × ({k : I // k ≠ i} → ℝ)
      ∂uniform01.prod law, z.1 ≠ z.2 ⟨j,hji⟩ := by
    apply (Measure.ae_prod_iff_ae_ae (by measurability)).mpr
    exact Filter.Eventually.of_forall hj
  exact (split_preserving i).quasiMeasurePreserving.ae hp

lemma ae_injective : ∀ᵐ u : I → ℝ ∂law, Function.Injective u := by
  have h : ∀ i j : I, ∀ᵐ u : I → ℝ ∂law, u i = u j → i = j := by
    intro i j
    by_cases hji : j = i
    · subst j; exact Filter.Eventually.of_forall (fun _ _ => rfl)
    · filter_upwards [ae_eval_ne i j hji] with u hu
      exact fun he => False.elim (hu he)
  change ∀ᵐ u : I → ℝ ∂law, ∀ i j, u i = u j → i = j
  rw [ae_all_iff]
  intro i
  rw [ae_all_iff]
  exact h i

lemma ae_exists_cell : ∀ᵐ u : I → ℝ ∂law, ∃ o : Order I, u ∈ cell o := by
  filter_upwards [ae_injective] with u hu
  exact exists_cell u hu

lemma sum_cell_indicator (f : (I → ℝ) → ℝ) :
    (fun u => ∑ o : Order I, (cell o).indicator f u) =ᵐ[law] f := by
  filter_upwards [ae_exists_cell] with u hu
  obtain ⟨o,ho⟩ := hu
  rw [Finset.sum_eq_single o]
  · exact Set.indicator_of_mem ho f
  · intro b _ hb
    apply Set.indicator_of_notMem
    exact fun hub => Set.disjoint_left.mp (cell_disjoint hb) hub ho
  · simp

lemma sum_integral_cells (f : (I → ℝ) → ℝ) (hf : Integrable f law) :
    (∑ o : Order I, ∫ u in cell o, f u ∂law) = ∫ u, f u ∂law := by
  simp_rw [← integral_indicator (measurableSet_cell _)]
  rw [← integral_finsetSum]
  · exact integral_congr_ae (sum_cell_indicator f)
  · intro o _
    exact hf.indicator (measurableSet_cell o)

end CriticalPercolation.Priority

end
end

end OAI