Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Finite Labelled Word Defect

Abstract

An ambiguous finite labelled family of words factors through strictly fewer generators.

For a natural number n, Fin(n) is the set of n labels. List(A) is the free monoid of finite words on A, including the empty word. The operation flatMap(s,f) replaces each label in s by its word f(i) and concatenates the results. Injective refers to equality of the complete labelled lists. The alphabet is an arbitrary type in any universe; it has no finiteness, inhabitation or decidable equality assumption.

Theorem 1.1 (Ambiguity forces a smaller generating family).

\forall u:Level, \forall A:\operatorname{Type}\left(u\right), \forall n:Nat, \forall f:\operatorname{Fin}\left(n\right) \to \operatorname{List}\left(A\right), \neg \operatorname{Injective}\left((\Lambda s:\operatorname{List}\left(\operatorname{Fin}\left(n\right)\right), \operatorname{flatMap}\left(s, f\right))\right) \Rightarrow \exists m:Nat, m < n \land \exists g:\operatorname{Fin}\left(m\right) \to \operatorname{List}\left(A\right), \exists c:\operatorname{Fin}\left(n\right) \to \operatorname{List}\left(\operatorname{Fin}\left(m\right)\right), \forall i:\operatorname{Fin}\left(n\right), \operatorname{f}\left(i\right) = \operatorname{flatMap}\left(\operatorname{c}\left(i\right), g\right).

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

Citation. Jean Néraud and Carla Selmi (2020). Embedding a θ-invariant code into a complete one. DOI: 10.1016/j.tcs.2018.08.022. URL: https://arxiv.org/abs/1801.05164v3.

Commentary.

The construction descends on the sum of the lengths of the n words, keeping n fixed. If a label carries the empty word, erase that label using succAbove and insertNth. Its coefficient is empty and every other coefficient is a singleton, giving n-1 generators directly.

Otherwise, absence of a directed prefix pair at distinct labels would make the family injective and its range prefix-free. Existing prefix-free unique decoding from pinned Mathlib’s IsPrefixFree.isUniquelyDecodable would then contradict the ambiguity. Choose distinct labels i and j with f(j)=f(i)r and replace f(j) by r. The substitution j maps to [i,j] and every other label k maps to [k]. Each substitution word ends in its original label, so reversing each substitution word gives an injective prefix-free family of nonempty words. The same pinned prefix-free decoding theorem applies to that reversed family. Reversing an encoded equality reverses both the order of labels and each substitution word; decoding and injectivity of reversal then give injectivity of the original substitution on whole lists.

Factoring the old evaluation through this injective substitution transports ambiguity to the shorter family. The total length strictly decreases because f(i) is nonempty. Strong induction gives fewer generators for the shorter family, and flatMap associativity composes its coefficients with the substitution to reconstruct every original word.

The statement includes distinct labels with equal codewords, empty words and n=0. For n=0 the ambiguity premise is impossible. The new generators may lie outside the monoid generated by the original words. No converse, minimality, free-basis property or algorithmic complexity is asserted. The cited primary source supplies the classical finite-set defect theorem; the labelled formulation explicitly handles duplicates and emptiness.

References