Analysis of Boolean Functions in Lean

7.1. Dictator testing🔗

Definition7.1.1
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.2
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0
Used by 6
Reverse dependency previews
Preview
Definition 7.1.2
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 7.1. Let f:\{0,1\}^n\to\{0,1\}. An r-query function-testing algorithm randomly chooses at most r query points x^{(1)},\ldots,x^{(r)}\in\{0,1\}^n, reads precisely the values of f at those points, and then deterministically accepts or rejects as a function of the returned values. The queries are nonadaptive: their joint distribution is chosen before any value of f is read.

Lean code for Definition7.1.15 definitions
  • structure(5 fields)defined in FABL/Chapter07/DictatorTesting.lean
    complete
    structure FABL.NonadaptiveFunctionTester.{u, v} (Domain : Type u)
      (Codomain : Type v) (r : ) : Type (max (u + 1) (v + 1))
    structure FABL.NonadaptiveFunctionTester.{u, v}
      (Domain : Type u) (Codomain : Type v)
      (r : ) : Type (max (u + 1) (v + 1))
    O'Donnell, Definition 7.1: a finite nonadaptive tester making at most `r` queries.
    
    The random seed fixes every query before the oracle is consulted. An unused query slot is
    represented by `none`, and the deterministic acceptance predicate receives only the seed and the
    resulting query transcript. In particular, it has no access to the tested function. 
    Seed : Type (max u v)
    The finite source of the tester's randomness. 
    seedFintype : Fintype self.Seed
    Finiteness witness for the tester's seed space. 
    distribution : PMF self.Seed
    Probability law used to sample a seed. 
    queries : self.Seed  Fin r  Option Domain
    The query address at each nonadaptive transcript position. 
    accept : self.Seed  (Fin r  Option Codomain)  Bool
    Deterministic acceptance predicate on the answered transcript. 
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.NonadaptiveFunctionTester.transcript.{u, v} {Domain : Type u}
      {Codomain : Type v} {r : }
      (T : FABL.NonadaptiveFunctionTester Domain Codomain r)
      (f : Domain  Codomain) (seed : T.Seed) : Fin r  Option Codomain
    def FABL.NonadaptiveFunctionTester.transcript.{u,
        v}
      {Domain : Type u} {Codomain : Type v}
      {r : }
      (T :
        FABL.NonadaptiveFunctionTester Domain
          Codomain r)
      (f : Domain  Codomain)
      (seed : T.Seed) :
      Fin r  Option Codomain
    The values visible to a nonadaptive tester after its queries are answered. 
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.NonadaptiveFunctionTester.accepts.{u, v} {Domain : Type u}
      {Codomain : Type v} {r : }
      (T : FABL.NonadaptiveFunctionTester Domain Codomain r)
      (f : Domain  Codomain) (seed : T.Seed) : Prop
    def FABL.NonadaptiveFunctionTester.accepts.{u,
        v}
      {Domain : Type u} {Codomain : Type v}
      {r : }
      (T :
        FABL.NonadaptiveFunctionTester Domain
          Codomain r)
      (f : Domain  Codomain)
      (seed : T.Seed) : Prop
    The deterministic outcome of a tester on one random seed. 
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.NonadaptiveFunctionTester.acceptanceProbability.{u, v}
      {Domain : Type u} {Codomain : Type v} {r : }
      (T : FABL.NonadaptiveFunctionTester Domain Codomain r)
      (f : Domain  Codomain) : 
    def FABL.NonadaptiveFunctionTester.acceptanceProbability.{u,
        v}
      {Domain : Type u} {Codomain : Type v}
      {r : }
      (T :
        FABL.NonadaptiveFunctionTester Domain
          Codomain r)
      (f : Domain  Codomain) : 
    Acceptance probability of a finite nonadaptive tester. 
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.NonadaptiveFunctionTester.rejectionProbability.{u, v}
      {Domain : Type u} {Codomain : Type v} {r : }
      (T : FABL.NonadaptiveFunctionTester Domain Codomain r)
      (f : Domain  Codomain) : 
    def FABL.NonadaptiveFunctionTester.rejectionProbability.{u,
        v}
      {Domain : Type u} {Codomain : Type v}
      {r : }
      (T :
        FABL.NonadaptiveFunctionTester Domain
          Codomain r)
      (f : Domain  Codomain) : 
    Rejection probability of a finite nonadaptive tester. 
Definition7.1.2
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 1.6.2
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 6
Reverse dependency previews
Preview
Lemma 7.1.3
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 7.2. Let \mathcal C be a property of Boolean functions on \{0,1\}^n and let \lambda>0. A tester locally tests \mathcal C with rejection rate \lambda if it accepts every f\in\mathcal C with probability 1 and, for every 0\le\epsilon\le1, \operatorname{dist}(f,\mathcal C)>\epsilon \quad\Longrightarrow\quad \Pr[\text{tester rejects }f]>\lambda\epsilon. Equivalently, acceptance probability at least 1-\lambda\epsilon implies that f is \epsilon-close to some member of \mathcal C.

Lean code for Definition7.1.23 declarations
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.IsLocalTester.{u_1, u_2} {Ω : Type u_1} {β : Type u_2} [Fintype Ω]
      [Nonempty Ω] [DecidableEq β] {r : }
      (T : FABL.NonadaptiveFunctionTester Ω β r) (P : (Ω  β)  Prop)
      (rate : ) : Prop
    def FABL.IsLocalTester.{u_1, u_2}
      {Ω : Type u_1} {β : Type u_2}
      [Fintype Ω] [Nonempty Ω] [DecidableEq β]
      {r : }
      (T :
        FABL.NonadaptiveFunctionTester Ω β r)
      (P : (Ω  β)  Prop) (rate : ) : Prop
    O'Donnell, Definition 7.2: `T` locally tests `P` with rejection rate `λ`.
    
    The second conjunct is the book's strict soundness formulation: every function farther than
    `ε` from every member of `P` is rejected with probability strictly greater than `λ * ε`. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.IsLocalTester.close_of_acceptanceProbability_ge.{u_1, u_2}
      {Ω : Type u_1} {β : Type u_2} [Fintype Ω] [Nonempty Ω] [DecidableEq β]
      {r : } {T : FABL.NonadaptiveFunctionTester Ω β r}
      {P : (Ω  β)  Prop} {rate ε : } (hT : FABL.IsLocalTester T P rate)
      ( : ε  Set.Icc 0 1) (f : Ω  β)
      (haccept : 1 - rate * ε  T.acceptanceProbability f) :
      FABL.IsCloseToProperty ε f P
    theorem FABL.IsLocalTester.close_of_acceptanceProbability_ge.{u_1,
        u_2}
      {Ω : Type u_1} {β : Type u_2}
      [Fintype Ω] [Nonempty Ω] [DecidableEq β]
      {r : }
      {T :
        FABL.NonadaptiveFunctionTester Ω β r}
      {P : (Ω  β)  Prop} {rate ε : }
      (hT : FABL.IsLocalTester T P rate)
      ( : ε  Set.Icc 0 1) (f : Ω  β)
      (haccept :
        1 - rate * ε 
          T.acceptanceProbability f) :
      FABL.IsCloseToProperty ε f P
    The equivalent high-acceptance conclusion in Definition 7.2. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.isLocalTester_of_close_of_acceptanceProbability_ge.{u_1, u_2}
      {Ω : Type u_1} {β : Type u_2} [Fintype Ω] [Nonempty Ω] [DecidableEq β]
      {r : } (T : FABL.NonadaptiveFunctionTester Ω β r)
      (P : (Ω  β)  Prop) (rate : ) (hrate : 0 < rate)
      (hcomplete :  (f : Ω  β), P f  T.acceptanceProbability f = 1)
      (hclose :
         ε  Set.Icc 0 1,
           (f : Ω  β),
            1 - rate * ε  T.acceptanceProbability f 
              FABL.IsCloseToProperty ε f P) :
      FABL.IsLocalTester T P rate
    theorem FABL.isLocalTester_of_close_of_acceptanceProbability_ge.{u_1,
        u_2}
      {Ω : Type u_1} {β : Type u_2}
      [Fintype Ω] [Nonempty Ω] [DecidableEq β]
      {r : }
      (T :
        FABL.NonadaptiveFunctionTester Ω β r)
      (P : (Ω  β)  Prop) (rate : )
      (hrate : 0 < rate)
      (hcomplete :
         (f : Ω  β),
          P f  T.acceptanceProbability f = 1)
      (hclose :
         ε  Set.Icc 0 1,
           (f : Ω  β),
            1 - rate * ε 
                T.acceptanceProbability f 
              FABL.IsCloseToProperty ε f P) :
      FABL.IsLocalTester T P rate
    The high-acceptance implication suffices to prove the strict soundness formulation of a
    local tester. 
Lemma7.1.3
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 1.6.5
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0L∃∀N

Example 7.3. The BLR Test is a 3-query local tester with rejection rate 1 for the property of linear functions f:\mathbb F_2^n\to\mathbb F_2.

Lean code for Lemma7.1.34 declarations
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.blrFunctionTester (n : ) :
      FABL.NonadaptiveFunctionTester (FABL.F₂Cube n) FABL.𝔽₂ 3
    def FABL.blrFunctionTester (n : ) :
      FABL.NonadaptiveFunctionTester
        (FABL.F₂Cube n) FABL.𝔽₂ 3
    The three-query BLR test as a finite nonadaptive tester. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.blrFunctionTester_acceptanceProbability {n : }
      (f : FABL.F₂Cube n  FABL.𝔽₂) :
      (FABL.blrFunctionTester n).acceptanceProbability f =
        FABL.blrAcceptanceProbability f
    theorem FABL.blrFunctionTester_acceptanceProbability
      {n : } (f : FABL.F₂Cube n  FABL.𝔽₂) :
      (FABL.blrFunctionTester
              n).acceptanceProbability
          f =
        FABL.blrAcceptanceProbability f
    The finite tester's acceptance probability is the BLR acceptance probability from Chapter 1. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.blrFunctionTester_complete {n : } (f : FABL.F₂Cube n  FABL.𝔽₂)
      (hf : FABL.IsF₂Linear f) :
      (FABL.blrFunctionTester n).acceptanceProbability f = 1
    theorem FABL.blrFunctionTester_complete {n : }
      (f : FABL.F₂Cube n  FABL.𝔽₂)
      (hf : FABL.IsF₂Linear f) :
      (FABL.blrFunctionTester
              n).acceptanceProbability
          f =
        1
    Linear functions pass every BLR test seed. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.blrFunctionTester_isLocalTester {n : } :
      FABL.IsLocalTester (FABL.blrFunctionTester n) FABL.IsF₂Linear 1
    theorem FABL.blrFunctionTester_isLocalTester
      {n : } :
      FABL.IsLocalTester
        (FABL.blrFunctionTester n)
        FABL.IsF₂Linear 1
    O'Donnell, Example 7.3: BLR is a three-query local tester for binary linear functions,
    with rejection rate one. 
Lemma7.1.4
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 0XL∃∀N

Remark 7.4. In applications one has a family (\mathcal C_n)_n and a tester for each input length. The rejection rate is required to be a positive constant independent of n. This chapter uses nonadaptive testers and rejection probabilities linear in the distance parameter.

Definition7.1.5
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 3
Reverse dependency previews
Preview
Definition 7.1.6
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

The dictator property on n bits is \mathcal D_n= \{f:\{0,1\}^n\to\{0,1\}:\exists i\in[n],\ f(x)=x_i\}. It contains the positive dictators only, not their negations.

Lean code for Definition7.1.51 definition
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.IsDictator {n : } (f : FABL.BooleanFunction n) : Prop
    def FABL.IsDictator {n : }
      (f : FABL.BooleanFunction n) : Prop
    The class of positive dictators. The negated dictators are deliberately excluded. 
Definition7.1.6
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 7.1.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

The AND Test independently samples uniform x,y\in\{0,1\}^n, defines z_i=x_i\wedge y_i, and accepts exactly when f(z)=f(x)\wedge f(y). Among parity functions, the functions accepted with probability 1 are precisely the dictators and the constant-zero function.

Lean code for Definition7.1.62 declarations
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.andFunctionTester.{u, v} {Domain : Type u} {Codomain : Type v}
      {r s : } (T : FABL.NonadaptiveFunctionTester Domain Codomain r)
      (U : FABL.NonadaptiveFunctionTester Domain Codomain s) :
      FABL.NonadaptiveFunctionTester Domain Codomain (r + s)
    def FABL.andFunctionTester.{u, v}
      {Domain : Type u} {Codomain : Type v}
      {r s : }
      (T :
        FABL.NonadaptiveFunctionTester Domain
          Codomain r)
      (U :
        FABL.NonadaptiveFunctionTester Domain
          Codomain s) :
      FABL.NonadaptiveFunctionTester Domain
        Codomain (r + s)
    Run two nonadaptive testers independently and accept exactly when both accept. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.andFunctionTester_acceptanceProbability.{u, v} {Domain : Type u}
      {Codomain : Type v} {r s : }
      (T : FABL.NonadaptiveFunctionTester Domain Codomain r)
      (U : FABL.NonadaptiveFunctionTester Domain Codomain s)
      (f : Domain  Codomain) :
      (FABL.andFunctionTester T U).acceptanceProbability f =
        T.acceptanceProbability f * U.acceptanceProbability f
    theorem FABL.andFunctionTester_acceptanceProbability.{u,
        v}
      {Domain : Type u} {Codomain : Type v}
      {r s : }
      (T :
        FABL.NonadaptiveFunctionTester Domain
          Codomain r)
      (U :
        FABL.NonadaptiveFunctionTester Domain
          Codomain s)
      (f : Domain  Codomain) :
      (FABL.andFunctionTester T
              U).acceptanceProbability
          f =
        T.acceptanceProbability f *
          U.acceptanceProbability f
    The independent conjunction tester's acceptance probability factors. 
Definition7.1.7
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Lemma 2.5.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 2
Reverse dependency previews
Preview
Theorem 7.1.8
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

The NAE Test for f:\{-1,1\}^n\to\{-1,1\} independently samples, for each coordinate i, a uniform triple (x_i,y_i,z_i) among the six sign triples satisfying \operatorname{NAE}_3, queries f(x),f(y),f(z), and accepts exactly when \operatorname{NAE}_3(f(x),f(y),f(z))=1.

Lean code for Definition7.1.73 declarations
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.naeFunctionTester (n : ) :
      FABL.NonadaptiveFunctionTester (FABL.SignCube n) FABL.Sign 3
    def FABL.naeFunctionTester (n : ) :
      FABL.NonadaptiveFunctionTester
        (FABL.SignCube n) FABL.Sign 3
    The NAE Test, with one independent uniform strict ranking per coordinate. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.naeFunctionTester_acceptanceProbability {n : }
      (f : FABL.BooleanFunction n) :
      (FABL.naeFunctionTester n).acceptanceProbability f =
        FABL.condorcetWinnerProbability f
    theorem FABL.naeFunctionTester_acceptanceProbability
      {n : } (f : FABL.BooleanFunction n) :
      (FABL.naeFunctionTester
              n).acceptanceProbability
          f =
        FABL.condorcetWinnerProbability f
    The NAE Test acceptance probability is the Condorcet-winner probability from Chapter 2. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.naeFunctionTester_complete_signedDictator {n : } (i : Fin n)
      (negated : Bool) :
      (FABL.naeFunctionTester n).acceptanceProbability
          (FABL.signedDictator i negated) =
        1
    theorem FABL.naeFunctionTester_complete_signedDictator
      {n : } (i : Fin n) (negated : Bool) :
      (FABL.naeFunctionTester
              n).acceptanceProbability
          (FABL.signedDictator i negated) =
        1
    Every positive or negative dictator passes the NAE Test. 
Theorem7.1.8
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 3
Statement dependency previews
Preview
Corollary 2.5.12
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

Theorem 7.5. If the NAE Test accepts a Boolean-valued f with probability 1-\epsilon, then \mathbf W^1[f]\ge1-\frac92\epsilon. Consequently the FKN Theorem implies that f has relative Hamming distance O(\epsilon) from a signed dictator \pm\chi_i.

Lean code for Theorem7.1.82 theorems
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.naeTest_levelOneWeight_ge {n : } (f : FABL.BooleanFunction n)
      (ε : )
      (haccept :
        (FABL.naeFunctionTester n).acceptanceProbability f = 1 - ε) :
      1 - 9 / 2 * ε  FABL.fourierWeightAtLevel 1 f.toReal
    theorem FABL.naeTest_levelOneWeight_ge {n : }
      (f : FABL.BooleanFunction n) (ε : )
      (haccept :
        (FABL.naeFunctionTester
                n).acceptanceProbability
            f =
          1 - ε) :
      1 - 9 / 2 * ε 
        FABL.fourierWeightAtLevel 1 f.toReal
    The level-one conclusion in O'Donnell, Theorem 7.5, reusing Corollary 2.59. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.naeTest_close_to_signedDictator {n : }
      (f : FABL.BooleanFunction n) (hn : 0 < n) (ε : ) (hε₀ : 0  ε)
      (haccept :
        (FABL.naeFunctionTester n).acceptanceProbability f = 1 - ε) :
       i negated,
        FABL.relativeHammingDist f (FABL.signedDictator i negated) 
          7205 * ε
    theorem FABL.naeTest_close_to_signedDictator
      {n : } (f : FABL.BooleanFunction n)
      (hn : 0 < n) (ε : ) (hε₀ : 0  ε)
      (haccept :
        (FABL.naeFunctionTester
                n).acceptanceProbability
            f =
          1 - ε) :
       i negated,
        FABL.relativeHammingDist f
            (FABL.signedDictator i negated) 
          7205 * ε
    O'Donnell, Theorem 7.5: NAE acceptance `1 - ε` makes `f` `O(ε)`-close to a signed
    dictator. The displayed universal constant closes the large-error case by the trivial distance
    bound, while the small-error case delegates to FKN. 
Theorem7.1.9
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 3
Statement dependency previews
Preview
Theorem 1.6.5
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

Theorem 7.6. Simultaneously running the BLR Test and the NAE Test gives a 6-query local tester for the dictator property with rejection rate 0.1.

Indeed acceptance at least 1-0.1\epsilon forces \mathbf W^1[f]\ge1-.45\epsilon and a Fourier coefficient \widehat f(S^*)\ge1-.2\epsilon. Parseval forces |S^*|=1, and the corresponding dictator is within distance \epsilon of f.

Lean code for Theorem7.1.93 theorems
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.fourierWeightAtLevel_one_add_coeff_sq_le_one_of_card_ne_one {n : }
      (f : FABL.BooleanFunction n) (S : Finset (Fin n))
      (hcard : S.card  1) :
      FABL.fourierWeightAtLevel 1 f.toReal +
          FABL.fourierCoeff f.toReal S ^ 2 
        1
    theorem FABL.fourierWeightAtLevel_one_add_coeff_sq_le_one_of_card_ne_one
      {n : } (f : FABL.BooleanFunction n)
      (S : Finset (Fin n))
      (hcard : S.card  1) :
      FABL.fourierWeightAtLevel 1 f.toReal +
          FABL.fourierCoeff f.toReal S ^ 2 
        1
    Fourier mass at level one together with a coefficient off level one cannot exceed total
    Parseval mass. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.exists_dictator_close_of_signBlr_and_nae_acceptance_ge {n : }
      (f : FABL.BooleanFunction n) (ε : ) ( : ε  Set.Icc 0 1)
      (hblr :
        1 - 1 / 10 * ε 
          (FABL.signBlrFunctionTester n).acceptanceProbability f)
      (hnae :
        1 - 1 / 10 * ε 
          (FABL.naeFunctionTester n).acceptanceProbability f) :
       i, FABL.relativeHammingDist f (FABL.dictator i)  ε
    theorem FABL.exists_dictator_close_of_signBlr_and_nae_acceptance_ge
      {n : } (f : FABL.BooleanFunction n)
      (ε : ) ( : ε  Set.Icc 0 1)
      (hblr :
        1 - 1 / 10 * ε 
          (FABL.signBlrFunctionTester
                n).acceptanceProbability
            f)
      (hnae :
        1 - 1 / 10 * ε 
          (FABL.naeFunctionTester
                n).acceptanceProbability
            f) :
       i,
        FABL.relativeHammingDist f
            (FABL.dictator i) 
          ε
    The quantitative core shared by the six-query and mixed three-query dictator tests. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.blrAndNae_isLocalTester {n : } :
      FABL.IsLocalTester
        (FABL.andFunctionTester (FABL.signBlrFunctionTester n)
          (FABL.naeFunctionTester n))
        FABL.IsDictator (1 / 10)
    theorem FABL.blrAndNae_isLocalTester {n : } :
      FABL.IsLocalTester
        (FABL.andFunctionTester
          (FABL.signBlrFunctionTester n)
          (FABL.naeFunctionTester n))
        FABL.IsDictator (1 / 10)
    O'Donnell, Theorem 7.6: performing both BLR and NAE is a six-query local tester for positive
    dictators, with rejection rate `0.1`. 
Definition7.1.10
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 1.6.5
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

The BLR+NAE Test runs the BLR Test with probability 1/2 and the NAE Test with probability 1/2.

Lean code for Definition7.1.101 definition
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.blrNaeFunctionTester (n : ) :
      FABL.NonadaptiveFunctionTester (FABL.SignCube n) FABL.Sign 3
    def FABL.blrNaeFunctionTester (n : ) :
      FABL.NonadaptiveFunctionTester
        (FABL.SignCube n) FABL.Sign 3
    The three-query BLR+NAE Test chooses either component with probability one half. 
Theorem7.1.11
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Theorem 7.1.9
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 2
Reverse dependency previews
Preview
Theorem 7.1.13
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Theorem 7.7. The BLR+NAE Test is a 3-query local tester for the dictator property with rejection rate 0.05.

Lean code for Theorem7.1.111 theorem
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.blrNae_isLocalTester {n : } :
      FABL.IsLocalTester (FABL.blrNaeFunctionTester n) FABL.IsDictator
        (1 / 20)
    theorem FABL.blrNae_isLocalTester {n : } :
      FABL.IsLocalTester
        (FABL.blrNaeFunctionTester n)
        FABL.IsDictator (1 / 20)
    O'Donnell, Theorem 7.7: the BLR+NAE Test is a three-query local tester for positive
    dictators, with rejection rate `0.05`. 
Lemma7.1.12
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1L∃∀N

Remark 7.8. Suppose t>0 testers use respectively r_1,\ldots,r_t queries. The tester that chooses one of them uniformly uses at most \max_i r_i queries. If the mixture accepts with probability at least 1-(\lambda/t)\epsilon, then every constituent accepts with probability at least 1-\lambda\epsilon.

Lean code for Lemma7.1.123 declarations
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.uniformMixtureFunctionTester.{u, v} {Domain : Type u}
      {Codomain : Type v} {r t : } (ht : 0 < t)
      (T : Fin t  FABL.NonadaptiveFunctionTester Domain Codomain r) :
      FABL.NonadaptiveFunctionTester Domain Codomain r
    def FABL.uniformMixtureFunctionTester.{u, v}
      {Domain : Type u} {Codomain : Type v}
      {r t : } (ht : 0 < t)
      (T :
        Fin t 
          FABL.NonadaptiveFunctionTester
            Domain Codomain r) :
      FABL.NonadaptiveFunctionTester Domain
        Codomain r
    Uniformly choose one tester from a positive finite family. The seed records the chosen
    subtest and that subtest's private randomness. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.uniformMixtureFunctionTester_acceptanceProbability.{u, v}
      {Domain : Type u} {Codomain : Type v} {r t : } (ht : 0 < t)
      (T : Fin t  FABL.NonadaptiveFunctionTester Domain Codomain r)
      (f : Domain  Codomain) :
      (FABL.uniformMixtureFunctionTester ht T).acceptanceProbability f =
        Finset.univ.expect fun i => (T i).acceptanceProbability f
    theorem FABL.uniformMixtureFunctionTester_acceptanceProbability.{u,
        v}
      {Domain : Type u} {Codomain : Type v}
      {r t : } (ht : 0 < t)
      (T :
        Fin t 
          FABL.NonadaptiveFunctionTester
            Domain Codomain r)
      (f : Domain  Codomain) :
      (FABL.uniformMixtureFunctionTester ht
              T).acceptanceProbability
          f =
        Finset.univ.expect fun i =>
          (T i).acceptanceProbability f
    Acceptance of a uniform mixture is the uniform average of the component acceptances. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.component_acceptanceProbability_ge_of_uniformMixture_ge.{u, v}
      {Domain : Type u} {Codomain : Type v} {r t : } (ht : 0 < t)
      (T : Fin t  FABL.NonadaptiveFunctionTester Domain Codomain r)
      (f : Domain  Codomain) (rate ε : )
      (haccept :
        1 - rate / t * ε 
          (FABL.uniformMixtureFunctionTester ht T).acceptanceProbability f)
      (i : Fin t) : 1 - rate * ε  (T i).acceptanceProbability f
    theorem FABL.component_acceptanceProbability_ge_of_uniformMixture_ge.{u,
        v}
      {Domain : Type u} {Codomain : Type v}
      {r t : } (ht : 0 < t)
      (T :
        Fin t 
          FABL.NonadaptiveFunctionTester
            Domain Codomain r)
      (f : Domain  Codomain) (rate ε : )
      (haccept :
        1 - rate / t * ε 
          (FABL.uniformMixtureFunctionTester
                ht T).acceptanceProbability
            f)
      (i : Fin t) :
      1 - rate * ε 
        (T i).acceptanceProbability f
    O'Donnell, Remark 7.8: if a uniform mixture of `t` tests accepts with probability at least
    `1 - (λ / t) ε`, every component accepts with probability at least `1 - λ ε`. 
Theorem7.1.13
Group: Chapter 7: Property testing, PCPPs, and CSPs (103)
Group member previews
Preview
Definition 7.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 3
Statement dependency previews
Preview
Proposition 1.6.6
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 2
Reverse dependency previews
Preview
Theorem 7.2.7
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Theorem 7.9. For S\subseteq[n], let \mathcal S=\{\chi_i:\{0,1\}^n\to\{0,1\}:i\in S\}. For every S, \mathcal S has a 3-query local tester with rejection rate 0.01. It mixes the BLR+NAE Test with the BLR local correction procedure evaluated at the indicator string 1_S, accepting the second branch exactly when the corrected value is 1.

Lean code for Theorem7.1.138 declarations
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.IsDictatorIn {n : } (S : Finset (Fin n))
      (f : FABL.BooleanFunction n) : Prop
    def FABL.IsDictatorIn {n : }
      (S : Finset (Fin n))
      (f : FABL.BooleanFunction n) : Prop
    The subclass of positive dictators whose coordinates lie in the fixed set `S`. 
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.subsetIndicatorSign {n : } (S : Finset (Fin n)) : FABL.SignCube n
    def FABL.subsetIndicatorSign {n : }
      (S : Finset (Fin n)) : FABL.SignCube n
    The sign-cube encoding of the subset indicator `1_S`: membership is represented by `-1`. 
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.subsetLocalCorrectionFunctionTester {n : } (S : Finset (Fin n)) :
      FABL.NonadaptiveFunctionTester (FABL.SignCube n) FABL.Sign 3
    def FABL.subsetLocalCorrectionFunctionTester
      {n : } (S : Finset (Fin n)) :
      FABL.NonadaptiveFunctionTester
        (FABL.SignCube n) FABL.Sign 3
    The two-query local correction check at the fixed subset indicator, padded to three query
    slots so it can be mixed with BLR+NAE. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.subsetLocalCorrectionFunctionTester_dictator {n : }
      (S : Finset (Fin n)) (i : Fin n) :
      (FABL.subsetLocalCorrectionFunctionTester S).acceptanceProbability
          (FABL.dictator i) =
        if i  S then 1 else 0
    theorem FABL.subsetLocalCorrectionFunctionTester_dictator
      {n : } (S : Finset (Fin n))
      (i : Fin n) :
      (FABL.subsetLocalCorrectionFunctionTester
              S).acceptanceProbability
          (FABL.dictator i) =
        if i  S then 1 else 0
    The local correction check accepts a dictator exactly when its coordinate belongs to `S`. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.subsetLocalCorrection_correctProbability_ge {n : }
      (S A : Finset (Fin n)) (f : FABL.BooleanFunction n) (δ : )
      (hclose : FABL.relativeHammingDist f (FABL.parityFunction A)  δ) :
      1 - 2 * δ 
        FABL.uniformProbability fun y =>
          FABL.localCorrection (fun z => f ((FABL.binaryCubeSignEquiv n) z))
              ((FABL.binaryCubeSignEquiv n).symm
                (FABL.subsetIndicatorSign S))
              y =
            FABL.parityFunction A (FABL.subsetIndicatorSign S)
    theorem FABL.subsetLocalCorrection_correctProbability_ge
      {n : } (S A : Finset (Fin n))
      (f : FABL.BooleanFunction n) (δ : )
      (hclose :
        FABL.relativeHammingDist f
            (FABL.parityFunction A) 
          δ) :
      1 - 2 * δ 
        FABL.uniformProbability fun y =>
          FABL.localCorrection
              (fun z =>
                f
                  ((FABL.binaryCubeSignEquiv
                      n)
                    z))
              ((FABL.binaryCubeSignEquiv
                    n).symm
                (FABL.subsetIndicatorSign S))
              y =
            FABL.parityFunction A
              (FABL.subsetIndicatorSign S)
    The local correction component is correct with probability at least `1 - 2δ` when `f` is
    `δ`-close to a parity. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.subsetLocalCorrectionFunctionTester_acceptanceProbability {n : }
      (S : Finset (Fin n)) (f : FABL.BooleanFunction n) :
      (FABL.subsetLocalCorrectionFunctionTester S).acceptanceProbability f =
        FABL.uniformProbability fun y =>
          FABL.localCorrection (fun z => f ((FABL.binaryCubeSignEquiv n) z))
              ((FABL.binaryCubeSignEquiv n).symm
                (FABL.subsetIndicatorSign S))
              y =
            -1
    theorem FABL.subsetLocalCorrectionFunctionTester_acceptanceProbability
      {n : } (S : Finset (Fin n))
      (f : FABL.BooleanFunction n) :
      (FABL.subsetLocalCorrectionFunctionTester
              S).acceptanceProbability
          f =
        FABL.uniformProbability fun y =>
          FABL.localCorrection
              (fun z =>
                f
                  ((FABL.binaryCubeSignEquiv
                      n)
                    z))
              ((FABL.binaryCubeSignEquiv
                    n).symm
                (FABL.subsetIndicatorSign S))
              y =
            -1
    The local correction tester's acceptance event is output `-1`. 
  • defdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    def FABL.dictatorSubclassFunctionTester {n : } (S : Finset (Fin n)) :
      FABL.NonadaptiveFunctionTester (FABL.SignCube n) FABL.Sign 3
    def FABL.dictatorSubclassFunctionTester
      {n : } (S : Finset (Fin n)) :
      FABL.NonadaptiveFunctionTester
        (FABL.SignCube n) FABL.Sign 3
    The tester for a fixed subclass `S` mixes BLR+NAE with local correction at `1_S`. 
  • theoremdefined in FABL/Chapter07/DictatorTesting.lean
    complete
    theorem FABL.dictatorSubclass_isLocalTester {n : } (S : Finset (Fin n)) :
      FABL.IsLocalTester (FABL.dictatorSubclassFunctionTester S)
        (FABL.IsDictatorIn S) (1 / 100)
    theorem FABL.dictatorSubclass_isLocalTester
      {n : } (S : Finset (Fin n)) :
      FABL.IsLocalTester
        (FABL.dictatorSubclassFunctionTester
          S)
        (FABL.IsDictatorIn S) (1 / 100)
    O'Donnell, Theorem 7.9: every fixed subclass of the positive dictators has a three-query
    local tester with rejection rate `0.01`.