Documentation

DescriptiveComplexity.Computability.Realize

Deciding first-order satisfaction on a finite structure #

The first step of the bridge to Mathlib's computability layer: on a finite structure whose relations are decidable and whose equality is decidable, FirstOrder.Language.BoundedFormula.Realize is decidable, by recursion on the formula – quantifiers going through Fintype.decidableForallFintype.

Mathlib has no such instance (Realize is a Prop-valued recursion, and Mathlib's model theory never needs to run it), so it is supplied here. It is the first formal justification of the claim, elsewhere by inspection, that first-order interpretations are effective: everything a reduction of this library computes is an evaluation of a fixed formula in a finite structure.

The instance is deliberately independent of the rest of the bridge: it mentions no encoding of structures, and it is useful on its own wherever a first-order condition has to be checked by decide.

@[instance_reducible]
instance FirstOrder.Language.BoundedFormula.decidableRealize {L : Language} {α : Type u_1} {M : Type u_2} [L.Structure M] [DecidableEq M] [Fintype M] [(n : ) → (R : L.Relations n) → (x : Fin nM) → Decidable (Structure.RelMap R x)] {l : } (φ : L.BoundedFormula α l) (v : αM) (xs : Fin lM) :
Decidable (φ.Realize v xs)

Satisfaction is decidable on a finite structure whose relations and whose equality are decidable: a recursion on the formula, the quantifier case being a decidable quantification over a Fintype.

The realization of a term needs no hypothesis: it is an ordinary function into the universe, and only the equality test it feeds needs DecidableEq M.

Equations
Dependency graph
@[instance_reducible]
instance FirstOrder.Language.Formula.decidableRealize {L : Language} {α : Type u_1} {M : Type u_2} [L.Structure M] [DecidableEq M] [Fintype M] [(n : ) → (R : L.Relations n) → (x : Fin nM) → Decidable (Structure.RelMap R x)] (φ : L.Formula α) (v : αM) :

Satisfaction of a formula (no bound variables left) is decidable on a finite structure with decidable relations.

Equations
Dependency graph
@[instance_reducible]
instance FirstOrder.Language.Sentence.decidableRealize {L : Language} {M : Type u_1} [L.Structure M] [DecidableEq M] [Fintype M] [(n : ) → (R : L.Relations n) → (x : Fin nM) → Decidable (Structure.RelMap R x)] (φ : L.Sentence) :
Decidable (M φ)

Satisfaction of a sentence is decidable on a finite structure with decidable relations.

Equations
Dependency graph