Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Prefix-generator envelopes for finite labelled word families

Abstract

Every finite labelled word family has exact factorizations through at most as many nonempty prefix-separated generators.

Fix an arbitrary universe u, a type alpha in that universe, a natural number n, and a family f assigning a finite word over alpha to each label in Fin n. Labels retain multiplicity: different labels may carry the same word. A prefix-generator envelope consists of a natural number m at most n, a family g indexed by Fin m, and a coefficient word c(i) over Fin m for each original label i. Every g(i) is nonempty, and a prefix relation from g(i) to g(j) forces the labels i and j to agree.

IsPrefix(x,y) means that there is a finite residual word r with x ++ r = y, including the reflexive case r = []. The expression flatMap(g,s) concatenates the words g(j) in the order of the labels in s; the empty coefficient word concatenates to the empty word.

Theorem 1.1 (Exact prefix-generator envelope).

\forall alpha \in \mathrm{Type}^{*},\; \forall n \in \mathrm{Nat},\; \forall f \in (\operatorname{Fin}\left(n\right) \to \operatorname{List}\left(alpha\right)),\; \exists m \in \mathrm{Nat},\; m \le n \land \left(\exists g \in (\operatorname{Fin}\left(m\right) \to \operatorname{List}\left(alpha\right)),\; \exists c \in (\operatorname{Fin}\left(n\right) \to \operatorname{List}\left(\operatorname{Fin}\left(m\right)\right)),\; \left(\forall i \in \operatorname{Fin}\left(m\right),\; \operatorname{g}\left(i\right) \neq []\right) \land \left(\left(\forall i \in \operatorname{Fin}\left(m\right),\; \forall j \in \operatorname{Fin}\left(m\right),\; \operatorname{IsPrefix}\left(\operatorname{g}\left(i\right), \operatorname{g}\left(j\right)\right) \Rightarrow i = j\right) \land \left(\forall i \in \operatorname{Fin}\left(n\right),\; \operatorname{f}\left(i\right) = \operatorname{flatMap}\left(g, \operatorname{c}\left(i\right)\right)\right)\right)\right)

Proof. Machine-checked in Lean as D5/S0/Computability/Coding/PrefixGeneratorEnvelope.prefix_generator_envelope (✓ std3). ∎

Source. Repository-derived.

Commentary.

Induct first on the number of labels and then strongly on the sum of all word lengths at that label count. With no labels, use m = 0 and the empty functions. If a labelled word is empty, delete that label using succAbove, apply the induction on the number of labels, and reinsert an empty coefficient word. All other coefficients are transported along succAbove.

If all words are nonempty and the labelled family is already prefix-separated, take g = f, m = n, and c(i) = [i]. Otherwise choose distinct labels i and j and a residual r with f(j) = f(i) ++ r. Replace only the word at j by r to obtain q. The total length strictly decreases by the positive length of f(i), so the inner induction supplies a prefix-generator envelope and exact coefficients d for q.

Define the substitution sigma by sigma(j) = [i,j] and sigma(k) = [k] for k different from j. Then f(k) = flatMap(q,sigma(k)) for every original label k. Set c(k) = flatMap(d,sigma(k)). Associativity of flatMap gives the required exact factorization through the generators returned by the induction, together with all their nonemptiness and prefix-separation properties. Equal words at distinct labels give an empty residual, which the deletion branch accommodates.

The alphabet may be empty or infinite, n may be zero, and the input may consist entirely of empty words or include duplicate nonempty words. No decidable equality or injectivity premise is imposed. The conclusion allows m = 0. The generators need not belong to the monoid generated by the input words. The bound m at most n does not assert a strict decrease, a minimum rank, or a least envelope.

References