Second-order definability with bounded alternation

Lax904597.SecondOrder · concepts/Lax904597/SecondOrder.lean · lax-904597

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 second-order quantifier block is a finite family of relation variables with given arities. A first-order sentence over the vocabulary expanded by kk blocks, read with the blocks quantified alternately, is a Σk\Sigma_k sentence when the first block is existential and a Πk\Pi_k sentence when it is universal; a decision problem is Σk\Sigma_k- or Πk\Pi_k-definable when such a sentence defines it on nonempty finite structures. No object-level second-order syntax is needed: a block is instantiated by an assignment of actual relations, which turns it into a structure over the block's own vocabulary, and only the first-order kernel is an object-level sentence.

    Σ1\Sigma_1-definability is existential second-order logic, and by Fagin's theorem the Σ1\Sigma_1-definable problems are exactly NP. This is how NP is defined in this submission: as Σ1\Sigma_1-definability, with no machine model.

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

    Lean source view on GitHub

    1import Mathlib.ModelTheory.Semantics
    2import Lax904597.Problems
    3
    4/-!
    5---
    6title: Second-order definability with bounded alternation
    7type: definition
    8---
    9A second-order quantifier *block* is a finite family of relation variables
    10with given arities. A first-order sentence over the vocabulary expanded by
    11kk blocks, read with the blocks quantified alternately, is a Σk\Sigma_k
    12sentence when the first block is existential and a Πk\Pi_k sentence when it
    13is universal; a decision problem is Σk\Sigma_k- or Πk\Pi_k-definable when
    14such a sentence defines it on nonempty finite structures. No object-level
    15second-order syntax is needed: a block is instantiated by an assignment of
    16actual relations, which turns it into a structure over the block's own
    17vocabulary, and only the first-order kernel is an object-level sentence.
    18
    19Σ1\Sigma_1-definability is existential second-order logic, and by Fagin's
    20theorem the Σ1\Sigma_1-definable problems are exactly NP. This is how NP is
    21defined in this submission: as Σ1\Sigma_1-definability, with no machine
    22model.
    23-/
    24
    25namespace Lax904597.SecondOrder
    26
    27open FirstOrder FirstOrder.Language Lax904597.Problems
    28
    29/-- A second-order quantifier block: finitely many relation variables, with
    30given arities. The index type is arbitrary rather than an initial segment of
    31`ℕ`, so that constructions on blocks can build their natural index types. -/
    32structure SOBlock : Type 1 where
    33 /-- The index type of the relation variables of the block. -/
    34 ι : Type
    35 /-- A block has finitely many relation variables. -/
    36 [ιFinite : Finite ι]
    37 /-- The arity of each relation variable. -/
    38 arity : ι → ℕ
    39
    40attribute [instance] SOBlock.ιFinite
    41
    42/-- The relational vocabulary of a block: one relation symbol per relation
    43variable. -/
    44def SOBlock.lang (B : SOBlock) : Language :=
    45 ⟨fun _ => Empty, fun n => {i : B.ι // B.arity i = n}⟩
    46
    47instance instIsRelationalLang (B : SOBlock) : IsRelational B.lang :=
    48 fun _ => ⟨fun f => Empty.elim f⟩
    49
    50/-- An assignment of actual relations on a universe `A` to the relation
    51variables of a block. -/
    52def SOBlock.Assignment (B : SOBlock) (A : Type) : Type :=
    53 ∀ i : B.ι, (Fin (B.arity i) → A) → Prop
    54
    55/-- The structure over the block's vocabulary determined by an assignment. -/
    56@[reducible]
    57def SOBlock.structure (B : SOBlock) {A : Type} (ρ : B.Assignment A) :
    58 B.lang.Structure A where
    59 funMap f := isEmptyElim f
    60 RelMap := fun {_} r x => ρ r.1 fun j => x (Fin.cast r.2 j)
    61
    62/-- The base vocabulary expanded by the vocabularies of a list of blocks. -/
    63def soLang (L : Language.{0, 0}) : List SOBlock → Language.{0, 0}
    64 | [] => L
    65 | B :: Bs => soLang (L.sum B.lang) Bs
    66
    67/-- Alternating second-order satisfaction: the sentence obtained from the
    68first-order kernel `φ` by quantifying the blocks `Bs` alternately,
    69existentially first when `pol` is `true`, holds in the `L`-structure `A`. -/
    70def SORealize (L : Language.{0, 0}) (A : Type) [inst : L.Structure A] :
    71 ∀ (Bs : List SOBlock), (soLang L Bs).Sentence → Bool → Prop
    72 | [], φ, _ => @Sentence.Realize L A inst φ
    73 | B :: Bs, φ, true =>
    74 ∃ ρ : B.Assignment A,
    75 @SORealize (L.sum B.lang) A (@sumStructure L B.lang A inst (B.structure ρ))
    76 Bs φ false
    77 | B :: Bs, φ, false =>
    78 ∀ ρ : B.Assignment A,
    79 @SORealize (L.sum B.lang) A (@sumStructure L B.lang A inst (B.structure ρ))
    80 Bs φ true
    81
    82variable {L : Language.{0, 0}}
    83
    84/-- A decision problem is `Σₖ`-definable if, on nonempty finite structures, it
    85is defined by a second-order sentence with `k` alternating blocks of
    86second-order quantifiers, starting existentially. -/
    87def SigmaSODefinable [L.IsRelational] (k : ℕ) (P : DecisionProblem L) : Prop :=
    88 ∃ Bs : List SOBlock, Bs.length = k ∧
    89 ∃ φ : (soLang L Bs).Sentence,
    90 ∀ (A : Type) [L.Structure A] [Finite A] [Nonempty A], P A ↔ SORealize L A Bs φ true
    91
    92/-- A decision problem is `Πₖ`-definable if, on nonempty finite structures, it
    93is defined by a second-order sentence with `k` alternating blocks of
    94second-order quantifiers, starting universally. -/
    95def PiSODefinable [L.IsRelational] (k : ℕ) (P : DecisionProblem L) : Prop :=
    96 ∃ Bs : List SOBlock, Bs.length = k ∧
    97 ∃ φ : (soLang L Bs).Sentence,
    98 ∀ (A : Type) [L.Structure A] [Finite A] [Nonempty A], P A ↔ SORealize L A Bs φ false
    99
    100end Lax904597.SecondOrder
    101

    Discussion

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

    Loading discussion…