Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Unary Gaps of Actual Words

Abstract

Occurrence-indexed unary gaps and complete positional source traces.

Fix a letter a in an arbitrary alphabet. A gap word alternates blocks of a with a list of non-a occurrences. The list preserves repeated letters as separate occurrences. Its gap vector has one more entry than its occurrence list; entries may be zero.

Definition 1.1 (Gap concatenation).

Formalization. D5/S1/Words/UnaryGapWords.gap (✓ std3).

Source. Repository-derived.

Commentary.

For an empty occurrence list, take the first gap’s copies of a. For c followed by cs, concatenate the first a block, c, and the remaining gap word. All uses of a gap presentation supply exactly one more mass than occurrences.

Definition 1.2 (Non-a occurrences).

Formalization. D5/S1/Words/UnaryGapWords.spine (✓ std3).

Source. Repository-derived.

Commentary.

Filter the actual word by inequality to a without removing multiplicities.

Definition 1.3 (Canonical gap lengths).

Formalization. D5/S1/Words/UnaryGapWords.sizes (✓ std3).

Source. Repository-derived.

Commentary.

Scan from the right. An a increments the first gap; a non-a occurrence starts a new zero gap. The empty word has the single gap zero.

Theorem 1.4 (Uniqueness of indexed gap words).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.gap_injective (✓ std3). ∎

Source. Repository-derived.

Commentary.

Recovering the spine and lengths from each actual concatenation proves both equalities, including repeated separators and zero gaps.

Theorem 1.5 (Every word has a canonical presentation).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.gap_exists (✓ std3). ∎

Source. Repository-derived.

Commentary.

The canonical spine and gap lengths reconstruct the original word.

Definition 1.6 (Complete gap labels).

Formalization. D5/S1/Words/UnaryGapWords.Trace (✓ std3).

Source. Repository-derived.

Commentary.

Every a gap retains its whole label list b. Its q count contributes to h, and its opposite-source count contributes to e. Every non-a occurrence has label q. This is an inductive decomposition of actual letters and labels.

Definition 1.7 (Grouped labels in each gap).

Formalization. D5/S1/Words/UnaryGapWords.grouped (✓ std3).

Source. Repository-derived.

Commentary.

With a unary inserted source, place its gap mass together after the base copies. With a unary base source, place base copies before the inserted copies in each nonterminal gap, and after them in the terminal gap.

Theorem 1.8 (Unique extra masses and actual masks).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.native_gap_iff (✓ std3). ∎

Source. Repository-derived.

Commentary.

For each native projection pair, non-a letters are forced to q. Splitting at those occurrences gives every label gap and both projected words. Conversely, grouped gap labels realize every permitted mass vector. Canonical word recovery makes the extra vector unique. No alphabet order, decidable equality premise or distinctness between separators is assumed.

Theorem 1.9 (Canonical recovery of a presented gap word).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.profile_gap (✓ std3). ∎

Source. Repository-derived.

Commentary.

Filtering recovers exactly the occurrence list, and the canonical gap scan recovers exactly the supplied lengths.

Theorem 1.10 (Both projections of a positional trace).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.trace_projections (✓ std3). ∎

Source. Repository-derived.

Commentary.

The trace gives matching word and mask lengths, both ordered source projections, all vector lengths and the actual enlarged gap word.

Theorem 1.11 (Extracting the full trace).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.trace_exists (✓ std3). ∎

Source. Repository-derived.

Commentary.

At each non-a occurrence the opposite projection excludes its label. Splitting there retains every intervening label and all zero gaps.

Theorem 1.12 (Realizing every extra vector).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.trace_construct (✓ std3). ∎

Source. Repository-derived.

Commentary.

The grouped mask realizes each permitted vector on an actual gap word, including the no-separator case and both exterior masses.

Theorem 1.13 (Recovering prescribed gap masses).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.trace_of_projections (✓ std3). ∎

Source. Repository-derived.

Commentary.

Actual word uniqueness identifies the extracted original and extra gaps with their prescribed vectors, without identifying repeated separators.

Theorem 1.14 (Transport at an actual word cut).

Proof. Machine-checked in Lean as D5/S1/Words/UnaryGapWords.gap_insert (✓ std3). ∎

Source. Repository-derived.

Commentary.

Let i count the non-a occurrences in X. Then i is a valid gap index. Inserting k copies of a at X|Y adds k only to e[i], preserves vector length, increases its sum by k, and gives exactly the concatenated word X followed by a^k followed by Y. This is an identity on actual words.

References