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

Theorem ccats1swrdeq 12668
Description: The last symbol of a word concatenated with the subword of the word having length less by 1 than the word results in the word itself. (Contributed by Alexander van der Vekens, 24-Oct-2018.)
Assertion
Ref Expression
ccats1swrdeq  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( W  =  ( U substr  <. 0 ,  ( # `  W
) >. )  ->  U  =  ( W concat  <" ( lastS  `  U ) "> ) ) )

Proof of Theorem ccats1swrdeq
StepHypRef Expression
1 oveq1 6284 . . . 4  |-  ( W  =  ( U substr  <. 0 ,  ( # `  W
) >. )  ->  ( W concat  <" ( lastS  `  U
) "> )  =  ( ( U substr  <. 0 ,  ( # `  W ) >. ) concat  <" ( lastS  `  U ) "> ) )
21adantl 466 . . 3  |-  ( ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `  U )  =  ( ( # `  W )  +  1 ) )  /\  W  =  ( U substr  <. 0 ,  ( # `  W
) >. ) )  -> 
( W concat  <" ( lastS  `  U ) "> )  =  ( ( U substr  <. 0 ,  (
# `  W ) >. ) concat  <" ( lastS  `  U
) "> )
)
3 oveq1 6284 . . . . . . . . . 10  |-  ( (
# `  U )  =  ( ( # `  W )  +  1 )  ->  ( ( # `
 U )  - 
1 )  =  ( ( ( # `  W
)  +  1 )  -  1 ) )
433ad2ant3 1018 . . . . . . . . 9  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( ( # `
 U )  - 
1 )  =  ( ( ( # `  W
)  +  1 )  -  1 ) )
5 lencl 12536 . . . . . . . . . . 11  |-  ( W  e. Word  V  ->  ( # `
 W )  e. 
NN0 )
6 nn0cn 10806 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  NN0  ->  ( # `  W
)  e.  CC )
7 pncan1 9984 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  CC  ->  ( (
( # `  W )  +  1 )  - 
1 )  =  (
# `  W )
)
85, 6, 73syl 20 . . . . . . . . . 10  |-  ( W  e. Word  V  ->  (
( ( # `  W
)  +  1 )  -  1 )  =  ( # `  W
) )
983ad2ant1 1016 . . . . . . . . 9  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( (
( # `  W )  +  1 )  - 
1 )  =  (
# `  W )
)
104, 9eqtr2d 2483 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( # `  W
)  =  ( (
# `  U )  -  1 ) )
1110opeq2d 4205 . . . . . . 7  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  <. 0 ,  ( # `  W
) >.  =  <. 0 ,  ( ( # `  U )  -  1 ) >. )
1211oveq2d 6293 . . . . . 6  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( U substr  <.
0 ,  ( # `  W ) >. )  =  ( U substr  <. 0 ,  ( ( # `  U )  -  1 ) >. ) )
1312oveq1d 6292 . . . . 5  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( ( U substr  <. 0 ,  (
# `  W ) >. ) concat  <" ( lastS  `  U
) "> )  =  ( ( U substr  <. 0 ,  ( (
# `  U )  -  1 ) >.
) concat  <" ( lastS  `  U
) "> )
)
14 simp2 996 . . . . . 6  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  U  e. Word  V )
15 nn0p1gt0 10826 . . . . . . . . . 10  |-  ( (
# `  W )  e.  NN0  ->  0  <  ( ( # `  W
)  +  1 ) )
165, 15syl 16 . . . . . . . . 9  |-  ( W  e. Word  V  ->  0  <  ( ( # `  W
)  +  1 ) )
17163ad2ant1 1016 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  0  <  ( ( # `  W
)  +  1 ) )
18 breq2 4437 . . . . . . . . 9  |-  ( (
# `  U )  =  ( ( # `  W )  +  1 )  ->  ( 0  <  ( # `  U
)  <->  0  <  (
( # `  W )  +  1 ) ) )
19183ad2ant3 1018 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( 0  <  ( # `  U
)  <->  0  <  (
( # `  W )  +  1 ) ) )
2017, 19mpbird 232 . . . . . . 7  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  0  <  (
# `  U )
)
21 hashneq0 12408 . . . . . . . 8  |-  ( U  e. Word  V  ->  (
0  <  ( # `  U
)  <->  U  =/=  (/) ) )
22213ad2ant2 1017 . . . . . . 7  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( 0  <  ( # `  U
)  <->  U  =/=  (/) ) )
2320, 22mpbid 210 . . . . . 6  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  U  =/=  (/) )
24 swrdccatwrd 12667 . . . . . 6  |-  ( ( U  e. Word  V  /\  U  =/=  (/) )  ->  (
( U substr  <. 0 ,  ( ( # `  U
)  -  1 )
>. ) concat  <" ( lastS  `  U ) "> )  =  U )
2514, 23, 24syl2anc 661 . . . . 5  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( ( U substr  <. 0 ,  ( ( # `  U
)  -  1 )
>. ) concat  <" ( lastS  `  U ) "> )  =  U )
2613, 25eqtrd 2482 . . . 4  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( ( U substr  <. 0 ,  (
# `  W ) >. ) concat  <" ( lastS  `  U
) "> )  =  U )
2726adantr 465 . . 3  |-  ( ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `  U )  =  ( ( # `  W )  +  1 ) )  /\  W  =  ( U substr  <. 0 ,  ( # `  W
) >. ) )  -> 
( ( U substr  <. 0 ,  ( # `  W
) >. ) concat  <" ( lastS  `  U ) "> )  =  U )
282, 27eqtr2d 2483 . 2  |-  ( ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `  U )  =  ( ( # `  W )  +  1 ) )  /\  W  =  ( U substr  <. 0 ,  ( # `  W
) >. ) )  ->  U  =  ( W concat  <" ( lastS  `  U ) "> ) )
2928ex 434 1  |-  ( ( W  e. Word  V  /\  U  e. Word  V  /\  ( # `
 U )  =  ( ( # `  W
)  +  1 ) )  ->  ( W  =  ( U substr  <. 0 ,  ( # `  W
) >. )  ->  U  =  ( W concat  <" ( lastS  `  U ) "> ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 369    /\ w3a 972    = wceq 1381    e. wcel 1802    =/= wne 2636   (/)c0 3767   <.cop 4016   class class class wbr 4433   ` cfv 5574  (class class class)co 6277   CCcc 9488   0cc0 9490   1c1 9491    + caddc 9493    < clt 9626    - cmin 9805   NN0cn0 10796   #chash 12379  Word cword 12508   lastS clsw 12509   concat cconcat 12510   <"cs1 12511   substr csubstr 12512
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1603  ax-4 1616  ax-5 1689  ax-6 1732  ax-7 1774  ax-8 1804  ax-9 1806  ax-10 1821  ax-11 1826  ax-12 1838  ax-13 1983  ax-ext 2419  ax-rep 4544  ax-sep 4554  ax-nul 4562  ax-pow 4611  ax-pr 4672  ax-un 6573  ax-cnex 9546  ax-resscn 9547  ax-1cn 9548  ax-icn 9549  ax-addcl 9550  ax-addrcl 9551  ax-mulcl 9552  ax-mulrcl 9553  ax-mulcom 9554  ax-addass 9555  ax-mulass 9556  ax-distr 9557  ax-i2m1 9558  ax-1ne0 9559  ax-1rid 9560  ax-rnegex 9561  ax-rrecex 9562  ax-cnre 9563  ax-pre-lttri 9564  ax-pre-lttrn 9565  ax-pre-ltadd 9566  ax-pre-mulgt0 9567
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 973  df-3an 974  df-tru 1384  df-ex 1598  df-nf 1602  df-sb 1725  df-eu 2270  df-mo 2271  df-clab 2427  df-cleq 2433  df-clel 2436  df-nfc 2591  df-ne 2638  df-nel 2639  df-ral 2796  df-rex 2797  df-reu 2798  df-rmo 2799  df-rab 2800  df-v 3095  df-sbc 3312  df-csb 3418  df-dif 3461  df-un 3463  df-in 3465  df-ss 3472  df-pss 3474  df-nul 3768  df-if 3923  df-pw 3995  df-sn 4011  df-pr 4013  df-tp 4015  df-op 4017  df-uni 4231  df-int 4268  df-iun 4313  df-br 4434  df-opab 4492  df-mpt 4493  df-tr 4527  df-eprel 4777  df-id 4781  df-po 4786  df-so 4787  df-fr 4824  df-we 4826  df-ord 4867  df-on 4868  df-lim 4869  df-suc 4870  df-xp 4991  df-rel 4992  df-cnv 4993  df-co 4994  df-dm 4995  df-rn 4996  df-res 4997  df-ima 4998  df-iota 5537  df-fun 5576  df-fn 5577  df-f 5578  df-f1 5579  df-fo 5580  df-f1o 5581  df-fv 5582  df-riota 6238  df-ov 6280  df-oprab 6281  df-mpt2 6282  df-om 6682  df-1st 6781  df-2nd 6782  df-recs 7040  df-rdg 7074  df-1o 7128  df-oadd 7132  df-er 7309  df-en 7515  df-dom 7516  df-sdom 7517  df-fin 7518  df-card 8318  df-cda 8546  df-pnf 9628  df-mnf 9629  df-xr 9630  df-ltxr 9631  df-le 9632  df-sub 9807  df-neg 9808  df-nn 10538  df-2 10595  df-n0 10797  df-z 10866  df-uz 11086  df-fz 11677  df-fzo 11799  df-hash 12380  df-word 12516  df-lsw 12517  df-concat 12518  df-s1 12519  df-substr 12520
This theorem is referenced by:  ccats1swrdeqrex  12678  ccats1swrdeqbi  12697
  Copyright terms: Public domain W3C validator