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

Theorem swrdccat2 12465
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 12387 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( S concat  T )  e. Word  B )
2 swrdcl 12428 . . . 4  |-  ( ( S concat  T )  e. Word  B  ->  ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
)  e. Word  B )
3 wrdf 12353 . . . 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 )
4 ffn 5662 . . . 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 )
) >. ) ) ) )
51, 2, 3, 44syl 21 . . 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
) ) >. )
) ) )
6 lencl 12362 . . . . . . . . . 10  |-  ( S  e. Word  B  ->  ( # `
 S )  e. 
NN0 )
76adantr 465 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  NN0 )
8 nn0uz 11001 . . . . . . . . 9  |-  NN0  =  ( ZZ>= `  0 )
97, 8syl6eleq 2550 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
107nn0zd 10851 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ZZ )
11 uzid 10981 . . . . . . . . . 10  |-  ( (
# `  S )  e.  ZZ  ->  ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) ) )
1210, 11syl 16 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) ) )
13 lencl 12362 . . . . . . . . . 10  |-  ( T  e. Word  B  ->  ( # `
 T )  e. 
NN0 )
1413adantl 466 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  NN0 )
15 uzaddcl 11017 . . . . . . . . 9  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  ( # `  S ) )  /\  ( # `  T )  e.  NN0 )  ->  ( ( # `  S )  +  (
# `  T )
)  e.  ( ZZ>= `  ( # `  S ) ) )
1612, 14, 15syl2anc 661 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( # `  S
) ) )
17 elfzuzb 11559 . . . . . . . 8  |-  ( (
# `  S )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  <->  ( ( # `
 S )  e.  ( ZZ>= `  0 )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( # `  S
) ) ) )
189, 16, 17sylanbrc 664 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( 0 ... ( ( # `  S )  +  (
# `  T )
) ) )
197, 14nn0addcld 10746 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e. 
NN0 )
2019, 8syl6eleq 2550 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  0 )
)
2119nn0zd 10851 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ZZ )
22 uzid 10981 . . . . . . . . . 10  |-  ( ( ( # `  S
)  +  ( # `  T ) )  e.  ZZ  ->  ( ( # `
 S )  +  ( # `  T
) )  e.  (
ZZ>= `  ( ( # `  S )  +  (
# `  T )
) ) )
2321, 22syl 16 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( ( # `
 S )  +  ( # `  T
) ) ) )
24 elfzuzb 11559 . . . . . . . . 9  |-  ( ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) )  <->  ( (
( # `  S )  +  ( # `  T
) )  e.  (
ZZ>= `  0 )  /\  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  ( ( # `
 S )  +  ( # `  T
) ) ) ) )
2520, 23, 24sylanbrc 664 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... (
( # `  S )  +  ( # `  T
) ) ) )
26 ccatlen 12388 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  ( S concat  T ) )  =  ( ( # `  S
)  +  ( # `  T ) ) )
2726oveq2d 6211 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0 ... ( # `
 ( S concat  T
) ) )  =  ( 0 ... (
( # `  S )  +  ( # `  T
) ) ) )
2825, 27eleqtrrd 2543 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S concat  T
) ) ) )
29 swrdlen 12432 . . . . . . 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 ) ) )
301, 18, 28, 29syl3anc 1219 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) )  =  ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) ) )
317nn0cnd 10744 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  CC )
3214nn0cnd 10744 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  CC )
3331, 32pncan2d 9827 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) )  =  ( # `  T
) )
3430, 33eqtrd 2493 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) )  =  ( # `  T
) )
3534oveq2d 6211 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( # `  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) )  =  ( 0..^ ( # `  T
) ) )
3635fneq2d 5605 . . 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 ) ) ) )
375, 36mpbid 210 . 2  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  Fn  ( 0..^ ( # `  T ) ) )
38 wrdf 12353 . . . 4  |-  ( T  e. Word  B  ->  T : ( 0..^ (
# `  T )
) --> B )
3938adantl 466 . . 3  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  T : ( 0..^ ( # `  T
) ) --> B )
40 ffn 5662 . . 3  |-  ( T : ( 0..^ (
# `  T )
) --> B  ->  T  Fn  ( 0..^ ( # `  T ) ) )
4139, 40syl 16 . 2  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  T  Fn  ( 0..^ ( # `  T
) ) )
421adantr 465 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( S concat  T )  e. Word  B )
4318adantr 465 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( # `  S )  e.  ( 0 ... ( ( # `  S
)  +  ( # `  T ) ) ) )
4428adantr 465 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S concat  T
) ) ) )
4533oveq2d 6211 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) )  =  ( 0..^ ( # `  T
) ) )
4645eleq2d 2522 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( k  e.  ( 0..^ ( ( (
# `  S )  +  ( # `  T
) )  -  ( # `
 S ) ) )  <->  k  e.  ( 0..^ ( # `  T
) ) ) )
4746biimpar 485 . . . 4  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
k  e.  ( 0..^ ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) ) ) )
48 swrdfv 12433 . . . 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 ) ) ) )
4942, 43, 44, 47, 48syl31anc 1222 . . 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 ) ) ) )
50 ccatval3 12391 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B  /\  k  e.  ( 0..^ ( # `  T ) ) )  ->  ( ( S concat  T ) `  (
k  +  ( # `  S ) ) )  =  ( T `  k ) )
51503expa 1188 . . 3  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( S concat  T
) `  ( k  +  ( # `  S
) ) )  =  ( T `  k
) )
5249, 51eqtrd 2493 . 2  |-  ( ( ( S  e. Word  B  /\  T  e. Word  B )  /\  k  e.  ( 0..^ ( # `  T
) ) )  -> 
( ( ( S concat  T ) substr  <. ( # `  S ) ,  ( ( # `  S
)  +  ( # `  T ) ) >.
) `  k )  =  ( T `  k ) )
5337, 41, 52eqfnfvd 5904 1  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )  =  T )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1370    e. wcel 1758   <.cop 3986    Fn wfn 5516   -->wf 5517   ` cfv 5521  (class class class)co 6195   0cc0 9388    + caddc 9391    - cmin 9701   NN0cn0 10685   ZZcz 10752   ZZ>=cuz 10967   ...cfz 11549  ..^cfzo 11660   #chash 12215  Word cword 12334   concat cconcat 12336   substr csubstr 12338
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1710  ax-7 1730  ax-8 1760  ax-9 1762  ax-10 1777  ax-11 1782  ax-12 1794  ax-13 1954  ax-ext 2431  ax-rep 4506  ax-sep 4516  ax-nul 4524  ax-pow 4573  ax-pr 4634  ax-un 6477  ax-cnex 9444  ax-resscn 9445  ax-1cn 9446  ax-icn 9447  ax-addcl 9448  ax-addrcl 9449  ax-mulcl 9450  ax-mulrcl 9451  ax-mulcom 9452  ax-addass 9453  ax-mulass 9454  ax-distr 9455  ax-i2m1 9456  ax-1ne0 9457  ax-1rid 9458  ax-rnegex 9459  ax-rrecex 9460  ax-cnre 9461  ax-pre-lttri 9462  ax-pre-lttrn 9463  ax-pre-ltadd 9464  ax-pre-mulgt0 9465
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1703  df-eu 2265  df-mo 2266  df-clab 2438  df-cleq 2444  df-clel 2447  df-nfc 2602  df-ne 2647  df-nel 2648  df-ral 2801  df-rex 2802  df-reu 2803  df-rab 2805  df-v 3074  df-sbc 3289  df-csb 3391  df-dif 3434  df-un 3436  df-in 3438  df-ss 3445  df-pss 3447  df-nul 3741  df-if 3895  df-pw 3965  df-sn 3981  df-pr 3983  df-tp 3985  df-op 3987  df-uni 4195  df-int 4232  df-iun 4276  df-br 4396  df-opab 4454  df-mpt 4455  df-tr 4489  df-eprel 4735  df-id 4739  df-po 4744  df-so 4745  df-fr 4782  df-we 4784  df-ord 4825  df-on 4826  df-lim 4827  df-suc 4828  df-xp 4949  df-rel 4950  df-cnv 4951  df-co 4952  df-dm 4953  df-rn 4954  df-res 4955  df-ima 4956  df-iota 5484  df-fun 5523  df-fn 5524  df-f 5525  df-f1 5526  df-fo 5527  df-f1o 5528  df-fv 5529  df-riota 6156  df-ov 6198  df-oprab 6199  df-mpt2 6200  df-om 6582  df-1st 6682  df-2nd 6683  df-recs 6937  df-rdg 6971  df-1o 7025  df-oadd 7029  df-er 7206  df-en 7416  df-dom 7417  df-sdom 7418  df-fin 7419  df-card 8215  df-pnf 9526  df-mnf 9527  df-xr 9528  df-ltxr 9529  df-le 9530  df-sub 9703  df-neg 9704  df-nn 10429  df-n0 10686  df-z 10753  df-uz 10968  df-fz 11550  df-fzo 11661  df-hash 12216  df-word 12342  df-concat 12344  df-substr 12346
This theorem is referenced by:  ccatopth  12477
  Copyright terms: Public domain W3C validator