File size: 908 Bytes
e320e82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Combinatorics.GraphThreshold.Model

namespace OAI

noncomputable section

namespace LeanBlast.SecondKahnKalai

structure FiniteLaw (Ω : Type*) [Fintype Ω] where
  weight : Ω → ℝ
  nonneg : ∀ ω, 0 ≤ weight ω
  total : ∑ ω, weight ω = 1

namespace FiniteLaw

def expectation {Ω : Type*} [Fintype Ω] (μ : FiniteLaw Ω) (f : Ω → ℝ) : ℝ :=
  ∑ ω, μ.weight ω * f ω

def prob {Ω : Type*} [Fintype Ω] (μ : FiniteLaw Ω) (P : Ω → Prop) : ℝ := by
  classical
  exact ∑ ω, if P ω then μ.weight ω else 0

def IsPositive {Ω : Type*} [Fintype Ω] (μ : FiniteLaw Ω) : Prop :=
  ∀ ω, 0 < μ.weight ω

end FiniteLaw

def IsSpread {X B : Type*} [DecidableEq X] [Fintype B]
    (μ : FiniteLaw B) (A : B → Finset X) (a : ℝ) : Prop :=
  ∀ J : Finset X, J.Nonempty → μ.prob (fun b => J ⊆ A b) ≤ a ^ J.card

end LeanBlast.SecondKahnKalai

end

end OAI