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

Theorem swrdccat2 11508
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 concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  =  T )

Proof of Theorem swrdccat2
Dummy variable  k is distinct from all other variables.
StepHypRef Expression
1 ccatcl 11476 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( S concat  T )  e. Word  B )
2 swrdcl 11499 . . . . 5  |-  ( ( S concat  T )  e. Word  B  ->  ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  e. Word  B )
31, 2syl 15 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  e. Word  B )
4 wrdf 11466 . . . 4  |-  ( ( ( S concat  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  e. Word  B  ->  ( ( S concat  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) : ( 0..^ ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) ) ) --> B )
5 ffn 5427 . . . 4  |-  ( ( ( S concat  T ) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. ) : ( 0..^ (
# `  ( ( S concat  T ) substr  <. ( # `
 S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) ) ) --> B  ->  ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  Fn  ( 0..^ ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) ) ) )
63, 4, 53syl 18 . . 3  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  Fn  ( 0..^ ( # `  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) ) )
7 lencl 11468 . . . . . . . . . 10  |-  ( S  e. Word  B  ->  ( # `
 S )  e. 
NN0 )
87adantr 451 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  NN0 )
9 nn0uz 10309 . . . . . . . . 9  |-  NN0  =  ( ZZ>= `  0 )
108, 9syl6eleq 2406 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
118nn0zd 10162 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ZZ )
12 uzid 10289 . . . . . . . . . 10  |-  ( (
# `  S )  e.  ZZ  ->  ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) ) )
1311, 12syl 15 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) ) )
14 lencl 11468 . . . . . . . . . 10  |-  ( T  e. Word  B  ->  ( # `
 T )  e. 
NN0 )
1514adantl 452 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  NN0 )
16 uzaddcl 10322 . . . . . . . . 9  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) )  /\  ( # `  T )  e.  NN0 )  ->  ( ( # `  S )  +  (
# `  T )
)  e.  ( ZZ>= `  ( # `  S ) ) )
1713, 15, 16syl2anc 642 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( # `  S
) ) )
18 elfzuzb 10839 . . . . . . . 8  |-  ( (
# `  S )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  <->  ( ( # `
 S )  e.  ( ZZ>= `  0 )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( # `  S
) ) ) )
1910, 17, 18sylanbrc 645 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( 0 ... ( ( # `  S )  +  (
# `  T )
) ) )
208, 15nn0addcld 10069 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e. 
NN0 )
2120, 9syl6eleq 2406 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  0 )
)
2220nn0zd 10162 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ZZ )
23 uzid 10289 . . . . . . . . . 10  |-  ( ( ( # `  S
)  +  ( # `  T ) )  e.  ZZ  ->  ( ( # `
 S )  +  ( # `  T
) )  e.  (
ZZ>= `  ( ( # `  S )  +  (
# `  T )
) ) )
2422, 23syl 15 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( ( # `
 S )  +  ( # `  T
) ) ) )
25 elfzuzb 10839 . . . . . . . . 9  |-  ( ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  <->  ( (
( # `  S )  +  ( # `  T
) )  e.  (
ZZ>= `  0 )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( ( # `
 S )  +  ( # `  T
) ) ) ) )
2621, 24, 25sylanbrc 645 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) ) )
27 ccatlen 11477 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  ( S concat  T ) )  =  ( ( # `  S
)  +  ( # `  T ) ) )
2827oveq2d 5916 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0 ... ( # `
 ( S concat  T
) ) )  =  ( 0 ... (
( # `  S )  +  ( # `  T
) ) ) )
2926, 28eleqtrrd 2393 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S concat  T
) ) ) )
30 swrdlen 11503 . . . . . . 7  |-  ( ( ( S concat  T )  e. Word  B  /\  ( # `
 S )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S concat  T
) ) ) )  ->  ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) )  =  ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) ) )
311, 19, 29, 30syl3anc 1182 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) )  =  ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) ) )
328nn0cnd 10067 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  CC )
3315nn0cnd 10067 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  CC )
3432, 33pncan2d 9204 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) )  =  ( # `  T
) )
3531, 34eqtrd 2348 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) )  =  ( # `  T
) )
3635oveq2d 5916 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( # `  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) )  =  ( 0..^ ( # `  T
) ) )
3736fneq2d 5373 . . 3  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  Fn  ( 0..^ ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) ) )  <-> 
( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  Fn  ( 0..^ ( # `  T ) ) ) )
386, 37mpbid 201 . 2  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  Fn  ( 0..^ ( # `  T ) ) )
39 wrdf 11466 . . . 4  |-  ( T  e. Word  B  ->  T : ( 0..^ (
# `  T )
) --> B )
4039adantl 452 . . 3  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  T : ( 0..^ ( # `  T
) ) --> B )
41 ffn 5427 . . 3  |-  ( T : ( 0..^ (
# `  T )
) --> B  ->  T  Fn  ( 0..^ ( # `  T ) ) )
4240, 41syl 15 . 2  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  T  Fn  ( 0..^ ( # `  T
) ) )
431adantr 451 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( S concat  T )  e. Word  B )
4419adantr 451 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( # `  S )  e.  ( 0 ... ( ( # `  S
)  +  ( # `  T ) ) ) )
4529adantr 451 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S concat  T
) ) ) )
4634oveq2d 5916 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) )  =  ( 0..^ ( # `  T
) ) )
4746eleq2d 2383 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( k  e.  ( 0..^ ( ( (
# `  S )  +  ( # `  T
) )  -  ( # `
 S ) ) )  <->  k  e.  ( 0..^ ( # `  T
) ) ) )
4847biimpar 471 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
k  e.  ( 0..^ ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) ) ) )
49 swrdfv 11504 . . . 4  |-  ( ( ( ( S concat  T
)  e. Word  B  /\  ( # `  S )  e.  ( 0 ... ( ( # `  S
)  +  ( # `  T ) ) )  /\  ( ( # `  S )  +  (
# `  T )
)  e.  ( 0 ... ( # `  ( S concat  T ) ) ) )  /\  k  e.  ( 0..^ ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) ) )  -> 
( ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) `  k )  =  ( ( S concat  T ) `  (
k  +  ( # `  S ) ) ) )
5043, 44, 45, 48, 49syl31anc 1185 . . 3  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) `  k )  =  ( ( S concat  T ) `  (
k  +  ( # `  S ) ) ) )
51 ccatval3 11480 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B  /\  k  e.  ( 0..^ ( # `  T ) ) )  ->  ( ( S concat  T ) `  (
k  +  ( # `  S ) ) )  =  ( T `  k ) )
52513expa 1151 . . 3  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( S concat  T
) `  ( k  +  ( # `  S
) ) )  =  ( T `  k
) )
5350, 52eqtrd 2348 . 2  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) `  k )  =  ( T `  k ) )
5438, 42, 53eqfnfvd 5663 1  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  =  T )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 358    = wceq 1633    e. wcel 1701   <.cop 3677    Fn wfn 5287   -->wf 5288   ` cfv 5292  (class class class)co 5900   0cc0 8782    + caddc 8785    - cmin 9082   NN0cn0 10012   ZZcz 10071   ZZ>=cuz 10277   ...cfz 10829  ..^cfzo 10917   #chash 11384  Word cword 11450   concat cconcat 11451   substr csubstr 11453
This theorem is referenced by:  ccatopth  11509
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1537  ax-5 1548  ax-17 1607  ax-9 1645  ax-8 1666  ax-13 1703  ax-14 1705  ax-6 1720  ax-7 1725  ax-11 1732  ax-12 1897  ax-ext 2297  ax-rep 4168  ax-sep 4178  ax-nul 4186  ax-pow 4225  ax-pr 4251  ax-un 4549  ax-cnex 8838  ax-resscn 8839  ax-1cn 8840  ax-icn 8841  ax-addcl 8842  ax-addrcl 8843  ax-mulcl 8844  ax-mulrcl 8845  ax-mulcom 8846  ax-addass 8847  ax-mulass 8848  ax-distr 8849  ax-i2m1 8850  ax-1ne0 8851  ax-1rid 8852  ax-rnegex 8853  ax-rrecex 8854  ax-cnre 8855  ax-pre-lttri 8856  ax-pre-lttrn 8857  ax-pre-ltadd 8858  ax-pre-mulgt0 8859
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1533  df-nf 1536  df-sb 1640  df-eu 2180  df-mo 2181  df-clab 2303  df-cleq 2309  df-clel 2312  df-nfc 2441  df-ne 2481  df-nel 2482  df-ral 2582  df-rex 2583  df-reu 2584  df-rab 2586  df-v 2824  df-sbc 3026  df-csb 3116  df-dif 3189  df-un 3191  df-in 3193  df-ss 3200  df-pss 3202  df-nul 3490  df-if 3600  df-pw 3661  df-sn 3680  df-pr 3681  df-tp 3682  df-op 3683  df-uni 3865  df-int 3900  df-iun 3944  df-br 4061  df-opab 4115  df-mpt 4116  df-tr 4151  df-eprel 4342  df-id 4346  df-po 4351  df-so 4352  df-fr 4389  df-we 4391  df-ord 4432  df-on 4433  df-lim 4434  df-suc 4435  df-om 4694  df-xp 4732  df-rel 4733  df-cnv 4734  df-co 4735  df-dm 4736  df-rn 4737  df-res 4738  df-ima 4739  df-iota 5256  df-fun 5294  df-fn 5295  df-f 5296  df-f1 5297  df-fo 5298  df-f1o 5299  df-fv 5300  df-ov 5903  df-oprab 5904  df-mpt2 5905  df-1st 6164  df-2nd 6165  df-riota 6346  df-recs 6430  df-rdg 6465  df-1o 6521  df-oadd 6525  df-er 6702  df-en 6907  df-dom 6908  df-sdom 6909  df-fin 6910  df-card 7617  df-pnf 8914  df-mnf 8915  df-xr 8916  df-ltxr 8917  df-le 8918  df-sub 9084  df-neg 9085  df-nn 9792  df-n0 10013  df-z 10072  df-uz 10278  df-fz 10830  df-fzo 10918  df-hash 11385  df-word 11456  df-concat 11457  df-substr 11459
  Copyright terms: Public domain W3C validator