Merging adjacent equal letters #
This file isolates the run-merging operation used in the deduction of
Proposition 5.7 from Proposition 5.9, paper equations (5.34)--(5.37).
mergeEqualRuns keeps one representative of every maximal constant run.
The generic listChainProduct_mergeEqualRuns lemma records the analytic
reason this operation is harmless: an edge joining two equal letters has
weight one.
Keep exactly one representative of every maximal constant run.
Equations
- Anderson4D.mergeEqualRuns l = List.destutter (fun (x1 x2 : α) => x1 ≠ x2) l
Instances For
Consecutive-edge product on a list.
Equations
- Anderson4D.listChainProduct edge [] = 1
- Anderson4D.listChainProduct edge [head] = 1
- Anderson4D.listChainProduct edge (a :: b :: l) = edge a b * Anderson4D.listChainProduct edge (b :: l)
Instances For
listChainProduct is the product of edge over the list zipped with
its tail.
Merging equal runs preserves any chain product whose equal-letter edge weight is one.
List form of a word after all adjacent equal letters have been merged.
Equations
Instances For
Multiplicity of a letter after run merging.
Equations
Instances For
The compressed word, indexed by its (generally smaller) length.
Equations
Instances For
The compressed word has the compressed multiplicities by construction.
The new multiplicities sum to the compressed word length.
Adjacent letters of the compressed word are distinct.
Word-level form of run-merging invariance for a generic edge product.