The bit-level logic, and definability in it #
The syntax the machines of DescriptiveComplexity.LogTime.Machine decide, and
an API for building sentences of it the way
DescriptiveComplexity.LogTime.Definable builds sentences of FO(≤, +, ×):
semantically, from the connectives and the quantifiers, with the sentence read
off only at the end.
The logic #
DescriptiveComplexity.BitAtom, over an arbitrary type of variables: the order,
the addition of ranks, the bit at an index BitIx i x, and an input relation
at a tuple of variables. Four atoms, and nothing here is ×. This is
FO(≤, +, BIT) in the classical naming – BIT(x, i) with i an element – which
is what makes the bit atom a reading the machine can perform at a guessed
address, and the arithmetic of positions the plain arithmetic of the universe.
A DescriptiveComplexity.BitSentence is a quantifier prefix – a polarity per
variable, exactly the shape a machine's registers have – over a quantifier-free
DescriptiveComplexity.BitKernel. It is prenex by construction, and that is the
point: a machine has no normal form to apply, so the logic must arrive in one.
Definability, and why the API is not the one for ArithDef #
DescriptiveComplexity.BitDef says that a family of relations on valuations is
realized by a prefix over a kernel, not by an arbitrary formula. So the
closure lemmas cannot simply build a larger formula: each of them has to
prenex as it goes, and the three lemmas that let it do so are in
DescriptiveComplexity.LogTime.Machine –
DescriptiveComplexity.prefixHolds_not (negation dualizes a prefix),
DescriptiveComplexity.prefixHolds_and_const (a prefix absorbs a side
condition) and DescriptiveComplexity.prefixHolds_add (two prefixes
concatenate). That is what replaces a normal-form theorem, and it is why
disjunction is derived from negation and conjunction rather than proved: doing
so costs one congr instead of a fourth prefix lemma.
Where it lands #
DescriptiveComplexity.BitDef.bitDefinable reads a closed relation as a
sentence, and DescriptiveComplexity.BitDefinable.ac0Definable translates the
whole logic into FO(≤, +, ×) atom by atom. Three of the four atoms translate
outright (DescriptiveComplexity.arithDef_le, _plus, _rel); the bit atom
goes through DescriptiveComplexity.powArithDef, the definability of
i ↦ 2 ^ i, which is proved in DescriptiveComplexity.LogTime.Pow and so costs
the statement no hypothesis. The converse direction, that a machine's acceptance
is a sentence of this logic rather than of the arithmetic one, is
DescriptiveComplexity.LogTime.Simulate.
The syntax #
The atoms of the bit-level logic: the order, the addition of ranks, the bit of an element at an index, and an input relation at a tuple of variables.
- le
{L : FirstOrder.Language}
{γ : Type}
(x y : γ)
: BitAtom L γ
x ≤ y. - plus
{L : FirstOrder.Language}
{γ : Type}
(x y z : γ)
: BitAtom L γ
orank x + orank y = orank z. - bit
{L : FirstOrder.Language}
{γ : Type}
(i x : γ)
: BitAtom L γ
The bit of
xat the indexiis set. - rel
{L : FirstOrder.Language}
{γ : Type}
{a : ℕ}
(R : L.Relations a)
(arg : Fin a → γ)
: BitAtom L γ
An input relation at a tuple of variables.
Instances For
Dependency graph
A quantifier-free kernel over the bit-level atoms.
- atom
{L : FirstOrder.Language}
{γ : Type}
(a : BitAtom L γ)
: BitKernel L γ
An atom.
- tt
{L : FirstOrder.Language}
{γ : Type}
: BitKernel L γ
The constant
true, so that a trivial relation needs no dummy variable. - not
{L : FirstOrder.Language}
{γ : Type}
(k : BitKernel L γ)
: BitKernel L γ
Negation.
- and
{L : FirstOrder.Language}
{γ : Type}
(k k' : BitKernel L γ)
: BitKernel L γ
Conjunction.
- or
{L : FirstOrder.Language}
{γ : Type}
(k k' : BitKernel L γ)
: BitKernel L γ
Disjunction.
Instances For
Dependency graph
A sentence of the bit-level logic, in prenex form: a polarity per variable and a quantifier-free kernel. Prenex by construction, which is what makes the compilation into a machine a matter of atoms rather than of normal forms.
- vars : ℕ
The number of quantified variables.
The quantifier at each variable:
trueexistential,falseuniversal.The quantifier-free kernel.
Instances For
Dependency graph
What an atom says of a valuation.
Equations
- (DescriptiveComplexity.BitAtom.le x_2 y).Holds x✝ = (x✝ x_2 ≤ x✝ y)
- (DescriptiveComplexity.BitAtom.plus x_2 y z).Holds x✝ = (DescriptiveComplexity.orank (x✝ x_2) + DescriptiveComplexity.orank (x✝ y) = DescriptiveComplexity.orank (x✝ z))
- (DescriptiveComplexity.BitAtom.bit i x_2).Holds x✝ = DescriptiveComplexity.BitIx (x✝ i) (x✝ x_2)
- (DescriptiveComplexity.BitAtom.rel R arg).Holds x✝ = FirstOrder.Language.Structure.RelMap R fun (t : Fin a) => x✝ (arg t)
Instances For
Dependency graph
Renaming the variables of an atom.
Equations
- DescriptiveComplexity.BitAtom.relabel f (DescriptiveComplexity.BitAtom.le x_1 y) = DescriptiveComplexity.BitAtom.le (f x_1) (f y)
- DescriptiveComplexity.BitAtom.relabel f (DescriptiveComplexity.BitAtom.plus x_1 y z) = DescriptiveComplexity.BitAtom.plus (f x_1) (f y) (f z)
- DescriptiveComplexity.BitAtom.relabel f (DescriptiveComplexity.BitAtom.bit i x_1) = DescriptiveComplexity.BitAtom.bit (f i) (f x_1)
- DescriptiveComplexity.BitAtom.relabel f (DescriptiveComplexity.BitAtom.rel R arg) = DescriptiveComplexity.BitAtom.rel R fun (t : Fin a) => f (arg t)
Instances For
Dependency graph
Renaming is composition on the valuation.
Dependency graph
What a kernel says of a valuation.
Equations
Instances For
Dependency graph
Renaming the variables of a kernel.
Equations
- DescriptiveComplexity.BitKernel.relabel f (DescriptiveComplexity.BitKernel.atom a) = DescriptiveComplexity.BitKernel.atom (DescriptiveComplexity.BitAtom.relabel f a)
- DescriptiveComplexity.BitKernel.relabel f DescriptiveComplexity.BitKernel.tt = DescriptiveComplexity.BitKernel.tt
- DescriptiveComplexity.BitKernel.relabel f k.not = (DescriptiveComplexity.BitKernel.relabel f k).not
- DescriptiveComplexity.BitKernel.relabel f (k.and k') = (DescriptiveComplexity.BitKernel.relabel f k).and (DescriptiveComplexity.BitKernel.relabel f k')
- DescriptiveComplexity.BitKernel.relabel f (k.or k') = (DescriptiveComplexity.BitKernel.relabel f k).or (DescriptiveComplexity.BitKernel.relabel f k')
Instances For
Dependency graph
Renaming is composition on the valuation.
Dependency graph
What a sentence says of an instance: the prefix, played over the kernel.
Equations
Instances For
Dependency graph
A decision problem is bit-definable when a prenex sentence over the
order, the addition and the bit at an index – FO(≤, +, BIT) – decides it on
every nonempty finite ordered structure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Definable relations with free variables #
A family of relations is bit-definable when one quantifier prefix over
one quantifier-free bit-level kernel realizes it in every nonempty finite
ordered structure. The free variables are indexed by α, the quantified ones by
Fin k, exactly as a machine's registers are.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Composing a valuation with a renaming that fixes the free variables.
Dependency graph
Definability transfers along a pointwise equivalence of relations.
Dependency graph
Renaming the free variables.
Dependency graph
Connectives #
The negation of a bit-definable relation is bit-definable: the prefix dualizes.
Dependency graph
The conjunction of two bit-definable relations is bit-definable: the two prefixes concatenate.
Dependency graph
The always-true relation is bit-definable.
Dependency graph
The always-false relation is bit-definable.
Dependency graph
The disjunction of two bit-definable relations is bit-definable, by De
Morgan: one congr rather than a fourth prefix lemma.
Dependency graph
An implication between bit-definable relations is bit-definable.
Dependency graph
An equivalence between bit-definable relations is bit-definable.
Dependency graph
A case distinction made outside the structure is bit-definable when both branches are.
Dependency graph
A truth value fixed outside the structure is bit-definable.
Dependency graph
A finite conjunction of bit-definable relations, the index ranging over
a Fin k of the machine rather than of the instance.
Dependency graph
A conjunction over any finite index of the machine.
Dependency graph
A disjunction over any finite index of the machine, by De Morgan.
Dependency graph
Quantifiers #
A quantifier prefix of m variables, prepended. The new block is
outermost, so it is the first m indices of Fin (m + k); this is the one
construction that touches the prefix, and exs/alls below are its
constant-polarity instances. A machine's register list is the general case.
Dependency graph
Existential quantification of a block of m variables at once.
Dependency graph
Universal quantification of a block of m variables at once.
Dependency graph
Existential quantification of one variable, in the layout the
ArithDef API uses.
Dependency graph
Universal quantification of one variable, in the same layout.
Dependency graph
The order between two variables is bit-definable.
Dependency graph
Addition of the ranks of three variables is bit-definable.
Dependency graph
The bit at an index is bit-definable: it is an atom of this logic, and the one the machine reads by addressing.
Dependency graph
Reading the input: an input relation at a tuple of variables is bit-definable. In the machine reading of this logic it is the query instruction.
Dependency graph
The strict order is bit-definable.
Dependency graph
Being the least element is bit-definable: x + x = x.
Dependency graph
Being the least nonzero element is bit-definable. Where FO(≤, +, ×)
reads orank x = 1 off the idempotence x * x = x, this logic has no × and
reads it off the order: nonzero, and below every nonzero element.
Dependency graph
Being the greatest element is bit-definable, through the order alone.
Dependency graph
The top index is bit-definable, and with nothing but the order and the
bit atom: it is the highest index carrying a bit of the greatest element
(DescriptiveComplexity.isTopIx_iff_bits). This is where the index naming pays
for itself – the end of the tape is read, where the place-value naming had to
compute a doubling that overflows.
Dependency graph
A low index is bit-definable in the same way: one with a bit of the greatest element above it.
Dependency graph
Equality is bit-definable, through the order.
Dependency graph
Into FO(≤, +, ×) #
The translation that makes the bit-level logic a sub-notion of
DescriptiveComplexity.AC0Definable without going through the machine: atom
by atom, then the Boolean structure, then the prefix. Doing it here rather than
through DescriptiveComplexity.LTDecidable.ac0Definable is what lets the
simulation of a machine land in this logic rather than in the arithmetic one.
Every bit-level atom is an atom of FO(≤, +, ×) – the bit atom through the
naming bridge DescriptiveComplexity.powArithDef, the other three outright.
Dependency graph
Every quantifier-free kernel is a formula of FO(≤, +, ×).
Dependency graph
The renaming that peels the innermost quantified variable, moving it out of
the block and into the Fin 1 the ArithDef quantifiers bind.
Equations
Instances For
Dependency graph
Peeling a variable is Fin.snoc on the valuation.
Dependency graph
A quantifier prefix is a block of ArithDef quantifiers.
Dependency graph
From a closed relation to a sentence #
The bridge to DescriptiveComplexity.BitDefinable: a bit-definable
relation with no free variables is a sentence of the bit-level logic.
Dependency graph
The bit-level logic is inside FO(≤, +, ×): a BitSentence is an AC⁰
definition, proved directly rather than through the machine. Its bit atom is
translated by DescriptiveComplexity.powArithDef, which is
Immerman 1999 Thm 1.17(2); every other atom is a
formula of the two numeric predicates outright.