The numeric predicates: the arithmetic expansion of a vocabulary #
The vocabulary of the bottom class of the ordered world. A finite linearly
ordered universe is an initial segment of ℕ, by the rank of an element
(DescriptiveComplexity.orank, the number of its strict predecessors), and this
file makes the arithmetic of that segment available to formulas: the language
FirstOrder.Language.arith has a binary ≤ and two ternary symbols
plus and times, interpreted on a finite linear order by
Relations, not functions, and therefore truncated: a sum or product that does
not fit in the universe simply has no witness, and “x + y overflows” is the
first-order ¬∃z, plus x y z (DescriptiveComplexity.no_plus_iff_card_le).
Why relations of the order, and not a new sort of data #
The numeric predicates are not extra input relations that an instance happens
to carry: they are functions of the linear order, computed by orank. Three
consequences, all of them design constraints rather than remarks.
- The canonical structure needs
[LinearOrder A] [Finite A], where Mathlib'sFirstOrder.Language.orderStructureneeds only[LE A]. It is still aninstance; it simply does not fire on an infinite type, which is correct – the arithmetic of an infinite universe is not what this vocabulary means. - There is no order-free reading of this vocabulary at all. Every logic built
on it is intrinsically a logic of ordered structures, and the class
DescriptiveComplexity.AC0Definableaccordingly has no…Freevariant, unlike ∃SO,SO(LFP)orSO(PFP). - Because the interpretation is canonical, an interpretation of one
vocabulary in another does not get the numeric predicates for free: it must
define the arithmetic of the interpreted universe, which is why the arithmetic
analogue of
DescriptiveComplexity.FOInterpretation.ordExtendis real work and not plumbing.
The transport from the ordered expansion #
DescriptiveComplexity.sumOrderToArith is the language map
L.sum Language.order →ᴸ L.sum Language.arith sending ≤ to ≤, with its
FirstOrder.Language.LHom.IsExpansionOn instance, so that every FO(≤) sentence
and every FO(≤) gadget formula of this library can be read as an arithmetic one
(DescriptiveComplexity.FODefinable.ac0Definable is the consumer).
It is stated at the level of the sum rather than as a map
Language.order →ᴸ Language.arith lifted by LHom.sumMap, deliberately:
Language.order.Structure is not an instance in Mathlib (it would fire on every
LE), so the generic sumMap instance would have to be fed a letI-supplied
structure at every use site, whereas the sum-level map has both structures
available by instance search.
What is here, and what needs it #
Besides the vocabulary and its semantics: the formula builders (aLeF, aLtF,
aPlusF, aTimesF, aMaxF, aMinF) with their realization lemmas, the
overflow characterization, and one worked sentence –
DescriptiveComplexity.evenCardSentence, which says that the universe has an
even number of elements, by reading the parity of the rank of its greatest
element. That sentence is what separates FO(≤) from AC⁰
(DescriptiveComplexity.Problems.Even), and it is the smallest example of the
one thing the numeric predicates buy over a bare order: access to the size of
the universe, one bit at a time.
Relation symbols of the arithmetic vocabulary.
- le : arithRel 2
le x y: the rank ofxis at most the rank ofy, i.e.,x ≤ y. - plus : arithRel 3
plus x y z: the ranks satisfyorank x + orank y = orank z. - times : arithRel 3
times x y z: the ranks satisfyorank x * orank y = orank z.
Instances For
Dependency graph
Equations
- FirstOrder.Language.instDecidableEqArithRel.decEq FirstOrder.Language.arithRel.le FirstOrder.Language.arithRel.le = isTrue FirstOrder.Language.instDecidableEqArithRel.decEq._proof_1
- FirstOrder.Language.instDecidableEqArithRel.decEq FirstOrder.Language.arithRel.plus FirstOrder.Language.arithRel.plus = isTrue FirstOrder.Language.instDecidableEqArithRel.decEq._proof_2
- FirstOrder.Language.instDecidableEqArithRel.decEq FirstOrder.Language.arithRel.plus FirstOrder.Language.arithRel.times = isFalse FirstOrder.Language.instDecidableEqArithRel.decEq._proof_3
- FirstOrder.Language.instDecidableEqArithRel.decEq FirstOrder.Language.arithRel.times FirstOrder.Language.arithRel.plus = isFalse FirstOrder.Language.instDecidableEqArithRel.decEq._proof_4
- FirstOrder.Language.instDecidableEqArithRel.decEq FirstOrder.Language.arithRel.times FirstOrder.Language.arithRel.times = isTrue FirstOrder.Language.instDecidableEqArithRel.decEq._proof_5
Instances For
Dependency graph
Dependency graph
The relational vocabulary of the numeric predicates: a linear order and the
graphs of addition and multiplication of ranks. Interpreted canonically on every
finite linear order by DescriptiveComplexity.arithStructure.
Equations
- FirstOrder.Language.arith = { Functions := fun (x : ℕ) => Empty, Relations := FirstOrder.Language.arithRel }
Instances For
Dependency graph
Dependency graph
The order symbol of the arithmetic vocabulary.
Instances For
Dependency graph
The addition symbol of the arithmetic vocabulary.
Instances For
Dependency graph
The multiplication symbol of the arithmetic vocabulary.
Instances For
Dependency graph
The canonical interpretation on a finite linear order #
The numeric predicates of a finite linear order: ≤ is the order, and
plus/times are the graphs of addition and multiplication of ranks. Both are
truncated: a value that is not the rank of an element of A is not related to
anything.
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The symbols of the arithmetic expansion of a vocabulary #
The order symbol, in the arithmetic expansion of L.
Instances For
Dependency graph
The addition symbol, in the arithmetic expansion of L.
Instances For
Dependency graph
The multiplication symbol, in the arithmetic expansion of L.
Instances For
Dependency graph
The numeric predicates of the arithmetic expansion #
Dependency graph
Dependency graph
Dependency graph
The transport of an ordered formula into the arithmetic expansion #
The arithmetic expansion extends the ordered one: the language map
sending the order symbol of Language.order to the order symbol of
Language.arith, and every input symbol to itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The transport is an expansion: both vocabularies read ≤ as the order and
the input symbols as themselves.
Dependency graph
Formula builders #
x ≤ y, as a formula over the arithmetic expansion.
Equations
Instances For
Dependency graph
x < y, as a formula over the arithmetic expansion.
Equations
Instances For
Dependency graph
x + y = z, as a formula over the arithmetic expansion.
Equations
Instances For
Dependency graph
x * y = z, as a formula over the arithmetic expansion.
Equations
Instances For
Dependency graph
The variable x holds a minimum.
Equations
Instances For
Dependency graph
The variable x holds a maximum.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Ranks, minima and covers #
The order facts every walk over the ranks needs, stated once here because both
routes to a complexity bound use them: the induction of
DescriptiveComplexity.ArithmeticFixedPoint and the head programs of
DescriptiveComplexity.HeadArith.
An element of rank 0 is least.
Dependency graph
The rank of an element with an immediate predecessor is one more.
Dependency graph
A rank one higher is a cover: the converse of
DescriptiveComplexity.orank_covBy, which is what lets a walk step a head by
choosing the element of the next rank.
Dependency graph
An element of positive rank has an immediate predecessor, of the rank below.
Dependency graph
Truncation, and the size of the universe #
Addition is truncated at the size of the universe: a sum has a witness
exactly when it is small enough to be a rank. This is what makes “x + y
overflows” a first-order statement.
Dependency graph
The parity of the universe is a numeric predicate. The greatest element
has rank Nat.card A - 1, so the universe has an even number of elements
exactly when no element doubles to the greatest one. The order alone cannot say
this (DescriptiveComplexity.even_not_foDefinable); addition can.
Dependency graph
A sentence for the parity of the universe #
The universe has an even number of elements, as a sentence of the arithmetic expansion: no maximum is the double of anything. The two quantifiers are the whole sentence – nothing about the input vocabulary is read, so this is a statement about the size of the instance, which is exactly what a bare order cannot express and the numeric predicates can.
Equations
- One or more equations did not get rendered due to their size.