WorksComputer Science
Block-exchange descent for insertion: commuting projections and minimum masks
Abstract
For fixed nonempty words , the minimum insertion degree of a shuffle is the least number of inserted-source runs among its representations. We prove that, after a block exchange from a minimum mask of degree , the minimum over masks with commuting source projections is exactly ; a larger decrease occurs precisely when a noncommuting mask has fewer runs. If either source is unary, every such exchange is exact. We prove an explicit repair for an infinite periodic degree-three family. Computer-assisted results establish first-mask descent through combined length seventeen over every alphabet, degree-three first-mask descent through length thirty, and a uniform repair of all degree-three failures through length thirty, including all further letter identifications. Counterexamples to arbitrary, first, and last minimum-mask choices explain the need for alternative masks. Finally, we prove that minimum iteration depths have no gaps for arbitrary languages. General block-exchange descent and Singleton No-Gap remain open.
Introduction
Insertion and shuffle are fundamental operations on words and formal languages. Both combine two sources while preserving the order of the symbols within each source, but they differ in how freely the symbols may be interleaved. In this paper, we investigate a natural question arising from that distinction: how many separate blocks of one word do we need to insert into another to produce a target word, and which minimum numbers of blocks can arise as the target word varies?
Let and be nonempty words over an alphabet . We regard as the inserted word and as the base word. A single insertion places all of at one position in , without changing the order of the letters of either word. More generally, a -insertion divides into at most nonempty consecutive factors and distributes them into positions in , again preserving the order of both sources. The formal definition permits empty factors, so that increasing the bound never removes an output.
If we set the insertion position to be the beginning of , the result is the concatenation of and , . If the number of inserted factors is unrestricted, the resulting words are precisely the shuffles of and : all interleavings that preserve the relative order of the letters originating in each source. Thus, bounded insertion provides a hierarchy between single-block insertion, such as concatenation, and unrestricted shuffle.
An important subtlety is that an output word may have several different representations as a shuffle of the same two sources. When letters occur in both source words, their origins may be ambiguous. Consequently, the number of inserted blocks in one representation need not be the smallest possible number for that output. We call the least positive number of inserted blocks required to produce an output its minimum insertion degree, denoted .
For example, take and . The word 0011 has minimum degree 1, because the two zeros can be inserted together. In contrast, 0110 has minimum degree 2, since its zeros are separated by the base letters, so two inserted blocks are necessary. Both words are shuffles of the same sources. This simple example illustrates how minimum insertion degree measures the amount of separation required between inserted-source letters. The source mask of 0110 is UVVU: the two zeros carry label U and the two ones carry label V. Its two maximal U-runs correspond to the two inserted blocks.
For fixed sources , , consider the set of minimum degrees attained by all their shuffle outputs:
Degree 1 is always attained: the concatenation is a shuffle in which the entire inserted word forms a single block. The Singleton No-Gap problem asks whether this spectrum always consists of consecutive positive integers, from 1 through some maximum. In other words, if an output requires at least inserted blocks, must there also be outputs whose minimum degrees are ?
This question arises from Hughes’s investigation of bounded insertion and adjacent equality in hierarchies of language operations [7 Section 11]. For singleton source languages, the No-Gap property would imply that the bounded-insertion hierarchy cannot skip an attainable minimum degree. For general languages, additional ambiguity arises because an output may be produced by different source-word pairs. We distinguish this broader insertion-degree problem from the singleton case considered here.
Our approach studies the representations of a shuffle directly. A source mask labels each output position according to whether its letter came from or . The number of maximal runs labeled by the inserted source equals the number of inserted blocks in that mask. A minimum mask is one attaining the minimum insertion degree.
Suppose a minimum mask has inserted-source runs. Two consecutive inserted runs are separated by a block of base-source letters. Exchanging that separating block with either neighboring inserted run merges the two runs while preserving the order of letters within each source. The resulting output therefore has a representation with inserted runs. However, it may admit another representation with fewer than runs. This is the principal obstacle to obtaining a degree- predecessor.
We ask whether, for every shuffle output of minimum degree , some minimum mask admits a block exchange whose resulting output has minimum degree exactly . An affirmative answer would establish Singleton No-Gap by repeated descent.
Our principal structural result characterizes the obstruction to an exact block exchange. We prove that transporting an alternative mask back through the exchange preserves both source words precisely when the corresponding projected factors commute. Here two words commute when concatenating them in either order gives the same word. Among these commuting masks, the minimum run count after the exchange is exactly ; any larger reduction in the output’s minimum insertion degree must arise from a noncommuting mask (Theorem 3). This yields an exact obstruction criterion and a dynamic-programming test.
We then establish that every block exchange from every minimum mask is exact whenever either source word is unary, meaning that it consists of repetitions of a single letter (Theorem 4). We also prove an exact repair theorem for an infinite periodic family of degree-three obstructions (Theorem 9). Explicit counterexamples show why an arbitrary minimum mask, or even the lexicographically first or last minimum mask, cannot always be selected.
Computer-assisted results establish additional bounded cases over arbitrary alphabets and identify the limitations of several natural mask-selection rules. Their precise length and degree bounds are stated in Section 8. Separately, we prove that the spectrum of minimum iteration depths has no gaps for arbitrary source languages (Theorem 15), extending the finite-language result of Hughes [7 Section 10]. Here iteration depth counts successive insertion steps; insertion degree counts blocks within one step.
The paper develops the relevant background, proves the structural and unary results, examines the counterexamples and periodic repair, presents the computational certificates, and concludes with the remaining open questions. The general existence of an exact block-exchange predecessor and the general Singleton No-Gap conjecture both remain open.
Related work
Insertion and deletion have long been studied as operations on formal languages. Haussler’s insertion languages [6] provide an early language-theoretic treatment. Kari studies closure properties of insertion [12] and deletion [11] operations; Kari and Thierrin [13] study contextual insertion and deletion and their computational power. Ito, Kari, and Thierrin treat insertion/deletion closure [8] and shuffle/scattered-deletion closure [9]. These works concern the languages generated or preserved by the operations. Our question concerns the least number of inserted blocks needed for an individual output of a fixed pair of words.
The closest bounded-operation framework is the -insertion of Ito and Sugiura [10]. They study its language-class properties and decompositions of regular languages under -insertion. Castiglione and Restivo [3] prove that star-free languages are closed under bounded shuffle. Their bound counts paired factors from the two sources, whereas ours counts maximal inserted-source runs. In paired form , with the from the base and the from the inserted source, there are at most inserted runs. Conversely, a mask with inserted runs has the form and becomes a paired factorization with pairs by taking ; endpoint factors may be empty. This relates the bounded operations; their closure theorem concerns language classes, while our degree spectrum minimizes over representations of each fixed output.
A bound on inserted blocks is also a restriction on the binary interleaving trajectory. Mateescu, Rozenberg, and Salomaa [16] develop shuffle on trajectories, in which a language of trajectories specifies allowed interleavings; Domaratzki [4] develops the corresponding deletion operation. In that terminology, masks of at most inserted runs form a regular trajectory language. The minimum degree studied here is the least for which a given output has a representation in that language. Distinct trajectories may emit the same word, and this equality is what makes local descent nontrivial.
Shuffle decomposition is another related inverse problem. Câmpeanu, Salomaa, and Vágvölgyi [2] introduce a shuffle analogue of the Nerode congruence and study decomposition of languages into shuffle factors. Their factors are languages to be recovered, whereas our factors , are fixed and the number of blocks in their interleaving is minimized. Thus -insertion and trajectory constraints supply the direct connection to interleavings with few blocks, while language decomposition supplies a related account of shuffle ambiguity.
The complexity of shuffle depends strongly on which objects are given. Warmuth and Haussler [19] study the complexity of iterated shuffle. Buss and Soltys [1] prove that deciding whether a word is a shuffle of two identical, unspecified words is NP-complete. For two specified source words, a source-grid dynamic program decides membership; adding a previous-source label and a cost for starting an inserted run computes the minimum degree. We use that weighted grid both for the fixed-exchange formula (3) and for testing equality partitions in the symbolic search. The computational difficulty here is the exhaustive search for descent obstructions over all masks and letter-equality patterns.
The algebraic obstruction is classical word commutation. The Lyndon–Schützenberger commutation theorem [15] characterizes commuting nonempty words as powers of a common word; it interprets the projection equations in Lemma 2. The primitive-root and rotation arguments in § 7 belong to the standard combinatorics of words [14]. Fine and Wilf’s periodicity theorem [5] gives a general criterion for two overlapping periods to force a common smaller period. The rotation argument needed here has a direct proof, given in § 3.
Hughes [7] formulates the two spectrum questions that motivate this paper. His Theorem 8 establishes the No-Gap conclusion for iteration depth of finite languages, and his Theorem 9 gives the unary-source singleton degree spectrum. We prove the arbitrary-language iteration-depth extension, retain a self-contained proof of the unary formula, and strengthen its conclusion to exactness of every minimum-mask exchange. The block commutation criterion, counterexamples, and periodic repair address the representation ambiguity in his singleton question.
Preliminaries
Let be an alphabet, its free monoid, and the empty word. Write for word length and for the set of letters occurring in . A word is unary if it is a nonempty power of one letter. Positions are indexed from zero unless explicitly numbered otherwise; denotes a half-open factor. Concatenation is written by juxtaposition. Spaces in displayed binary words separate groups of symbols and are not letters.
The shuffle consists of the interleavings of and that preserve the order of each source. Throughout Sections 4–8, are nonempty and form a fixed ordered pair: is the inserted source and the base source. A mask of labels its positions U or V so that the two projected subsequences are and . Write for the number of maximal nonempty U-runs and set
A -insertion splits and and emits , with empty factors allowed. For nonempty , its least positive is exactly : the nonempty give at most inserted runs, and the maximal inserted runs of a mask give such a factorization. Consequently . Singleton No-Gap asks whether is an initial interval of positive integers.
Let be a minimum mask of a word of degree . A block exchange interchanges a separating maximal V-block with either neighboring maximal U-run, moving letters and labels together. Both source orders are preserved, and two U-runs merge. The resulting word therefore satisfies . The exchange is exact when . We call bad if none of its exchanges is exact. Masks are compared lexicographically with U V. Number the separating V-blocks from left to right; and exchange separator with its preceding and following U-runs, respectively. Successor-degree vectors use the order .
A nonempty word is primitive if it is not a proper power of a shorter word. Formally, a nonempty word is primitive if, for every nonempty word and every positive integer , the equality implies . In such an equality, ; thus a proper-power witness necessarily satisfies and . Every nonempty word has a unique primitive root. A primitive word of length is fixed by a cyclic rotation through positions only if : rotation invariance makes its letters constant on the residue classes modulo , so it would otherwise be a proper power of its prefix of that length. This elementary consequence of primitivity will be used in the periodic repair argument.
The exchange and its exact obstruction
Lemma 1. Let and , with nonempty. Transport any binary labeling of with the letters to . Its number of U-runs changes by at most one.
Proof. Encode U by $1$ and V by . Let be the last label of , or if ; let be the first and last labels of , and those of ; let be the first label of , or $0 if . Internal transitions within the four words are unchanged. If , its end contributes no transition, which is exactly the convention . The run count for minus that for is
If , this is zero. Otherwise the three differences are a permutation of . The expression is therefore a difference of two elements of , and belongs to .
For a mask of , write for the letter subsequences in the indicated blocks carrying source label . Call commuting for this exchange if
Empty words commute with every word. This definition refers to the projections of , which may differ from the pure blocks in the selected minimum mask.
Lemma 2. Transporting back to gives a mask for the same sources if and only if is commuting.
Proof. For source q, its projection in has the form , whereas its transported projection in is . Equality of these two words is equivalent, by left and right cancellation in the free monoid, to . Apply this to both sources.
Theorem 3. Fix a block exchange from a minimum mask of , where and . Put
where ranges over masks of , and an empty minimum is . Then
In particular, the exchange is exact if and only if .
Proof. If a commuting mask had at most runs, Lemmas 1 and 2 would give a mask of with at most runs, contradicting . Thus . The mask obtained from the chosen minimum mask has exactly runs and is commuting: each of the exchanged blocks is pure in one source, so one of its two projections is empty for each source. Hence . Partitioning all masks of into the two classes gives the second identity.
The equations in Lemma 2 have the usual Lyndon–Schützenberger interpretation: when both projected factors are nonempty, they commute precisely when they are powers of a common primitive word [15]. For an exchange of adjacent unequal letters, the commuting masks are exactly those assigning the two positions to different sources. Different labels give an empty projection in each source, while identical labels require the two unequal letters to commute, which is impossible. Thus Theorem 3 specializes to the different-source and same-source minimum formula for adjacent-letter pull-back.
A source-grid formula
The commutation predicate can be read from three source-grid states. In , let , , . At these boundaries let a mask have consumed letters of and letters of . Its two U-projections are the consecutive factors
and similarly , . Here slices have zero-based, half-open indices. Put and . A state is , where , , and is the previous label. At output position require . On an output letter the only allowed transitions, with their costs, are
For any segment , define to be the least total cost of a path reading exactly from to . Compute it by initializing cost zero at , infinity at every other state, and applying the two transitions successively to each letter of , retaining the least cost at each state. A missing path has cost ; for an empty segment, if and otherwise. Set
Thus the initial previous label is V, both sources must be consumed completely at termination, and an empty prefix or suffix needs no special convention. With at , the fixed-exchange obstruction minimum is
Splitting a mask at the three boundaries proves one inequality; concatenating realizing paths with the same boundary states proves the other. This gives an exact test that accounts for every alternative mask, including masks with different source consumptions at the block boundaries.
Prefix lower bounds
Let be the least run count of a mask of the prefix consuming letters of and letters of , with last source . Infeasible states have value , and the initial state has previous source V. Let be the minimum additional run cost of completing the suffix from that state. Then
Splitting a mask at the prefix boundary and concatenating compatible minimum-cost paths prove the identity. Constraining the labels at two specified positions gives the corresponding different-source and same-source minima.
If two words differ by a swap at positions , and for some one has
their common suffix has the same completion cost in both words. The identity therefore gives . We call such a swap profile-certified. The comparison in Proposition 14 shows the limits of this sufficient test.
Cases in which every exchange is exact
Theorem 4. If either or is unary, every block exchange of every minimum mask of a word of degree gives an output of degree exactly .
Proof. First suppose , . Write
Every output has a unique gap description , where and . Each occupied gap, with , requires a U-run; non- letters are forced to source V. Putting all inserted 's of each gap together attains the bound, so
Every minimum mask therefore has one U-run in each occupied gap and no others. An exchange moves the entire inserted mass of one occupied gap across the intervening V-block into the adjacent occupied gap. It empties exactly one occupied gap and hence lowers by one.
Now suppose . If has no non- letters, and the assertion is vacuous. Otherwise write
The same output-gap description, now with , gives
Indeed, every non- letter is forced to U, and every positive internal gap has a V between its two bounding non- letters. Putting all source-U copies together in each gap, and putting outer source-V copies outside , attains the bound.
Let be the number of positive internal gaps. These gaps partition the forced non- source-U letters into groups, already requiring the runs in (5). Equality permits neither an additional all- U-run nor two V-blocks in one internal gap: the intervening U-letters would split a forced group or create an extra run. Thus every U-run contains non- letters, and each occupied internal gap contains a single separating V-block carrying its entire base mass. Exchanging that block with a neighboring U-run moves the mass into the neighboring V-block, if present, or into an outer gap. The donor internal gap becomes empty; the recipient is already an occupied internal gap or is outer. Exactly one counted gap disappears.
The first pointwise formula is the gap argument in Hughes’s unary-source spectrum theorem [7 Section 11, Theorem 9]. The second formula and both exact-exchange conclusions follow from the minimum-mask structure proved above.
For completeness, if denotes the number of non- letters in , the formulas give the two spectra
In the first case distribute the inserted letters among any chosen number of gaps; in the second occupy any chosen number of internal gaps and put the remaining base letters at an outer end. These constructions attain every integer up to the stated bounds.
If the source alphabets are disjoint, every mask is uniquely determined by its letters, so the intended exchanged mask is the only mask and the exchange is exact. Also, for arbitrary sources and , every exchange is exact: it has a one-run mask, and nonempty forces .
Why the minimum mask and separator matter
The following example rules out choosing an arbitrary minimum mask.
Proposition 5. For
Proof. Use one-based positions throughout this proof. Both sources alternate. Each of the equal-letter pairs at positions 1, 2; 5, 6; 7, 8; and 9, 10 must therefore split between the two sources. The final 0 must be U, since ends in 1. These choices use all five U positions, so every other position is V. Conversely, every choice of one U in each of those four pairs, followed by the final U, gives the correct two sources. This gives exactly the sixteen masks in Appendix § 11, Table 8.
| Mask | Runs | Mask | Runs |
| UVVVUVUVUVVVU | 5 | VUVVUVUVUVVVU | 5 |
| UVVVUVUVVUVVU | 5 | VUVVUVUVVUVVU | 5 |
| UVVVUVVUUVVVU | 4 | VUVVUVVUUVVVU | 4 |
| UVVVUVVUVUVVU | 5 | VUVVUVVUVUVVU | 5 |
| UVVVVUUVUVVVU | 4 | VUVVVUUVUVVVU | 4 |
| UVVVVUUVVUVVU | 4 | VUVVVUUVVUVVU | 4 |
| UVVVVUVUUVVVU | 4 | VUVVVUVUUVVVU | 4 |
| UVVVVUVUVUVVU | 5 | VUVVVUVUVUVVU | 5 |
Table 8. All masks of 0010 1100 1101 0 for the sources in Proposition 5. Each row pairs the two possibilities for the initial two positions.
The first and last U positions are isolated. Among the other three, at most one adjacent pair can merge: the middle one is at position 7 or 8, and cannot join both its neighbors. Thus every mask has at least four runs, and attains four. Its six exchanges have the four distinct outputs in Table 1, with multiplicities 2, 1, 2, 1. The displayed masks prove degree at most two. A degree-one mask would select a contiguous occurrence of whose deletion leaves . The last column lists the remainders for all such occurrences; none is 01010101. Thus all four outputs have degree two.
| Output | Two-run mask | Remainders |
| 0101 0100 1101 0 | VVVVVVUVVUUUU | 10011010, 01011010 |
| 0010 1010 1101 0 | UVVVVVVVVUUUU | 01011010, 00111010 |
| 0010 1101 0101 0 | VUUUUVVVVVVVU | 00101110, 00101101 |
| 0010 1100 1010 1 | VUUUUVUVVVVVV | 00101101 |
Table 1. The four successor words, two-run witnesses, and all remainders after deleting a contiguous copy of .
This example has eight minimum masks. Its first minimum mask, UVVVVVUVVVU with U < V, has an exchange to 0100 1100 1101 0 of degree 3. Thus Proposition 5 does not refute existence over all minimum masks.
Proposition 6. Let be letters, , and . Put
The word has exactly twelve masks, each with three U-runs. The mask
has both exchanges at its first separator equal to , and both at its second separator equal to , all of degree one. Its first minimum mask has an exact degree-two exchange.
Proof. Write and number the occurrences of in from 0 to . The numbers of ’s in the initial, internal, and final gaps are
The source requires two ’s between consecutive ’s. Hence at least one of , must be U, and at least one of , must be U: retaining both members of either pair would leave at most one intervening . The source has exactly two ’s, so it selects one from each pair and no other .
Since , both ’s bounding the central gap of three ’s are V. Exactly one of those three ’s must therefore be U. It is the middle of the source . If the first U-labeled is , its preceding U-labeled is the initial ; if it is , that is the single between and , since the initial must remain in . The analogous statement at the right end selects the following next to the last U-labeled . Thus there are exactly masks. Each has a first run, an isolated central run, and a last run, and all choices give the two specified sources.
For , the first pair of rotations gives , since . The second pair gives .
With , the first minimum mask is
Exchange its first U-run with its first separating block . The resulting word is
and the transported mask has two runs. A degree-one mask would delete a contiguous from . Its two ’s would have to be separated by a single . There are exactly two such internal gaps in . Deleting the occurrence at the first merges -gaps of lengths 2, 1, 3 and removes three ’s, leaving an internal gap of length 3. Deleting the occurrence at the last leaves the central gap of length 3 untouched. Neither remainder is , whose internal gaps all have length 2. Thus .
For , this gives , and , of total length seventeen. Proposition 12 proves that this is the first possible length for an arbitrary-mask failure at degree three, over every alphabet. Appending to its base and output forces a final , since ends in . Thus an arbitrary minimum mask with no exact exchange exists at every binary length at least seventeen, already at degree three. Proposition 5 similarly gives degree-four examples at every binary length at least thirteen after the same forced- suffix padding.
Simple separator rules also fail, even after choosing a first minimum mask. Table 2 gives counterexamples. In each row the original degree is three, both directions at every selected separator give degree one, and another separator gives an exact degree-two predecessor. “Shortest” and “longest” refer to the separating -block, with all ties allowed. In Table 2, a complete position check gives the first minimum masks and the selected degrees . Each displayed exact successor has the indicated two-run mask and contains no contiguous copy of , proving degree two.
| Rule | Sources and output | First mask; selected degrees | Exact move; output and mask |
| First | <br><br> | <br>, length 2<br> | , degree 2<br><br> |
| Last | <br><br> | <br>, length 1<br> | , degree 2<br><br> |
| Shortest | <br><br> | <br>, length 1<br> | , degree 2<br><br> |
| Longest | <br><br> | <br>, length 2<br> | , degree 2<br><br> |
Table 2. Failed separator choices in the first minimum mask. Source identity is fixed in each row; .
Proposition 7. For
the first minimum mask, with , is . It is a minimum mask for a word of degree four, but all six block exchanges give degree two. Another minimum mask has an exact degree-three exchange.
Proof. Number the seven ’s of from 0 to 6. The -gap lengths are . Consecutive ’s in require two intervening ’s. Therefore can take at most one of , at most two of , and at most one of . It needs four ’s, so it takes one from each outer pair and two in the middle. The pairs and have only one intervening , whereas consecutive ’s in need two. The middle pair is therefore exactly . The remaining three ’s belong to .
The first source- gap between ’s needs one , and the second needs two. Assigning the ’s accordingly gives exactly the following six prefix masks of the first ten positions, and six suffix masks of the last eight positions:
Every prefix projects to , every suffix to , and every combination is valid. Each prefix ends in , so the run counts add. Four prefixes and four suffixes have two runs; the other two in each list have three. Thus there are exactly 36 masks, with 16, 16, 4 masks having 4, 5, 6 runs, respectively. The first two-run prefix and first two-run suffix give . The six exchanges of have five distinct outputs, listed in Table 3; the first occurs twice. The displayed two-run masks give degree at most two. None of these words contains a contiguous copy of , so none has degree one. Finally, UUVVVUUUUUVUUUVUUVV is another minimum mask; exchanging its second separator with the following U-run (the exchange) gives ABABAAABAABABAABAB. The transported mask UUVVVUUUUUUUVVUUVV has three runs. This word’s internal -gaps between successive ’s have lengths . Selecting the four ’s of in at most two runs would require at least two pairs of successive ’s within a run, each separated by exactly two ’s. The two gaps of length two would therefore both have to be selected. But their four bounding ’s have only one between the middle pair, whereas requires two. Thus two runs are impossible and the degree is exactly three.
| Output | Two-run mask |
| ABAABAABABABAAABAB | UUUUUUUUVVVVVUUUVV |
| ABABABAABAABAAABAB | VVVVUUUUUUUUUUVUVV |
| ABABAAABAABAABABAB | VVVVVVUUUUUUUUUVUU |
| ABABAAABABAABAABAB | VVUUUUVVVUUUUUUUVV |
| ABABAAABABABAABAAB | VVVVVVUUUVUUUUUUUU |
Table 3. The five degree-two outputs from the first minimum mask in Proposition 7.
The first-mask failure occurs at every binary length at least eighteen. Append to and in Proposition 7. Every appended position is forced to V: if any were U, the last U-letter would be A, whereas ends in B. Thus all masks, their run counts, and their lexicographic order are unchanged apart from the final V. The same applies to every exchanged word.
Proposition 8. For
The last minimum mask, UUUUUUUVVVUUVVVUVVVU, has all six block exchanges of degree two. The first minimum mask, UUUUUUUVVVUUVVVUVVUV, has successor-degree vector , so its exchange is exact.
Proof. The exhaustive position test gives exactly the eight masks in Appendix § 11, Table 9: six have five runs and two have four. To check completeness of this finite list, test each choice of positions in against , and test the complementary positions against , retaining precisely the matches. The last minimum mask is UUUUUUUVVVUUVVVUVVVU; all six of its successor degrees are . Their five distinct outputs and two-run masks appear in Table 4. Four outputs contain no contiguous ; the remaining output has the sole contiguous- deletion remainder ABABABABB, different from . Thus the displayed upper bounds are exact. The first minimum mask, UUUUUUUVVVUUVVVUVVUV, has successor degrees . Its sole exact move is , to ABABABABABABAB. The same appendix table also lists all sixteen masks of , obtained by the same finite position test. None has fewer than three runs, and UUUUUUUUVVVVVVVUUUV has three. This proves .
Table 4: Degree-two exchanges of the last minimum mask in the length-twenty example. The second output occurs twice.
| Output | Two-run mask |
| ABAABABABBABBABABABB | VVVUUUUUUVVVVVUUUUUV |
| ABABABBABABABABABABB | VVVVVVVUUUUUUVUUUUUV |
| ABABABBABAABABABBABB | UUUUUUUUUUVVVVVVVVUV |
| ABABABBABAABBABBABAB | VVVVVVVUUUVVUUUUUUUU |
| ABABABBABAABBABABBAB | UUUUUUUUUUVUVVVVVVVV |
Table 4.
Proposition 12 establishes length twenty as the smallest degree-four last-mask failure over every alphabet. Neither extremal minimum mask alone is a universal choice.
Even allowing both end separators of the first minimum mask is insufficient. Take
Its first minimum mask is UVUVVVUUVUVUUUVUVU, a minimum mask for a word of degree seven. The four moves at the first and last separators have degree five. To see the end failures, split the word at the fresh markers , whose labels are forced VUV. The left gadget (01201, 201, 02101201) has degree three and both first-separator moves give degree one. The right gadget (34534, 345, 34534354) has degree three and both last-separator moves give degree one. Their alphabets are disjoint, and the markers isolate one extra U-run. The global degree is therefore the sum of the two local degrees plus one, both before and after these end moves.
Label shifts and a further counterexample
The first minimum mask satisfies useful necessary conditions. Suppose one of its separating V-blocks is and its following U-run is . If with , the two adjacent copies of can exchange source labels: becomes . If with , the two copies of can exchange labels, changing to . Both changes preserve the source words and the number of runs, and give an earlier mask. The first minimum mask therefore admits neither arrangement. These are shifts within one output word, not descent exchanges to a different output.
These shifts do not characterize the obstruction. For example,
has exactly the eight masks listed in Appendix § 11, Table 10, all with four U-runs. The selected minimum mask VVVUUUVUUVUUVUUVVV has successor degrees ; Table 5 gives the six outputs and two-run witnesses. For the first output the sole contiguous- deletion remainder is BABABABBA, and for the last it is ABBABABAB; neither is . The other four outputs contain no contiguous . Thus all six degrees are exactly two.
Table 5: The six degree-two successors of VVVUUVUUVUUVUUVVV in the packed example.
| Move | Output | Two-run mask | Degree |
| 1L | ABBAABBABABABABBA | UUUUUUUVVUVVVVVVV | 2 |
| 1R | ABBABBAABABABABBA | VVVUUUUUUVUUVVVVV | 2 |
| 2L | ABBABABBAABABABBA | VVVVVUUUUUUVUUUVVV | 2 |
| 2R | ABBABABAABBABABBA | VVVUVUUUUUUVVVVVVV | 2 |
| 3L | ABBABABABAABBABBA | VVVUUUVVVUUUUUUVVV | 2 |
| 3R | ABBABABABABBABABBA | VVVVVVVUVVUUUUUUU | 2 |
Table 5.
| Original word | |||
| Mask | Mask | ||
| UUUVVUVUUVUUVVVVV | 4 | UUUVVUVUUVVVUUVVV | 4 |
| UUUVVUVVVUUVUUVVV | 4 | UUUVVUVVVVVUVVUUU | 4 |
| VVVUUVUUVUUVUUVVV | 4 | VVVUUVUUVVVUVVUUU | 4 |
| VVVUUVVVUUVUVVUUU | 4 | VVVVVUUVUUVUVVUUU | 4 |
| Exact successor | |||
| Mask | Mask | ||
| UUVUVUVUUVUUVVVVV | 5 | UUVUVUVUUVVVUUVVV | 5 |
| UUVUVUVVVUUVUUVVV | 5 | UUVVUUVUUVUUVVVVV | 4 |
| UUVUVUVVVVVUVVUUU | 5 | UUVVUUVUUVVVUUVVV | 4 |
| UUVVUUVVVUUVUUVVV | 4 | UUVVUUVVVVVUVVUUU | 4 |
| UUVVVVUUVUUVUUVVV | 4 | UUVVVVUUVVVUVVUUU | 4 |
| UUVVVVVVUUVUVVUUU | 4 | VVUUUUVUUVUUVVVVV | 3 |
| VVUUUUVUUVVVUUVVV | 3 | VVUUUUVVVUUVUUVVV | 3 |
| VVUUUUVVVVVUVVUUU | 3 | VVUUVVUUVUUVUUVVV | 4 |
| VVUUVVUUVVVUVVUUU | 4 | VVUUVVVVUUVUVVUUU | 4 |
| VVUVUVUUVUUVUUVVV | 5 | VVUVUVUUVVVUVVUUU | 5 |
| VVUVUVVVUUVUVVUUU | 5 |
Table 10. Complete mask lists for the packed example: eight masks of , and twenty-one masks of the exact first-mask successor .
In the selected mask the three internal pairs of a separating V-block and its following U-run are , , and . Each separator is shorter than its following run and cannot have that run as a proper suffix; neither begins with nor with . At the leading V-block the pair is : does not end with , and is shorter. Hence neither whole-factor shift is available, including at the leading block.
The first minimum mask is UUUVVUVUUVUUVVVVV; its move gives . Table 10 lists all twenty-one masks of . The minimum run count in that list is three, attained for example by VVUUUUVUUVUUVVVVV. The same exhaustive position test as above produces both complete lists, proving .
A periodic repair at degree three
The preceding counterexamples show that a minimum mask can have no exact block exchange even when another minimum mask does. We now study a mechanism for changing the source labels without changing the output or its minimum run count. A common periodic structure forces such a shift; for an explicitly chosen infinite family, we also prove that the shifted mask admits an exact descent exchange.
A label shift under a common-period hypothesis
Write a three-run mask as
where are nonempty and the outer blocks may be empty. The bounded classification in Proposition 11 gives as powers of one primitive word for every bad degree-three mask in its domain. We first examine the consequence of this common-period hypothesis.
Suppose now that and are powers of one primitive word . This common-period hypothesis forces a label shift. Put and . If , the first letters of are from , and are the rotation from : . Primitivity forces , and then are powers of . Selecting contiguously in the local periodic block would give a one-run mask of , even with the outer contexts, a contradiction. Thus . Hence , and with . Relabeling the adjacent identical copies of gives
The two source words and the three-run count are unchanged, and the new mask is earlier under . Existence of this shift alone does not prove that one of its exchanges is exact. The following result supplies the missing degree calculation for an infinite family.
Exact repair for an infinite family
Theorem 9. Let be letters, put , and let be positive integers. Set
The mask has three runs; its four exchanges give , all of degree one. Shifting the middle to the identical final of gives
The exchange of gives
Consequently, whenever , is an alternative minimum mask with a specified exact exchange.
Proof. The identities and give the four exchanged words. For example, both exchanges at the first separator give ; those at the second give . The shift preserves the source projections, and its exchange has the word in (7) and a two-run transported mask. It remains to rule out degree one.
Number the copies of in from zero. Its initial and final -gaps have length one. All internal gaps have length two, except the gaps after , , and , whose lengths are respectively . A contiguous copy of uses successive 's and has exactly one internal gap of length one, after its th ; all its other internal gaps have length two.
If this short gap matches the first short gap of , the copy must start at and end at . A negative initial index is impossible. If , the copy contains the gap of length three and cannot be . If , deleting it leaves that gap untouched. If , the deletion ends beside that gap and removes one of its three 's. If , the joined internal gap has length
; if , the initial gap has length . The case was excluded by the negative start. None is compatible with .
If the short gap matches the last short gap of , the copy starts at and ends at . When it contains the three-letter gap; when the deletion leaves that gap untouched; when the deletion leaves a final gap of length two. Again the remainder cannot be . These are all possible contiguous copies of , so no one-run mask exists and .
A finite diagnostic supports a sharper but presently unproved form of the hypothesis in Theorem 9. An independent source-grid calculation over (all 2,401 tuples) found 371 degree-three instances and no exception to
The same calculation agrees with complete mask enumeration on the box . This finite evidence does not replace a proof for all positive parameters, so Theorem 9 retains its explicit condition .
For and , Proposition 6 proves , so this repairs each bad mask in that family without choosing an extremal mask. The same construction allows to be replaced by any nonempty word containing no . Every -block is pure in a valid mask. More precisely, every maximal non- block in each of , , , and the exchanged word is exactly one copy of : copies of are separated by an , and the source order forces both sources to enter each such block at a copy boundary. Splitting that block between the sources would leave both copies unfinished at the following , which neither source could then read. Contracting the pure -blocks to therefore preserves masks and their run counts. In particular, is covered by taking , where , , are distinct letters.
Computational results
The computations below enumerate shuffle masks and letter-equality patterns. The software and data are available as release v1.0 of Insertion-degree descent [17]; its README gives the commands, input files, certificates, and execution records. The propositions state the exact domains of the finite conclusions, and the following arguments establish completeness of their reductions. Table 6 summarizes the scope and the kind of evidence supporting the main computational statements. A completed exhaustive search, a certificate check, and an independently regenerated search are distinct forms of evidence; their respective roles are specified below.
| Result | Scope | Evidence |
| Prop. 10 | Alphabet sizes at most 2, 3, 4; , respectively | Exhaustive numerical enumeration |
| Prop. 11 | Degree-three bad masks, , all alphabets | Symbolic search and independently checked certificates; regeneration through |
| Prop. 12 | All degrees through , all alphabets; additional degree-specific bounds | Symbolic exhaustive search with completeness reduction |
| Prop. 14 | 168 failed candidate adjacent swaps in the stated finite domain | Direct enumeration and prefix-profile certification tests |
Table 6. Guide to the computational results. Length means ; all-alphabet claims use symbolic equality-pattern enumeration.
Numerical enumeration
For each ordered source pair, enumerate all binary masks with U-positions and V-positions, emit their words, and group equal outputs. The minimum run count is taken after grouping, and the first and last minimizers are retained. For each selected mask of degree greater than one, form every block exchange and look up its output degree in the same table. Every mask has the prescribed projections by construction, and every representation of an output occurs in its group. Since an exchange preserves the sources, its successor is present in that table. This proves completeness for each finite source-pair domain.
For alphabet bounds, restricted-growth strings for represent each letter-equality pattern once: scanning from left to right, give the first new letter the name 0, the next 1, and so on. Renaming letters preserves all masks and degrees. Thus enumeration of these patterns with at most classes covers every alphabet of size at most .
Proposition 10 (Computer-assisted). For nonempty ordered source pairs in each domain in Table 7, every output of degree has an exact exchange from its first minimum mask and an exact exchange from its last minimum mask. In particular, Singleton No-Gap holds in each domain.
| Alphabet size at most | Combined length |
| Two | |
| Three | |
| Four |
Table 7. Exhaustive alphabet-bounded domains of Proposition 10; .
The enumerations just described test both extremal masks in these domains. Repeated exact descent from degree gives degrees with the same ordered sources, proving the stated No-Gap consequence. All words in that induction have the same combined length. The source-pair and output totals are recorded in the software README.
Symbolic enumeration and completeness
Fix length , degree parameter , and a source-position mask of length with . Write and , requiring . The symbolic search enumerates every such . Give the positions of the concatenated sources distinct variables . For a mask with U-positions and V-positions, let be the variable sequence obtained by reading each source in order. Then is the original output, and exchanging its pure blocks gives variable sequences in the move order defined in Section 3.
The lower-mask list contains every length- mask with exactly U-positions, exactly V-positions, and . To propose as a lower witness for move , impose all equalities
These equalities test both source projections, including every consumed position; equality of the whole emitted words is equivalent to being a mask of that successor. Union-find represents the least equivalence relation containing the accumulated equalities. Its classes give the most general source letters satisfying them. Further identifications can introduce masks but cannot remove a valid mask.
For fixed , the recursive search is:
Search, initially and the discrete partition :
If , record a surviving terminal partition and return.
For every :
.
In memoized mode, skip if was seen; otherwise mark it seen.
Compute the minimum run count using both sources.
If , prune this extension. In first mode, prune if an earlier -run mask of exists. In last mode, prune if a later -run mask of exists. In arbitrary mode, apply neither order-based pruning rule. Otherwise call Search(, ).
Here denotes equivalence closure. The ordinary source-grid DP computes , comparing letters by class; retaining the lexicographically first or last path among minimum-cost paths tests the order condition. Normalize a partition by scanning source positions in the order and naming classes at their first occurrence. The full memoization key is ; with a fresh cache for each fixed , only the last two entries need storage. The nonmemoized mode stores no seen set and counts each complete witness tuple separately.
At depth , the partition satisfies a chosen lower witness for each of the first moves. Every retained node still makes minimum with , and first or last when that mode requires it. Both invariants hold initially and persist after the explicit tests. A terminal node therefore represents a mask for which every exchange has a lower witness.
For the first-minimum-mask search, a lower or earlier pruning witness persists under further identifications, so a pruned branch cannot yield a counterexample whose selected mask is first and minimum. For an actual counterexample, choose one actual lower witness for each exchange. Every equality imposed along that witness path holds in the counterexample. A lower or earlier original-mask pruning witness along the path would therefore also hold in the counterexample, contradicting its selected mask being first and minimum. The path survives, and its leaf equality partition refines the counterexample’s actual equality pattern. Hence every counterexample is a coarsening of the partition of a surviving leaf. This proves completeness for each tested length and degree, over arbitrary alphabet sizes. Replacing “earlier” with “later” gives the last-mask argument; dropping that condition gives the arbitrary-mask argument.
Memoizing the key just defined is also complete: the remaining moves, equality constraints, and pruning tests depend only on the fixed original mask, current partition, and depth. Earlier witness choices with that same key have exactly the same possible continuations.
Execution and evidence. The finite premises are supplied by the completed production enumerations archived in release v1.0, with the exact domains, commands, and completed ranges recorded in its README. Independent degree-three symbolic regeneration covers every counter and all twelve surviving witness tuples through length twenty. A separate independent certificate checker verifies all 1 512 archived tuples, 896 distinct source/output/mask instances, and 41 244 identification cuts through length thirty. It checks the original degrees, lower witnesses, common periods, shifted successors, and the persistent lower masks used below. Certificate checking establishes the validity of the surviving cases; completeness of generation above length twenty, and the larger higher-degree bounds, rely on the archived completed production searches together with the reduction just proved.
Uniform repair of degree-three bad masks
Proposition 11 (Computational result). For combined length at most thirty, every degree-three minimum mask whose four exchanges all have degree one has the following common-period structure; under further identifications, the claims below are restricted to identifications that preserve the original minimum degree three. Writing , , and as in Section 7, the nonempty words are powers of a common primitive word. The mask admits the shift in (6), and its shifted successor-degree vector, in the order , is , over every alphabet.
Proof. The arbitrary-mask symbolic search of § 8.2 represents every possible bad mask by a coarsening of a surviving equality partition. The complete search through length thirty yields 896 distinct source/output/mask instances. For each instance, the finite checks verify the original degree, all four contiguous witnesses, the common period, and every shifted successor. The primitive periods are ABA, ABCA, ABABA, ABCAB, and ABCDA, with some periods represented by many distinct contexts. These power equations persist under letter identifications, taking the primitive root of the identified period when necessary.
Further identifications are checked without assuming that a displayed word is the only word represented by its partition. For each possible one-run cut of each shifted 1L and 2R successor, impose the least additional source-letter equalities making that cut a valid mask. The resulting original word always has degree at most two; its lower mask remains valid under every further identification. Thus a coarsening retaining original degree three cannot give degree one at either shifted successor. The transported masks supply degree at most two, while the displayed one-run witnesses for 1R and 2L persist under identifications. This proves the vector (2, 1, 1, 2) for every such coarsening.
The completeness argument in § 8.2 and this persistent lower-mask test cover every letter identification, and hence every alphabet.
All-alphabet descent bounds
For degree three, the lower witnesses in the symbolic enumeration are exactly the one-run masks
In arbitrary-mask mode the search enumerates every three-run original mask and every four-tuple of cuts, retaining the lower-run pruning after each equality extension. A surviving tuple therefore has original degree three and a one-run witness for each of its four exchanges. Different tuples may describe the same equality partition or source/output/mask instance. The completeness argument above covers all such bad masks and every coarsening of their partitions.
Proposition 12 (Computer-assisted). For nonempty ordered sources over any alphabet, the following hold.
Through combined length seventeen, every output of degree has an exact exchange from its first minimum mask. Consequently, Singleton No-Gap holds through length seventeen. Length eighteen is the smallest first-minimum-mask failure over all degrees and alphabets.
At degree three, first-minimum-mask descent holds through length thirty. A bad arbitrary minimum mask has combined length at least seventeen, and Proposition 6 attains that bound.
At degree four and length eighteen, the first-mask failure in Proposition 7 is the unique failure up to letter renaming. At degree five, first-mask descent holds through length eighteen. Some minimum mask has an exact exchange at each degree through length eighteen. Degrees can occur at length eighteen, and no No-Gap assertion is made for those degrees.
At degree four, last-minimum-mask descent holds through length nineteen. At length twenty its unique failure up to letter renaming is the example in Proposition 8, whose first minimum mask has an exact exchange. Hence one of the two extremal minimum masks has an exact exchange at degree four through length twenty.
Proof. The complete symbolic searches have no surviving first-mask partition through length seventeen, none at degree three through length thirty, and none at degree five and length eighteen. For length at most sixteen, the bound is at most eight; at length seventeen it is at most nine. Thus all possible degrees are covered, with degree two exact by § 5. Iterating exact descent proves Singleton No-Gap in the first domain.
The arbitrary-mask degree-three search has no surviving tuple through length sixteen. Proposition 6 gives a bad mask at length seventeen. At degree four and length eighteen the sole surviving first-mask partition is the binary example of Proposition 7. Its only proper coarsening is unary and has degree one, so the failure is unique up to renaming. Its alternative exact exchange, together with the degree-three and degree-five searches, gives the third assertion.
The last-mask search has no degree-four survivor at length nineteen and a single binary partition at length twenty. Its only proper coarsening is unary, and Proposition 8, with the complete mask list in Appendix § 11, Table 9, proves that its first-mask exchange is exact. This gives the fourth assertion.
To pass from an exact-length search to shorter lengths, append to and , where . Every new mask is an old mask followed by : an appended letter cannot belong to . Its run count and lexicographic order are unchanged, and every exchange is an old exchange followed by . A shorter counterexample would therefore persist at the tested length. A letter different from the last letter of also forces the suffix to , so the same padding works on any fixed alphabet with at least two letters.
A structured binary domain
The following domain is specified separately from the exhaustive length bounds. For each , take every binary block of length containing both letters, including blocks with a smaller period. For , , and , let be the length- prefix of its infinite repetition starting at offset zero, and the length- prefix starting at offset . When , also include each single-position flip of with fixed, and each single-position flip of with fixed; never perturb both sources. Deduplicate the exact ordered pairs. Denote the resulting set of 70 710 pairs by .
Proposition 13 (Computer-assisted). For every , every output of degree has an exact exchange from each extremal minimum mask. Every degree-three minimum mask has at least one exact exchange.
The grouped-mask enumeration verifies the extremal assertions. A separate pass through all degree-three output groups examines every minimum mask and verifies the second assertion. The domain contains 20 001 166 outputs, including 8 861 068 of degree three; this conclusion is specific to .
The prefix test
An eligible adjacent swap interchanges unequal letters at positions , assigned to different sources by some minimum mask, whose transported mask has one fewer run. Count positions once within a source/output triple, even if several masks make them eligible.
Proposition 14 (Computer-assisted). Among all labeled binary nonempty ordered source pairs of combined length eight or nine and their degree-three outputs, exactly 168 triples have an eligible swap whose output has degree one. Each triple has exactly one such failed position. Of the 116 triples having another eligible swap of degree two, 94 have such a swap certified by (4), and 22 have none certified. For each of the remaining 52 triples, the prefix test certifies an ordinary adjacent swap of degree two, which need not lower a minimum mask’s run count.
Enumeration of every mask and adjacent position verifies the counts; the prefix dynamic program tests whether there exists a cutoff satisfying (4) at every source state. The same word from a different ordered source pair is counted separately. The lower-bound argument in § 4.2 proves the meaning of each certificate. Thus the prefix condition is useful for certifying individual predecessors but does not characterize existence of a successful eligible swap.
Iteration depth for arbitrary languages
Hughes proved iteration-depth No-Gap for finite languages [7 Section 10, Theorem 8] and posed the Iteration-Depth No-Gap Conjecture for arbitrary languages [7 Section 10]. The following padding argument proves that conjecture.
Let be arbitrary languages. For a positive integer , a -insertion writes a source word as and a base word as , and produces . Factors may be empty. Set and obtain by -insertion into a base word in . The degree is fixed within each history. For a reachable word define
Theorem 15. For arbitrary languages , if a reachable word has , then for each integer with there exists a reachable word with .
Proof. Padding by empty source and base factors gives whenever ; induction on lifts the predecessor and then pads the last insertion. Suppose with , and take its final base predecessor . If through degree , let . Padding gives , and padding the final insertion gives . This contradicts minimality of . Therefore , and induction realizes all smaller depths. No inclusion between successive iteration stages is required.
The iteration-depth theorem above has a Lean 4 formalization [18] for arbitrary languages over an arbitrary alphabet type , without finiteness or countability assumptions. The formal theorem result uses the literal insertion operation with one fixed positive degree throughout each history. Its empty-pair padding argument synchronizes degrees and shows that a predecessor of a word of minimum depth has minimum depth exactly .
Conclusion and open problems
Block exchange has an exact algebraic obstruction: the commuting representations of the successor have minimum degree , while every additional decrease is caused by a noncommuting representation. The unary formulas eliminate this obstruction for every minimum mask. In the periodic degree-three family, an explicit label shift yields an exact exchange. The counterexamples show why a general descent argument must allow more than an arbitrary mask, either extremal mask, or a fixed separator rule.
The principal open question is whether every shuffle of degree admits some minimum mask and some block exchange with no noncommuting representation of at most runs. An affirmative answer would prove Singleton No-Gap. The finite results establish this conclusion through length seventeen in all degrees, and give larger bounds at selected degrees, but the unbounded existence step remains unresolved.
At degree three, two structural questions are more specific. Must every bad minimum mask have as powers of one primitive word? Under that hypothesis and arbitrary outer contexts, must the shift in (6) have an exact exchange? Theorem 9 answers the repair question for its infinite family; Proposition 11 answers both questions through length thirty. Establishing the common-period classification and extending the repair to all contexts would give a route to an unbounded degree-three theorem.
At the language level, Hughes’s representation-erasure and finite-to-arbitrary questions remain [7 Section 11]. Even if every singleton spectrum is an initial interval, competing source pairs can lower degrees of the same output, so the language spectrum requires a separate argument. Iteration depth has a different mechanism: padding all histories to a common insertion degree makes the last predecessor attain the preceding minimum depth. That proves No-Gap for arbitrary languages without an assumption of monotonicity between successive iteration stages.
Complete finite mask lists
The tables below retain every mask used in the finite completeness arguments of § 6. For fixed , a direct position test enumerates every -element subset of the positions of , retains it exactly when its subsequence is and the complementary subsequence is , and counts its maximal U-runs. Thus the lists include every representation for the specified ordered sources.
Table 8 gives the sixteen masks in Proposition 5; its proof also derives the list directly from the four equal-letter pairs.
Table 9 gives all masks of the original word and the exact first-mask successor in Proposition 8. The minima in the two lists are four and three, respectively.
| Mask | Mask | ||
| UUUUUUUVVUVUVVVUVVUV | 5 | UUUUUUUVVUVUVVVUVVVU | 5 |
| UUUUUUUVVUVVUVVUVVUV | 5 | UUUUUUUVVUVVUVVUVVVU | 5 |
| UUUUUUUVVVUUVVVUVVUV | 4 | UUUUUUUVVVUUVVVUVVVU | 4 |
| UUUUUUUVVVUVUVVUVVUV | 5 | UUUUUUUVVVUVUVVUVVVU | 5 |
Table 9. Complete mask lists for the last-mask example and its exact first-mask successor . The upper list has eight masks; the lower list has sixteen. Both use the same ordered sources.
| Mask | Mask | ||
| UUUUUUUVVUVUVVVVUVUV | 5 | UUUUUUUVVUVUVVVVUVVU | 5 |
| UUUUUUUVVUVUVVVVVUUV | 4 | UUUUUUUVVUVUVVVVVUVU | 5 |
| UUUUUUUVVUVVUVVVUVUV | 5 | UUUUUUUVVUVVUVVVUVVU | 5 |
| UUUUUUUVVUVVUVVVVUUV | 4 | UUUUUUUVVUVVUVVVVUVU | 5 |
| UUUUUUUVVVUUVVVVUVUV | 4 | UUUUUUUVVVUUVVVVUVVU | 4 |
| UUUUUUUVVVUUVVVVVUUV | 3 | UUUUUUUVVVUUVVVVVUVU | 4 |
| UUUUUUUVVVUVUVVVUVUV | 5 | UUUUUUUVVVUVUVVVUVVU | 5 |
| UUUUUUUVVVUVUVVVVUUV | 4 | UUUUUUUVVVUVUVVVVUVU | 5 |
Table 9. Exact successor
Table 10 gives all masks of the packed example and its first-mask successor from § 6. Their minima are four and three, respectively.
Use of AI tools
The authors used AI tools throughout this work. Ma and Zhang used ChatGPT Pro (GPT-6 Pro), Codex (gpt-6.1-sol) and Claude Opus 5.5 (via Claude Code) for literature search, computation and double-checking, including formal verification of the results in Lean; Hughes used ChatGPT for mathematical discussions and the development of open problems, for critical examination of arguments and for suggestions on exposition and manuscript organization, and Claude.ai to validate all proofs and computations. Ma and Zhang chose the open questions on which this paper is based and developed the initial proofs and counterexamples, which all three authors then refined together. All proofs can be checked by hand, the computations can be reproduced from the verification package, and all authors take full responsibility for the final manuscript.
References
- [1]S. Buss and M. Soltys, Unshuffling a square is NP-hard, Journal of Computer and System Sciences 80(4) (2014), 766–776. doi:10.1016/j.jcss.2013.11.002.DOI
- [2]C. Câmpeanu, K. Salomaa, and S. Vágvölgyi, Shuffle quotient and decompositions, in Developments in Language Theory, LNCS 2295, Springer, 2002, pp. 186–196. doi:10.1007/3-540-46011-X_15.DOI
- [3]G. Castiglione and A. Restivo, On the shuffle of star-free languages, Fundamenta Informaticae 116(1–4) (2012), 35–44. doi:10.3233/FI-2012-666.DOI
- [4]M. Domaratzki, Deletion along trajectories, Theoretical Computer Science 320(2–3) (2004), 293–313. doi:10.1016/j.tcs.2004.02.031.DOI
- [5]N. J. Fine and H. S. Wilf, Uniqueness theorems for periodic functions, Proceedings of the American Mathematical Society 16(1) (1965), 109–114. doi:10.1090/S0002-9939-1965-0174934-9.DOI
- [6]D. Haussler, Insertion languages, Information Sciences 31(1) (1983), 77–89. doi:10.1016/0020-0255(83)90023-3.DOI
- [7]C. E. Hughes, Undecidability of Adjacent Equality for Insertion, Shuffle, and Crossover Language Operations, arXiv:2608.27755v2, 2026.arxiv.org/abs/2608.27755
- [8]M. Ito, L. Kari, and G. Thierrin, Insertion and deletion closure of languages, Theoretical Computer Science 183(1) (1997), 3–19. doi:10.1016/S0304-3975(96)00037-6.DOI
- [9]M. Ito, L. Kari, and G. Thierrin, Shuffle and scattered deletion closure of languages, Theoretical Computer Science 245(1) (2000), 115–133. doi:10.1016/S0304-3975(99)00277-7.DOI
- [10]M. Ito and R. Sugiura, n-Insertion on languages, in Aspects of Molecular Computing, LNCS 2950, Springer, 2003, pp. 213–218. doi:10.1007/978-3-540-24635-0_15.DOI
- [11]L. Kari, Deletion operations: closure properties, International Journal of Computer Mathematics 52(1–2) (1994), 23–42.
- [12]L. Kari, Insertion operations: closure properties, Bulletin of the European Association for Theoretical Computer Science 51 (1993), 181–191.
- [13]L. Kari and G. Thierrin, Contextual insertions/deletions and computability, Information and Computation 131(1) (1996), 47–61. doi:10.1006/inco.1996.0091.
- [14]M. Lothaire, Algebraic Combinatorics on Words, Cambridge University Press, Cambridge, 2002.DOI
- [15]R. C. Lyndon and M. P. Schützenberger, The equation a^M = b^Nc^P in a free group, Michigan Mathematical Journal 9(4) (1962), 289–298. doi:10.1307/mmj/1028998766.DOI
- [16]A. Mateescu, G. Rozenberg, and A. Salomaa, Shuffle on trajectories: syntactic constraints, Theoretical Computer Science 197(1–2) (1998), 1–56. doi:10.1016/S0304-3975(97)00163-1.DOI
- [17]Insertion-degree descent, software and data, release v1.0, 2026. https://github.com/the-omega-institute/insertion-degree-descent/releases/tag/v1.0.
- [18]HughesIterationDepthNoGap.lean, Lean 4 formalization of the iteration-depth no-gap theorem for arbitrary languages over any alphabet, revision 16f6e1a0d882, 2026. GitHub source at the verified revision. Lean 4.35.0; mathlib v4.35.0 (pinned dependency manifest).
- [19]M. K. Warmuth and D. Haussler. On the complexity of iterated shuffle, Journal of Computer and System Sciences 28(3) (1984), 345–358. doi:10.1016/0022-0000(84)90018–7.DOI