Metamath Proof Explorer


Theorem ccats1alpha

Description: A concatenation of a word with a singleton word is a word over an alphabet S iff the symbols of both words belong to the alphabet S . (Contributed by AV, 27-Mar-2022)

Ref Expression
Assertion ccats1alpha ( ( 𝐴 ∈ Word 𝑉𝑋𝑈 ) → ( ( 𝐴 ++ ⟨“ 𝑋 ”⟩ ) ∈ Word 𝑆 ↔ ( 𝐴 ∈ Word 𝑆𝑋𝑆 ) ) )

Proof

Step Hyp Ref Expression
1 wrdv ( 𝐴 ∈ Word 𝑉𝐴 ∈ Word V )
2 s1cli ⟨“ 𝑋 ”⟩ ∈ Word V
3 2 a1i ( 𝑋𝑈 → ⟨“ 𝑋 ”⟩ ∈ Word V )
4 ccatalpha ( ( 𝐴 ∈ Word V ∧ ⟨“ 𝑋 ”⟩ ∈ Word V ) → ( ( 𝐴 ++ ⟨“ 𝑋 ”⟩ ) ∈ Word 𝑆 ↔ ( 𝐴 ∈ Word 𝑆 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ) )
5 1 3 4 syl2an ( ( 𝐴 ∈ Word 𝑉𝑋𝑈 ) → ( ( 𝐴 ++ ⟨“ 𝑋 ”⟩ ) ∈ Word 𝑆 ↔ ( 𝐴 ∈ Word 𝑆 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ) )
6 simpr ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) → ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 )
7 s1len ( ♯ ‘ ⟨“ 𝑋 ”⟩ ) = 1
8 wrdl1exs1 ( ( ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ∧ ( ♯ ‘ ⟨“ 𝑋 ”⟩ ) = 1 ) → ∃ 𝑤𝑆 ⟨“ 𝑋 ”⟩ = ⟨“ 𝑤 ”⟩ )
9 6 7 8 sylancl ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) → ∃ 𝑤𝑆 ⟨“ 𝑋 ”⟩ = ⟨“ 𝑤 ”⟩ )
10 elex ( 𝑋𝑈𝑋 ∈ V )
11 10 adantr ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) → 𝑋 ∈ V )
12 elex ( 𝑤𝑆𝑤 ∈ V )
13 s111 ( ( 𝑋 ∈ V ∧ 𝑤 ∈ V ) → ( ⟨“ 𝑋 ”⟩ = ⟨“ 𝑤 ”⟩ ↔ 𝑋 = 𝑤 ) )
14 11 12 13 syl2an ( ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ∧ 𝑤𝑆 ) → ( ⟨“ 𝑋 ”⟩ = ⟨“ 𝑤 ”⟩ ↔ 𝑋 = 𝑤 ) )
15 simpr ( ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ∧ 𝑤𝑆 ) → 𝑤𝑆 )
16 eleq1 ( 𝑋 = 𝑤 → ( 𝑋𝑆𝑤𝑆 ) )
17 15 16 syl5ibrcom ( ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ∧ 𝑤𝑆 ) → ( 𝑋 = 𝑤𝑋𝑆 ) )
18 14 17 sylbid ( ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ∧ 𝑤𝑆 ) → ( ⟨“ 𝑋 ”⟩ = ⟨“ 𝑤 ”⟩ → 𝑋𝑆 ) )
19 18 rexlimdva ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) → ( ∃ 𝑤𝑆 ⟨“ 𝑋 ”⟩ = ⟨“ 𝑤 ”⟩ → 𝑋𝑆 ) )
20 9 19 mpd ( ( 𝑋𝑈 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) → 𝑋𝑆 )
21 20 ex ( 𝑋𝑈 → ( ⟨“ 𝑋 ”⟩ ∈ Word 𝑆𝑋𝑆 ) )
22 s1cl ( 𝑋𝑆 → ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 )
23 21 22 impbid1 ( 𝑋𝑈 → ( ⟨“ 𝑋 ”⟩ ∈ Word 𝑆𝑋𝑆 ) )
24 23 anbi2d ( 𝑋𝑈 → ( ( 𝐴 ∈ Word 𝑆 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ↔ ( 𝐴 ∈ Word 𝑆𝑋𝑆 ) ) )
25 24 adantl ( ( 𝐴 ∈ Word 𝑉𝑋𝑈 ) → ( ( 𝐴 ∈ Word 𝑆 ∧ ⟨“ 𝑋 ”⟩ ∈ Word 𝑆 ) ↔ ( 𝐴 ∈ Word 𝑆𝑋𝑆 ) ) )
26 5 25 bitrd ( ( 𝐴 ∈ Word 𝑉𝑋𝑈 ) → ( ( 𝐴 ++ ⟨“ 𝑋 ”⟩ ) ∈ Word 𝑆 ↔ ( 𝐴 ∈ Word 𝑆𝑋𝑆 ) ) )