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

Theorem swrdccat2 12739
Description: Recover the right half of a concatenated word. (Contributed by Mario Carneiro, 27-Sep-2015.)
Assertion
Ref Expression
swrdccat2  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S ++  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  =  T )

Proof of Theorem swrdccat2
Dummy variable  k is distinct from all other variables.
StepHypRef Expression
1 ccatcl 12647 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( S ++  T )  e. Word  B )
2 swrdcl 12700 . . . 4  |-  ( ( S ++  T )  e. Word  B  ->  ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  e. Word  B )
3 wrdf 12603 . . . 4  |-  ( ( ( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  e. Word  B  ->  ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) : ( 0..^ ( # `  (
( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) ) --> B )
4 ffn 5714 . . . 4  |-  ( ( ( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. ) : ( 0..^ (
# `  ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) ) ) --> B  ->  ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  Fn  ( 0..^ ( # `  (
( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) ) )
51, 2, 3, 44syl 19 . . 3  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S ++  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  Fn  ( 0..^ ( # `  ( ( S ++  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) ) )
6 lencl 12614 . . . . . . . . . 10  |-  ( S  e. Word  B  ->  ( # `
 S )  e. 
NN0 )
76adantr 463 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  NN0 )
8 nn0uz 11161 . . . . . . . . 9  |-  NN0  =  ( ZZ>= `  0 )
97, 8syl6eleq 2500 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
107nn0zd 11006 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ZZ )
11 uzid 11141 . . . . . . . . . 10  |-  ( (
# `  S )  e.  ZZ  ->  ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) ) )
1210, 11syl 17 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) ) )
13 lencl 12614 . . . . . . . . . 10  |-  ( T  e. Word  B  ->  ( # `
 T )  e. 
NN0 )
1413adantl 464 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  NN0 )
15 uzaddcl 11183 . . . . . . . . 9  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) )  /\  ( # `  T )  e.  NN0 )  ->  ( ( # `  S )  +  (
# `  T )
)  e.  ( ZZ>= `  ( # `  S ) ) )
1612, 14, 15syl2anc 659 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( # `  S
) ) )
17 elfzuzb 11736 . . . . . . . 8  |-  ( (
# `  S )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  <->  ( ( # `
 S )  e.  ( ZZ>= `  0 )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( # `  S
) ) ) )
189, 16, 17sylanbrc 662 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( 0 ... ( ( # `  S )  +  (
# `  T )
) ) )
197, 14nn0addcld 10897 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e. 
NN0 )
2019, 8syl6eleq 2500 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  0 )
)
2119nn0zd 11006 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ZZ )
22 uzid 11141 . . . . . . . . . 10  |-  ( ( ( # `  S
)  +  ( # `  T ) )  e.  ZZ  ->  ( ( # `
 S )  +  ( # `  T
) )  e.  (
ZZ>= `  ( ( # `  S )  +  (
# `  T )
) ) )
2321, 22syl 17 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( ( # `
 S )  +  ( # `  T
) ) ) )
24 elfzuzb 11736 . . . . . . . . 9  |-  ( ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  <->  ( (
( # `  S )  +  ( # `  T
) )  e.  (
ZZ>= `  0 )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( ( # `
 S )  +  ( # `  T
) ) ) ) )
2520, 23, 24sylanbrc 662 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) ) )
26 ccatlen 12648 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  ( S ++  T ) )  =  ( ( # `  S
)  +  ( # `  T ) ) )
2726oveq2d 6294 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0 ... ( # `
 ( S ++  T
) ) )  =  ( 0 ... (
( # `  S )  +  ( # `  T
) ) ) )
2825, 27eleqtrrd 2493 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S ++  T
) ) ) )
29 swrdlen 12704 . . . . . . 7  |-  ( ( ( S ++  T )  e. Word  B  /\  ( # `
 S )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S ++  T
) ) ) )  ->  ( # `  (
( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
)  =  ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) )
301, 18, 28, 29syl3anc 1230 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  (
( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
)  =  ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) )
317nn0cnd 10895 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  CC )
3214nn0cnd 10895 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  CC )
3331, 32pncan2d 9969 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) )  =  ( # `  T
) )
3430, 33eqtrd 2443 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  (
( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
)  =  ( # `  T ) )
3534oveq2d 6294 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( # `  ( ( S ++  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) )  =  ( 0..^ ( # `  T
) ) )
3635fneq2d 5653 . . 3  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  Fn  ( 0..^ ( # `  (
( S ++  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) )  <->  ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  Fn  ( 0..^ ( # `  T
) ) ) )
375, 36mpbid 210 . 2  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S ++  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  Fn  ( 0..^ ( # `  T ) ) )
38 wrdf 12603 . . . 4  |-  ( T  e. Word  B  ->  T : ( 0..^ (
# `  T )
) --> B )
3938adantl 464 . . 3  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  T : ( 0..^ ( # `  T
) ) --> B )
40 ffn 5714 . . 3  |-  ( T : ( 0..^ (
# `  T )
) --> B  ->  T  Fn  ( 0..^ ( # `  T ) ) )
4139, 40syl 17 . 2  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  T  Fn  ( 0..^ ( # `  T
) ) )
421adantr 463 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( S ++  T )  e. Word  B )
4318adantr 463 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( # `  S )  e.  ( 0 ... ( ( # `  S
)  +  ( # `  T ) ) ) )
4428adantr 463 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S ++  T
) ) ) )
4533oveq2d 6294 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) )  =  ( 0..^ ( # `  T
) ) )
4645eleq2d 2472 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( k  e.  ( 0..^ ( ( (
# `  S )  +  ( # `  T
) )  -  ( # `
 S ) ) )  <->  k  e.  ( 0..^ ( # `  T
) ) ) )
4746biimpar 483 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
k  e.  ( 0..^ ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) ) ) )
48 swrdfv 12705 . . . 4  |-  ( ( ( ( S ++  T
)  e. Word  B  /\  ( # `  S )  e.  ( 0 ... ( ( # `  S
)  +  ( # `  T ) ) )  /\  ( ( # `  S )  +  (
# `  T )
)  e.  ( 0 ... ( # `  ( S ++  T ) ) ) )  /\  k  e.  ( 0..^ ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) ) )  -> 
( ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) `  k )  =  ( ( S ++  T ) `  (
k  +  ( # `  S ) ) ) )
4942, 43, 44, 47, 48syl31anc 1233 . . 3  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) `  k )  =  ( ( S ++  T ) `  (
k  +  ( # `  S ) ) ) )
50 ccatval3 12651 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B  /\  k  e.  ( 0..^ ( # `  T ) ) )  ->  ( ( S ++  T ) `  (
k  +  ( # `  S ) ) )  =  ( T `  k ) )
51503expa 1197 . . 3  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( S ++  T
) `  ( k  +  ( # `  S
) ) )  =  ( T `  k
) )
5249, 51eqtrd 2443 . 2  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( ( S ++  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) `  k )  =  ( T `  k ) )
5337, 41, 52eqfnfvd 5962 1  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S ++  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  =  T )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 367    = wceq 1405    e. wcel 1842   <.cop 3978    Fn wfn 5564   -->wf 5565   ` cfv 5569  (class class class)co 6278   0cc0 9522    + caddc 9525    - cmin 9841   NN0cn0 10836   ZZcz 10905   ZZ>=cuz 11127   ...cfz 11726  ..^cfzo 11854   #chash 12452  Word cword 12583   ++ cconcat 12585   substr csubstr 12587
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 4507  ax-sep 4517  ax-nul 4525  ax-pow 4572  ax-pr 4630  ax-un 6574  ax-cnex 9578  ax-resscn 9579  ax-1cn 9580  ax-icn 9581  ax-addcl 9582  ax-addrcl 9583  ax-mulcl 9584  ax-mulrcl 9585  ax-mulcom 9586  ax-addass 9587  ax-mulass 9588  ax-distr 9589  ax-i2m1 9590  ax-1ne0 9591  ax-1rid 9592  ax-rnegex 9593  ax-rrecex 9594  ax-cnre 9595  ax-pre-lttri 9596  ax-pre-lttrn 9597  ax-pre-ltadd 9598  ax-pre-mulgt0 9599
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 2759  df-rex 2760  df-reu 2761  df-rmo 2762  df-rab 2763  df-v 3061  df-sbc 3278  df-csb 3374  df-dif 3417  df-un 3419  df-in 3421  df-ss 3428  df-pss 3430  df-nul 3739  df-if 3886  df-pw 3957  df-sn 3973  df-pr 3975  df-tp 3977  df-op 3979  df-uni 4192  df-int 4228  df-iun 4273  df-br 4396  df-opab 4454  df-mpt 4455  df-tr 4490  df-eprel 4734  df-id 4738  df-po 4744  df-so 4745  df-fr 4782  df-we 4784  df-xp 4829  df-rel 4830  df-cnv 4831  df-co 4832  df-dm 4833  df-rn 4834  df-res 4835  df-ima 4836  df-pred 5367  df-ord 5413  df-on 5414  df-lim 5415  df-suc 5416  df-iota 5533  df-fun 5571  df-fn 5572  df-f 5573  df-f1 5574  df-fo 5575  df-f1o 5576  df-fv 5577  df-riota 6240  df-ov 6281  df-oprab 6282  df-mpt2 6283  df-om 6684  df-1st 6784  df-2nd 6785  df-wrecs 7013  df-recs 7075  df-rdg 7113  df-1o 7167  df-oadd 7171  df-er 7348  df-en 7555  df-dom 7556  df-sdom 7557  df-fin 7558  df-card 8352  df-cda 8580  df-pnf 9660  df-mnf 9661  df-xr 9662  df-ltxr 9663  df-le 9664  df-sub 9843  df-neg 9844  df-nn 10577  df-2 10635  df-n0 10837  df-z 10906  df-uz 11128  df-fz 11727  df-fzo 11855  df-hash 12453  df-word 12591  df-concat 12593  df-substr 12595
This theorem is referenced by:  ccatopth  12751
  Copyright terms: Public domain W3C validator