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

Theorem lswccatn0lsw 12568
Description: The last symbol of a word concatenated with a nonempty word is the last symbol of the nonempty word. (Contributed by AV, 22-Oct-2018.) (Proof shortened by AV, 1-May-2020.)
Assertion
Ref Expression
lswccatn0lsw  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( lastS  `  ( A ++  B ) )  =  ( lastS  `  B
) )

Proof of Theorem lswccatn0lsw
StepHypRef Expression
1 ovex 6262 . . . 4  |-  ( A ++  B )  e.  _V
2 lsw 12545 . . . 4  |-  ( ( A ++  B )  e. 
_V  ->  ( lastS  `  ( A ++  B ) )  =  ( ( A ++  B
) `  ( ( # `
 ( A ++  B
) )  -  1 ) ) )
31, 2mp1i 13 . . 3  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( lastS  `  ( A ++  B ) )  =  ( ( A ++  B ) `  ( ( # `  ( A ++  B ) )  - 
1 ) ) )
4 ccatlen 12555 . . . . . . . 8  |-  ( ( A  e. Word  V  /\  B  e. Word  V )  ->  ( # `  ( A ++  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
54oveq1d 6249 . . . . . . 7  |-  ( ( A  e. Word  V  /\  B  e. Word  V )  ->  ( ( # `  ( A ++  B ) )  - 
1 )  =  ( ( ( # `  A
)  +  ( # `  B ) )  - 
1 ) )
653adant3 1017 . . . . . 6  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  (
( # `  ( A ++  B ) )  - 
1 )  =  ( ( ( # `  A
)  +  ( # `  B ) )  - 
1 ) )
7 lencl 12521 . . . . . . . . . . 11  |-  ( A  e. Word  V  ->  ( # `
 A )  e. 
NN0 )
87nn0zd 10926 . . . . . . . . . 10  |-  ( A  e. Word  V  ->  ( # `
 A )  e.  ZZ )
983ad2ant1 1018 . . . . . . . . 9  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( # `
 A )  e.  ZZ )
10 lennncl 12522 . . . . . . . . . 10  |-  ( ( B  e. Word  V  /\  B  =/=  (/) )  ->  ( # `
 B )  e.  NN )
11103adant1 1015 . . . . . . . . 9  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( # `
 B )  e.  NN )
12 simpl 455 . . . . . . . . . 10  |-  ( ( ( # `  A
)  e.  ZZ  /\  ( # `  B )  e.  NN )  -> 
( # `  A )  e.  ZZ )
13 nnz 10847 . . . . . . . . . . . 12  |-  ( (
# `  B )  e.  NN  ->  ( # `  B
)  e.  ZZ )
1413adantl 464 . . . . . . . . . . 11  |-  ( ( ( # `  A
)  e.  ZZ  /\  ( # `  B )  e.  NN )  -> 
( # `  B )  e.  ZZ )
1512, 14zaddcld 10932 . . . . . . . . . 10  |-  ( ( ( # `  A
)  e.  ZZ  /\  ( # `  B )  e.  NN )  -> 
( ( # `  A
)  +  ( # `  B ) )  e.  ZZ )
16 zre 10829 . . . . . . . . . . 11  |-  ( (
# `  A )  e.  ZZ  ->  ( # `  A
)  e.  RR )
17 nnrp 11192 . . . . . . . . . . 11  |-  ( (
# `  B )  e.  NN  ->  ( # `  B
)  e.  RR+ )
18 ltaddrp 11217 . . . . . . . . . . 11  |-  ( ( ( # `  A
)  e.  RR  /\  ( # `  B )  e.  RR+ )  ->  ( # `
 A )  < 
( ( # `  A
)  +  ( # `  B ) ) )
1916, 17, 18syl2an 475 . . . . . . . . . 10  |-  ( ( ( # `  A
)  e.  ZZ  /\  ( # `  B )  e.  NN )  -> 
( # `  A )  <  ( ( # `  A )  +  (
# `  B )
) )
2012, 15, 193jca 1177 . . . . . . . . 9  |-  ( ( ( # `  A
)  e.  ZZ  /\  ( # `  B )  e.  NN )  -> 
( ( # `  A
)  e.  ZZ  /\  ( ( # `  A
)  +  ( # `  B ) )  e.  ZZ  /\  ( # `  A )  <  (
( # `  A )  +  ( # `  B
) ) ) )
219, 11, 20syl2anc 659 . . . . . . . 8  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  (
( # `  A )  e.  ZZ  /\  (
( # `  A )  +  ( # `  B
) )  e.  ZZ  /\  ( # `  A
)  <  ( ( # `
 A )  +  ( # `  B
) ) ) )
22 fzolb 11778 . . . . . . . 8  |-  ( (
# `  A )  e.  ( ( # `  A
)..^ ( ( # `  A )  +  (
# `  B )
) )  <->  ( ( # `
 A )  e.  ZZ  /\  ( (
# `  A )  +  ( # `  B
) )  e.  ZZ  /\  ( # `  A
)  <  ( ( # `
 A )  +  ( # `  B
) ) ) )
2321, 22sylibr 212 . . . . . . 7  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( # `
 A )  e.  ( ( # `  A
)..^ ( ( # `  A )  +  (
# `  B )
) ) )
24 fzoend 11853 . . . . . . 7  |-  ( (
# `  A )  e.  ( ( # `  A
)..^ ( ( # `  A )  +  (
# `  B )
) )  ->  (
( ( # `  A
)  +  ( # `  B ) )  - 
1 )  e.  ( ( # `  A
)..^ ( ( # `  A )  +  (
# `  B )
) ) )
2523, 24syl 17 . . . . . 6  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  (
( ( # `  A
)  +  ( # `  B ) )  - 
1 )  e.  ( ( # `  A
)..^ ( ( # `  A )  +  (
# `  B )
) ) )
266, 25eqeltrd 2490 . . . . 5  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  (
( # `  ( A ++  B ) )  - 
1 )  e.  ( ( # `  A
)..^ ( ( # `  A )  +  (
# `  B )
) ) )
27 ccatval2 12557 . . . . 5  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  (
( # `  ( A ++  B ) )  - 
1 )  e.  ( ( # `  A
)..^ ( ( # `  A )  +  (
# `  B )
) ) )  -> 
( ( A ++  B
) `  ( ( # `
 ( A ++  B
) )  -  1 ) )  =  ( B `  ( ( ( # `  ( A ++  B ) )  - 
1 )  -  ( # `
 A ) ) ) )
2826, 27syld3an3 1275 . . . 4  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  (
( A ++  B ) `
 ( ( # `  ( A ++  B ) )  -  1 ) )  =  ( B `
 ( ( (
# `  ( A ++  B ) )  - 
1 )  -  ( # `
 A ) ) ) )
295oveq1d 6249 . . . . . . 7  |-  ( ( A  e. Word  V  /\  B  e. Word  V )  ->  ( ( ( # `  ( A ++  B ) )  -  1 )  -  ( # `  A
) )  =  ( ( ( ( # `  A )  +  (
# `  B )
)  -  1 )  -  ( # `  A
) ) )
307nn0cnd 10815 . . . . . . . 8  |-  ( A  e. Word  V  ->  ( # `
 A )  e.  CC )
31 lencl 12521 . . . . . . . . 9  |-  ( B  e. Word  V  ->  ( # `
 B )  e. 
NN0 )
3231nn0cnd 10815 . . . . . . . 8  |-  ( B  e. Word  V  ->  ( # `
 B )  e.  CC )
33 addcl 9524 . . . . . . . . . 10  |-  ( ( ( # `  A
)  e.  CC  /\  ( # `  B )  e.  CC )  -> 
( ( # `  A
)  +  ( # `  B ) )  e.  CC )
34 1cnd 9562 . . . . . . . . . 10  |-  ( ( ( # `  A
)  e.  CC  /\  ( # `  B )  e.  CC )  -> 
1  e.  CC )
35 simpl 455 . . . . . . . . . 10  |-  ( ( ( # `  A
)  e.  CC  /\  ( # `  B )  e.  CC )  -> 
( # `  A )  e.  CC )
3633, 34, 35sub32d 9919 . . . . . . . . 9  |-  ( ( ( # `  A
)  e.  CC  /\  ( # `  B )  e.  CC )  -> 
( ( ( (
# `  A )  +  ( # `  B
) )  -  1 )  -  ( # `  A ) )  =  ( ( ( (
# `  A )  +  ( # `  B
) )  -  ( # `
 A ) )  -  1 ) )
37 pncan2 9783 . . . . . . . . . 10  |-  ( ( ( # `  A
)  e.  CC  /\  ( # `  B )  e.  CC )  -> 
( ( ( # `  A )  +  (
# `  B )
)  -  ( # `  A ) )  =  ( # `  B
) )
3837oveq1d 6249 . . . . . . . . 9  |-  ( ( ( # `  A
)  e.  CC  /\  ( # `  B )  e.  CC )  -> 
( ( ( (
# `  A )  +  ( # `  B
) )  -  ( # `
 A ) )  -  1 )  =  ( ( # `  B
)  -  1 ) )
3936, 38eqtrd 2443 . . . . . . . 8  |-  ( ( ( # `  A
)  e.  CC  /\  ( # `  B )  e.  CC )  -> 
( ( ( (
# `  A )  +  ( # `  B
) )  -  1 )  -  ( # `  A ) )  =  ( ( # `  B
)  -  1 ) )
4030, 32, 39syl2an 475 . . . . . . 7  |-  ( ( A  e. Word  V  /\  B  e. Word  V )  ->  ( ( ( (
# `  A )  +  ( # `  B
) )  -  1 )  -  ( # `  A ) )  =  ( ( # `  B
)  -  1 ) )
4129, 40eqtrd 2443 . . . . . 6  |-  ( ( A  e. Word  V  /\  B  e. Word  V )  ->  ( ( ( # `  ( A ++  B ) )  -  1 )  -  ( # `  A
) )  =  ( ( # `  B
)  -  1 ) )
42413adant3 1017 . . . . 5  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  (
( ( # `  ( A ++  B ) )  - 
1 )  -  ( # `
 A ) )  =  ( ( # `  B )  -  1 ) )
4342fveq2d 5809 . . . 4  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( B `  ( (
( # `  ( A ++  B ) )  - 
1 )  -  ( # `
 A ) ) )  =  ( B `
 ( ( # `  B )  -  1 ) ) )
4428, 43eqtrd 2443 . . 3  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  (
( A ++  B ) `
 ( ( # `  ( A ++  B ) )  -  1 ) )  =  ( B `
 ( ( # `  B )  -  1 ) ) )
453, 44eqtrd 2443 . 2  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( lastS  `  ( A ++  B ) )  =  ( B `
 ( ( # `  B )  -  1 ) ) )
46 lsw 12545 . . . 4  |-  ( B  e. Word  V  ->  ( lastS  `  B )  =  ( B `  ( (
# `  B )  -  1 ) ) )
4746eqcomd 2410 . . 3  |-  ( B  e. Word  V  ->  ( B `  ( ( # `
 B )  - 
1 ) )  =  ( lastS  `  B )
)
48473ad2ant2 1019 . 2  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( B `  ( ( # `
 B )  - 
1 ) )  =  ( lastS  `  B )
)
4945, 48eqtrd 2443 1  |-  ( ( A  e. Word  V  /\  B  e. Word  V  /\  B  =/=  (/) )  ->  ( lastS  `  ( A ++  B ) )  =  ( lastS  `  B
) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 367    /\ w3a 974    = wceq 1405    e. wcel 1842    =/= wne 2598   _Vcvv 3058   (/)c0 3737   class class class wbr 4394   ` cfv 5525  (class class class)co 6234   CCcc 9440   RRcr 9441   1c1 9443    + caddc 9445    < clt 9578    - cmin 9761   NNcn 10496   ZZcz 10825   RR+crp 11183  ..^cfzo 11767   #chash 12359  Word cword 12490   lastS clsw 12491   ++ cconcat 12492
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1639  ax-4 1652  ax-5 1725  ax-6 1771  ax-7 1814  ax-8 1844  ax-9 1846  ax-10 1861  ax-11 1866  ax-12 1878  ax-13 2026  ax-ext 2380  ax-rep 4506  ax-sep 4516  ax-nul 4524  ax-pow 4571  ax-pr 4629  ax-un 6530  ax-cnex 9498  ax-resscn 9499  ax-1cn 9500  ax-icn 9501  ax-addcl 9502  ax-addrcl 9503  ax-mulcl 9504  ax-mulrcl 9505  ax-mulcom 9506  ax-addass 9507  ax-mulass 9508  ax-distr 9509  ax-i2m1 9510  ax-1ne0 9511  ax-1rid 9512  ax-rnegex 9513  ax-rrecex 9514  ax-cnre 9515  ax-pre-lttri 9516  ax-pre-lttrn 9517  ax-pre-ltadd 9518  ax-pre-mulgt0 9519
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 975  df-3an 976  df-tru 1408  df-ex 1634  df-nf 1638  df-sb 1764  df-eu 2242  df-mo 2243  df-clab 2388  df-cleq 2394  df-clel 2397  df-nfc 2552  df-ne 2600  df-nel 2601  df-ral 2758  df-rex 2759  df-reu 2760  df-rmo 2761  df-rab 2762  df-v 3060  df-sbc 3277  df-csb 3373  df-dif 3416  df-un 3418  df-in 3420  df-ss 3427  df-pss 3429  df-nul 3738  df-if 3885  df-pw 3956  df-sn 3972  df-pr 3974  df-tp 3976  df-op 3978  df-uni 4191  df-int 4227  df-iun 4272  df-br 4395  df-opab 4453  df-mpt 4454  df-tr 4489  df-eprel 4733  df-id 4737  df-po 4743  df-so 4744  df-fr 4781  df-we 4783  df-ord 4824  df-on 4825  df-lim 4826  df-suc 4827  df-xp 4948  df-rel 4949  df-cnv 4950  df-co 4951  df-dm 4952  df-rn 4953  df-res 4954  df-ima 4955  df-iota 5489  df-fun 5527  df-fn 5528  df-f 5529  df-f1 5530  df-fo 5531  df-f1o 5532  df-fv 5533  df-riota 6196  df-ov 6237  df-oprab 6238  df-mpt2 6239  df-om 6639  df-1st 6738  df-2nd 6739  df-recs 6999  df-rdg 7033  df-1o 7087  df-oadd 7091  df-er 7268  df-en 7475  df-dom 7476  df-sdom 7477  df-fin 7478  df-card 8272  df-cda 8500  df-pnf 9580  df-mnf 9581  df-xr 9582  df-ltxr 9583  df-le 9584  df-sub 9763  df-neg 9764  df-nn 10497  df-2 10555  df-n0 10757  df-z 10826  df-uz 11046  df-rp 11184  df-fz 11644  df-fzo 11768  df-hash 12360  df-word 12498  df-lsw 12499  df-concat 12500
This theorem is referenced by:  lswccats1  12599
  Copyright terms: Public domain W3C validator