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

Theorem swrdccat2 11461
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 11429 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( S concat  T )  e. Word  B )
2 swrdcl 11452 . . . . 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 11419 . . . 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 5389 . . . 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 11421 . . . . . . . . . 10  |-  ( S  e. Word  B  ->  ( # `
 S )  e. 
NN0 )
87adantr 451 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  NN0 )
9 nn0uz 10262 . . . . . . . . 9  |-  NN0  =  ( ZZ>= `  0 )
108, 9syl6eleq 2373 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
118nn0zd 10115 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  ZZ )
12 uzid 10242 . . . . . . . . . 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 11421 . . . . . . . . . 10  |-  ( T  e. Word  B  ->  ( # `
 T )  e. 
NN0 )
1514adantl 452 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  NN0 )
16 uzaddcl 10275 . . . . . . . . 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 10792 . . . . . . . 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 10022 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e. 
NN0 )
2120, 9syl6eleq 2373 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( ZZ>= `  0 )
)
2220nn0zd 10115 . . . . . . . . . 10  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ZZ )
23 uzid 10242 . . . . . . . . . 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 10792 . . . . . . . . 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 11430 . . . . . . . . 9  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  ( S concat  T ) )  =  ( ( # `  S
)  +  ( # `  T ) ) )
2827oveq2d 5874 . . . . . . . 8  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0 ... ( # `
 ( S concat  T
) ) )  =  ( 0 ... (
( # `  S )  +  ( # `  T
) ) ) )
2926, 28eleqtrrd 2360 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( # `  S
)  +  ( # `  T ) )  e.  ( 0 ... ( # `
 ( S concat  T
) ) ) )
30 swrdlen 11456 . . . . . . 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 10020 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  S
)  e.  CC )
3315nn0cnd 10020 . . . . . . 7  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  T
)  e.  CC )
3432, 33pncan2d 9159 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( ( ( # `  S )  +  (
# `  T )
)  -  ( # `  S ) )  =  ( # `  T
) )
3531, 34eqtrd 2315 . . . . 5  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( # `  (
( S concat  T ) substr  <.
( # `  S ) ,  ( ( # `  S )  +  (
# `  T )
) >. ) )  =  ( # `  T
) )
3635oveq2d 5874 . . . 4  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( # `  ( ( S concat  T
) substr  <. ( # `  S
) ,  ( (
# `  S )  +  ( # `  T
) ) >. )
) )  =  ( 0..^ ( # `  T
) ) )
3736fneq2d 5336 . . 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 11419 . . . 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 5389 . . 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 5874 . . . . . 6  |-  ( ( S  e. Word  B  /\  T  e. Word  B )  ->  ( 0..^ ( ( ( # `  S
)  +  ( # `  T ) )  -  ( # `  S ) ) )  =  ( 0..^ ( # `  T
) ) )
4746eleq2d 2350 . . . . 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 11457 . . . 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 11433 . . . 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 2315 . 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 5625 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 1623    e. wcel 1684   <.cop 3643    Fn wfn 5250   -->wf 5251   ` cfv 5255  (class class class)co 5858   0cc0 8737    + caddc 8740    - cmin 9037   NN0cn0 9965   ZZcz 10024   ZZ>=cuz 10230   ...cfz 10782  ..^cfzo 10870   #chash 11337  Word cword 11403   concat cconcat 11404   substr csubstr 11406
This theorem is referenced by:  ccatopth  11462
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814
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 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-int 3863  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-oadd 6483  df-er 6660  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-card 7572  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-nn 9747  df-n0 9966  df-z 10025  df-uz 10231  df-fz 10783  df-fzo 10871  df-hash 11338  df-word 11409  df-concat 11410  df-substr 11412
  Copyright terms: Public domain W3C validator