FINSAT: finite satisfiability of a first-order sentence #
The problem of Trakhtenbrot's theorem (Trakhtenbrot 1950,
Libkin 2004, ch. 9): does the given first-order
sentence have a finite model? This file carries the instance encoding – a
sentence, presented as a finite structure – and its semantics; membership in
RE and RE-hardness live in the sibling files, and the completeness theorem in
DescriptiveComplexity.Problems.FinSat.
The encoding #
An instance is a parse DAG in negation normal form. Its elements play several roles at once – nodes, variables, relation symbols, argument positions – and nothing forces those roles to be disjoint:
andN,orNmark the n-ary conjunction and disjunction nodes: such a node is the conjunction (disjunction) of all the nodes itschildrelation gives it. Nothing is a binary tree, which is what lets a reduction write an unbounded conjunction as a single node;allN,exNmark the quantifier nodes,bindgiving the variable quantified; a quantifier node is again read over all its children;- the leaves are literals:
eqL g x yandneqL g x yforx = yandx ≠ y, andposL g s/negL g sfors(…)and¬s(…), the arguments of the atom being given byarg g p x(“the argument at positionpis the variablex”) and the argument positions of the symbolsbysig s p; rootmarks the node the sentence starts at;leis a linear order on the instance. A sentence is a string, so an encoding of one may certainly carry the order of its own syntax; what the order buys is thatchild g c → c < g– acyclicity of the parse DAG – becomes first-order, while acyclicity itself is not. The membership proof has to check well-formedness, so this matters.
Negation normal form is not a matter of economy: with negation confined to the
leaves the value of a node is monotone in the values of its children, so
satisfaction is a least fixed point (DescriptiveComplexity.FinSat.Gval,
below) and no well-founded recursion on a decoded parse tree is needed
anywhere. Every first-order formula has a negation normal form, and the
hardness reduction produces one directly.
The semantics #
There is deliberately no decoding into a FirstOrder.Language.Sentence:
the relation symbols of the encoded sentence are elements of the instance,
so the decoded vocabulary would depend on the instance. Satisfaction is
instead defined on the encoding, Tarski-style, by
DescriptiveComplexity.FinSat.gstep – one clause per node kind, which is what
a reader has to check anyway – iterated on a fuel counter
(DescriptiveComplexity.FinSat.gval) and closed up
(DescriptiveComplexity.FinSat.Gval).
A model is a finite nonempty type M together with an interpretation
I : A → (A → M) → Prop reading a symbol and an assignment of argument
positions, required to be local: I s may only look at the positions of
the signature of s. Locality is what makes I s a relation of the arity of
s rather than of the whole universe, and what makes the negative-atom clause
unambiguous.
DescriptiveComplexity.FINSAT then holds of an instance when it is
well-formed and the universal closure of the encoded formula has a finite
model. Taking the universal closure costs nothing – the sentences the
reduction produces are closed – and avoids conditioning on “every variable is
bound by an ancestor”, which is a reachability property and so not
first-order.
What is and is not claimed #
RE is the logically defined class of
DescriptiveComplexity.RecursivelyEnumerable (definability in ∃SO[new]), so
completeness of FINSAT for it is a statement about that logic. It becomes
undecidability of finite satisfiability only through the bridge to Mathlib's
computability layer (DescriptiveComplexity.finsat_not_computable).
Relation symbols of the language of encoded first-order sentences in negation normal form.
- le : finsatRel 2
le x y: the order of the syntax. - andN : finsatRel 1
andN g: the nodegis the conjunction of its children. - orN : finsatRel 1
orN g: the nodegis the disjunction of its children. - allN : finsatRel 1
allN g: the nodeguniversally quantifies its bound variable. - exN : finsatRel 1
exN g: the nodegexistentially quantifies its bound variable. - child : finsatRel 2
child g c: the nodecis one of the children of the nodeg. - bind : finsatRel 2
bind g x: the quantifier nodegbinds the variablex. - eqL : finsatRel 3
eqL g x y: the nodegis the literalx = y. - neqL : finsatRel 3
neqL g x y: the nodegis the literalx ≠ y. - posL : finsatRel 2
posL g s: the nodegis a positive atom of the relation symbols. - negL : finsatRel 2
negL g s: the nodegis a negated atom of the relation symbols. - arg : finsatRel 3
arg g p x: the argument of the atomgat positionpis the variablex. - sig : finsatRel 2
sig s p: the relation symbolshas an argument positionp. - root : finsatRel 1
root g: the nodegis the root of the encoded sentence.
Instances For
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The relational vocabulary of encoded first-order sentences: a parse DAG in negation normal form, ordered by the order of its own syntax.
Equations
- FirstOrder.Language.finsat = { Functions := fun (x : ℕ) => Empty, Relations := FirstOrder.Language.finsatRel }
Instances For
Dependency graph
Dependency graph
The order symbol of the syntax.
Instances For
Dependency graph
The symbol marking conjunction nodes.
Instances For
Dependency graph
The symbol marking disjunction nodes.
Instances For
Dependency graph
The symbol marking universal quantifier nodes.
Instances For
Dependency graph
The symbol marking existential quantifier nodes.
Instances For
Dependency graph
The symbol of the child relation of the parse DAG.
Instances For
Dependency graph
The symbol binding a variable to a quantifier node.
Instances For
Dependency graph
The symbol of positive equality literals.
Instances For
Dependency graph
The symbol of negated equality literals.
Instances For
Dependency graph
The symbol of positive atoms.
Instances For
Dependency graph
The symbol of negated atoms.
Instances For
Dependency graph
The symbol giving the arguments of an atom.
Instances For
Dependency graph
The symbol giving the signature of a relation symbol.
Instances For
Dependency graph
The symbol marking the root node.
Instances For
Dependency graph
Reading the encoding #
x precedes y in the order of the syntax.
Equations
Instances For
Dependency graph
x strictly precedes y in the order of the syntax.
Equations
- DescriptiveComplexity.FinSat.OrdLt x y = (DescriptiveComplexity.FinSat.Ord x y ∧ x ≠ y)
Instances For
Dependency graph
The node g is a conjunction.
Equations
Instances For
Dependency graph
The node g is a disjunction.
Equations
Instances For
Dependency graph
The node g is a universal quantifier.
Equations
Instances For
Dependency graph
The node g is an existential quantifier.
Equations
Instances For
Dependency graph
The node c is a child of the node g.
Equations
Instances For
Dependency graph
The quantifier node g binds the variable x.
Equations
Instances For
Dependency graph
The node g is the literal x = y.
Equations
Instances For
Dependency graph
The node g is the literal x ≠ y.
Equations
Instances For
Dependency graph
The node g is a positive atom of the symbol s.
Equations
Instances For
Dependency graph
The node g is a negated atom of the symbol s.
Equations
Instances For
Dependency graph
The argument of the atom g at position p is the variable x.
Equations
Instances For
Dependency graph
The symbol s has an argument position p.
Equations
Instances For
Dependency graph
The node g is the root of the encoded sentence.
Equations
Instances For
Dependency graph
Well-formedness #
Little is required of an instance, and all of it is first-order: the order
symbol is a linear order and children come strictly earlier in it – so the
parse DAG is acyclic, on a finite instance well-founded – together with the
shape of an atom, which carries one symbol and exactly one argument at each
position of that symbol's signature. Nothing is required of the kinds of a
node nor of the multiplicity of binders: the semantics below reads every clause
of gstep as a disjunction, so a node with two kinds simply means the
disjunction of its two readings, and the membership kernel can mirror gstep
clause by clause.
The atom conditions are the ones that cannot be dispensed with, and their reason is the membership proof rather than the semantics: there the model's interpretation of a symbol is recovered from the guessed truth values of the atoms, and two atoms of the same symbol whose arguments have the same values must therefore have the same truth value – which they need not, if an atom may carry two symbols, or lack an argument at a position its symbol declares.
Well-formedness of an encoded sentence: the order symbol is a linear order and the parse DAG descends along it.
- ord_refl (x : A) : Ord x x
The order of the syntax is reflexive.
The order of the syntax is transitive.
The order of the syntax is antisymmetric.
The order of the syntax is total.
Children come strictly earlier: the parse DAG is acyclic.
An atom has at most one argument at each position.
An atom has at most one relation symbol.
An atom only has arguments at the positions of its symbol's signature.
An atom has an argument at every position of its symbol's signature.
Instances For
Dependency graph
Environments #
Updating an environment at one variable. (Classical: the instance is a bare type, with no decidable equality.)
Instances For
Dependency graph
Dependency graph
Dependency graph
Satisfaction #
gstep is the Tarskian truth definition of a node, one clause per kind of
node, with the values of the children supplied by the parameter rec. It is
monotone in rec – this is what negation normal form buys – so iterating it
from the everywhere-false valuation gives an increasing sequence whose union
Gval is the least fixed point, and on a well-formed instance the fixed point
is unique (DescriptiveComplexity.FinSat.Membership).
One unfolding of the truth definition: the value of the node g under
the environment v, given the values rec of the nodes below it. A
conjunction node holds when all its children do, a disjunction node when one
of them does, a quantifier node when all (respectively one) of the values of
its bound variable make all (one of) its children hold; a literal reads the
environment, an atom the interpretation I, on an assignment w of the
argument positions matching the environment on the arguments of the atom.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The truth definition is monotone in the values of the nodes below: no
clause of DescriptiveComplexity.FinSat.gstep uses rec negatively, because
negation is confined to the leaves.
Dependency graph
Satisfaction, by iteration: gval I k v g is the k-th approximant of
the truth of the node g under the environment v.
Equations
- DescriptiveComplexity.FinSat.gval I 0 = fun (x : A → M) (x_1 : A) => False
- DescriptiveComplexity.FinSat.gval I k.succ = DescriptiveComplexity.FinSat.gstep I (DescriptiveComplexity.FinSat.gval I k)
Instances For
Dependency graph
Dependency graph
The node g holds under the environment v: the least fixed point of
the truth definition, reached because a finite parse DAG has finite depth.
Equations
- DescriptiveComplexity.FinSat.Gval I v g = ∃ (k : ℕ), DescriptiveComplexity.FinSat.gval I k v g
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
An interpretation is local when the value of a symbol depends only on the arguments its signature declares.
Equations
- DescriptiveComplexity.FinSat.Local I = ∀ (s : A) (w w' : A → M), (∀ (p : A), DescriptiveComplexity.FinSat.SigG s p → w p = w' p) → (I s w ↔ I s w')
Instances For
Dependency graph
The problem #
The encoded sentence has a finite model: the instance is well-formed and there is a finite nonempty universe with a local interpretation of the relation symbols under which every environment satisfies the root – that is, a finite model of the universal closure of the encoded formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Isomorphism-invariance #
Everything the semantics reads is a relation of the instance, so an
isomorphism transports it. The model is carried over unchanged, its
interpretation composed with the isomorphism
(DescriptiveComplexity.FinSat.mapI); the substance is the transport of
gval, an induction on the fuel with one step per clause of the truth
definition. Only one direction is proved: the converse is the same statement
at the inverse isomorphism.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The positive-or-negative reading of an atom transports along an isomorphism.
Dependency graph
The same transports read backwards, at the inverse isomorphism: the shape
every field of DescriptiveComplexity.FinSat.isWF_map needs.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Well-formedness transports along an isomorphism.
Dependency graph
The interpretation of the symbols, transported along an isomorphism of instances: the model is unchanged, and its interpretation reads the symbol and the argument positions through the isomorphism.
Equations
- DescriptiveComplexity.FinSat.mapI e I s w = I (e.symm s) fun (a : A) => w (e a)
Instances For
Dependency graph
Dependency graph
Reading the transported interpretation at a transported argument is reading the original one.
Dependency graph
Dependency graph
Satisfaction transports along an isomorphism, one clause of the truth definition at a time.
Dependency graph
The problem transports along an isomorphism (one direction; the converse
is this statement at e.symm).
Dependency graph
FINSAT: does the encoded first-order sentence have a finite model? Trakhtenbrot's problem, and the first RE-complete problem of the catalog.
Equations
- One or more equations did not get rendered due to their size.