Analysis of Boolean Functions in Lean

7.3. CSPs and computational complexity🔗

Lemma7.3.1
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 0used by 1L∃∀N

Example 7.21. The optimization problems used in this chapter are:

  • Max-3-Sat: maximize the number of satisfied clauses in a CNF whose clauses have width at most 3;

  • Max-Cut: maximize the number of graph edges crossing a bipartition;

  • Max-E3-Lin: maximize the number of satisfied \mathbb F_2-linear equations, each involving exactly three variables;

  • Max-3-Coloring: maximize the number of bichromatic edges under a three-color assignment.

Lean code for Lemma7.3.18 definitions
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.maxCutTemplate : FABL.CSPTemplate FABL.Sign
    def FABL.maxCutTemplate :
      FABL.CSPTemplate FABL.Sign
    The single inequality predicate used by Max-Cut. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.maxThreeColoringTemplate : FABL.CSPTemplate (Fin 3)
    def FABL.maxThreeColoringTemplate :
      FABL.CSPTemplate (Fin 3)
    The single inequality predicate used by Max-3-Coloring. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.maxE3LinTemplate : FABL.CSPTemplate FABL.𝔽₂
    def FABL.maxE3LinTemplate :
      FABL.CSPTemplate FABL.𝔽₂
    The two possible right-hand sides of an exact three-variable equation over `𝔽₂`. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.e3SatPredicate (negated values : Fin 3  Bool) : Bool
    def FABL.e3SatPredicate
      (negated values : Fin 3  Bool) : Bool
    A three-literal disjunction, with one negation bit for each literal. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.maxE3SatTemplate : FABL.CSPTemplate Bool
    def FABL.maxE3SatTemplate :
      FABL.CSPTemplate Bool
    The eight exact-three-literal predicates used by Max-E3-Sat. 
  • abbrevdefined in FABL/Chapter07/CSP.lean
    complete
    abbrev FABL.MaxThreeSatPredicate : Type
    abbrev FABL.MaxThreeSatPredicate : Type
    Predicate names for clauses of width one, two, or three. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.maxThreeSatPredicateEval (p : FABL.MaxThreeSatPredicate)
      (values : Fin (p.fst + 1)  Bool) : Bool
    def FABL.maxThreeSatPredicateEval
      (p : FABL.MaxThreeSatPredicate)
      (values : Fin (p.fst + 1)  Bool) :
      Bool
    Disjunction of a nonempty tuple of literals. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.maxThreeSatTemplate : FABL.CSPTemplate Bool
    def FABL.maxThreeSatTemplate :
      FABL.CSPTemplate Bool
    The fourteen width-at-most-three clause predicates used by Max-3-Sat. 
Definition7.3.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.
uses 1
Used by 6
Reverse dependency previews
Preview
Lemma 7.3.3
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 7.22. A finite-domain CSP is specified by a finite set \Psi of predicates. A predicate may have its own arity, \psi:\Omega^r\to\{0,1\}, and the arity of the CSP is the maximum such r.

For Max-3-Sat, \Psi consists of the eight signed three-literal ORs, four signed two-literal ORs, and two signed one-literal ORs. Max-Cut and Max-3-Coloring use inequality on the sign and three-color domains, respectively. Max-E3-Lin uses the two predicates x_1+x_2+x_3 and x_1+x_2+x_3+1 over \mathbb F_2.

Lean code for Definition7.3.23 declarations
  • structure(4 fields)defined in FABL/Chapter07/CSP.lean
    complete
    structure FABL.CSPTemplate.{u, v} (D : Type u) : Type (max u (v + 1))
    structure FABL.CSPTemplate.{u, v} (D : Type u) :
      Type (max u (v + 1))
    O'Donnell, Definition 7.22: a finite family of predicates over a domain `D`.
    
    Using a finite index type avoids imposing decidable equality on dependent function values while
    still presenting exactly a finite collection of predicate types. 
    Predicate : Type v
    Names of the allowed predicates. 
    fintypePredicate : Fintype self.Predicate
    The predicate family is finite. 
    arity : self.Predicate  
    Arity of an allowed predicate. 
    eval : (p : self.Predicate)  (Fin (self.arity p)  D)  Bool
    Evaluation of an allowed predicate; `true` means that the constraint is satisfied. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPTemplate.maxArity.{u, u_1} {D : Type u}
      (Ψ : FABL.CSPTemplate D) : 
    def FABL.CSPTemplate.maxArity.{u, u_1}
      {D : Type u} (Ψ : FABL.CSPTemplate D) :
      
    Maximum arity of the predicates in a finite CSP template. 
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.CSPTemplate.maxArity_eq_of_forall_arity_eq.{u, u_1} {D : Type u}
      (Ψ : FABL.CSPTemplate D) [Nonempty Ψ.Predicate] {r : }
      (h :  (p : Ψ.Predicate), Ψ.arity p = r) : Ψ.maxArity = r
    theorem FABL.CSPTemplate.maxArity_eq_of_forall_arity_eq.{u,
        u_1}
      {D : Type u} (Ψ : FABL.CSPTemplate D)
      [Nonempty Ψ.Predicate] {r : }
      (h :
         (p : Ψ.Predicate), Ψ.arity p = r) :
      Ψ.maxArity = r
Lemma7.3.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.
uses 1used by 0XL∃∀N

Remark 7.23. A Boolean CSP has domain \{0,1\} (or signs). Max-\psi means that the allowed predicate set is the singleton \{\psi\}. The prefix E3 requires exactly three variables per constraint, whereas 3-Lin and 3-Sat permit arities at most three unless E3 is written explicitly.

Definition7.3.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 1
Used by 4
Reverse dependency previews
Preview
Lemma 7.3.5
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 7.24. An instance P of Max-CSP(\Psi) is a nonempty finite multiset of constraints C=(S,\psi). If \psi has arity r, then S=(v_1,\ldots,v_r) is an injective tuple of variables. Every variable occurs in at least one scope. With domain, predicate set, and arity fixed as constants and n=|V|, the encoded input size lies between n and O(|P|\log n).

The finite instance, injective scopes, nonempty multiset, participation invariant, and Mathlib ValuedCSP bridge are formalized. The displayed bit-encoding size estimate remains a representation-level claim until a concrete variable-name and constraint codec is supplied.

Lean code for Definition7.3.47 declarations
  • structure(2 fields)defined in FABL/Chapter07/CSP.lean
    complete
    structure FABL.CSPConstraint.{u, v, u_1} {D : Type u} (Ψ : FABL.CSPTemplate D)
      (V : Type v) : Type (max u_1 v)
    structure FABL.CSPConstraint.{u, v, u_1}
      {D : Type u} (Ψ : FABL.CSPTemplate D)
      (V : Type v) : Type (max u_1 v)
    One constraint of a Max-CSP instance. Its embedding-valued scope makes repeated variables
    unrepresentable. 
    predicate : Ψ.Predicate
    Predicate applied by this constraint. 
    scope : Fin (Ψ.arity self.predicate)  V
    Ordered tuple of pairwise-distinct variables. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPTemplate.unsatisfiedCost.{u, u_1} {D : Type u}
      (Ψ : FABL.CSPTemplate D) (p : Ψ.Predicate) (x : Fin (Ψ.arity p)  D) :
      
    def FABL.CSPTemplate.unsatisfiedCost.{u, u_1}
      {D : Type u} (Ψ : FABL.CSPTemplate D)
      (p : Ψ.Predicate)
      (x : Fin (Ψ.arity p)  D) : 
    The zero-one cost complementary to a CSP predicate. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPTemplate.toValuedCSP.{u, u_1} {D : Type u}
      (Ψ : FABL.CSPTemplate D) : ValuedCSP D 
    def FABL.CSPTemplate.toValuedCSP.{u, u_1}
      {D : Type u} (Ψ : FABL.CSPTemplate D) :
      ValuedCSP D 
    The Mathlib valued-CSP template obtained by charging one for an unsatisfied constraint. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPConstraint.toValuedTerm.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (c : FABL.CSPConstraint Ψ V) :
      Ψ.toValuedCSP.Term V
    def FABL.CSPConstraint.toValuedTerm.{u, v,
        u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (c : FABL.CSPConstraint Ψ V) :
      Ψ.toValuedCSP.Term V
    Interpret a book constraint as a term of Mathlib's cost-minimizing `ValuedCSP`. 
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.CSPConstraint.evalSolution_toValuedTerm.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) :
      c.toValuedTerm.evalSolution assignment =
        c.unsatisfiedIndicator assignment
    theorem FABL.CSPConstraint.evalSolution_toValuedTerm.{u,
        v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) :
      c.toValuedTerm.evalSolution assignment =
        c.unsatisfiedIndicator assignment
  • structure(3 fields)defined in FABL/Chapter07/CSP.lean
    complete
    structure FABL.CSPInstance.{u, v, u_1} {D : Type u} (Ψ : FABL.CSPTemplate D)
      (V : Type v) : Type (max u_1 v)
    structure FABL.CSPInstance.{u, v, u_1} {D : Type u}
      (Ψ : FABL.CSPTemplate D) (V : Type v) :
      Type (max u_1 v)
    O'Donnell, Definition 7.24: a nonempty multiset of constraints in which every declared
    variable participates. 
    constraints : Multiset (FABL.CSPConstraint Ψ V)
    Constraint multiset; multiplicity records integer weights. 
    constraints_nonempty : self.constraints  0
    Normalized value requires at least one constraint. 
    participates :  (variableName : V),  constraint  self.constraints, variableName  Set.range constraint.scope
    Every declared variable occurs in some constraint scope. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPInstance.toValuedInstance.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (P : FABL.CSPInstance Ψ V) :
      Ψ.toValuedCSP.Instance V
    def FABL.CSPInstance.toValuedInstance.{u, v,
        u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (P : FABL.CSPInstance Ψ V) :
      Ψ.toValuedCSP.Instance V
    The underlying Mathlib valued-CSP instance. 
Lemma7.3.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 1used by 1L∃∀N

Remark 7.25. The Max-Cut convention permits parallel edges but forbids self-loops and isolated vertices; the graph need not be connected.

Lean code for Lemma7.3.56 declarations
  • defdefined in FABL/Chapter07/CSPExamples.lean
    complete
    def FABL.maxCutConstraintScope.{u} {V : Type u}
      (c : FABL.CSPConstraint FABL.maxCutTemplate V) : Fin 2  V
    def FABL.maxCutConstraintScope.{u}
      {V : Type u}
      (c :
        FABL.CSPConstraint FABL.maxCutTemplate
          V) :
      Fin 2  V
    The two ordered endpoints of a Max-Cut constraint. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.maxCutConstraint_scope_ne.{u} {V : Type u}
      (c : FABL.CSPConstraint FABL.maxCutTemplate V) :
      (FABL.maxCutConstraintScope c) 0  (FABL.maxCutConstraintScope c) 1
    theorem FABL.maxCutConstraint_scope_ne.{u}
      {V : Type u}
      (c :
        FABL.CSPConstraint FABL.maxCutTemplate
          V) :
      (FABL.maxCutConstraintScope c) 0 
        (FABL.maxCutConstraintScope c) 1
    A Max-Cut constraint cannot be a self-loop because its scope is an embedding. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.maxCutInstance_exists_incident_constraint.{u} {V : Type u}
      (P : FABL.CSPInstance FABL.maxCutTemplate V) (v : V) :
       c  P.constraints,
        v = (FABL.maxCutConstraintScope c) 0 
          v = (FABL.maxCutConstraintScope c) 1
    theorem FABL.maxCutInstance_exists_incident_constraint.{u}
      {V : Type u}
      (P :
        FABL.CSPInstance FABL.maxCutTemplate
          V)
      (v : V) :
       c  P.constraints,
        v = (FABL.maxCutConstraintScope c) 0 
          v = (FABL.maxCutConstraintScope c) 1
    Every declared vertex of a Max-Cut instance is incident to some edge. 
  • defdefined in FABL/Chapter07/CSPExamples.lean
    complete
    def FABL.twoVertexMaxCutConstraint :
      FABL.CSPConstraint FABL.maxCutTemplate (Fin 2)
    def FABL.twoVertexMaxCutConstraint :
      FABL.CSPConstraint FABL.maxCutTemplate
        (Fin 2)
    The canonical two-vertex Max-Cut edge. 
  • defdefined in FABL/Chapter07/CSPExamples.lean
    complete
    def FABL.parallelEdgeMaxCutInstance :
      FABL.CSPInstance FABL.maxCutTemplate (Fin 2)
    def FABL.parallelEdgeMaxCutInstance :
      FABL.CSPInstance FABL.maxCutTemplate
        (Fin 2)
    A Max-Cut instance containing two parallel copies of the same edge. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.parallelEdgeMaxCutInstance_card :
      FABL.parallelEdgeMaxCutInstance.constraints.card = 2
    theorem FABL.parallelEdgeMaxCutInstance_card :
      FABL.parallelEdgeMaxCutInstance.constraints.card =
        2
Definition7.3.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.
uses 1
Used by 4
Reverse dependency previews
Preview
Lemma 7.3.7
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 7.26. An assignment is a map F:V\to\Omega. A constraint (S,\psi) is satisfied exactly when \psi(F(S))=1. Its value and the instance optimum are \operatorname{Val}_P(F) =\mathbb E_{(S,\psi)\sim P}[\psi(F(S))], \tag{7.3} \operatorname{Opt}(P)=\max_{F:V\to\Omega}\operatorname{Val}_P(F). The instance is satisfiable when \operatorname{Opt}(P)=1.

Lean code for Definition7.3.614 declarations
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPConstraint.Satisfied.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) : Prop
    def FABL.CSPConstraint.Satisfied.{u, v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) : Prop
    An assignment satisfies a constraint when its predicate evaluates to true. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPConstraint.satisfiedIndicator.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) : 
    def FABL.CSPConstraint.satisfiedIndicator.{u,
        v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) : 
    Indicator of a satisfied constraint. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPConstraint.unsatisfiedIndicator.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) : 
    def FABL.CSPConstraint.unsatisfiedIndicator.{u,
        v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (c : FABL.CSPConstraint Ψ V)
      (assignment : V  D) : 
    Indicator of an unsatisfied constraint. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPInstance.satisfiedCount.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) : 
    def FABL.CSPInstance.satisfiedCount.{u, v,
        u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) : 
    Number of satisfied constraints, including multiplicity. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPInstance.unsatisfiedCost.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) : 
    def FABL.CSPInstance.unsatisfiedCost.{u, v,
        u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) : 
    Number of unsatisfied constraints, expressed through Mathlib's `ValuedCSP` evaluator. 
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.CSPInstance.satisfiedCount_add_unsatisfiedCost.{u, v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D} {V : Type v}
      (P : FABL.CSPInstance Ψ V) (assignment : V  D) :
      P.satisfiedCount assignment + P.unsatisfiedCost assignment =
        P.constraints.card
    theorem FABL.CSPInstance.satisfiedCount_add_unsatisfiedCost.{u,
        v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) :
      P.satisfiedCount assignment +
          P.unsatisfiedCost assignment =
        P.constraints.card
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPInstance.value.{u, v, u_1} {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} (P : FABL.CSPInstance Ψ V) (assignment : V  D) : 
    def FABL.CSPInstance.value.{u, v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) : 
    O'Donnell, Definition 7.26: the fraction of constraints satisfied by an assignment. 
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.CSPInstance.value_eq_one_sub_unsatisfiedCost_div.{u, v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D} {V : Type v}
      (P : FABL.CSPInstance Ψ V) (assignment : V  D) :
      P.value assignment =
        1 - (P.unsatisfiedCost assignment) / P.constraints.card
    theorem FABL.CSPInstance.value_eq_one_sub_unsatisfiedCost_div.{u,
        v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) :
      P.value assignment =
        1 -
          (P.unsatisfiedCost assignment) /
            P.constraints.card
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPInstance.optimalAssignment.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) : V  D
    def FABL.CSPInstance.optimalAssignment.{u, v,
        u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) :
      V  D
    A maximizing assignment, whose existence is supplied by finite extrema. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPInstance.optimum.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) : 
    def FABL.CSPInstance.optimum.{u, v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) :
      
    O'Donnell, Definition 7.26: maximum value over all assignments. 
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.CSPInstance.optimum_nonneg.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) : 0  P.optimum
    theorem FABL.CSPInstance.optimum_nonneg.{u, v,
        u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) :
      0  P.optimum
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.CSPInstance.value_le_optimum.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) (assignment : V  D) :
      P.value assignment  P.optimum
    theorem FABL.CSPInstance.value_le_optimum.{u, v,
        u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V)
      (assignment : V  D) :
      P.value assignment  P.optimum
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.CSPInstance.Satisfiable.{u, v, u_1} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) : Prop
    def FABL.CSPInstance.Satisfiable.{u, v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) :
      Prop
    An instance is satisfiable when its optimum value is one. 
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.CSPInstance.satisfiable_iff_exists_fullySatisfied.{u, v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D} {V : Type v} [Finite D]
      [Nonempty D] [Finite V] (P : FABL.CSPInstance Ψ V) :
      P.Satisfiable   assignment, P.FullySatisfied assignment
    theorem FABL.CSPInstance.satisfiable_iff_exists_fullySatisfied.{u,
        v, u_1}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v} [Finite D] [Nonempty D]
      [Finite V] (P : FABL.CSPInstance Ψ V) :
      P.Satisfiable 
         assignment,
          P.FullySatisfied assignment
Lemma7.3.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.
uses 1used by 0XL∃∀N

Remark 7.27. Variable names and their assigned values are distinct objects. Thus a constraint is evaluated using F(x_i), not by silently identifying x_i with a domain element.

Definition7.3.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.
uses 1
Used by 3
Reverse dependency previews
Preview
Theorem 7.3.12
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 7.28. Max-CSP(\Psi) is the optimization task which, on input a valid instance P, outputs an assignment having as large a value \operatorname{Val}_P as possible.

Lean code for Definition7.3.81 definition
  • structure(5 fields)defined in FABL/Chapter07/Complexity.lean
    complete
    structure FABL.EncodedMaximizationProblem : Type
    structure FABL.EncodedMaximizationProblem : Type
    A maximization problem presented at the binary encoding boundary. Mathematical CSP values
    remain in `CSP.lean`; an application supplies the concrete encoders and the following semantics. 
    instances : Language Bool
    Well-formed encoded instances. 
    Feasible : List Bool  List Bool  Prop
    Feasibility relation between an instance and an encoded solution. 
    value : List Bool  List Bool  
    Objective value of an encoded solution. 
    optimum : List Bool  
    Optimum objective value of an encoded instance. 
    value_le_optimum :  {input solution : List Bool},
      input  self.instances  self.Feasible input solution  self.value input solution  self.optimum input
    Feasible solutions never exceed the stated optimum. 
Theorem7.3.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
Definition 7.2.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1L∃∀N

Finite CSPs and finite uniformly randomized string testers are equivalent. Sampling a uniform constraint of an arity-r CSP and checking its predicate gives an r-query tester satisfying \Pr[T\text{ accepts }F]=\operatorname{Val}_P(F). Conversely, enumerating every random seed of a tester whose seed space is finite and uniform and whose query tuple is injective gives a CSP instance with the same acceptance value. General real-valued seed probabilities and repeated query positions require, respectively, weighted constraints and the duplicate-scope repair of Exercise 7.31; they are not silently coerced to an unweighted CSP.

Lean code for Theorem7.3.95 declarations
  • structure(6 fields)defined in FABL/Chapter07/CSP.lean
    complete
    structure FABL.UniformStringTester.{u, v, u_1, u_2} {D : Type u}
      (Ψ : FABL.CSPTemplate D) (V : Type v) :
      Type (max (max (u_1 + 1) u_2) v)
    structure FABL.UniformStringTester.{u, v, u_1, u_2}
      {D : Type u} (Ψ : FABL.CSPTemplate D)
      (V : Type v) :
      Type (max (max (u_1 + 1) u_2) v)
    A finite uniform string tester whose queries are distinct and collectively cover its declared
    variables. These are exactly the hypotheses needed for the tester-to-CSP direction under
    Definition 7.24. 
    Seed : Type u_1
    Uniform finite random seed. 
    fintypeSeed : Fintype self.Seed
    The seed space is finite. 
    nonemptySeed : Nonempty self.Seed
    A uniform seed can be drawn. 
    predicate : self.Seed  Ψ.Predicate
    Predicate selected by a seed. 
    scope : (seed : self.Seed)  Fin (Ψ.arity (self.predicate seed))  V
    Ordered tuple of distinct queries selected by a seed. 
    covers :  (variableName : V),  seed, variableName  Set.range (self.scope seed)
    Every declared string coordinate is queried for at least one seed. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.UniformStringTester.constraint.{u, v, u_1, u_2} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v}
      (T : FABL.UniformStringTester Ψ V) (seed : T.Seed) :
      FABL.CSPConstraint Ψ V
    def FABL.UniformStringTester.constraint.{u, v,
        u_1, u_2}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (T : FABL.UniformStringTester Ψ V)
      (seed : T.Seed) : FABL.CSPConstraint Ψ V
    Constraint selected by a tester seed. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.UniformStringTester.toCSPInstance.{u, v, u_1, u_2} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v}
      (T : FABL.UniformStringTester Ψ V) : FABL.CSPInstance Ψ V
    def FABL.UniformStringTester.toCSPInstance.{u,
        v, u_1, u_2}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (T : FABL.UniformStringTester Ψ V) :
      FABL.CSPInstance Ψ V
    Enumerating the uniform seeds produces a genuine CSP multiset, retaining duplicate
    constraints when different seeds make the same test. 
  • defdefined in FABL/Chapter07/CSP.lean
    complete
    def FABL.UniformStringTester.acceptance.{u, v, u_1, u_2} {D : Type u}
      {Ψ : FABL.CSPTemplate D} {V : Type v}
      (T : FABL.UniformStringTester Ψ V) (assignment : V  D) : 
    def FABL.UniformStringTester.acceptance.{u, v,
        u_1, u_2}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (T : FABL.UniformStringTester Ψ V)
      (assignment : V  D) : 
    Acceptance probability of a finite uniform tester on a fixed assignment. 
  • theoremdefined in FABL/Chapter07/CSP.lean
    complete
    theorem FABL.UniformStringTester.acceptance_eq_value.{u, v, u_1, u_2}
      {D : Type u} {Ψ : FABL.CSPTemplate D} {V : Type v}
      (T : FABL.UniformStringTester Ψ V) (assignment : V  D) :
      T.acceptance assignment = T.toCSPInstance.value assignment
    theorem FABL.UniformStringTester.acceptance_eq_value.{u,
        v, u_1, u_2}
      {D : Type u} {Ψ : FABL.CSPTemplate D}
      {V : Type v}
      (T : FABL.UniformStringTester Ψ V)
      (assignment : V  D) :
      T.acceptance assignment =
        T.toCSPInstance.value assignment
    The tester's acceptance probability is exactly the value of its associated CSP assignment. 
Lemma7.3.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 3
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.29. The PCPP of Example 7.15 is a Max-3-Lin instance on 2n-1 variables. The BLR tester is a Max-3-Lin instance on the 2^n truth-table variables, with equations F(x)+F(y)+F(x+y)=0. When a displayed equation repeats a variable, equal variables are first cancelled over \mathbb F_2, producing an equivalent constraint of arity at most three with an injective scope.

The compiled BLR instance retains all 2^n truth-table variables for n\ge2. In dimensions zero and one, cancellation makes nonzero truth-table coordinates isolated, so they must be removed before imposing Definition 7.24's participation invariant; this endpoint is recorded rather than represented by a false coverage proof.

Lean code for Lemma7.3.1022 declarations
  • structure(2 fields)defined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    structure FABL.MaxThreeLinPredicate : Type
    structure FABL.MaxThreeLinPredicate : Type
    An affine equation over `𝔽₂` with at most three distinct variables. 
    arityIndex : Fin 4
    Number of variables occurring in the equation. 
    rhs : FABL.𝔽₂
    Right-hand side of the equation. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.maxAtMostThreeLinTemplate : FABL.CSPTemplate FABL.𝔽₂
    def FABL.maxAtMostThreeLinTemplate :
      FABL.CSPTemplate FABL.𝔽₂
    The mixed-arity Max-3-Lin template used by Example 7.29. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.maxArity_maxAtMostThreeLinTemplate :
      FABL.maxAtMostThreeLinTemplate.maxArity = 3
    theorem FABL.maxArity_maxAtMostThreeLinTemplate :
      FABL.maxAtMostThreeLinTemplate.maxArity =
        3
  • abbrevdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    abbrev FABL.OddWeightPartialSumVariable (m : ) : Type
    abbrev FABL.OddWeightPartialSumVariable (m : ) :
      Type
    The `2(m+2)-1` input-and-proof variables of Example 7.15. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.oddWeightPartialSumCSPPredicate {m : }
      (seed : FABL.OddWeightPartialSumCheckSeed m) :
      FABL.MaxThreeLinPredicate
    def FABL.oddWeightPartialSumCSPPredicate
      {m : }
      (seed :
        FABL.OddWeightPartialSumCheckSeed m) :
      FABL.MaxThreeLinPredicate
    Predicate selected by an endpoint or recurrence check of Example 7.15. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.oddWeightPartialSumCSPScope {m : }
      (seed : FABL.OddWeightPartialSumCheckSeed m) :
      Fin
          (FABL.maxAtMostThreeLinTemplate.arity
            (FABL.oddWeightPartialSumCSPPredicate seed)) 
        FABL.OddWeightPartialSumVariable m
    def FABL.oddWeightPartialSumCSPScope {m : }
      (seed :
        FABL.OddWeightPartialSumCheckSeed m) :
      Fin
          (FABL.maxAtMostThreeLinTemplate.arity
            (FABL.oddWeightPartialSumCSPPredicate
              seed)) 
        FABL.OddWeightPartialSumVariable m
    The distinct variables used by an endpoint or recurrence equation of Example 7.15. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.oddWeightPartialSumUniformStringTester (m : ) :
      FABL.UniformStringTester FABL.maxAtMostThreeLinTemplate
        (FABL.OddWeightPartialSumVariable m)
    def FABL.oddWeightPartialSumUniformStringTester
      (m : ) :
      FABL.UniformStringTester
        FABL.maxAtMostThreeLinTemplate
        (FABL.OddWeightPartialSumVariable m)
    The uniform constraint tester underlying Example 7.15. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.oddWeightPartialSumCSPAssignment {m : } (w : Fin (m + 2)  Bool)
      (proof : Fin (m + 1)  Bool) :
      FABL.OddWeightPartialSumVariable m  FABL.𝔽₂
    def FABL.oddWeightPartialSumCSPAssignment
      {m : } (w : Fin (m + 2)  Bool)
      (proof : Fin (m + 1)  Bool) :
      FABL.OddWeightPartialSumVariable m 
        FABL.𝔽₂
    Interpret an input and proof as the `𝔽₂` assignment used by the Max-3-Lin instance. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.oddWeightPartialSumCSPPredicate_eval {m : }
      (seed : FABL.OddWeightPartialSumCheckSeed m) (w : Fin (m + 2)  Bool)
      (proof : Fin (m + 1)  Bool) :
      FABL.maxAtMostThreeLinTemplate.eval
          (FABL.oddWeightPartialSumCSPPredicate seed)
          (FABL.oddWeightPartialSumCSPAssignment w proof 
            (FABL.oddWeightPartialSumCSPScope seed)) =
        decide (FABL.OddWeightPartialSumCheckHolds seed w proof)
    theorem FABL.oddWeightPartialSumCSPPredicate_eval
      {m : }
      (seed :
        FABL.OddWeightPartialSumCheckSeed m)
      (w : Fin (m + 2)  Bool)
      (proof : Fin (m + 1)  Bool) :
      FABL.maxAtMostThreeLinTemplate.eval
          (FABL.oddWeightPartialSumCSPPredicate
            seed)
          (FABL.oddWeightPartialSumCSPAssignment
              w proof 
            (FABL.oddWeightPartialSumCSPScope
                seed)) =
        decide
          (FABL.OddWeightPartialSumCheckHolds
            seed w proof)
    Every Max-3-Lin constraint is exactly the corresponding endpoint or recurrence check. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.card_oddWeightPartialSumVariable (m : ) :
      Fintype.card (FABL.OddWeightPartialSumVariable m) = 2 * (m + 2) - 1
    theorem FABL.card_oddWeightPartialSumVariable
      (m : ) :
      Fintype.card
          (FABL.OddWeightPartialSumVariable
            m) =
        2 * (m + 2) - 1
    The CSP attached to Example 7.15 has exactly `2n-1` variables when `n=m+2`. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.oddWeightPartialSumUniformStringTester_acceptance_eq_value {m : }
      (w : Fin (m + 2)  Bool) (proof : Fin (m + 1)  Bool) :
      (FABL.oddWeightPartialSumUniformStringTester m).acceptance
          (FABL.oddWeightPartialSumCSPAssignment w proof) =
        (FABL.oddWeightPartialSumUniformStringTester m).toCSPInstance.value
          (FABL.oddWeightPartialSumCSPAssignment w proof)
    theorem FABL.oddWeightPartialSumUniformStringTester_acceptance_eq_value
      {m : } (w : Fin (m + 2)  Bool)
      (proof : Fin (m + 1)  Bool) :
      (FABL.oddWeightPartialSumUniformStringTester
              m).acceptance
          (FABL.oddWeightPartialSumCSPAssignment
            w proof) =
        (FABL.oddWeightPartialSumUniformStringTester
                m).toCSPInstance.value
          (FABL.oddWeightPartialSumCSPAssignment
            w proof)
    Enumerating Example 7.15's checks produces a Max-3-Lin instance with the same value. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.oddWeightPartialSumUniformStringTester_acceptance_eq_expect {m : }
      (w : Fin (m + 2)  Bool) (proof : Fin (m + 1)  Bool) :
      (FABL.oddWeightPartialSumUniformStringTester m).acceptance
          (FABL.oddWeightPartialSumCSPAssignment w proof) =
        Finset.univ.expect fun seed =>
          if FABL.OddWeightPartialSumCheckHolds seed w proof then 1 else 0
    theorem FABL.oddWeightPartialSumUniformStringTester_acceptance_eq_expect
      {m : } (w : Fin (m + 2)  Bool)
      (proof : Fin (m + 1)  Bool) :
      (FABL.oddWeightPartialSumUniformStringTester
              m).acceptance
          (FABL.oddWeightPartialSumCSPAssignment
            w proof) =
        Finset.univ.expect fun seed =>
          if
              FABL.OddWeightPartialSumCheckHolds
                seed w proof then
            1
          else 0
    The uniform CSP acceptance integrand is exactly the PCPP's endpoint/recurrence predicate. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.blrQueryTriple {n : } (x y : FABL.F₂Cube n) :
      Fin 3  FABL.F₂Cube n
    def FABL.blrQueryTriple {n : }
      (x y : FABL.F₂Cube n) :
      Fin 3  FABL.F₂Cube n
    The three BLR query positions before repeated variables are cancelled. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.BLRQueriesCollide {n : } (x y : FABL.F₂Cube n) : Prop
    def FABL.BLRQueriesCollide {n : }
      (x y : FABL.F₂Cube n) : Prop
    Exactly the cases in which the three BLR query positions are not distinct. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.blrCSPConstraint {n : } (x y : FABL.F₂Cube n) :
      FABL.CSPConstraint FABL.maxAtMostThreeLinTemplate (FABL.F₂Cube n)
    def FABL.blrCSPConstraint {n : }
      (x y : FABL.F₂Cube n) :
      FABL.CSPConstraint
        FABL.maxAtMostThreeLinTemplate
        (FABL.F₂Cube n)
    The injective affine constraint obtained by cancelling repeated BLR query variables. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.blrCSPPredicate {n : } (x y : FABL.F₂Cube n) :
      FABL.MaxThreeLinPredicate
    def FABL.blrCSPPredicate {n : }
      (x y : FABL.F₂Cube n) :
      FABL.MaxThreeLinPredicate
    Predicate selected after BLR collision cancellation. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.blrCSPScope {n : } (x y : FABL.F₂Cube n) :
      Fin
          (FABL.maxAtMostThreeLinTemplate.arity
            (FABL.blrCSPPredicate x y)) 
        FABL.F₂Cube n
    def FABL.blrCSPScope {n : }
      (x y : FABL.F₂Cube n) :
      Fin
          (FABL.maxAtMostThreeLinTemplate.arity
            (FABL.blrCSPPredicate x y)) 
        FABL.F₂Cube n
    Injective scope selected after BLR collision cancellation. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.blrCSPPredicate_eval {n : } (f : FABL.F₂Cube n  FABL.𝔽₂)
      (x y : FABL.F₂Cube n) :
      FABL.maxAtMostThreeLinTemplate.eval (FABL.blrCSPPredicate x y)
          (f  (FABL.blrCSPScope x y)) =
        decide (FABL.blrAccepts f x y)
    theorem FABL.blrCSPPredicate_eval {n : }
      (f : FABL.F₂Cube n  FABL.𝔽₂)
      (x y : FABL.F₂Cube n) :
      FABL.maxAtMostThreeLinTemplate.eval
          (FABL.blrCSPPredicate x y)
          (f  (FABL.blrCSPScope x y)) =
        decide (FABL.blrAccepts f x y)
    Evaluating the cancelled injective constraint is equivalent to the original BLR equation. 
  • defdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    def FABL.blrUniformStringTester (n : ) (hn : 2  n) :
      FABL.UniformStringTester FABL.maxAtMostThreeLinTemplate
        (FABL.F₂Cube n)
    def FABL.blrUniformStringTester (n : )
      (hn : 2  n) :
      FABL.UniformStringTester
        FABL.maxAtMostThreeLinTemplate
        (FABL.F₂Cube n)
    For `n≥2`, cancellation still leaves every truth-table variable in some BLR constraint. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.card_blrTruthTableVariables (n : ) :
      Fintype.card (FABL.F₂Cube n) = 2 ^ n
    theorem FABL.card_blrTruthTableVariables (n : ) :
      Fintype.card (FABL.F₂Cube n) = 2 ^ n
    The BLR CSP has one truth-table variable for each point of `𝔽₂ⁿ`. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.blrUniformStringTester_acceptance_eq_value {n : } (hn : 2  n)
      (f : FABL.F₂Cube n  FABL.𝔽₂) :
      (FABL.blrUniformStringTester n hn).acceptance f =
        (FABL.blrUniformStringTester n hn).toCSPInstance.value f
    theorem FABL.blrUniformStringTester_acceptance_eq_value
      {n : } (hn : 2  n)
      (f : FABL.F₂Cube n  FABL.𝔽₂) :
      (FABL.blrUniformStringTester n
              hn).acceptance
          f =
        (FABL.blrUniformStringTester n
                hn).toCSPInstance.value
          f
    The cancelled BLR tester's acceptance is exactly its Max-3-Lin instance value. 
  • theoremdefined in FABL/Chapter07/CSPTesterExamples.lean
    complete
    theorem FABL.blrUniformStringTester_acceptance_eq_expect {n : } (hn : 2  n)
      (f : FABL.F₂Cube n  FABL.𝔽₂) :
      (FABL.blrUniformStringTester n hn).acceptance f =
        Finset.univ.expect fun x =>
          Finset.univ.expect fun y => if FABL.blrAccepts f x y then 1 else 0
    theorem FABL.blrUniformStringTester_acceptance_eq_expect
      {n : } (hn : 2  n)
      (f : FABL.F₂Cube n  FABL.𝔽₂) :
      (FABL.blrUniformStringTester n
              hn).acceptance
          f =
        Finset.univ.expect fun x =>
          Finset.univ.expect fun y =>
            if FABL.blrAccepts f x y then 1
            else 0
    The finite uniform acceptance integrand of the CSP is the named BLR acceptance predicate. 
Definition7.3.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.
uses 1
Used by 8
Reverse dependency previews
Preview
Theorem 7.3.12
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Circuit-Sat is the decision problem which, given a finite encoding of a Boolean circuit C, asks whether there is an input w satisfying C(w)=1. A problem is NP-hard in this chapter when Circuit-Sat admits a polynomial-time many-one reduction to it; ordinary computable many-one reducibility is not sufficient.

Lean code for Definition7.3.116 declarations
  • structure(2 fields)defined in FABL/Chapter07/Complexity.lean
    complete
    structure FABL.PolytimeMap : Type 1
    structure FABL.PolytimeMap : Type 1
    A total binary-string map accompanied by a CSLib single-tape polynomial-time computation. 
    toFun : List Bool  List Bool
    Extensional function computed by the machine. 
    computation : Cslib.Turing.SingleTapeTM.PolyTimeComputable self.toFun
    CSLib computation and polynomial runtime certificate. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.PolytimeMap.id : FABL.PolytimeMap
    def FABL.PolytimeMap.id : FABL.PolytimeMap
    The identity binary-string map. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.PolytimeMap.comp (g f : FABL.PolytimeMap) : FABL.PolytimeMap
    def FABL.PolytimeMap.comp
      (g f : FABL.PolytimeMap) :
      FABL.PolytimeMap
    Composition of polynomial-time binary-string maps, using CSLib's machine composition after
    replacing the second runtime bound by its monotone polynomial majorant. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.KarpReducible (source target : Language Bool) : Prop
    def FABL.KarpReducible
      (source target : Language Bool) : Prop
    Polynomial-time many-one (Karp) reducibility between binary languages. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.KarpReducible.refl (language : Language Bool) :
      language ≤ₖ language
    theorem FABL.KarpReducible.refl
      (language : Language Bool) :
      language ≤ₖ language
    Karp reducibility is reflexive. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.KarpReducible.trans {first second third : Language Bool}
      (h₁₂ : first ≤ₖ second) (h₂₃ : second ≤ₖ third) : first ≤ₖ third
    theorem FABL.KarpReducible.trans
      {first second third : Language Bool}
      (h₁₂ : first ≤ₖ second)
      (h₂₃ : second ≤ₖ third) : first ≤ₖ third
    Karp reductions compose. 
Theorem7.3.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.
Statement uses 2
Statement dependency previews
Preview
Definition 7.3.8
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1XL∃∀N

Theorem 7.30. Computing a maximum cut in a finite graph is NP-hard.

The reduction is quoted rather than proved in the book and supplies no assumption to the production library.

Definition7.3.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.
uses 1
Used by 15
Reverse dependency previews
Preview
Lemma 7.3.14
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
L∃∀N

Definition 7.31. For 0\le\alpha\le\beta\le1, an algorithm A is an (\alpha,\beta)-approximation for Max-CSP(\Psi) when every input instance satisfying \operatorname{Opt}(P)\ge\beta is mapped to an assignment of value at least \alpha. For a randomized algorithm, the expected value of the output assignment must be at least \alpha.

Encoded objectives are rational, while the analytic constants used by the long-code reduction may be arbitrary real numbers. The formal promise boundary therefore compares the rational optimum after coercion to real thresholds; it does not require those thresholds to be rational. The associated IsThresholdApproximation is deterministic; the book's randomized expected-output variant still requires an explicit randomized machine semantics and is not inferred from PolytimeMap.

Lean code for Definition7.3.1314 declarations
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.PolytimeMap.IsThresholdApproximation (algorithm : FABL.PolytimeMap)
      (problem : FABL.EncodedMaximizationProblem)
      (outputThreshold optimumThreshold : ) : Prop
    def FABL.PolytimeMap.IsThresholdApproximation
      (algorithm : FABL.PolytimeMap)
      (problem :
        FABL.EncodedMaximizationProblem)
      (outputThreshold optimumThreshold : ) :
      Prop
    An `(outputThreshold, optimumThreshold)` threshold approximation: on each valid instance it
    returns a feasible solution, and whenever the optimum reaches `optimumThreshold`, its output
    value reaches `outputThreshold`. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.PolytimeMap.IsThresholdApproximation.weaken
      {algorithm : FABL.PolytimeMap}
      {problem : FABL.EncodedMaximizationProblem}
      {outputThreshold optimumThreshold weakerOutput weakerOptimum : }
      (h :
        algorithm.IsThresholdApproximation problem outputThreshold
          optimumThreshold)
      (hOutput : weakerOutput  outputThreshold)
      (hOptimum : optimumThreshold  weakerOptimum) :
      algorithm.IsThresholdApproximation problem weakerOutput weakerOptimum
    theorem FABL.PolytimeMap.IsThresholdApproximation.weaken
      {algorithm : FABL.PolytimeMap}
      {problem :
        FABL.EncodedMaximizationProblem}
      {outputThreshold optimumThreshold
        weakerOutput weakerOptimum : }
      (h :
        algorithm.IsThresholdApproximation
          problem outputThreshold
          optimumThreshold)
      (hOutput :
        weakerOutput  outputThreshold)
      (hOptimum :
        optimumThreshold  weakerOptimum) :
      algorithm.IsThresholdApproximation
        problem weakerOutput weakerOptimum
    Threshold guarantees weaken monotonically in the output threshold and antitonically in the
    triggering optimum threshold. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.PolytimeMap.IsThresholdApproximation.value_le_optimum
      {algorithm : FABL.PolytimeMap}
      {problem : FABL.EncodedMaximizationProblem}
      {outputThreshold optimumThreshold : }
      (h :
        algorithm.IsThresholdApproximation problem outputThreshold
          optimumThreshold)
      {input : List Bool} (hinput : input  problem.instances) :
      problem.value input (algorithm.toFun input)  problem.optimum input
    theorem FABL.PolytimeMap.IsThresholdApproximation.value_le_optimum
      {algorithm : FABL.PolytimeMap}
      {problem :
        FABL.EncodedMaximizationProblem}
      {outputThreshold optimumThreshold : }
      (h :
        algorithm.IsThresholdApproximation
          problem outputThreshold
          optimumThreshold)
      {input : List Bool}
      (hinput : input  problem.instances) :
      problem.value input
          (algorithm.toFun input) 
        problem.optimum input
    The value returned by a threshold approximation is bounded by the problem optimum. 
  • structure(3 fields)defined in FABL/Chapter07/Complexity.lean
    complete
    structure FABL.BinaryPromiseProblem : Type
    structure FABL.BinaryPromiseProblem : Type
    A binary promise problem with disjoint yes- and no-instance languages. 
    yesInstances : Language Bool
    Inputs on which the promised answer is yes. 
    noInstances : Language Bool
    Inputs on which the promised answer is no. 
    disjoint : Disjoint self.yesInstances self.noInstances
    No input carries both promised answers. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.PromiseKarpReducible (source target : FABL.BinaryPromiseProblem) :
      Prop
    def FABL.PromiseKarpReducible
      (source target :
        FABL.BinaryPromiseProblem) :
      Prop
    Polynomial-time many-one reducibility between binary promise problems. The reduction must
    preserve both sides of the promise; behavior outside the source promise is unrestricted. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.PromiseKarpReducible.refl (problem : FABL.BinaryPromiseProblem) :
      FABL.PromiseKarpReducible problem problem
    theorem FABL.PromiseKarpReducible.refl
      (problem : FABL.BinaryPromiseProblem) :
      FABL.PromiseKarpReducible problem
        problem
    Promise Karp reducibility is reflexive. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.PromiseKarpReducible.trans
      {first second third : FABL.BinaryPromiseProblem}
      (h₁₂ : FABL.PromiseKarpReducible first second)
      (h₂₃ : FABL.PromiseKarpReducible second third) :
      FABL.PromiseKarpReducible first third
    theorem FABL.PromiseKarpReducible.trans
      {first second third :
        FABL.BinaryPromiseProblem}
      (h₁₂ :
        FABL.PromiseKarpReducible first
          second)
      (h₂₃ :
        FABL.PromiseKarpReducible second
          third) :
      FABL.PromiseKarpReducible first third
    Promise Karp reductions compose. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.PolytimeMap.DistinguishesPromise (decision : FABL.PolytimeMap)
      (problem : FABL.BinaryPromiseProblem) : Prop
    def FABL.PolytimeMap.DistinguishesPromise
      (decision : FABL.PolytimeMap)
      (problem : FABL.BinaryPromiseProblem) :
      Prop
    A polynomial-time one-bit decision map distinguishes a promise problem when it returns
    `[true]` on every yes-instance and `[false]` on every no-instance. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.HasPolytimeDistinguisher (problem : FABL.BinaryPromiseProblem) :
      Prop
    def FABL.HasPolytimeDistinguisher
      (problem : FABL.BinaryPromiseProblem) :
      Prop
    Existence of a polynomial-time distinguisher for a binary promise problem. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.PromiseKarpReducible.hasPolytimeDistinguisher
      {source target : FABL.BinaryPromiseProblem}
      (hreduction : FABL.PromiseKarpReducible source target)
      (hdistinguisher : FABL.HasPolytimeDistinguisher target) :
      FABL.HasPolytimeDistinguisher source
    theorem FABL.PromiseKarpReducible.hasPolytimeDistinguisher
      {source target :
        FABL.BinaryPromiseProblem}
      (hreduction :
        FABL.PromiseKarpReducible source
          target)
      (hdistinguisher :
        FABL.HasPolytimeDistinguisher
          target) :
      FABL.HasPolytimeDistinguisher source
    A promise Karp reduction transports a polynomial-time distinguisher back to its source. 
  • structure(2 fields)defined in FABL/Chapter07/Complexity.lean
    complete
    structure FABL.PolytimeMap.ValueThresholdTest (algorithm : FABL.PolytimeMap)
      (problem : FABL.EncodedMaximizationProblem) (threshold : ) : Type 1
    structure FABL.PolytimeMap.ValueThresholdTest
      (algorithm : FABL.PolytimeMap)
      (problem :
        FABL.EncodedMaximizationProblem)
      (threshold : ) : Type 1
    A supplied polynomial-time implementation of thresholding an approximation algorithm's
    semantic output value. This interface is necessary because a bare rational-valued objective need
    not itself be computable. 
    decision : FABL.PolytimeMap
    Polynomial-time one-bit test. 
    decision_eq :  (input : List Bool), self.decision.toFun input = [decide (threshold  problem.value input (algorithm.toFun input))]
    Exact threshold semantics. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.EncodedMaximizationProblem.gapPromise
      (problem : FABL.EncodedMaximizationProblem)
      (soundness completeness : ) (hgap : soundness < completeness) :
      FABL.BinaryPromiseProblem
    def FABL.EncodedMaximizationProblem.gapPromise
      (problem :
        FABL.EncodedMaximizationProblem)
      (soundness completeness : )
      (hgap : soundness < completeness) :
      FABL.BinaryPromiseProblem
    The promise problem of distinguishing optimum at least `completeness` from optimum at most
    `soundness`. The strict gap makes the two promise sides disjoint. 
  • defdefined in FABL/Chapter07/Complexity.lean
    complete
    def FABL.EncodedMaximizationProblem.gapPromiseReal
      (problem : FABL.EncodedMaximizationProblem)
      (soundness completeness : ) (hgap : soundness < completeness) :
      FABL.BinaryPromiseProblem
    def FABL.EncodedMaximizationProblem.gapPromiseReal
      (problem :
        FABL.EncodedMaximizationProblem)
      (soundness completeness : )
      (hgap : soundness < completeness) :
      FABL.BinaryPromiseProblem
    The same maximization gap with real thresholds, comparing them to the real coercion of the
    rational encoded optimum.  This is the faithful boundary for analytic reductions whose constants
    need not be rational. 
  • theoremdefined in FABL/Chapter07/Complexity.lean
    complete
    theorem FABL.EncodedMaximizationProblem.gapPromiseReal_reducible_of_thresholds
      (problem : FABL.EncodedMaximizationProblem)
      {soundness completeness weakerSoundness weakerCompleteness : }
      (hgap : soundness < completeness)
      (hweakerGap : weakerSoundness < weakerCompleteness)
      (hsoundness : soundness  weakerSoundness)
      (hcompleteness : weakerCompleteness  completeness) :
      FABL.PromiseKarpReducible
        (problem.gapPromiseReal soundness completeness hgap)
        (problem.gapPromiseReal weakerSoundness weakerCompleteness
          hweakerGap)
    theorem FABL.EncodedMaximizationProblem.gapPromiseReal_reducible_of_thresholds
      (problem :
        FABL.EncodedMaximizationProblem)
      {soundness completeness weakerSoundness
        weakerCompleteness : }
      (hgap : soundness < completeness)
      (hweakerGap :
        weakerSoundness < weakerCompleteness)
      (hsoundness :
        soundness  weakerSoundness)
      (hcompleteness :
        weakerCompleteness  completeness) :
      FABL.PromiseKarpReducible
        (problem.gapPromiseReal soundness
          completeness hgap)
        (problem.gapPromiseReal
          weakerSoundness weakerCompleteness
          hweakerGap)
    The identity machine weakens a real-valued encoded maximization gap by raising its soundness
    threshold or lowering its completeness threshold. 
Lemma7.3.14
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
Lemma 6.4.5
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0L∃∀N

Example 7.32. For Max-E3-Lin, output the better of the two constant assignments F\equiv0 and F\equiv1. Every equation is satisfied by exactly one of these assignments, so the better one has value at least 1/2; this is a (1/2,\beta)-approximation for every \beta. Gaussian elimination gives a (1,1)-approximation for Max-r-Lin.

The associated declarations verify the exact finite comparison of the two constant assignments. For general Max-r-Lin they transport every scoped constraint to Chapter 6's executable \mathbb F_2 row representation, reuse its forward elimination and back substitution, and prove both the returned assignment's correctness and the cubic charged-operation bound. Turning this finite algorithm into a CSLib machine remains explicitly conditional on a chosen binary encoding; no encoding-independent polynomial-time claim is manufactured.

Lean code for Lemma7.3.1421 declarations
  • defdefined in FABL/Chapter07/CSPExamples.lean
    complete
    def FABL.e3LinConstantAssignment.{u} {V : Type u} (b : FABL.𝔽₂) :
      V  FABL.𝔽₂
    def FABL.e3LinConstantAssignment.{u}
      {V : Type u} (b : FABL.𝔽₂) : V  FABL.𝔽₂
    The constant assignment with label `b`. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.satisfiedIndicator_e3LinConstantAssignment.{u} {V : Type u}
      (c : FABL.CSPConstraint FABL.maxE3LinTemplate V) (b : FABL.𝔽₂) :
      c.satisfiedIndicator (FABL.e3LinConstantAssignment b) =
        if c.predicate = b then 1 else 0
    theorem FABL.satisfiedIndicator_e3LinConstantAssignment.{u}
      {V : Type u}
      (c :
        FABL.CSPConstraint
          FABL.maxE3LinTemplate V)
      (b : FABL.𝔽₂) :
      c.satisfiedIndicator
          (FABL.e3LinConstantAssignment b) =
        if c.predicate = b then 1 else 0
    A constant Max-E3-Lin assignment satisfies exactly the constraints whose right-hand side is
    that constant. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.satisfiedIndicator_zero_add_one_e3Lin.{u} {V : Type u}
      (c : FABL.CSPConstraint FABL.maxE3LinTemplate V) :
      c.satisfiedIndicator (FABL.e3LinConstantAssignment 0) +
          c.satisfiedIndicator (FABL.e3LinConstantAssignment 1) =
        1
    theorem FABL.satisfiedIndicator_zero_add_one_e3Lin.{u}
      {V : Type u}
      (c :
        FABL.CSPConstraint
          FABL.maxE3LinTemplate V) :
      c.satisfiedIndicator
            (FABL.e3LinConstantAssignment 0) +
          c.satisfiedIndicator
            (FABL.e3LinConstantAssignment 1) =
        1
    For every three-variable linear equation, exactly one of the all-zero and all-one
    assignments satisfies it. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.satisfiedCount_zero_add_one_e3Lin.{u} {V : Type u}
      (P : FABL.CSPInstance FABL.maxE3LinTemplate V) :
      P.satisfiedCount (FABL.e3LinConstantAssignment 0) +
          P.satisfiedCount (FABL.e3LinConstantAssignment 1) =
        P.constraints.card
    theorem FABL.satisfiedCount_zero_add_one_e3Lin.{u}
      {V : Type u}
      (P :
        FABL.CSPInstance FABL.maxE3LinTemplate
          V) :
      P.satisfiedCount
            (FABL.e3LinConstantAssignment 0) +
          P.satisfiedCount
            (FABL.e3LinConstantAssignment 1) =
        P.constraints.card
    Across an instance, the satisfaction counts of the all-zero and all-one assignments sum to
    the number of constraints. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.exists_constantAssignment_value_ge_half_e3Lin.{u} {V : Type u}
      (P : FABL.CSPInstance FABL.maxE3LinTemplate V) :
       b, 1 / 2  P.value (FABL.e3LinConstantAssignment b)
    theorem FABL.exists_constantAssignment_value_ge_half_e3Lin.{u}
      {V : Type u}
      (P :
        FABL.CSPInstance FABL.maxE3LinTemplate
          V) :
       b,
        1 / 2 
          P.value
            (FABL.e3LinConstantAssignment b)
    One of the two constant assignments has value at least one half. 
  • defdefined in FABL/Chapter07/CSPExamples.lean
    complete
    def FABL.betterE3LinConstantLabel.{u} {V : Type u}
      (P : FABL.CSPInstance FABL.maxE3LinTemplate V) : FABL.𝔽₂
    def FABL.betterE3LinConstantLabel.{u}
      {V : Type u}
      (P :
        FABL.CSPInstance FABL.maxE3LinTemplate
          V) :
      FABL.𝔽₂
    Label of the better of the all-zero and all-one assignments. 
  • defdefined in FABL/Chapter07/CSPExamples.lean
    complete
    def FABL.betterE3LinConstantAssignment.{u} {V : Type u}
      (P : FABL.CSPInstance FABL.maxE3LinTemplate V) : V  FABL.𝔽₂
    def FABL.betterE3LinConstantAssignment.{u}
      {V : Type u}
      (P :
        FABL.CSPInstance FABL.maxE3LinTemplate
          V) :
      V  FABL.𝔽₂
    The constant assignment selected by comparing the two objective values. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.betterE3LinConstantAssignment_value_ge_half.{u} {V : Type u}
      (P : FABL.CSPInstance FABL.maxE3LinTemplate V) :
      1 / 2  P.value (FABL.betterE3LinConstantAssignment P)
    theorem FABL.betterE3LinConstantAssignment_value_ge_half.{u}
      {V : Type u}
      (P :
        FABL.CSPInstance FABL.maxE3LinTemplate
          V) :
      1 / 2 
        P.value
          (FABL.betterE3LinConstantAssignment
            P)
    The explicit better-constant assignment attains value at least one half. 
  • theoremdefined in FABL/Chapter07/CSPExamples.lean
    complete
    theorem FABL.half_le_optimum_maxE3Lin.{u} {V : Type u} [Finite V]
      (P : FABL.CSPInstance FABL.maxE3LinTemplate V) : 1 / 2  P.optimum
    theorem FABL.half_le_optimum_maxE3Lin.{u}
      {V : Type u} [Finite V]
      (P :
        FABL.CSPInstance FABL.maxE3LinTemplate
          V) :
      1 / 2  P.optimum
    Example 7.32: every Max-E3-Lin instance has optimum at least one half, witnessed by an
    all-zero or all-one assignment. 
  • structure(3 fields)defined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    structure FABL.MaxLinearPredicate (r : ) : Type
    structure FABL.MaxLinearPredicate (r : ) : Type
    A positive arity at most `r`, together with the right-hand side of a binary linear equation. 
    arityIndex : Fin (r + 1)
    Arity, represented as a natural strictly below `r + 1`. 
    arity_pos : 0 < self.arityIndex
    Linear constraints contain at least one variable. 
    rhs : FABL.𝔽₂
    Right-hand side of the equation. 
  • defdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    def FABL.maxLinearTemplate (r : ) : FABL.CSPTemplate FABL.𝔽₂
    def FABL.maxLinearTemplate (r : ) :
      FABL.CSPTemplate FABL.𝔽₂
    The finite family of all positive-arity binary linear equations using at most `r` distinct
    variables. 
  • defdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    def FABL.CSPConstraint.toF₂LinearEquation.{u} {r : } {V : Type u}
      [DecidableEq V]
      (constraint : FABL.CSPConstraint (FABL.maxLinearTemplate r) V) :
      FABL.F₂LinearEquation V
    def FABL.CSPConstraint.toF₂LinearEquation.{u}
      {r : } {V : Type u} [DecidableEq V]
      (constraint :
        FABL.CSPConstraint
          (FABL.maxLinearTemplate r) V) :
      FABL.F₂LinearEquation V
    Global linear equation obtained from a scoped Max-`r`-Lin constraint. 
  • theoremdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    theorem FABL.CSPConstraint.eval_toF₂LinearEquation.{u} {r : } {V : Type u}
      [Fintype V] [DecidableEq V]
      (constraint : FABL.CSPConstraint (FABL.maxLinearTemplate r) V)
      (assignment : V  FABL.𝔽₂) :
      constraint.toF₂LinearEquation.eval assignment =
         i, assignment (constraint.scope i)
    theorem FABL.CSPConstraint.eval_toF₂LinearEquation.{u}
      {r : } {V : Type u} [Fintype V]
      [DecidableEq V]
      (constraint :
        FABL.CSPConstraint
          (FABL.maxLinearTemplate r) V)
      (assignment : V  FABL.𝔽₂) :
      constraint.toF₂LinearEquation.eval
          assignment =
         i, assignment (constraint.scope i)
    The global equation evaluates to the sum of the assignment on the constraint scope. 
  • theoremdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    theorem FABL.CSPConstraint.isSatisfied_toF₂LinearEquation_iff.{u} {r : }
      {V : Type u} [Fintype V] [DecidableEq V]
      (constraint : FABL.CSPConstraint (FABL.maxLinearTemplate r) V)
      (assignment : V  FABL.𝔽₂) :
      constraint.toF₂LinearEquation.IsSatisfied assignment 
        constraint.Satisfied assignment
    theorem FABL.CSPConstraint.isSatisfied_toF₂LinearEquation_iff.{u}
      {r : } {V : Type u} [Fintype V]
      [DecidableEq V]
      (constraint :
        FABL.CSPConstraint
          (FABL.maxLinearTemplate r) V)
      (assignment : V  FABL.𝔽₂) :
      constraint.toF₂LinearEquation.IsSatisfied
          assignment 
        constraint.Satisfied assignment
    Satisfaction of the transported equation is exactly satisfaction of the original CSP
    constraint. 
  • defdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    def FABL.CSPInstance.linearRows {r : } {V : Type} [DecidableEq V]
      (problem : FABL.CSPInstance (FABL.maxLinearTemplate r) V) :
      List (FABL.F₂LinearEquation V)
    def FABL.CSPInstance.linearRows {r : }
      {V : Type} [DecidableEq V]
      (problem :
        FABL.CSPInstance
          (FABL.maxLinearTemplate r) V) :
      List (FABL.F₂LinearEquation V)
    Row list supplied to Chapter 6's executable Gaussian solver. 
  • theoremdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    theorem FABL.CSPInstance.satisfiesRows_linearRows_iff {r : } {V : Type}
      [Fintype V] [DecidableEq V]
      (problem : FABL.CSPInstance (FABL.maxLinearTemplate r) V)
      (assignment : V  FABL.𝔽₂) :
      FABL.F₂SatisfiesRows problem.linearRows assignment 
        problem.FullySatisfied assignment
    theorem FABL.CSPInstance.satisfiesRows_linearRows_iff
      {r : } {V : Type} [Fintype V]
      [DecidableEq V]
      (problem :
        FABL.CSPInstance
          (FABL.maxLinearTemplate r) V)
      (assignment : V  FABL.𝔽₂) :
      FABL.F₂SatisfiesRows problem.linearRows
          assignment 
        problem.FullySatisfied assignment
    Simultaneous satisfaction of the transported rows is exactly full satisfaction of the CSP
    instance. 
  • defdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    def FABL.CSPInstance.gaussianAssignment {r : } {V : Type} [Fintype V]
      [DecidableEq V] [Encodable V]
      (problem : FABL.CSPInstance (FABL.maxLinearTemplate r) V) :
      V  FABL.𝔽₂
    def FABL.CSPInstance.gaussianAssignment
      {r : } {V : Type} [Fintype V]
      [DecidableEq V] [Encodable V]
      (problem :
        FABL.CSPInstance
          (FABL.maxLinearTemplate r) V) :
      V  FABL.𝔽₂
    Assignment returned by the established Chapter 6 Gaussian solver. 
  • theoremdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    theorem FABL.CSPInstance.gaussianAssignment_fullySatisfied_of_satisfiable
      {r : } {V : Type} [Fintype V] [DecidableEq V] [Encodable V]
      (problem : FABL.CSPInstance (FABL.maxLinearTemplate r) V)
      (hproblem : problem.Satisfiable) :
      problem.FullySatisfied problem.gaussianAssignment
    theorem FABL.CSPInstance.gaussianAssignment_fullySatisfied_of_satisfiable
      {r : } {V : Type} [Fintype V]
      [DecidableEq V] [Encodable V]
      (problem :
        FABL.CSPInstance
          (FABL.maxLinearTemplate r) V)
      (hproblem : problem.Satisfiable) :
      problem.FullySatisfied
        problem.gaussianAssignment
    Gaussian elimination fully satisfies every satisfiable Max-`r`-Lin instance. 
  • theoremdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    theorem FABL.CSPInstance.gaussianAssignment_value_eq_one_of_satisfiable {r : }
      {V : Type} [Fintype V] [DecidableEq V] [Encodable V]
      (problem : FABL.CSPInstance (FABL.maxLinearTemplate r) V)
      (hproblem : problem.Satisfiable) :
      problem.value problem.gaussianAssignment = 1
    theorem FABL.CSPInstance.gaussianAssignment_value_eq_one_of_satisfiable
      {r : } {V : Type} [Fintype V]
      [DecidableEq V] [Encodable V]
      (problem :
        FABL.CSPInstance
          (FABL.maxLinearTemplate r) V)
      (hproblem : problem.Satisfiable) :
      problem.value
          problem.gaussianAssignment =
        1
    Example 7.32: Gaussian elimination is a `(1,1)` Max-`r`-Lin approximation in the exact
    finite semantic sense. 
  • defdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    def FABL.CSPInstance.gaussianEliminationWork {r : } {V : Type} [Fintype V]
      [DecidableEq V] [Encodable V]
      (problem : FABL.CSPInstance (FABL.maxLinearTemplate r) V) : 
    def FABL.CSPInstance.gaussianEliminationWork
      {r : } {V : Type} [Fintype V]
      [DecidableEq V] [Encodable V]
      (problem :
        FABL.CSPInstance
          (FABL.maxLinearTemplate r) V) :
      
    Charged work for dense row construction followed by the same forward elimination and back
    substitution executed by the canonical Chapter 6 solver backend. 
  • theoremdefined in FABL/Chapter07/LinearCSPAlgorithms.lean
    complete
    theorem FABL.CSPInstance.gaussianEliminationWork_le {r : } {V : Type}
      [Fintype V] [DecidableEq V] [Encodable V]
      (problem : FABL.CSPInstance (FABL.maxLinearTemplate r) V) :
      problem.gaussianEliminationWork 
        problem.constraints.card * (Fintype.card V + 1) +
            Fintype.card V * problem.constraints.card *
              (Fintype.card V + 2) +
          Fintype.card V * (Fintype.card V + 1)
    theorem FABL.CSPInstance.gaussianEliminationWork_le
      {r : } {V : Type} [Fintype V]
      [DecidableEq V] [Encodable V]
      (problem :
        FABL.CSPInstance
          (FABL.maxLinearTemplate r) V) :
      problem.gaussianEliminationWork 
        problem.constraints.card *
              (Fintype.card V + 1) +
            Fintype.card V *
                problem.constraints.card *
              (Fintype.card V + 2) +
          Fintype.card V *
            (Fintype.card V + 1)
    Dense row construction, forward elimination, and back substitution obey the displayed
    cubic charged-work bound. 
Theorem7.3.15
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

For every \beta, the Goemans--Williamson semidefinite algorithm is an efficient randomized (.878\beta,\beta)-approximation for Max-Cut.

This external approximation theorem is cited by the book and supplies no assumption to the production library.

Theorem7.3.16
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
Definition 7.3.11
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0XL∃∀N

Theorem 7.33. A (1,1)-approximation for Max-E3-Sat is NP-hard, and so is a (1,1)-approximation for Max-3-Coloring. Exercise 7.13 supplies the Max-E3-Sat reduction; the Max-3-Coloring reduction is external to the chapter.

Theorem7.3.17
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.3.11
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0XL∃∀N

Theorem 7.34. For every fixed \beta\in(1/2,1), an (\beta,\beta)-approximation for Max-E3-Lin is NP-hard, and so is an (\beta,\beta)-approximation for Max-Cut.

These textbook hardness theorems are quoted without proof.

Theorem7.3.18
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 4
Statement dependency previews
Preview
Theorem 7.2.13
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1XL∃∀N

Theorem 7.35. There is a universal constant \delta_0>0 such that an (1-\delta_0,1)-approximation for Max-E3-Sat is NP-hard.

The book sketches the implication from the external PCPP Theorem and the finite reductions in Exercises 7.12 and 7.19. Since the PCPP theorem itself is not proved here, the unconditional hardness claim remains statement-only and supplies no assumption to the production library.