MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  ccatopth2 Structured version   Unicode version

Theorem ccatopth2 12626
Description: An opth 4649-like theorem for recovering the two halves of a concatenated word. (Contributed by Mario Carneiro, 1-Oct-2015.)
Assertion
Ref Expression
ccatopth2  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( A ++  B
)  =  ( C ++  D )  <->  ( A  =  C  /\  B  =  D ) ) )

Proof of Theorem ccatopth2
StepHypRef Expression
1 fveq2 5787 . . . 4  |-  ( ( A ++  B )  =  ( C ++  D )  ->  ( # `  ( A ++  B ) )  =  ( # `  ( C ++  D ) ) )
2 ccatlen 12522 . . . . . . . 8  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( # `  ( A ++  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
323ad2ant1 1015 . . . . . . 7  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  ( A ++  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
4 simp3 996 . . . . . . . 8  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  B )  =  ( # `  D
) )
54oveq2d 6230 . . . . . . 7  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( # `  A
)  +  ( # `  B ) )  =  ( ( # `  A
)  +  ( # `  D ) ) )
63, 5eqtrd 2433 . . . . . 6  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  ( A ++  B ) )  =  ( ( # `  A
)  +  ( # `  D ) ) )
7 ccatlen 12522 . . . . . . 7  |-  ( ( C  e. Word  X  /\  D  e. Word  X )  ->  ( # `  ( C ++  D ) )  =  ( ( # `  C
)  +  ( # `  D ) ) )
873ad2ant2 1016 . . . . . 6  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  ( C ++  D ) )  =  ( ( # `  C
)  +  ( # `  D ) ) )
96, 8eqeq12d 2414 . . . . 5  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( # `  ( A ++  B ) )  =  ( # `  ( C ++  D ) )  <->  ( ( # `
 A )  +  ( # `  D
) )  =  ( ( # `  C
)  +  ( # `  D ) ) ) )
10 simp1l 1018 . . . . . . . 8  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  ->  A  e. Word  X )
11 lencl 12488 . . . . . . . 8  |-  ( A  e. Word  X  ->  ( # `
 A )  e. 
NN0 )
1210, 11syl 16 . . . . . . 7  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  A )  e.  NN0 )
1312nn0cnd 10789 . . . . . 6  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  A )  e.  CC )
14 simp2l 1020 . . . . . . . 8  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  ->  C  e. Word  X )
15 lencl 12488 . . . . . . . 8  |-  ( C  e. Word  X  ->  ( # `
 C )  e. 
NN0 )
1614, 15syl 16 . . . . . . 7  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  C )  e.  NN0 )
1716nn0cnd 10789 . . . . . 6  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  C )  e.  CC )
18 simp2r 1021 . . . . . . . 8  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  ->  D  e. Word  X )
19 lencl 12488 . . . . . . . 8  |-  ( D  e. Word  X  ->  ( # `
 D )  e. 
NN0 )
2018, 19syl 16 . . . . . . 7  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  D )  e.  NN0 )
2120nn0cnd 10789 . . . . . 6  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( # `  D )  e.  CC )
2213, 17, 21addcan2d 9713 . . . . 5  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( ( # `  A )  +  (
# `  D )
)  =  ( (
# `  C )  +  ( # `  D
) )  <->  ( # `  A
)  =  ( # `  C ) ) )
239, 22bitrd 253 . . . 4  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( # `  ( A ++  B ) )  =  ( # `  ( C ++  D ) )  <->  ( # `  A
)  =  ( # `  C ) ) )
241, 23syl5ib 219 . . 3  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( A ++  B
)  =  ( C ++  D )  ->  ( # `
 A )  =  ( # `  C
) ) )
25 ccatopth 12625 . . . . . . 7  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  A
)  =  ( # `  C ) )  -> 
( ( A ++  B
)  =  ( C ++  D )  <->  ( A  =  C  /\  B  =  D ) ) )
2625biimpd 207 . . . . . 6  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  A
)  =  ( # `  C ) )  -> 
( ( A ++  B
)  =  ( C ++  D )  ->  ( A  =  C  /\  B  =  D )
) )
27263expia 1196 . . . . 5  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
) )  ->  (
( # `  A )  =  ( # `  C
)  ->  ( ( A ++  B )  =  ( C ++  D )  -> 
( A  =  C  /\  B  =  D ) ) ) )
2827com23 78 . . . 4  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
) )  ->  (
( A ++  B )  =  ( C ++  D
)  ->  ( ( # `
 A )  =  ( # `  C
)  ->  ( A  =  C  /\  B  =  D ) ) ) )
29283adant3 1014 . . 3  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( A ++  B
)  =  ( C ++  D )  ->  (
( # `  A )  =  ( # `  C
)  ->  ( A  =  C  /\  B  =  D ) ) ) )
3024, 29mpdd 40 . 2  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( A ++  B
)  =  ( C ++  D )  ->  ( A  =  C  /\  B  =  D )
) )
31 oveq12 6223 . 2  |-  ( ( A  =  C  /\  B  =  D )  ->  ( A ++  B )  =  ( C ++  D
) )
3230, 31impbid1 203 1  |-  ( ( ( A  e. Word  X  /\  B  e. Word  X )  /\  ( C  e. Word  X  /\  D  e. Word  X
)  /\  ( # `  B
)  =  ( # `  D ) )  -> 
( ( A ++  B
)  =  ( C ++  D )  <->  ( A  =  C  /\  B  =  D ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 367    /\ w3a 971    = wceq 1399    e. wcel 1836   ` cfv 5509  (class class class)co 6214    + caddc 9424   NN0cn0 10730   #chash 12326  Word cword 12457   ++ cconcat 12459
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1633  ax-4 1646  ax-5 1719  ax-6 1765  ax-7 1808  ax-8 1838  ax-9 1840  ax-10 1855  ax-11 1860  ax-12 1872  ax-13 2016  ax-ext 2370  ax-rep 4491  ax-sep 4501  ax-nul 4509  ax-pow 4556  ax-pr 4614  ax-un 6509  ax-cnex 9477  ax-resscn 9478  ax-1cn 9479  ax-icn 9480  ax-addcl 9481  ax-addrcl 9482  ax-mulcl 9483  ax-mulrcl 9484  ax-mulcom 9485  ax-addass 9486  ax-mulass 9487  ax-distr 9488  ax-i2m1 9489  ax-1ne0 9490  ax-1rid 9491  ax-rnegex 9492  ax-rrecex 9493  ax-cnre 9494  ax-pre-lttri 9495  ax-pre-lttrn 9496  ax-pre-ltadd 9497  ax-pre-mulgt0 9498
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 972  df-3an 973  df-tru 1402  df-ex 1628  df-nf 1632  df-sb 1758  df-eu 2232  df-mo 2233  df-clab 2378  df-cleq 2384  df-clel 2387  df-nfc 2542  df-ne 2589  df-nel 2590  df-ral 2747  df-rex 2748  df-reu 2749  df-rmo 2750  df-rab 2751  df-v 3049  df-sbc 3266  df-csb 3362  df-dif 3405  df-un 3407  df-in 3409  df-ss 3416  df-pss 3418  df-nul 3725  df-if 3871  df-pw 3942  df-sn 3958  df-pr 3960  df-tp 3962  df-op 3964  df-uni 4177  df-int 4213  df-iun 4258  df-br 4381  df-opab 4439  df-mpt 4440  df-tr 4474  df-eprel 4718  df-id 4722  df-po 4727  df-so 4728  df-fr 4765  df-we 4767  df-ord 4808  df-on 4809  df-lim 4810  df-suc 4811  df-xp 4932  df-rel 4933  df-cnv 4934  df-co 4935  df-dm 4936  df-rn 4937  df-res 4938  df-ima 4939  df-iota 5473  df-fun 5511  df-fn 5512  df-f 5513  df-f1 5514  df-fo 5515  df-f1o 5516  df-fv 5517  df-riota 6176  df-ov 6217  df-oprab 6218  df-mpt2 6219  df-om 6618  df-1st 6717  df-2nd 6718  df-recs 6978  df-rdg 7012  df-1o 7066  df-oadd 7070  df-er 7247  df-en 7454  df-dom 7455  df-sdom 7456  df-fin 7457  df-card 8251  df-cda 8479  df-pnf 9559  df-mnf 9560  df-xr 9561  df-ltxr 9562  df-le 9563  df-sub 9738  df-neg 9739  df-nn 10471  df-2 10529  df-n0 10731  df-z 10800  df-uz 11020  df-fz 11612  df-fzo 11736  df-hash 12327  df-word 12465  df-concat 12467  df-substr 12469
This theorem is referenced by:  ccatrcan  12628
  Copyright terms: Public domain W3C validator