The Krom fragment of existential second-order logic

Lax485149.KromFragment · concepts/Lax485149/KromFragment.lean · lax-485149

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 Krom clause over a vocabulary LL, a block of second-order relation variables and kk first-order variables xˉ\bar x is an implication γ(xˉ)→ℓ1∨ℓ2\gamma(\bar x) \to \ell_1 \vee \ell_2, where the guard γ\gamma is an arbitrary first-order formula over LL and each ℓi\ell_i is an atom in the relation variables or the negation of one; either literal may be absent, so a clause may be a unit clause or the goal clause γ(xˉ)→⊥\gamma(\bar x) \to \bot. A Krom program is a finite list of such clauses, and an assignment of relations to the block satisfies it on a structure when every clause holds at every valuation of xˉ\bar x.

    A decision problem PP over LL is SO-Krom definable when there are a block, a number kk and a Krom program over L∪{≤}L \cup \{\le\} such that, for every nonempty finite LL-structure AA and every linear order on AA, AA is a yes-instance of PP if and only if some assignment satisfies the program on AA with that order. The guards may thus use the order, while the problem does not depend on it. This is the fragment SO-Krom of Grädel, existential second-order logic whose first-order kernel is universal with at most two second-order literals per clause.

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

    Lean source view on GitHub

    1import Mathlib.ModelTheory.Order
    2import Mathlib.ModelTheory.Semantics
    3import Lax485149.SecondOrderAtoms
    4import Lax904597.Problems
    5import Lax904597.SecondOrder
    6import Lax904597.Interpretations
    7
    8/-!
    9---
    10title: The Krom fragment of existential second-order logic
    11type: definition
    12---
    13A Krom clause over a vocabulary LL, a block of second-order relation
    14variables and kk first-order variables xˉ\bar x is an implication
    15γ(xˉ)→ℓ1∨ℓ2\gamma(\bar x) \to \ell_1 \vee \ell_2, where the guard γ\gamma is an
    16arbitrary first-order formula over LL and each ℓi\ell_i is an atom in the
    17relation variables or the negation of one; either literal may be absent, so a
    18clause may be a unit clause or the goal clause γ(xˉ)→⊥\gamma(\bar x) \to \bot.
    19A Krom program is a finite list of such clauses, and an assignment of
    20relations to the block satisfies it on a structure when every clause holds at
    21every valuation of xˉ\bar x.
    22
    23A decision problem PP over LL is SO-Krom definable when there are a block,
    24a number kk and a Krom program over L∪{≤}L \cup \{\le\} such that, for
    25every nonempty finite LL-structure AA and every linear order on AA, AA is
    26a yes-instance of PP if and only if some assignment satisfies the program
    27on AA with that order. The guards may thus use the order, while the problem
    28does not depend on it. This is the fragment SO-Krom of Grädel, existential
    29second-order logic whose first-order kernel is universal with at most two
    30second-order literals per clause.
    31-/
    32
    33namespace Lax485149.KromFragment
    34
    35open Lax485149.SecondOrderAtoms Lax904597.Problems Lax904597.SecondOrder
    36
    37open FirstOrder
    38
    39open Language Structure
    40
    41/-- A literal in the relation variables of a block: an atom together with a
    42sign (`positive = false` for a negated atom). -/
    43structure KromLit (B : SOBlock) (k : ℕ) where
    44 /-- The underlying second-order atom. -/
    45 atom : SOAtom B k
    46 /-- The sign of the literal: `true` for the atom, `false` for its
    47 negation. -/
    48 positive : Bool
    49
    50/-- A Krom clause over the input vocabulary `L` and the block `B`, with `k`
    51universally quantified first-order variables: an arbitrary first-order guard
    52over `L` implies the disjunction of at most two signed second-order literals.
    53A `none` literal is absent, so a clause with both literals absent is the goal
    54clause `guard → ⊥`. -/
    55structure KromClause (L : Language.{0, 0}) (B : SOBlock) (k : ℕ) where
    56 /-- The first-order guard, over the input vocabulary alone. -/
    57 guard : L.Formula (Fin k)
    58 /-- The first literal of the clause, if any. -/
    59 lit₁ : Option (KromLit B k)
    60 /-- The second literal of the clause, if any. -/
    61 lit₂ : Option (KromLit B k)
    62
    63/-- An SO-Krom kernel, as data: a finite conjunction of Krom clauses, each
    64implicitly universally quantified over the same `k` first-order variables. -/
    65abbrev KromProgram (L : Language.{0, 0}) (B : SOBlock) (k : ℕ) : Type :=
    66 List (KromClause L B k)
    67
    68section Semantics
    69
    70variable {L : Language.{0, 0}} {B : SOBlock} {k : ℕ} {A : Type} [L.Structure A]
    71
    72/-- The truth value of a literal: its atom, or the negation of its atom. -/
    73def KromLit.Holds (l : KromLit B k) (ρ : B.Assignment A) (v : Fin k → A) : Prop :=
    74 if l.positive then l.atom.Holds ρ v else ¬l.atom.Holds ρ v
    75
    76/-- The truth value of one of the two literal slots of a clause: `False` when
    77the literal is absent. -/
    78def KromLit.slotHolds (o : Option (KromLit B k)) (ρ : B.Assignment A) (v : Fin k → A) :
    79 Prop :=
    80 o.elim False fun l => l.Holds ρ v
    81
    82/-- A Krom clause holds at a valuation when its guard forces one of its (at
    83most two) literals. -/
    84def KromClause.Holds (c : KromClause L B k) (ρ : B.Assignment A) (v : Fin k → A) :
    85 Prop :=
    86 c.guard.Realize v →
    87 (KromLit.slotHolds c.lit₁ ρ v ∨ KromLit.slotHolds c.lit₂ ρ v)
    88
    89/-- An assignment satisfies a program when every clause holds at every
    90valuation of the universally quantified variables. -/
    91def KromProgram.Holds (prog : KromProgram L B k) (ρ : B.Assignment A) : Prop :=
    92 ∀ v : Fin k → A, ∀ c ∈ prog, c.Holds ρ v
    93
    94end Semantics
    95
    96variable {L : Language.{0, 0}}
    97
    98/-- A decision problem is *SO-Krom definable* if, on nonempty finite *ordered*
    99structures, it is defined by an existential second-order sentence with a Krom
    100kernel: there is a block of relation variables and a Krom program over the
    101ordered expansion of the vocabulary such that the yes-instances are exactly
    102the structures admitting a satisfying assignment. A single block suffices,
    103since existential second-order quantifiers merge.
    104
    105The guards live over `L.sum Language.order` and the equivalence is required
    106for *every* linear order on `A`, so this is order-invariant SO-Krom
    107definability. -/
    108def SigmaSOKromDefinable [L.IsRelational] (P : DecisionProblem L) : Prop :=
    109 ∃ (B : SOBlock) (k : ℕ) (prog : KromProgram (L.sum Language.order) B k),
    110 ∀ (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A],
    111 P A ↔ ∃ ρ : B.Assignment A, prog.Holds ρ
    112
    113end Lax485149.KromFragment
    114

    Discussion

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

    Loading discussion…