PhyslibAlpha.AlgebraicFramework.JordanOrderUnit.ShirshovWords
Alternating-block words in two letters
Infrastructure for formalizing A.I. Shirshov's proof that the free Jordan algebra on two generators is special (`On special J-rings`, Mat. Sbornik 38 (1956), 149–166; English translation by M.R. Bremner and M.V. Kochetov in *Selected Works of A.I. Shirshov*, Birkhäuser, 2009).
Shirshov's proof works with associative words in two letters `a`, `b`, organized by their **height**: `aˢ`/`bʳ` have height 1, `aˢbʳ`/`bʳaˢ` have height 2, and in general a word `a^{n₁}b^{m₁}a^{n₂}b^{m₂}⋯` (or the same starting with `b`) has height equal to its number of maximal same-letter blocks. Rather than recovering this block structure from a raw `List (Fin 2)` by a run-length-encoding pass (needing its own correctness lemmas before anything else can start), a word is represented *directly* as its block list: an alternating list of `(letter, positive multiplicity)` pairs, `BWord`. This is the same data with none of the decoding work, since every construction in Shirshov's paper builds words block-by-block already.
Main definitions
- `BWord` : an associative word in the letters `Fin 2`, as an alternating list of `(letter, positive run length)` pairs. - `BWord.height` : the number of blocks, `Shirshov`'s notion of height. - `BWord.bar` : Shirshov's reduction `α ↦ ᾱ` (his overline, defined just before his equation (5)): peel the trailing block off and move it to the front, merging it into the new front block if the two share a letter. **Not an involution** and **not full word-reversal** — it strictly drops height on words of height `≥ 3`, which is exactly what makes it usable as the base case of a recursion on height in Shirshov's construction of the `*`-map (his equation (5), not yet formalized here).
16 declarations
Equality of `BWord`s via block sequences ()
For any two alternating-block words and (represented as the type `BWord`), if their sequences of blocks and are equal, then the words and are equal. Here, the block list is the alternating sequence of letters and their positive multiplicities that uniquely defines the word.
Shirshov's height of a word
For a word represented as an alternating sequence of blocks (maximal runs of the same letter), its height is defined as the total number of these blocks. For instance, a word such as has a height equal to the number of terms in the sequence of its constituent blocks.
Total degree of a word
For a word represented as a sequence of alternating blocks (where each is a letter and is its positive multiplicity), the degree of is the sum of the multiplicities of all its blocks, . This value represents the total length of the word as a string of letters.
Single-block word
Given a letter and a positive natural number , the function constructs a word consisting of a single block of copies of the letter . This results in a word of height 1, represented by the block list , corresponding to the associative word .
The block list of the word is
For any letter and any positive natural number , the list of blocks representing the single-run word (constructed via `ofRun`) is exactly the singleton list containing the pair .
Height of the single-block word is 1
For any letter and any positive natural number , the height of the word consisting of a single block of copies of the letter (denoted ) is equal to .
Default element of is the empty word
The type , which represents words in two letters as alternating lists of blocks, is an inhabited type. Its default instance is the empty word, which is represented by an empty list of blocks and has a height of and a degree of .
Prepend and merge a block to a list
The function `consMerge` takes a letter , a positive multiplicity , and a list of blocks (where each block is a pair consisting of a letter and its multiplicity). It prepends the block to the list with the following logic: - If is empty, it returns the list containing only the block . - If starts with a block , and , it merges the two blocks into a single block with the same letter and the sum of the multiplicities, returning . - If starts with a block , and , it simply prepends the new block to the list, returning .
`consMerge` preserves alternating letters in block lists
Let be a letter and be a positive natural number. Let be a list of blocks, where each block is a pair consisting of a letter and a multiplicity. If satisfies the condition that any two adjacent blocks have distinct letters, then the list resulting from prepending and merging the block into (using `consMerge`) also satisfies the condition that any two adjacent blocks have distinct letters.
`consMerge` preserves positive multiplicities in block words
Let be a letter and be a positive natural number (). Let be a list of blocks, where each block is a pair consisting of a letter and a multiplicity . If every block has a positive multiplicity (), then every block in the list produced by prepending and merging the block into (using `consMerge`) also has a positive multiplicity ().
Multiplicities in the `dropLast` of a block word are positive
Let be a block word (), which is represented as a list of blocks where each block consists of a letter and a multiplicity . For every block in the list (the list of blocks of excluding the last one), the multiplicity is strictly positive ().
Dropping the last block of a `BWord` preserves the alternation of letters
For any `BWord` , the list of blocks obtained by removing the last element, denoted as `w.blocks.dropLast`, remains alternating. That is, for any two consecutive blocks and in the shortened list, the letters (the first components of the pairs) are distinct: .
Shirshov's reduction map
Given an alternating-block word represented as a list of blocks , where each block consists of a letter and a positive multiplicity , Shirshov's reduction map (denoted here as `bar w`) is defined as follows: - If the height of the word is less than or equal to 1, then . - If , the trailing block is removed from the end and moved to the front of the remaining sequence . - If the letter of the trailing block matches the letter of the first block (i.e., ), the two are merged into a single block with multiplicity . - Otherwise, is prepended as a new distinct block. This map is non-increasing on the height of the word and strictly height-decreasing for words of height , making it suitable as a recursion measure. Note that this operation is not an involution and does not correspond to a full reversal of the word.
for Words of Height
For any alternating-block word , if its height (the number of blocks in its representation, denoted as `w.blocks.length`) is less than or equal to 1, then Shirshov's reduction map (denoted as `bar w`) is equal to .
For any letter , any positive multiplicity (where ), and any list of blocks (where each block is a pair consisting of a letter and its multiplicity), the length of the list resulting from prepending and potentially merging the block into via the `consMerge` operation is at most the length of plus one. That is, The `consMerge` function prepends the block as a new element if is empty or if its first block has a different letter than ; otherwise, it merges into the first block of by adding the multiplicities, which preserves the list length.
Let be an alternating-block word in two letters, and let denote the number of its constituent blocks (maximal runs of the same letter). Let denote Shirshov's reduction of , which is obtained by moving the trailing block to the front and merging it with the original first block if they share the same letter. Then the height of the reduced word is less than or equal to the height of the original word:
