The class #P, by witness counting
Lax366625.WitnessCounting · concepts/Lax366625/WitnessCounting.lean · lax-366625
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
Given a block of second-order relation variables and a first-order sentence over a vocabulary expanded by the block, the witness count of on a structure is the number of assignments of relations to the block under which holds. A counting problem over is #P-definable when there are a block and a sentence over and the block such that, for every nonempty finite -structure and every linear order on , is the witness count of on with that order: the number of witnesses of an existential second-order sentence, after Saluja, Subrahmanyam, and Thakur. #P is the counting class of the #P-definable problems.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.SetTheory.Cardinal.Finite |
| 2 | import Mathlib.Tactic.FinCases |
| 3 | import Mathlib.Order.PiLex |
| 4 | import Mathlib.Data.Prod.Lex |
| 5 | import Mathlib.Data.Fintype.EquivFin |
| 6 | import Mathlib.ModelTheory.Order |
| 7 | import Mathlib.ModelTheory.Semantics |
| 8 | import Mathlib.ModelTheory.Complexity |
| 9 | import Mathlib.Logic.Equiv.Fin.Basic |
| 10 | import Mathlib.Data.Fintype.Lattice |
| 11 | import Mathlib.Data.Finite.Sigma |
| 12 | import Lax366625.CountingProblems |
| 13 | import Lax904597.SecondOrder |
| 14 | import Lax366625.CountingClasses |
| 15 | |
| 16 | /-! |
| 17 | --- |
| 18 | title: The class #P, by witness counting |
| 19 | type: definition |
| 20 | --- |
| 21 | Given a block of second-order relation variables and a first-order sentence |
| 22 | over a vocabulary expanded by the block, the witness count of |
| 23 | on a structure is the number of assignments of relations to the |
| 24 | block under which holds. A counting problem over is |
| 25 | #P-definable when there are a block and a sentence over |
| 26 | and the block such that, for every nonempty finite |
| 27 | -structure and every linear order on , is the witness count |
| 28 | of on with that order: the number of witnesses of an |
| 29 | existential second-order sentence, after Saluja, Subrahmanyam, and Thakur. |
| 30 | #P is the counting class of the #P-definable problems. |
| 31 | -/ |
| 32 | |
| 33 | namespace Lax366625.WitnessCounting |
| 34 | |
| 35 | open Lax366625.CountingProblems Lax904597.SecondOrder |
| 36 | |
| 37 | open FirstOrder |
| 38 | |
| 39 | open Language Structure |
| 40 | |
| 41 | section Witness |
| 42 | |
| 43 | variable {L : Language.{0, 0}} |
| 44 | |
| 45 | /-- The number of assignments of the block `B` on the structure `A` under which |
| 46 | the first-order kernel `φ` holds. -/ |
| 47 | noncomputable def witnessCount (B : SOBlock) (φ : (L.sum B.lang).Sentence) (A : Type) |
| 48 | [inst : L.Structure A] : ℕ := |
| 49 | Nat.card {ρ : B.Assignment A // |
| 50 | @Sentence.Realize (L.sum B.lang) A (@sumStructure L B.lang A inst (B.structure ρ)) φ} |
| 51 | |
| 52 | end Witness |
| 53 | |
| 54 | section Definable |
| 55 | |
| 56 | variable {L : Language.{0, 0}} [L.IsRelational] |
| 57 | |
| 58 | /-- A counting problem is **`#P`-definable** if, on nonempty finite structures, |
| 59 | it counts the witnesses of an existential second-order sentence over the |
| 60 | ordered expansion: for some block `B` and first-order kernel `φ`, its value is |
| 61 | the number of assignments of `B` satisfying `φ`, whatever the linear order of |
| 62 | the instance. -/ |
| 63 | def SharpPDefinable (C : CountingProblem L) : Prop := |
| 64 | ∃ (B : SOBlock) (φ : ((L.sum Language.order).sum B.lang).Sentence), |
| 65 | ∀ (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A], |
| 66 | C A = witnessCount B φ A |
| 67 | |
| 68 | end Definable |
| 69 | |
| 70 | open Lax366625.CountingClasses |
| 71 | |
| 72 | /-- **#P**: the class of the `#P`-definable counting problems. -/ |
| 73 | def SharpP : CountingClass := |
| 74 | CountingClass.ofMem fun C => SharpPDefinable C |
| 75 | |
| 76 | end Lax366625.WitnessCounting |
| 77 |
Used by
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments