File size: 1,397 Bytes
9dbc64e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Computability.DepthThree.FiniteProbability
import Mathlib.Tactic.Linarith

namespace OAI

universe uDepth1

open scoped Classical

namespace DepthThreeLowerBound

variable {V : Type uDepth1} [Fintype V]

theorem sign_eq_two_indicator_sub_one (b : Bool) :
    sign b = 2 * indicator b - 1 := by
  cases b <;> norm_num [sign, indicator]

theorem finiteAvg_sign (f : Cube V → Bool) :
    finiteAvg (fun x => sign (f x)) =
      2 * finiteAvg (fun x => indicator (f x)) - 1 := by
  calc
    _ = finiteAvg (fun x => 2 * indicator (f x) - 1) :=
      finiteAvg_congr (fun x => sign_eq_two_indicator_sub_one (f x))
    _ = _ := by rw [finiteAvg_sub, finiteAvg_const_mul, finiteAvg_const]

theorem acceptance_density_lower_of_sign_bound (f : Cube V → Bool) (ε : ℝ)
    (h : |finiteAvg (fun x => sign (f x))| ≤ ε) :
    (1 - ε) / 2 ≤ finiteAvg (fun x => indicator (f x)) := by
  have hl := (abs_le.mp h).1
  rw [finiteAvg_sign] at hl
  linarith

theorem acceptance_density_lower_of_width_correlation (f : Cube V → Bool)
    (k : ℕ) (ε : ℝ)
    (h : ∀ H : CNF V, H.WidthAtMost k →
      |finiteAvg (fun x : Cube V => sign (f x) * indicator (H.eval x))| ≤ ε) :
    (1 - ε) / 2 ≤ finiteAvg (fun x => indicator (f x)) := by
  apply acceptance_density_lower_of_sign_bound
  have he := h [] (by intro C hC; simp at hC)
  simpa using he

end DepthThreeLowerBound

end OAI