While this submission is a draft, it cannot be used by other submissions.

Decision classes defined by counting

Lax175070.CountDefinability · concepts/Lax175070/CountDefinability.lean · lax-175070

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    A decision problem PP over LL is defined by a relation RR between two witness counts under a side condition SS when there are two existential second-order sentences over L∪{≤}L \cup \{\le\} whose witness counts cc and dd satisfy, on every nonempty finite LL-structure with every linear order, S(c,d)S(c, d), and PP holds exactly when R(c,d)R(c, d). The class of SS and RR consists of these problems, with cofinal hardness. Taking for the answer a property of the counts, rather than of one integer, is the two-number form of the GapP characterization of Fenner, Fortnow, and Kurtz.

    The classes are ⊕P, after Papadimitriou and Zachos and, independently, Goldschlager and Parberry, where the first count is odd; Modk_kP, after Cai and Hemachandra, where it is not a multiple of kk; PP, after Gill, where the first count exceeds the second; C=_=P, after Wagner, where the two counts are equal; and UP, after Valiant, where the first count is at most one and the answer is whether it is one. No complete problem is known for UP, and the question does not relativize, as Hartmanis and Hemachandra showed: UP is here for its inclusions. The decision version of a counting problem by a property of numbers holds on the structures whose count has the property.

    Concept map
    10 concepts; 7 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib.Data.Fintype.Lattice
    2import Mathlib.ModelTheory.Order
    3import Mathlib.ModelTheory.Semantics
    4import Mathlib.ModelTheory.Complexity
    5import Mathlib.Tactic.FinCases
    6import Mathlib.SetTheory.Cardinal.Finite
    7import Mathlib.Order.PiLex
    8import Mathlib.Data.Prod.Lex
    9import Mathlib.Data.Fintype.EquivFin
    10import Mathlib.Logic.Equiv.Fin.Basic
    11import Mathlib.Data.Finite.Sigma
    12import Mathlib.Order.Lattice.Nat
    13import Mathlib.Data.Set.Card
    14import Mathlib.Data.Fintype.Pigeonhole
    15import Mathlib.Dynamics.FixedPoints.Basic
    16import Mathlib.ModelTheory.Syntax
    17import Mathlib.Algebra.Order.BigOperators.Group.Finset
    18import Mathlib.Data.Fintype.Card
    19import Lax366625.WitnessCounting
    20import Lax904597.Problems
    21import Lax904597.SecondOrder
    22import Lax904597.Classes
    23import Lax485149.Problems
    24import Lax366625.CountingProblems
    25
    26/-!
    27---
    28title: Decision classes defined by counting
    29type: definition
    30---
    31A decision problem PP over LL is defined by a relation RR between two
    32witness counts under a side condition SS when there are two existential
    33second-order sentences over L∪{≤}L \cup \{\le\} whose witness counts cc and
    34dd satisfy, on every nonempty finite LL-structure with every linear order,
    35S(c,d)S(c, d), and PP holds exactly when R(c,d)R(c, d). The class of SS and RR
    36consists of these problems, with cofinal hardness. Taking for the answer a
    37property of the counts, rather than of one integer, is the two-number form
    38of the GapP characterization of Fenner, Fortnow, and Kurtz.
    39
    40The classes are ⊕P, after Papadimitriou and Zachos and, independently,
    41Goldschlager and Parberry, where the first count is odd; Modk_kP, after Cai
    42and Hemachandra, where it is not a multiple of kk; PP, after Gill, where
    43the first count exceeds the second; C=_=P, after Wagner, where the two
    44counts are equal; and UP, after Valiant, where the first count is at most
    45one and the answer is whether it is one. No complete problem is known for
    46UP, and the question does not relativize, as Hartmanis and Hemachandra
    47showed: UP is here for its inclusions. The decision version of a counting
    48problem by a property of numbers holds on the structures whose count has the
    49property.
    50-/
    51
    52namespace Lax175070.CountDefinability
    53
    54open Lax366625.WitnessCounting Lax904597.Problems Lax904597.SecondOrder
    55
    56open FirstOrder
    57
    58open Language Structure
    59
    60section Definable
    61
    62variable {L : Language.{0, 0}} [L.IsRelational]
    63
    64/-- A decision problem is **defined by the relation `R` between two witness
    65counts under the side condition `S`** if, on nonempty finite ordered
    66structures, the two counts satisfy `S` and the problem holds exactly when
    67they satisfy `R`. -/
    68def CountDefinable (S R : ℕ → ℕ → Prop) (P : DecisionProblem L) : Prop :=
    69 ∃ (B : SOBlock) (φ : ((L.sum Language.order).sum B.lang).Sentence)
    70 (B' : SOBlock) (φ' : ((L.sum Language.order).sum B'.lang).Sentence),
    71 ∀ (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A],
    72 S (witnessCount B φ A) (witnessCount B' φ' A) ∧
    73 (P A ↔ R (witnessCount B φ A) (witnessCount B' φ' A))
    74
    75end Definable
    76
    77open Lax904597.Classes Lax485149.Problems Lax366625.CountingProblems
    78
    79/-- The class of the problems defined by the relation `R` between two witness
    80counts under the side condition `S`, with cofinal hardness. -/
    81def countClass (S R : ℕ → ℕ → Prop) : ComplexityClass :=
    82 ComplexityClass.ofMem fun P => CountDefinable S R P
    83
    84/-- **⊕P**: the number of witnesses is odd. -/
    85def ParityP : ComplexityClass :=
    86 countClass (fun _ _ => True) fun c _ => Odd c
    87
    88/-- **Mod_k P**: the number of witnesses is not a multiple of `k`. -/
    89def ModP (k : ℕ) : ComplexityClass :=
    90 countClass (fun _ _ => True) fun c _ => ¬ k ∣ c
    91
    92/-- **PP**: the first number of witnesses exceeds the second. -/
    93def PP : ComplexityClass :=
    94 countClass (fun _ _ => True) fun c d => d < c
    95
    96/-- **C₌P**: the two numbers of witnesses are equal. -/
    97def CeqP : ComplexityClass :=
    98 countClass (fun _ _ => True) fun c d => c = d
    99
    100/-- **UP**: at most one witness, and the answer is whether there is one. -/
    101def UP : ComplexityClass :=
    102 countClass (fun c _ => c ≤ 1) fun c _ => c = 1
    103
    104/-- The decision version of a counting problem by a property `R` of numbers:
    105does the count satisfy `R`? -/
    106def decide {L : Language.{0, 0}} [L.IsRelational] (R : ℕ → Prop) (C : CountingProblem L) :
    107 DecisionProblem L :=
    108 DecisionProblem.ofPred fun A _ => R (C A)
    109
    110end Lax175070.CountDefinability
    111

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…