Documentation

CslibFrontier.Computability.Complexity.FineGrained.GapETH

Gap k-SAT exponents and the Gap Exponential Time Hypotheses #

This module formalizes fixed-width gap satisfiability GapKSAT, its deterministic and bounded-error randomized exponential-time rates gapSatExponent and rGapSatExponent, and the deterministic and randomized Gap Exponential Time Hypotheses (GapETH, rGapETH) [Din16], [MR17], [IP01]:

  1. Gap specification (GapKSATSpec, GapKSAT). A parameter record P : GapKSATSpec packages a clause width P.width, a completeness threshold P.completeness, and a soundness threshold P.soundness satisfying 0 ≤ P.soundness < P.completeness ≤ 1. GapKSAT P restricts PromiseProblem.gapMax (fun φ => 1 - φ.unsatVal) to formulas of clause length at most P.width, specializing definitionally at (3, 1, s) (GapKSATSpec.perfectThree) to GapThreeSAT s from CslibFrontier.Computability.PCP.Approximation.MaxThreeSAT.
  2. Threshold MAX-k-SAT and rational-midpoint reduction (MaxKSATThreshold). Choosing a strictly separating rational num / den ∈ (P.soundness, P.completeness) reduces GapKSAT P in polynomial time with zero variable blowup to ofSet (MaxKSATThreshold P.width), even when P.completeness < 1 or the thresholds are irrational. Exhaustive search over 2 ^ n numbered assignments decides MaxKSATThreshold k in time 2 ^ n * poly(L), giving 0 ≤ rGapSatExponent P ≤ gapSatExponent P ≤ 1 for every P : GapKSATSpec.
  3. Hypothesis hierarchy. On perfect-completeness specs GapKSATSpec.perfect k s, any exact k-SAT solver solves the gap problem, yielding the positive implications rGapETH → GapETH → ETH and rGapETH → rETH → ETH, together with threshold invariance of rGapETH across (0, 1 / 2).

Main definitions #

Main results #

References #

1. Gap k-SAT parameter specifications and promise problems #

Parameters (k, c, s) for fixed-width gap satisfiability GapKSAT: clause width bound width, completeness threshold completeness, and soundness threshold soundness, with 0 ≤ soundness < completeness ≤ 1.

  • width : ℕ

    Maximum allowed clause length (k).

  • completeness : ℝ

    Minimum satisfied clause proportion on yes-instances (c).

  • soundness : ℝ

    Maximum satisfied clause proportion on no-instances (s).

  • soundness_nonneg : 0 ≤ self.soundness

    Soundness is nonnegative.

  • soundness_lt_completeness : self.soundness < self.completeness

    Soundness is strictly below completeness (s < c).

  • completeness_le_one : self.completeness ≤ 1

    Completeness is at most 1.

def Cslib.Complexity.GapKSATSpec.perfect (k : ℕ) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s < 1) :

Perfect-completeness gap k-SAT specification (k, 1, s) for 0 ≤ s < 1.

@[reducible, inline]
abbrev Cslib.Complexity.GapKSATSpec.perfectThree (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s < 1) :

Perfect-completeness gap 3-SAT specification (3, 1, s) for 0 ≤ s < 1.

Gap k-SAT (GapKSAT P): distinguish formulas of clause length at most P.width in which some assignment satisfies at least P.completeness of the clauses (1 - φ.unsatVal ≥ P.completeness) from those in which every assignment satisfies at most P.soundness of the clauses (1 - φ.unsatVal ≤ P.soundness).

@[simp]

At (3, 1, s), GapKSAT is definitionally GapThreeSAT s.

Yes-instances of GapKSAT P are ≤ P.width-CNFs with φ.unsatVal ≤ 1 - P.completeness.

No-instances of GapKSAT P are ≤ P.width-CNFs with 1 - P.soundness ≤ φ.unsatVal.

theorem Cslib.Complexity.yes_GapKSAT_perfect (k : ℕ) {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s < 1) :

At perfect completeness 1, the yes-instances of GapKSAT are KSAT k.

theorem Cslib.Complexity.no_GapKSAT_perfect_subset_compl (k : ℕ) {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s < 1) :
(GapKSAT (GapKSATSpec.perfect k s hs0 hs1)).no ⊆ (KSAT k)ᶜ

At perfect completeness 1, every no-instance of GapKSAT is unsatisfiable (∉ KSAT k).

theorem Cslib.Complexity.GapKSAT_subset_of_le {P₁ P₂ : GapKSATSpec} (hw : P₁.width ≤ P₂.width) (hc : P₂.completeness ≤ P₁.completeness) (hs : P₁.soundness ≤ P₂.soundness) :
(GapKSAT P₁).yes ⊆ (GapKSAT P₂).yes ∧ (GapKSAT P₁).no ⊆ (GapKSAT P₂).no

Enlarging clause width (width₁ ≤ width₂) or narrowing the gap (completeness₂ ≤ completeness₁, soundness₁ ≤ soundness₂) enlarges both yes and no, so GapKSAT P₁ reduces via id to GapKSAT P₂.

Width-0 GapKSAT lies in PromiseP for all thresholds 0 ≤ s < c ≤ 1: a width-0 formula consists solely of empty clauses [], so it has value 1 (unsatVal = 0) when empty and value 0 (unsatVal = 1) when nonempty.

2. Threshold MAX-k-SAT and rational-midpoint reduction #

Input to the threshold decision version of MAX-k-SAT: a CNF formula paired with a unary clause-satisfaction threshold cutoff.

  • formula : Logic.PL.CNF ℕ

    Input CNF formula.

  • cutoff : ℕ

    Required minimum number of satisfied clauses (counted with multiplicity).

Instances For
    theorem Cslib.Complexity.encMaxSATThresholdInput_formula_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → MaxSATThresholdInput} :

    Framed encoding of MaxSATThresholdInput (encCNF formula and encUnary cutoff).

    theorem Cslib.Complexity.encMaxSATThresholdInput_cutoff_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → MaxSATThresholdInput} :
    theorem Cslib.Complexity.encMaxSATThresholdInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Logic.PL.CNF ℕ} {T0 S0 x1 T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encCNF T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { formula := x0 x, cutoff := x1 x }) encIn encMaxSATThresholdInput (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
    theorem Cslib.Complexity.encMaxSATThresholdInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Logic.PL.CNF ℕ} {x1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encCNF budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encUnary budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { formula := x0 x, cutoff := x1 x }) encIn encMaxSATThresholdInput budget

    Number of distinct occurring variables of x.formula.

    Threshold MAX-k-SAT (MaxKSATThreshold k): instances (φ, cutoff) where every clause of φ has length at most k and some assignment satisfies at least cutoff clauses (cutoff ≤ φ.length - φ.countUnsat σ).

    Leaf query for exhaustive search on MaxKSATThreshold: formula, cached distinct variables, unary satisfaction cutoff, and binary assignment index.

    • formula : Logic.PL.CNF ℕ

      Input CNF formula.

    • varsList : List ℕ

      Cached duplicate-free variable list (formula.distinctVars).

    • cutoff : ℕ

      Unary minimum satisfied-clause threshold.

    • index : ℕ

      Binary assignment index in 0, …, 2 ^ |varsList| - 1.

    Instances For
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_cutoff_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Leaf} :
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Logic.PL.CNF ℕ} {T0 S0 : γ → ℕ} {x1 : γ → List ℕ} {T1 S1 x2 T2 S2 x3 T3 S3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encCNF T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encUnary T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encNat T3 S3) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { formula := x0 x, varsList := x1 x, cutoff := x2 x, index := x3 x }) encIn encLeaf (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_formula_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Leaf} :
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_formula_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Leaf} :
      Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encLeaf S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).formula) encIn✝ encCNF S✝
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_varsList_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Leaf} :
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_mk_deg :
      Turing.MultiTapeTM.ComputableInDegree (fun (p : Logic.PL.CNF ℕ × List ℕ × ℕ × ℕ) => { formula := p.1, varsList := p.2.1, cutoff := p.2.2.1, index := p.2.2.2 }) encLeafFields encLeaf 1 1
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_index_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Leaf} :
      theorem Cslib.Complexity.MaxSATThresholdSearch.encLeaf_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Logic.PL.CNF ℕ} {x1 : γ → List ℕ} {x2 x3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encCNF budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encUnary budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encNat budget) :
      Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { formula := x0 x, varsList := x1 x, cutoff := x2 x, index := x3 x }) encIn encLeaf budget

      Check whether bitsAssignment q.varsList q.index satisfies at least q.cutoff clauses.

      Threshold MAX-k-SAT by exhaustive search: MaxKSATThreshold k is decidable within time 2 ^ n * poly(L) where n = x.numVars.

      Rational-midpoint reduction from GapKSAT P to MaxKSATThreshold P.width. Choosing a rational num / den strictly inside (P.soundness, P.completeness) and setting cutoff(φ) = ⌊num * |φ| / den⌋ + 1 (or 0 when φ = []) maps yes-instances into MaxKSATThreshold P.width and no-instances into its complement in polynomial time, keeping the underlying formula unchanged ((f φ).numVars = φ.numVars).

      Every GapKSAT P (including imperfect completeness c < 1) is solvable deterministically in time 2 ^ n * poly(L).

      Every GapKSAT P is solvable in randomized time 2 ^ n * poly(L) under any error profile.

      3. Perfect-completeness decision-to-gap transfers #

      At perfect completeness 1, any 2 ^ (δ * n) * poly(L) decider (δ ≥ 0) for KSAT k solves GapKSAT (GapKSATSpec.perfect k s hs0 hs1).

      At perfect completeness 1, any randomized 2 ^ (δ * n) * poly(L) solver (δ ≥ 0) for KSAT k solves GapKSAT (GapKSATSpec.perfect k s hs0 hs1) with the same error profile E.

      4. gapSatExponent, rGapSatExponent, GapETH, and rGapETH #

      Deterministic gap k-SAT exponent (gapSatExponent P): infimum (Cslib.rateExponent) of δ ≥ 0 such that GapKSAT P is deterministically solvable within time 2 ^ (δ * n) * poly(L).

      Randomized gap k-SAT exponent (rGapSatExponent P): infimum (Cslib.rateExponent) of δ ≥ 0 such that GapKSAT P is solvable with two-sided bounded error (1 / 3) within time 2 ^ (δ * n) * poly(L).

      Gap Exponential Time Hypothesis (GapETH) variant: this adaptation posits that for some soundness threshold 0 ≤ s < 1 and rate δ > 0, GapThreeSAT s cannot be solved deterministically within time 2 ^ (δ * n) * poly(L) where n = φ.numVars. This definition ranges over unrestricted clause density and existential s with a closed no-promise. It explicitly quantifies over ComputableInTimeO, using occurring variables numVars, the encCNF encoding, a polynomial factor in encoded length L, and the deterministic time model. This is an explicitly documented adaptation and does not assert equivalence to the sparse source formulations: [Dinur2016, Hypothesis 2.5, p.5] has fixed soundness < 0.9 and at most D n clauses, and [ManurangsiRaghavendra2017, §1.1, p.78:5] states the approximation ETHA formulation.

      Randomized Gap Exponential Time Hypothesis (rGapETH): for some soundness threshold 0 ≤ s < 1 and rate δ > 0, GapThreeSAT s cannot be solved with two-sided bounded error (1 / 3) within time 2 ^ (δ * n) * poly(L) where n = φ.numVars.

      Threshold invariance of rGapSatExponent. Any ε ∈ (0, 1 / 2) yields the exact same infimum exponent rGapSatExponent P.

      gapSatExponent P is positive iff GapKSAT P is not solvable at some positive rate.

      rGapSatExponent P is positive iff GapKSAT P is not solvable with bounded error at some positive rate.

      theorem Cslib.Complexity.gapSatExponent_mono {P₁ P₂ : GapKSATSpec} (hw : P₁.width ≤ P₂.width) (hc : P₂.completeness ≤ P₁.completeness) (hs : P₁.soundness ≤ P₂.soundness) :

      Parameter monotonicity of gapSatExponent: increasing clause width (width₁ ≤ width₂) or narrowing the gap (completeness₂ ≤ completeness₁, soundness₁ ≤ soundness₂) cannot decrease gapSatExponent.

      theorem Cslib.Complexity.rGapSatExponent_mono {P₁ P₂ : GapKSATSpec} (hw : P₁.width ≤ P₂.width) (hc : P₂.completeness ≤ P₁.completeness) (hs : P₁.soundness ≤ P₂.soundness) :

      Parameter monotonicity of rGapSatExponent.

      At perfect completeness 1, gapSatExponent is bounded above by satExponent k.

      At perfect completeness 1, rGapSatExponent is bounded above by rSatExponent k.

      5. Characterizations and conditional hierarchy for GapETH and rGapETH #

      GapETH holds iff gapSatExponent (GapKSATSpec.perfectThree s hs0 hs1) > 0 for some 0 ≤ s < 1.

      rGapETH holds iff rGapSatExponent (GapKSATSpec.perfectThree s hs0 hs1) > 0 for some 0 ≤ s < 1.

      theorem Cslib.Complexity.rGapETH_iff_twoSided {ε : ℝ} (h0 : 0 < ε) (h1 : ε < 1 / 2) :

      Threshold invariance of rGapETH. Replacing ErrorModel.bounded (1 / 3) by any two-sided error ε ∈ (0, 1 / 2) gives an equivalent hypothesis.

      GapETH implies ETH (GapETH → ETH).