Reading the encoded sentence off the image #
DescriptiveComplexity.FinSat.Interp builds the sentence σ_A and proves it
well formed (DescriptiveComplexity.FinSat.image_isWF); this file reads it back
as a sentence – what its nodes are, and which of them are children, binders and
literals of which – which is what the correctness of the reduction is then
stated and proved against.
The elements are points #
Every relation of the image but the order demands canonically padded tuples
(DescriptiveComplexity.FinSat.canonG), and a canonical tuple is the padding
of its own prefix (DescriptiveComplexity.pad_pref_of_canon). So the elements
the sentence actually reads are exactly the
DescriptiveComplexity.FinSat.ptOf a₀ t w: a tag together with a tuple of the
tag's own length, padded with the least element. Elements that are not of that
form are junk – variables of the encoded sentence that no node binds and no
literal reads – and DescriptiveComplexity.FinSat.eq_ptOf says they are the
only ones, so every case analysis may assume a point.
This is the idiom the library uses wherever tagged tuples are compared: a def
for the element, an iff lemma for each relation it takes part in, and an
inversion lemma putting an arbitrary element in that form. Matching on a pair
literal at the type FOInterpretation.Map is ill-typed at the transparency
rw and simp work at, so the named constructor is not a convenience but a
requirement.
The points of the image #
An element of the encoded sentence: a tag, and a tuple of the tag's own
length padded with the least element a₀.
Equations
- DescriptiveComplexity.FinSat.ptOf B φ a₀ t w = (t, DescriptiveComplexity.pad a₀ w)
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Junk is the only thing that is not a point: an element whose tuple is canonically padded for its tag is the point of its own prefix.
Dependency graph
Dependency graph
The first coordinate of a point, which is where a tag of dimension one – the prefix, its variable, a literal of a translated atom – holds its element.
Dependency graph
The second coordinate of a point: where a distinctness literal of the diagram holds the second of its two elements.
Dependency graph
The kinds of a node, at a point #
The four kinds are decided by the tag alone
(DescriptiveComplexity.FinSat.andTag and its companions), so at a point they
are read off the tag and nothing else.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The nodes of the encoded sentence, by name #
One definition per tag, so that a statement about the sentence never mentions a
tuple that has to be reduced to be typed. Each is a
DescriptiveComplexity.FinSat.ptOf, definitionally, which is how the lemmas
below are proved: the work is done at ptOf – where the tags are literal
constructors, so simp can reduce the body of a defining formula – and
transported to the named node by exact, which unfolds at the transparency the
matching tactics do not.
The top conjunction of the sentence: the diagram and the translated kernel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The existential of the prefix binding the variable of a.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The variable that existential binds.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The distinctness literal x_a ≠ x_b of the diagram.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The variable naming a de Bruijn level of the kernel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The relation symbol of a relation variable of the block.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
An argument position of the relation symbols.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The translation of the subformula at a position, at a polarity.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
One tuple of the translation of an atom the sentence may not mention.
Equations
- DescriptiveComplexity.FinSat.atupPt B φ a₀ p pol w = DescriptiveComplexity.FinSat.ptOf B φ a₀ (DescriptiveComplexity.FinSat.Tag.atup p pol) w
Instances For
Dependency graph
One equality literal inside such a tuple.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The relations that read the tuples #
child, bind and the two equality literals are not decided by the tags alone:
their bodies compare the elements the tuples hold. Each is bridged to its named
body (DescriptiveComplexity.FinSat.childBodyF and its companions) read at the
valuation the interpretation supplies, and then computed at the tags it is
defined for.
The bridge is stated at points, not at two arbitrary elements projected with
.1: a projection out of FOInterpretation.Map is ill-typed at the
transparency simp matches at, so childBodyF B φ g.1 c.1 would never reduce
even with both tags known. At a point the tag is syntactically there.
The valuation a unary defining formula of the image is read at.
Equations
- DescriptiveComplexity.FinSat.val₁ B φ x q = (![x] q.1).2 q.2
Instances For
Dependency graph
The valuation a binary defining formula of the image is read at.
Equations
- DescriptiveComplexity.FinSat.val₂ B φ x y q = (![x, y] q.1).2 q.2
Instances For
Dependency graph
The valuation a ternary defining formula of the image is read at.
Instances For
Dependency graph
The child relation at a pair of points: canonicity is automatic, so only the body is left.
Dependency graph
The child relation, node by node #
The existential prefix is a chain: the node of a has the node of the
next element of the input order as its child.
Dependency graph
The last node of the prefix hands over the top conjunction: the node of the greatest element of the input order.
Dependency graph
The top conjunction takes the distinctness literals of the diagram – and
only those of distinct pairs: the literal of (a, a) says x_a ≠ x_a, which
no environment satisfies, so it must not be a conjunct.
Dependency graph
The top conjunction takes the root of the translated kernel, and nothing else of the kernel.
Dependency graph
Inside the translated kernel the child relation follows
DescriptiveComplexity.FinSat.kidOf, the polarity flipping exactly at the
premise of an implication.
Dependency graph
A translated atom takes the tuple nodes where it holds: the one place the reduction reads the input structure, and the reason the encoded sentence never mentions a symbol of the input vocabulary.
Dependency graph
Each tuple node takes one equality literal per argument position, binding that argument to the variable of the corresponding element.
Dependency graph
The binders, the literals and the root #
Dependency graph
Each node of the prefix binds its own variable.
Dependency graph
A quantifier of the kernel binds the variable of the de Bruijn level it introduces.
Dependency graph
Dependency graph
The diagram: the literal of the pair (a, b) says that the variables of
a and of b are distinct, and it exists only for a ≠ b.
Dependency graph
Dependency graph
The root of the encoded sentence is the node of the prefix binding the least element of the input order: the outermost existential.
Dependency graph
Inversion: these are the only children #
The truth definition quantifies over all the children of a node, so reading
σ_A needs the converse of the lemmas above: which elements of the image are
children of a given node, and no others. Everything rests on canonicity – a
relation of the image holds only of canonically padded tuples, and those are the
points – so an arbitrary element can always be replaced by a point, after which
the tag alone decides.
Every canonically padded element is a point.
Dependency graph
Dependency graph
Dependency graph
A child is a point: the child relation of the image never leaves the elements the sentence reads.
Dependency graph
A tag pair the child relation is not defined at has no edge.
Dependency graph
The tuples of the tags of dimension zero, one and two, read out: what the inversion lemmas put an arbitrary tuple back into.
Dependency graph
Dependency graph
Dependency graph
The children of the top conjunction: every distinctness literal of the
diagram, and the root of the translated kernel at polarity true.
Dependency graph
The children of a node of the existential prefix: the node of the next element of the input order, and – at the greatest element – the top conjunction.
Dependency graph
The literals and the atoms, node by node #
The remaining clauses of the truth definition: the equality literals of the kernel and of the translated atoms, and the atoms of the relation variables – the only genuine atoms of the encoded sentence – with their symbols, their argument positions and their signature. All but the literals of a translated atom are decided by the tags.
Dependency graph
A positive equality of the kernel, between the variables of two de Bruijn levels.
Dependency graph
A negated equality of the kernel.
Dependency graph
A literal of a translated atom: the argument of the atom at one position is the variable of the element that tuple holds there.
Dependency graph
The same, negated: what a tuple of a negatively translated atom asks.
Dependency graph
The atoms of the relation variables, which the encoded sentence does name: all four relations are decided by the tags.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The children of the translated kernel #
Inside the kernel a node takes the nodes of its children positions – the polarity flipping exactly at the premise of an implication – and, where the kernel carries an atom the sentence may not mention, the tuple nodes of that atom, each of which takes one equality literal per argument. A tuple node of another position is never a child, which is what makes the translation of two atoms independent.
A kernel node only takes tuple nodes of its own position and polarity.
Dependency graph
A tuple node only takes literals of its own position and polarity.
Dependency graph
The children of a node of the translated kernel.
Dependency graph
The children of a tuple node: one equality literal per argument position, binding that argument to the variable of the element the tuple holds there.
Dependency graph
The binders of a quantifier node #
The quantifier clauses of the truth definition quantify over the variables a
node binds, so they need the converse of
DescriptiveComplexity.FinSat.bindG_nd_dbvar: a quantifier of the kernel binds
the variable of the de Bruijn level it introduces, and nothing else.
A binder is a point.
Dependency graph
A tag pair the binding relation is not defined at binds nothing.
Dependency graph
What a quantifier of the kernel binds: the variable of the de Bruijn level it introduces, and nothing else.
Dependency graph
The environment, as a de Bruijn context #
An environment of the encoded sentence assigns a model element to every element
of the image; what the kernel's own recursion reads is only its restriction to
the variables of the de Bruijn levels. Passing under a quantifier updates the
environment at one variable, and that is exactly Fin.snoc on the context
tuple – the one calculation the quantifier case of the kernel recursion
needs.
The variables of two distinct de Bruijn levels are distinct elements.
Dependency graph
The de Bruijn context an environment carries.
Equations
- DescriptiveComplexity.FinSat.envOf B φ a₀ v l = v (DescriptiveComplexity.FinSat.dbvarPt B φ a₀ l)
Instances For
Dependency graph
Passing under a quantifier is Fin.snoc: updating the environment at
the variable of level n extends the context tuple of length n by the value
bound there.
Dependency graph
The equality literals of the kernel, inverted #
The truth definition's literal clauses quantify over the two elements an equality relates, so, as with the children, an arbitrary pair has to be put back into points and the tags then decide.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The positive equality literals of a kernel node: the variables of the two
de Bruijn levels the kernel compares there, at polarity true.
Dependency graph
The same for the negated equalities.
Dependency graph
The existential prefix, evaluated #
The prefix is the one chain of the encoded sentence, and the one place the proof
walks the input order. Its evaluation needs nothing about the kernel: given that
the top conjunction holds under the environment sending each variable x_b to
its intended value, every node of the prefix holds – by downward induction, from
the greatest element of the input order, where the child is the top conjunction,
to the least, which is the root of the sentence.
The variables of the prefix are pairwise distinct: they are the elements the sentence's diagram forces apart.
Dependency graph
The prefix holds: at every element of the input order, provided the top conjunction holds once every variable has been given its intended value.
Dependency graph
A tag the root marker is not defined at marks nothing.
Dependency graph
The root of the encoded sentence holds, which is what finite satisfiability asks: the root is the prefix node of the least element, and no variable is bound outside it.
Dependency graph
The diagram, evaluated #
What is left of the ⟹ direction, once the prefix is walked: the top conjunction. Its children are the distinctness literals and the root of the translated kernel, so it holds as soon as the environment separates the variables of distinct elements – which the intended assignment does, being injective – and the kernel holds.
The top conjunction holds when the environment separates the variables of distinct elements and the root of the translated kernel holds.
Dependency graph
The encoded sentence holds, modulo its kernel: the whole of the ⟹
direction that does not depend on φ. An injective intended assignment ι of
the prefix variables satisfies the diagram, the prefix chain carries it to the
root, and what is left to prove of σ_A is that the root of the translated
kernel holds under every environment giving the prefix variables their intended
values.
Dependency graph
The model side: an interpretation from an assignment of the block #
DescriptiveComplexity.FinSat.FinSatOn asks for a model together with a local
interpretation – one that reads a symbol only at the argument positions of its
own signature. The relation variables of the block give one: the symbol of a
variable is interpreted by that variable's relation, read at the argument
positions. Locality is what makes it a relation of the symbol's own arity rather
than of the whole universe, and it is the condition the truth definition's atom
clauses are stated against.
Distinct relation variables get distinct symbols.
Dependency graph
The arguments an assignment of the argument positions gives to a relation variable. A variable of the block whose arity exceeds the dimension cannot occur in the kernel, so the sentence never reads it; the value taken there is immaterial, and reading it at the first position keeps the whole tuple inside the symbol's signature, which is what locality asks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The interpretation determined by an assignment of the block.
Equations
- DescriptiveComplexity.FinSat.blockI B φ a₀ μ s w = ∃ (i : B.ι), s = DescriptiveComplexity.FinSat.symPt B φ a₀ i ∧ μ i (DescriptiveComplexity.FinSat.argTup B φ a₀ i w)
Instances For
Dependency graph
The arguments of a relation variable are read inside its signature.
Dependency graph
The interpretation is local, so it is a genuine interpretation of the encoded sentence's vocabulary.
Dependency graph
The atom of a relation variable, read on the image: at a node carrying a block atom of the kernel, the interpretation holds of an assignment exactly when the variable's relation holds of the arguments that assignment gives.
Dependency graph
The atom clause does not depend on the assignment it is read at #
The truth definition reads an atom at some assignment of the argument
positions matching the environment on the atom's arguments. Two such assignments
agree on every position of the symbol's signature – that is what
DescriptiveComplexity.FinSat.IsWF.arg_tot gives – so a local interpretation
cannot tell them apart, and the clause may always be read at the canonical
assignment below. This is the one place the shape conditions of well-formedness
are used for something other than being proved.
The canonical assignment of the argument positions of a node: the value of the argument sitting there, and anything at all elsewhere.
Equations
- DescriptiveComplexity.FinSat.argAssign B φ v g junk q = if h : ∃ (x : (DescriptiveComplexity.FinSat.finsatInterp B φ).Map A), DescriptiveComplexity.FinSat.ArgG g q x then v h.choose else junk
Instances For
Dependency graph
It does match the environment on the arguments – the atom of the image has at most one argument at each position.
Dependency graph
Any matching assignment gives the atom the same value as the canonical one: they agree on the signature of the symbol, and the interpretation is local.
Dependency graph
The atoms of the relation variables, evaluated #
Putting the last three pieces together: at a node of the kernel carrying an atom of a relation variable, the atom clause of the truth definition says exactly that the variable's relation holds of the values its arguments take. This is the one clause of the kernel recursion that mentions the model at all.
An element canonical at dimension zero carrying the tag of a symbol is that symbol.
Dependency graph
The symbol of an atom of the image: a node of the kernel carries a
positive atom exactly when it sits at polarity true on a block atom, and then
the symbol is that of its relation variable.
Dependency graph
The same at polarity false: a negated atom.
Dependency graph
The positive-atom clause of the truth definition, evaluated.
Dependency graph
The negated-atom clause, the same at polarity false.
Dependency graph
The nodes of a translated atom #
An atom the sentence may not mention becomes a disjunction over the tuples where it holds, each tuple a conjunction of equality literals pinning one argument to a prefix variable. Those two node kinds need the same treatment as the kernel's: which clause of the truth definition fires, and which elements it relates.
A node that is not a translation of a kernel position carries no atom.
Dependency graph
Dependency graph
A tuple node of a translated atom carries no equality literal: it is a conjunction of them, not one itself.
Dependency graph
Dependency graph
The equality literal of a translated atom, inverted: it relates the variable of the argument's de Bruijn level to the prefix variable of the element its tuple holds there.
Dependency graph
The same for a negatively translated atom.
Dependency graph
The one place the input structure is read #
The tuple nodes of a translated atom are selected by a defining formula, so
reading them off the image means realizing that formula: for an atom of the
input vocabulary it is the atom itself, at the tuple the node holds; for the
marker old it is ⊤, since every original element is old. The kernelNode
equation is a hypothesis to rewrite with – its arity is an implicit argument,
so destructing it would land in HEq.
Dependency graph
Dependency graph
The truth definition at a node of the kernel #
What the kernel says at a position decides which clause of the truth definition
can fire there, and the other seven are then vacuous. These two lemmas do that
bookkeeping once: at a node translating an n-ary connective – falsity, an
implication or an atom the sentence may not mention – the value is the
disjunction of the children's at polarity true and their conjunction at
polarity false.
Dependency graph
Dependency graph
At a quantifier node the value is the conjunction (respectively the disjunction) over the model of the child's, the bound variable of the level the quantifier introduces taking each value in turn.
Dependency graph
Dependency graph
At a node translating an equality of the kernel the value is that equality, read at the variables of the two de Bruijn levels.
Dependency graph
Dependency graph
At a node translating an atom of a relation variable – the only genuine atoms of the encoded sentence – the value is that relation, read at the values of the atom's arguments.
Dependency graph
Dependency graph
The kernel, position by position #
The cases of the induction, each stated for a subformula of the kernel embedded
by a DescriptiveComplexity.FinSat.SubEmb: the shape facts come from
SubEmb.node, the children from SubEmb.kid and
SubEmb.kid_range through
DescriptiveComplexity.FinSat.childG_nd_iff.
A node translating falsity has no children at all: at polarity true it
is the empty disjunction, which is false, and at false the empty conjunction,
which is true.
Dependency graph
A node translating an implication: at polarity true it is the
disjunction of the negated premise and the conclusion, at false the
conjunction of the premise and the negated conclusion – negation normal form,
as a polarity flag on the premise.
Dependency graph
A node translating a quantifier: at polarity true it is the
conjunction over the model of the body's values, at false the disjunction –
the variable of the de Bruijn level the quantifier introduces taking each value
of the model in turn.
Dependency graph
A node translating an equality of the kernel: the equality of the values
of the two variables, negated at polarity false.
Dependency graph
A node translating an atom of a relation variable: the relation the assignment gives that variable, read at the values of the atom's arguments.
Dependency graph
The truth definition at the two node kinds of a translated atom: a tuple node is the conjunction of its literals (the disjunction, at a negatively translated atom), and a literal is the equality it carries.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
A tuple node of a translated atom is the conjunction of its literals, one per argument position.
Dependency graph
At a negatively translated atom the tuple node is the disjunction of its literals: negation normal form has pushed the negation to the leaves.
Dependency graph
A node translating an atom the sentence may not mention: the disjunction,
over the tuples where the atom holds, of the conjunctions of its literals – and
dually at polarity false. This is the Tseitin trick: the tuples are selected by
a defining formula, so the input structure is read by the interpretation and
never by the encoded sentence.
Dependency graph
A literal of a translated atom, evaluated: it pins the argument at its position to the prefix variable of the element the tuple holds there.
Dependency graph
Dependency graph
The kernel, by induction on the formula #
The node lemmas above are stated about a position; tying them together is an
induction on the kernel itself, carried by a
DescriptiveComplexity.FinSat.SubEmb – a subformula together with an embedding
of its positions into the kernel's – so that the clause of a node, which
quantifies over all the children it has in the kernel, collapses to the
subformula (SubEmb.no_children, SubEmb.imp_children, SubEmb.all_children).
Two things fall out of the same induction rather than being assumed: negation
normal form, as the second half of each statement, and the quantifier step,
where updating the environment at the variable of the level bound there is
Fin.snoc on the context tuple (pref_envOf_upd).
The model is any structure over DescriptiveComplexity.newLang L whose
relations are read through an injection ι of the instance – the shape an
extended universe A ⊕ Fin m has (DescriptiveComplexity.relMap_ext_iff), and
the only thing about it the translation uses.
The arguments of an atom of a relation variable: the canonical assignment of the argument positions gives, at each of them, the value of the variable of that argument's de Bruijn level.
Dependency graph
The second point a binary defining formula of the image is read at.
Dependency graph
The de Bruijn levels of the arguments of a translated atom, and the values its terms take: in a relational vocabulary every argument is a variable, so it has a level, and the value of the term is the context tuple there.
Dependency graph
A node translating an atom the sentence may not mention, evaluated: the
disjunction over the tuples the defining formula selects, of the conjunctions of
the literals pinning each argument to a prefix variable, is the atom – read at
the values the environment gives the arguments' de Bruijn levels, through the
intended assignment ι of the prefix variables.
Stated once for the two shapes it serves: an atom of the input vocabulary, where
the filter Filt is the atom itself, and the marker old, where it is ⊤.
Dependency graph
The translated kernel computes the kernel: at every position of the
kernel the node of the encoded sentence at polarity true holds exactly when
the subformula there does, and the node at polarity false exactly when it does
not.
The environment gives the prefix variables their intended values ι and the
variables of the de Bruijn levels the context tuple; the model reads the
relations of the instance through ι, which is what an extended universe
does.