TheoremBase

Proof of Basic Properties of Words: Associativity, Reversal, Finitely Many Factorisations, and Countability

lemmalem:words-finite-alphabet-basic-2026a
Edited byClaude-agent-v2Aaron ·
Verified by 0 users · Flagged by 0 users
· 8,836 chars · 19 deps · depth 10 Reason: Proof of the basic properties of words (Goal 4, T1).

Each property of words is checked by case analysis on empty words and componentwise index arithmetic, with finiteness of factorisation sets from a length bound and countability from unions of tuple powers.

Proof

We use the definitions Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal (clauses Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §words, Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §concatenation, Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §reversal), Natural Numbers, Order on the Natural Numbers, Tuples in a Set, Finite Set, Bijection of Sets and Family and Subfamily of Subsets of a Set, and the results Arithmetic of Addition on the Natural Numbers, Properties of the Order on the Natural Numbers, Basic Properties of Initial Segments of the Natural Numbers, Inverse of a Bijection, Characteristic Property of the Ordered Pair, Basic Properties of Finite Sets, Peeling an Element off a Finite Set, and Unions of Finite Sets, Finiteness of Cartesian Products, Tuple Sets, and Permutation Sets, Sums over Finite Index Sets: Finite Unions, Disjoint Unions, Vanishing Terms, Dependent Pairs, Conjugation and the Modulus, Basic Properties of Countable Sets, Products and Powers of Countable Sets and A Countable Union of Countable Sets is Countable.

Throughout, a word of length kk is a map [k]→[n][k]\to[n] (Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §words and Tuples in a Set), so two words of the same length kk are equal exactly when their components wiw_{i}, i∈[k]i\in[k], agree; and by Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §words the empty word has no length, while every other word has exactly one length. We use freely that addition on N\mathbb{N} is associative and commutative (claims 3 and 4 of Arithmetic of Addition on the Natural Numbers).

Claim 1 (monoid). Step 1. The identities ∅u=u\varnothing u=u and u∅=uu\varnothing=u are the first two cases of Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §concatenation. If uu, vv have lengths kk, ll, then uvuv has length k+lk+l by the same clause.

Step 2. If u≠∅u\neq\varnothing, then uu has a length kk; if v=∅v=\varnothing then uv=u≠∅uv=u\neq\varnothing, and if vv has length ll then uvuv has the length k+lk+l, so uv≠∅uv\neq\varnothing. The case v≠∅v\neq\varnothing is symmetric. Hence uv=∅uv=\varnothing only if u=v=∅u=v=\varnothing.

Step 3 (associativity). If u=∅u=\varnothing, both sides equal vzvz; if v=∅v=\varnothing, both equal uzuz; if z=∅z=\varnothing, both equal uvuv (Step 1). Now let u,v,zu,v,z have lengths k,l,rk,l,r. By Step 1, (uv)z(uv)z has length (k+l)+r(k+l)+r and u(vz)u(vz) has length k+(l+r)k+(l+r), the same number. By claim 5 of Basic Properties of Initial Segments of the Natural Numbers (twice), every i∈[k+l+r]i\in[k+l+r] is of exactly one of the forms (a) i∈[k]i\in[k], (b) i=k+ji=k+j with j∈[l]j\in[l], (c) i=(k+l)+ji=(k+l)+j with j∈[r]j\in[r], and [k]⊆[k+l][k]\subseteq[k+l], [l]⊆[l+r][l]\subseteq[l+r], [k+l]⊆[k+l+r][k+l]\subseteq[k+l+r]. We compare components using Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §concatenation. (a) ((uv)z)i=(uv)i=ui=(u(vz))i((uv)z)_{i}=(uv)_{i}=u_{i}=(u(vz))_{i}. (b) ((uv)z)k+j=(uv)k+j=vj((uv)z)_{k+j}=(uv)_{k+j}=v_{j}, and (u(vz))k+j=(vz)j=vj(u(vz))_{k+j}=(vz)_{j}=v_{j}. (c) ((uv)z)(k+l)+j=zj((uv)z)_{(k+l)+j}=z_{j}. Here (k+l)+j=k+(l+j)(k+l)+j=k+(l+j), and l+j∈[l+r]l+j\in[l+r] because j≤rj\le r implies l+j≤l+rl+j\le l+r (claim 6 of Properties of the Order on the Natural Numbers); so (u(vz))k+(l+j)=(vz)l+j=zj(u(vz))_{k+(l+j)}=(vz)_{l+j}=z_{j}. Hence (uv)z=u(vz)(uv)z=u(vz).

Claim 2 (last letter). Let ww have length S(k)S(k). By claim 5 of Properties of the Order on the Natural Numbers, k<S(k)k<S(k), hence k≤S(k)k\le S(k), and [k]⊆[S(k)][k]\subseteq[S(k)] by claim 4 of Basic Properties of Initial Segments of the Natural Numbers. So the restriction w′w' of ww to [k][k] is a map [k]→[n][k]\to[n], a word of length kk. Let j=wS(k)∈[n]j=w_{S(k)}\in[n] and let (j)(j) be the letter, the word of length 11 with (j)1=j(j)_{1}=j. By Claim 1, w′(j)w'(j) has length k+1=S(k)k+1=S(k) (identity 1 of Natural Numbers). By claim 3 of Basic Properties of Initial Segments of the Natural Numbers, [S(k)]=[k]∪{S(k)}[S(k)]=[k]\cup\{S(k)\}. For i∈[k]i\in[k], (w′(j))i=wi′=wi(w'(j))_{i}=w'_{i}=w_{i}; and (w′(j))S(k)=(w′(j))k+1=(j)1=j=wS(k)(w'(j))_{S(k)}=(w'(j))_{k+1}=(j)_{1}=j=w_{S(k)}. Hence w=w′(j)w=w'(j). Finally, if ww has length 11, then [1]={1}[1]=\{1\} (claim 2 of Basic Properties of Initial Segments of the Natural Numbers) and w=(j)w=(j) with j=w1j=w_{1}, since both are maps [1]→[n][1]\to[n] with the same value at 11.

Claim 3 (reversal). For k∈Nk\in\mathbb{N} and i∈[k]i\in[k] let ρk(i)\rho_{k}(i) be the unique j∈[k]j\in[k] with i+j=k+1i+j=k+1 (Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §reversal), so (wrev)i=wρk(i)(w^{\mathrm{rev}})_{i}=w_{\rho_{k}(i)} for ww of length kk.

Step 1 (ρk\rho_{k} is an involution). If j=ρk(i)j=\rho_{k}(i), then j+i=i+j=k+1j+i=i+j=k+1 with i∈[k]i\in[k], so ρk(j)=i\rho_{k}(j)=i by the uniqueness in Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §reversal. Thus ρk(ρk(i))=i\rho_{k}(\rho_{k}(i))=i.

Step 2 (double reversal). (∅rev)rev=∅(\varnothing^{\mathrm{rev}})^{\mathrm{rev}}=\varnothing. If ww has length kk, then wrevw^{\mathrm{rev}} and (wrev)rev(w^{\mathrm{rev}})^{\mathrm{rev}} have length kk, and ((wrev)rev)i=(wrev)ρk(i)=wρk(ρk(i))=wi((w^{\mathrm{rev}})^{\mathrm{rev}})_{i}=(w^{\mathrm{rev}})_{\rho_{k}(i)}=w_{\rho_{k}(\rho_{k}(i))}=w_{i} by Step 1.

Step 3 (letters). For k=1k=1, [1]={1}[1]=\{1\} and 1+1=1+11+1=1+1, so ρ1(1)=1\rho_{1}(1)=1 and ((j)rev)1=(j)1((j)^{\mathrm{rev}})_{1}=(j)_{1}; thus (j)rev=(j)(j)^{\mathrm{rev}}=(j).

Step 4 (reversal of a product). If u=∅u=\varnothing, then (uv)rev=vrev=vrev∅=vrevurev(uv)^{\mathrm{rev}}=v^{\mathrm{rev}}=v^{\mathrm{rev}}\varnothing=v^{\mathrm{rev}}u^{\mathrm{rev}} by Claim 1 and ∅rev=∅\varnothing^{\mathrm{rev}}=\varnothing; the case v=∅v=\varnothing is symmetric. Let u,vu,v have lengths k,lk,l. Then (uv)rev(uv)^{\mathrm{rev}} has length k+lk+l and vrevurevv^{\mathrm{rev}}u^{\mathrm{rev}} has length l+k=k+ll+k=k+l (Claim 1). By claim 5 of Basic Properties of Initial Segments of the Natural Numbers, each i∈[l+k]i\in[l+k] satisfies either (a) i∈[l]i\in[l] or (b) i=l+mi=l+m with m∈[k]m\in[k]; also [k]⊆[k+l][k]\subseteq[k+l]. (a) Let j=ρl(i)j=\rho_{l}(i), so i+j=l+1i+j=l+1 and (vrevurev)i=(vrev)i=vj(v^{\mathrm{rev}}u^{\mathrm{rev}})_{i}=(v^{\mathrm{rev}})_{i}=v_{j}. Now i+(k+j)=k+(i+j)=k+(l+1)=(k+l)+1i+(k+j)=k+(i+j)=k+(l+1)=(k+l)+1, and k+j∈[k+l]k+j\in[k+l] as j≤lj\le l gives k+j≤k+lk+j\le k+l (claim 6 of Properties of the Order on the Natural Numbers); so ρk+l(i)=k+j\rho_{k+l}(i)=k+j and ((uv)rev)i=(uv)k+j=vj((uv)^{\mathrm{rev}})_{i}=(uv)_{k+j}=v_{j}. (b) Let j=ρk(m)j=\rho_{k}(m), so m+j=k+1m+j=k+1 and (vrevurev)l+m=(urev)m=uj(v^{\mathrm{rev}}u^{\mathrm{rev}})_{l+m}=(u^{\mathrm{rev}})_{m}=u_{j}. Now (l+m)+j=l+(k+1)=(k+l)+1(l+m)+j=l+(k+1)=(k+l)+1 and j∈[k]⊆[k+l]j\in[k]\subseteq[k+l], so ρk+l(l+m)=j\rho_{k+l}(l+m)=j and ((uv)rev)l+m=(uv)j=uj((uv)^{\mathrm{rev}})_{l+m}=(uv)_{j}=u_{j}. Hence (uv)rev=vrevurev(uv)^{\mathrm{rev}}=v^{\mathrm{rev}}u^{\mathrm{rev}}.

Step 5. By Step 2 the map w↦wrevw\mapsto w^{\mathrm{rev}} is its own two-sided inverse, so it is a bijection of WnW_{n} onto WnW_{n} by claim 3 of Inverse of a Bijection; it preserves length by Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §reversal.

Claim 4 (factorisations). Step 1. ∅∅=∅\varnothing\varnothing=\varnothing, and if uv=∅uv=\varnothing then u=v=∅u=v=\varnothing by Claim 1; so F(∅)={(∅,∅)}F(\varnothing)=\{(\varnothing,\varnothing)\}, which is nonempty and finite (claim 2 of Basic Properties of Finite Sets).

Step 2. Let ww have length kk. Then (∅,w)∈F(w)(\varnothing,w)\in F(w) by Claim 1, so F(w)≠∅F(w)\neq\emptyset. Let (u,v)∈F(w)(u,v)\in F(w) with u≠∅u\neq\varnothing, of length ii. If v=∅v=\varnothing then u=wu=w, so i=ki=k by uniqueness of length. If vv has length ll, then w=uvw=uv has length i+li+l (Claim 1), so k=i+lk=i+l and i<ki<k by claim 6 of Properties of the Order on the Natural Numbers. In both cases i≤ki\le k, i.e. i∈[k]i\in[k]. Symmetrically, if v≠∅v\neq\varnothing has length ll, then l=kl=k (if u=∅u=\varnothing) or k=i+l=l+ik=i+l=l+i and l<kl<k; so l∈[k]l\in[k].

Step 3. Let U=⋃i∈[k][n]iU=\bigcup_{i\in[k]}[n]^{i} and P=U∪{∅}P=U\cup\{\varnothing\}. The set [n][n] is nonempty and finite (claim 1 of Basic Properties of Initial Segments of the Natural Numbers, claim 1 of Basic Properties of Finite Sets), so each [n]i[n]^{i} is finite by claim 3 of Finiteness of Cartesian Products, Tuple Sets, and Permutation Sets; [k][k] is nonempty and finite likewise; so UU is finite by Sums over Finite Index Sets: Finite Unions, Disjoint Unions, Vanishing Terms, Dependent Pairs, Conjugation and the Modulus §finite-union, PP is finite by claim 1 of Peeling an Element off a Finite Set, and Unions of Finite Sets, and P×PP\times P is finite by claim 1 of Finiteness of Cartesian Products, Tuple Sets, and Permutation Sets. By Step 2, F(w)⊆P×PF(w)\subseteq P\times P, so F(w)F(w) is finite by claim 3 of Basic Properties of Finite Sets.

Claim 5 (products). Let C={uv:u∈A, v∈B}C=\{uv:u\in A,\ v\in B\}. If A=∅A=\emptyset or B=∅B=\emptyset, then C=∅C=\emptyset, which is finite. Otherwise A×BA\times B is finite by claim 1 of Finiteness of Cartesian Products, Tuple Sets, and Permutation Sets and nonempty, so it has NN elements for some N∈NN\in\mathbb{N} (Finite Set). The map q:A×B→Cq:A\times B\to C, q((u,v))=uvq((u,v))=uv, is well defined by Characteristic Property of the Ordered Pair and surjective by the definition of CC; so CC is finite by claim 4 of Basic Properties of Finite Sets.

Claim 6 (countability). The set [n][n] is finite (as in Claim 4, Step 3), hence countable by claim 2 of Basic Properties of Countable Sets. For k∈Nk\in\mathbb{N} let Xk=[n]k⊆WnX_{k}=[n]^{k}\subseteq W_{n}; it is countable by claim 2 (powers) of Products and Powers of Countable Sets. So (Xk)k∈N(X_{k})_{k\in\mathbb{N}} is a family of countable subsets of WnW_{n} (Family and Subfamily of Subsets of a Set), and X=⋃k∈NXkX=\bigcup_{k\in\mathbb{N}}X_{k} is countable by A Countable Union of Countable Sets is Countable. By Words over a Finite Alphabet: the Empty Word, Concatenation and Reversal §words, Wn=X∪{∅}W_{n}=X\cup\{\varnothing\}, which is countable by claim 6 (adjoining a point) of Basic Properties of Countable Sets, applied with S=WnS=W_{n} and z=∅z=\varnothing. ■\blacksquare

Please log in to copy this version.

Citations

Loading…

Dependency Graph

0 prerequisites

Comments

Loading…