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.
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
The lexicographic order on blocks and positions #
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
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.
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.