Metamath Proof Explorer


Theorem s2eq2s1eq

Description: Two length 2 words are equal iff the corresponding singleton words consisting of their symbols are equal. (Contributed by Alexander van der Vekens, 24-Sep-2018)

Ref Expression
Assertion s2eq2s1eq
|- ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> ( <" A B "> = <" C D "> <-> ( <" A "> = <" C "> /\ <" B "> = <" D "> ) ) )

Proof

Step Hyp Ref Expression
1 df-s2
 |-  <" A B "> = ( <" A "> ++ <" B "> )
2 1 a1i
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> <" A B "> = ( <" A "> ++ <" B "> ) )
3 df-s2
 |-  <" C D "> = ( <" C "> ++ <" D "> )
4 3 a1i
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> <" C D "> = ( <" C "> ++ <" D "> ) )
5 2 4 eqeq12d
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> ( <" A B "> = <" C D "> <-> ( <" A "> ++ <" B "> ) = ( <" C "> ++ <" D "> ) ) )
6 s1cl
 |-  ( A e. V -> <" A "> e. Word V )
7 s1cl
 |-  ( B e. V -> <" B "> e. Word V )
8 6 7 anim12i
 |-  ( ( A e. V /\ B e. V ) -> ( <" A "> e. Word V /\ <" B "> e. Word V ) )
9 8 adantr
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> ( <" A "> e. Word V /\ <" B "> e. Word V ) )
10 s1cl
 |-  ( C e. V -> <" C "> e. Word V )
11 s1cl
 |-  ( D e. V -> <" D "> e. Word V )
12 10 11 anim12i
 |-  ( ( C e. V /\ D e. V ) -> ( <" C "> e. Word V /\ <" D "> e. Word V ) )
13 12 adantl
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> ( <" C "> e. Word V /\ <" D "> e. Word V ) )
14 s1len
 |-  ( # ` <" A "> ) = 1
15 s1len
 |-  ( # ` <" C "> ) = 1
16 14 15 eqtr4i
 |-  ( # ` <" A "> ) = ( # ` <" C "> )
17 16 a1i
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> ( # ` <" A "> ) = ( # ` <" C "> ) )
18 ccatopth
 |-  ( ( ( <" A "> e. Word V /\ <" B "> e. Word V ) /\ ( <" C "> e. Word V /\ <" D "> e. Word V ) /\ ( # ` <" A "> ) = ( # ` <" C "> ) ) -> ( ( <" A "> ++ <" B "> ) = ( <" C "> ++ <" D "> ) <-> ( <" A "> = <" C "> /\ <" B "> = <" D "> ) ) )
19 9 13 17 18 syl3anc
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> ( ( <" A "> ++ <" B "> ) = ( <" C "> ++ <" D "> ) <-> ( <" A "> = <" C "> /\ <" B "> = <" D "> ) ) )
20 5 19 bitrd
 |-  ( ( ( A e. V /\ B e. V ) /\ ( C e. V /\ D e. V ) ) -> ( <" A B "> = <" C D "> <-> ( <" A "> = <" C "> /\ <" B "> = <" D "> ) ) )