Sorted enumerations, and matchings between them #
The list layer under DescriptiveComplexity.PCP ∈ RE. A word of a Post
instance is a partial map from a finite linear order to letters
(DescriptiveComplexity.Pcp.IsWordU), so everything the semantics reads is
mediated by the strictly increasing list enumerating the positions used. This
file is that mediation, stated for arbitrary relations and lists:
DescriptiveComplexity.Pcp.IsEnum– being the strictly increasing enumeration of a predicate, andDescriptiveComplexity.Pcp.exists_isEnum, which produces one over a finite type carrying a linear order relation (DescriptiveComplexity.IsLinOrd), by sorting;- the two ways a parse of a concatenation is built out of the parses of its
blocks:
DescriptiveComplexity.Pcp.forall₂_flatMapfor the letters andList.pairwise_flatMapfor the order; DescriptiveComplexity.Pcp.forall₂_of_matching, the lemma of the file: a relation between the members of two strictly sorted lists that is total on both sides and reflects the order is the pairing of their entries index by index. This is what makes a matching between the two parses – a relation variable, hence first-order-checkable – as good as the equality of the two concatenations, which is not.
The converse pairing, DescriptiveComplexity.Pcp.IdxMatch, is the matching two
lists of the same length carry for free; it is the certificate a yes-instance
hands back.
Strictly increasing enumerations #
ps enumerates S in increasing order: it is strictly sorted for Lt,
and its members are exactly the elements satisfying S. Such a list is unique
when it exists, but nothing below needs the uniqueness.
Equations
- DescriptiveComplexity.Pcp.IsEnum Lt S ps = (List.Pairwise Lt ps ∧ ∀ (p : α), p ∈ ps ↔ S p)
Instances For
Dependency graph
Over a finite type ordered by a linear order relation, every predicate has a strictly increasing enumeration: sort the elements satisfying it.
Dependency graph
Indices of a strictly sorted list #
A strictly sorted list has no repetitions, so its order is the order of its indices: that is the only property of the two parses the matching lemma below uses.
An asymmetric relation is irreflexive.
Dependency graph
In a strictly sorted list, one entry precedes another exactly when its index is smaller.
Dependency graph
Lists built block by block #
Two flatMaps over the same list are related entry by entry as soon as
their blocks are: the parse of a concatenation is the concatenation of the
parses.
Dependency graph
A list of witnesses for a list of existentials.
Dependency graph
Two lists read off entry by entry along a matching agree, as soon as the matched entries carry the same letter.
Dependency graph
The lexicographic order on blocks and positions #
The lexicographic order on pairs (block, position inside it), for two strict orders.
Equations
- DescriptiveComplexity.Pcp.LexOf R S x y = (R x.1 y.1 ∨ x.1 = y.1 ∧ S x.2 y.2)
Instances For
Dependency graph
The strict part of a linear order relation is asymmetric.
Dependency graph
The lexicographic order of two asymmetric relations is asymmetric.
Dependency graph
The index list of a parse #
A parse of a concatenation is indexed by the pairs (block, position inside the block), in lexicographic order: the common word is never invented, only the two ways of cutting it into blocks are.
The index list of a parse: the pairs (block, position used inside it), block by block.
Equations
- DescriptiveComplexity.Pcp.parseIx slots ps = List.flatMap (fun (s : D) => List.map (fun (p : α) => (s, p)) (ps s)) slots
Instances For
Dependency graph
Dependency graph
The index list of a parse is sorted lexicographically: the blocks come in order, and the positions inside a block come in order.
Dependency graph
The letters of a parse, read along its index list, are the letters of the concatenation.
Dependency graph
Reading a Forall₂ as a function #
The certificate of a yes-instance indexes its slots by Fin n, while the
semantics hands the words over as a List.Forall₂; this turns the one into
the other, once.
Entries of two lists related by List.Forall₂ are related index by
index.
Dependency graph
A List.Forall₂ is a function on the indices of its left list.
Dependency graph
Matchings between two sorted lists #
A matching between two strictly sorted lists pairs their entries index by index. The relation is asked only for what a first-order kernel can check of a relation variable – that it lands in the two lists, that it is defined everywhere on both, and that it reflects the two orders – and this is already enough to make it the unique order isomorphism, hence to identify the two lists entry by entry. Functionality and injectivity are not hypotheses: they follow from reflecting the order.
Dependency graph
The matching two lists of the same length carry #
The pairing of two lists index by index, as a relation: the matching a yes-instance hands back once its two parses are known to be the same word.
Equations
Instances For
Dependency graph
The index pairing relates members of the two lists.
Dependency graph
The index pairing is defined on every member of the left list.
Dependency graph
The index pairing is defined on every member of the right list.
Dependency graph
The index pairing reflects the orders of two strictly sorted lists: both read as the order of the indices.