Decision classes defined by counting
Lax175070.CountDefinability · concepts/Lax175070/CountDefinability.lean · lax-175070
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
A decision problem over is defined by a relation between two witness counts under a side condition when there are two existential second-order sentences over whose witness counts and satisfy, on every nonempty finite -structure with every linear order, , and holds exactly when . The class of and 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; ModP, after Cai and Hemachandra, where it is not a multiple of ; PP, after Gill, where the first count exceeds the second; CP, 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
Lean source view on GitHub
| 1 | import Mathlib.Data.Fintype.Lattice |
| 2 | import Mathlib.ModelTheory.Order |
| 3 | import Mathlib.ModelTheory.Semantics |
| 4 | import Mathlib.ModelTheory.Complexity |
| 5 | import Mathlib.Tactic.FinCases |
| 6 | import Mathlib.SetTheory.Cardinal.Finite |
| 7 | import Mathlib.Order.PiLex |
| 8 | import Mathlib.Data.Prod.Lex |
| 9 | import Mathlib.Data.Fintype.EquivFin |
| 10 | import Mathlib.Logic.Equiv.Fin.Basic |
| 11 | import Mathlib.Data.Finite.Sigma |
| 12 | import Mathlib.Order.Lattice.Nat |
| 13 | import Mathlib.Data.Set.Card |
| 14 | import Mathlib.Data.Fintype.Pigeonhole |
| 15 | import Mathlib.Dynamics.FixedPoints.Basic |
| 16 | import Mathlib.ModelTheory.Syntax |
| 17 | import Mathlib.Algebra.Order.BigOperators.Group.Finset |
| 18 | import Mathlib.Data.Fintype.Card |
| 19 | import Lax366625.WitnessCounting |
| 20 | import Lax904597.Problems |
| 21 | import Lax904597.SecondOrder |
| 22 | import Lax904597.Classes |
| 23 | import Lax485149.Problems |
| 24 | import Lax366625.CountingProblems |
| 25 | |
| 26 | /-! |
| 27 | --- |
| 28 | title: Decision classes defined by counting |
| 29 | type: definition |
| 30 | --- |
| 31 | A decision problem over is defined by a relation between two |
| 32 | witness counts under a side condition when there are two existential |
| 33 | second-order sentences over whose witness counts and |
| 34 | satisfy, on every nonempty finite -structure with every linear order, |
| 35 | , and holds exactly when . The class of and |
| 36 | consists of these problems, with cofinal hardness. Taking for the answer a |
| 37 | property of the counts, rather than of one integer, is the two-number form |
| 38 | of the GapP characterization of Fenner, Fortnow, and Kurtz. |
| 39 | |
| 40 | The classes are ⊕P, after Papadimitriou and Zachos and, independently, |
| 41 | Goldschlager and Parberry, where the first count is odd; ModP, after Cai |
| 42 | and Hemachandra, where it is not a multiple of ; PP, after Gill, where |
| 43 | the first count exceeds the second; CP, after Wagner, where the two |
| 44 | counts are equal; and UP, after Valiant, where the first count is at most |
| 45 | one and the answer is whether it is one. No complete problem is known for |
| 46 | UP, and the question does not relativize, as Hartmanis and Hemachandra |
| 47 | showed: UP is here for its inclusions. The decision version of a counting |
| 48 | problem by a property of numbers holds on the structures whose count has the |
| 49 | property. |
| 50 | -/ |
| 51 | |
| 52 | namespace Lax175070.CountDefinability |
| 53 | |
| 54 | open Lax366625.WitnessCounting Lax904597.Problems Lax904597.SecondOrder |
| 55 | |
| 56 | open FirstOrder |
| 57 | |
| 58 | open Language Structure |
| 59 | |
| 60 | section Definable |
| 61 | |
| 62 | variable {L : Language.{0, 0}} [L.IsRelational] |
| 63 | |
| 64 | /-- A decision problem is **defined by the relation `R` between two witness |
| 65 | counts under the side condition `S`** if, on nonempty finite ordered |
| 66 | structures, the two counts satisfy `S` and the problem holds exactly when |
| 67 | they satisfy `R`. -/ |
| 68 | def 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 | |
| 75 | end Definable |
| 76 | |
| 77 | open Lax904597.Classes Lax485149.Problems Lax366625.CountingProblems |
| 78 | |
| 79 | /-- The class of the problems defined by the relation `R` between two witness |
| 80 | counts under the side condition `S`, with cofinal hardness. -/ |
| 81 | def countClass (S R : ℕ → ℕ → Prop) : ComplexityClass := |
| 82 | ComplexityClass.ofMem fun P => CountDefinable S R P |
| 83 | |
| 84 | /-- **⊕P**: the number of witnesses is odd. -/ |
| 85 | def 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`. -/ |
| 89 | def ModP (k : ℕ) : ComplexityClass := |
| 90 | countClass (fun _ _ => True) fun c _ => ¬ k ∣ c |
| 91 | |
| 92 | /-- **PP**: the first number of witnesses exceeds the second. -/ |
| 93 | def PP : ComplexityClass := |
| 94 | countClass (fun _ _ => True) fun c d => d < c |
| 95 | |
| 96 | /-- **C₌P**: the two numbers of witnesses are equal. -/ |
| 97 | def 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. -/ |
| 101 | def 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: |
| 105 | does the count satisfy `R`? -/ |
| 106 | def decide {L : Language.{0, 0}} [L.IsRelational] (R : ℕ → Prop) (C : CountingProblem L) : |
| 107 | DecisionProblem L := |
| 108 | DecisionProblem.ofPred fun A _ => R (C A) |
| 109 | |
| 110 | end Lax175070.CountDefinability |
| 111 |
Builds on
Used by
From Mathlib
Mathlib.Algebra.Order.BigOperators.Group.FinsetMathlib.Data.Finite.SigmaMathlib.Data.Fintype.CardMathlib.Data.Fintype.EquivFinMathlib.Data.Fintype.LatticeMathlib.Data.Fintype.PigeonholeMathlib.Data.Prod.LexMathlib.Data.Set.CardMathlib.Dynamics.FixedPoints.BasicMathlib.Logic.Equiv.Fin.BasicMathlib.ModelTheory.ComplexityMathlib.ModelTheory.OrderMathlib.ModelTheory.SemanticsMathlib.ModelTheory.SyntaxMathlib.Order.Lattice.NatMathlib.Order.PiLexMathlib.SetTheory.Cardinal.FiniteMathlib.Tactic.FinCases
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments