File size: 3,684 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
import OAI.NumberTheory.TwoPoint.Circuits.CircuitSemiExact

namespace OAI

/-! The algebraic error-cutoff step of Braverman's Lemma 10. A Fourier
approximation of the exceptional event suppresses the large polynomial
values on that event while preserving exact zeros. -/

namespace TwoPointCorrelations

open scoped Classical

noncomputable def exceptionalExtension {n : β„•} (F : BooleanCube n β†’ ℝ)
    (E : BooleanCube n β†’ Bool) (x : BooleanCube n) : ℝ :=
  if E x then 1 else F x

noncomputable def errorCutoffPolynomial {n : β„•} (P T : BooleanCube n β†’ ℝ)
    (x : BooleanCube n) : ℝ := P x * (1 - T x)

lemma exceptionalExtension_boolean {n : β„•} {F : BooleanCube n β†’ ℝ}
    (hF : βˆ€ x, F x = 0 ∨ F x = 1) (E : BooleanCube n β†’ Bool) (x : BooleanCube n) :
    exceptionalExtension F E x = 0 ∨ exceptionalExtension F E x = 1 := by
  unfold exceptionalExtension
  split_ifs
  Β· exact Or.inr rfl
  Β· exact hF x

lemma errorCutoffPolynomial_zero {n : β„•} {F P T : BooleanCube n β†’ ℝ}
    {E : BooleanCube n β†’ Bool} (he : βˆ€ x, E x = false β†’ P x = F x)
    (x : BooleanCube n) (hx : exceptionalExtension F E x = 0) :
    errorCutoffPolynomial P T x = 0 := by
  have hE : E x = false := by
    cases h : E x <;> simp_all [exceptionalExtension]
  have hF : F x = 0 := by simpa [exceptionalExtension, hE] using hx
  simp [errorCutoffPolynomial, he x hE, hF]

lemma errorCutoffPolynomial_degree {n p q : β„•} {P T : BooleanCube n β†’ ℝ}
    (hP : WalshDegreeLE P p) (hT : WalshDegreeLE T q) :
    WalshDegreeLE (errorCutoffPolynomial P T) (p + q) :=
  hP.mul ((WalshDegreeLE.const 1 q).sub hT)

lemma errorCutoffPolynomial_sq_bound {n : β„•} {F P T : BooleanCube n β†’ ℝ}
    {E : BooleanCube n β†’ Bool} (hF : βˆ€ x, F x = 0 ∨ F x = 1)
    (he : βˆ€ x, E x = false β†’ P x = F x) {B : ℝ} (hB : 1 ≀ B)
    (hP : βˆ€ x, |P x| ≀ B) (x : BooleanCube n) :
    (exceptionalExtension F E x - errorCutoffPolynomial P T x) ^ 2 ≀
      2 * (if E x then (1 : ℝ) else 0) +
        2 * B ^ 2 * ((if E x then (1 : ℝ) else 0) - T x) ^ 2 := by
  have hp : (P x) ^ 2 ≀ B ^ 2 := by
    have ha := abs_le.mp (hP x)
    nlinarith
  have hBsq : 1 ≀ B ^ 2 := by nlinarith
  cases hE : E x
  Β· have heq := he x hE
    rcases hF x with hf | hf
    Β· simp [exceptionalExtension, errorCutoffPolynomial, hE, heq, hf]
      positivity
    Β· simp only [exceptionalExtension, errorCutoffPolynomial, hE,
        Bool.false_eq_true, ite_false, heq, hf, one_mul, mul_zero, zero_add]
      have hh := mul_le_mul_of_nonneg_right hBsq (sq_nonneg (T x))
      nlinarith only [hh, sq_nonneg (T x)]
  Β· simp only [exceptionalExtension, errorCutoffPolynomial, hE, ite_true]
    have hh := mul_le_mul_of_nonneg_right hp (sq_nonneg (1 - T x))
    nlinarith only [hh, sq_nonneg (1 + P x * (1 - T x))]

theorem errorCutoffPolynomial_mean_sq {n : β„•} {F P T : BooleanCube n β†’ ℝ}
    {E : BooleanCube n β†’ Bool} (hF : βˆ€ x, F x = 0 ∨ F x = 1)
    (he : βˆ€ x, E x = false β†’ P x = F x) {B Ξ΄ Ξ΅ : ℝ} (hB : 1 ≀ B)
    (hP : βˆ€ x, |P x| ≀ B)
    (hE : cubeAverage (fun x => if E x then (1 : ℝ) else 0) ≀ Ξ΄)
    (hT : cubeAverage (fun x => ((if E x then (1 : ℝ) else 0) - T x) ^ 2) ≀ Ξ΅) :
    cubeAverage (fun x =>
      (exceptionalExtension F E x - errorCutoffPolynomial P T x) ^ 2) ≀
        2 * Ξ΄ + 2 * B ^ 2 * Ξ΅ := by
  have hh := cubeAverage_mono (errorCutoffPolynomial_sq_bound (T := T) hF he hB hP)
  rw [cubeAverage_add, cubeAverage_mul_const, cubeAverage_mul_const] at hh
  exact hh.trans (add_le_add (mul_le_mul_of_nonneg_left hE (by norm_num))
    (mul_le_mul_of_nonneg_left hT (by positivity)))

end TwoPointCorrelations

end OAI