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

Theorem swrdcl 12307
Description: Closure of the subword extractor. (Contributed by Stefan O'Rear, 16-Aug-2015.) (Revised by Mario Carneiro, 26-Feb-2016.)
Assertion
Ref Expression
swrdcl  |-  ( S  e. Word  A  ->  ( S substr  <. F ,  L >. )  e. Word  A )

Proof of Theorem swrdcl
Dummy variables  s 
b  x are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 eleq1 2498 . 2  |-  ( ( S substr  <. F ,  L >. )  =  (/)  ->  (
( S substr  <. F ,  L >. )  e. Word  A  <->  (/)  e. Word  A ) )
2 n0 3641 . . . 4  |-  ( ( S substr  <. F ,  L >. )  =/=  (/)  <->  E. x  x  e.  ( S substr  <. F ,  L >. ) )
3 df-substr 12225 . . . . . . 7  |- substr  =  ( s  e.  _V , 
b  e.  ( ZZ 
X.  ZZ )  |->  if ( ( ( 1st `  b )..^ ( 2nd `  b ) )  C_  dom  s ,  ( x  e.  ( 0..^ ( ( 2nd `  b
)  -  ( 1st `  b ) ) ) 
|->  ( s `  (
x  +  ( 1st `  b ) ) ) ) ,  (/) ) )
43elmpt2cl2 6301 . . . . . 6  |-  ( x  e.  ( S substr  <. F ,  L >. )  ->  <. F ,  L >.  e.  ( ZZ 
X.  ZZ ) )
5 opelxp 4864 . . . . . 6  |-  ( <. F ,  L >.  e.  ( ZZ  X.  ZZ ) 
<->  ( F  e.  ZZ  /\  L  e.  ZZ ) )
64, 5sylib 196 . . . . 5  |-  ( x  e.  ( S substr  <. F ,  L >. )  ->  ( F  e.  ZZ  /\  L  e.  ZZ ) )
76exlimiv 1688 . . . 4  |-  ( E. x  x  e.  ( S substr  <. F ,  L >. )  ->  ( F  e.  ZZ  /\  L  e.  ZZ ) )
82, 7sylbi 195 . . 3  |-  ( ( S substr  <. F ,  L >. )  =/=  (/)  ->  ( F  e.  ZZ  /\  L  e.  ZZ ) )
9 swrdval 12305 . . . . 5  |-  ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  ( S substr  <. F ,  L >. )  =  if ( ( F..^ L ) 
C_  dom  S , 
( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) ) ,  (/) ) )
10 wrdf 12232 . . . . . . . . . . 11  |-  ( S  e. Word  A  ->  S : ( 0..^ (
# `  S )
) --> A )
11103ad2ant1 1009 . . . . . . . . . 10  |-  ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  S : ( 0..^ (
# `  S )
) --> A )
1211ad2antrr 725 . . . . . . . . 9  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  S : ( 0..^ ( # `  S
) ) --> A )
13 simplr 754 . . . . . . . . . . 11  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  ( F..^ L
)  C_  dom  S )
14 simpr 461 . . . . . . . . . . . 12  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  x  e.  ( 0..^ ( L  -  F ) ) )
15 simpll3 1029 . . . . . . . . . . . 12  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  L  e.  ZZ )
16 simpll2 1028 . . . . . . . . . . . 12  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  F  e.  ZZ )
17 fzoaddel2 11590 . . . . . . . . . . . 12  |-  ( ( x  e.  ( 0..^ ( L  -  F
) )  /\  L  e.  ZZ  /\  F  e.  ZZ )  ->  (
x  +  F )  e.  ( F..^ L
) )
1814, 15, 16, 17syl3anc 1218 . . . . . . . . . . 11  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  ( x  +  F )  e.  ( F..^ L ) )
1913, 18sseldd 3352 . . . . . . . . . 10  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  ( x  +  F )  e.  dom  S )
20 fdm 5558 . . . . . . . . . . 11  |-  ( S : ( 0..^ (
# `  S )
) --> A  ->  dom  S  =  ( 0..^ (
# `  S )
) )
2112, 20syl 16 . . . . . . . . . 10  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  dom  S  =  ( 0..^ ( # `  S
) ) )
2219, 21eleqtrd 2514 . . . . . . . . 9  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  ( x  +  F )  e.  ( 0..^ ( # `  S
) ) )
2312, 22ffvelrnd 5839 . . . . . . . 8  |-  ( ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  /\  x  e.  ( 0..^ ( L  -  F ) ) )  ->  ( S `  ( x  +  F
) )  e.  A
)
24 eqid 2438 . . . . . . . 8  |-  ( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F
) ) )  =  ( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) )
2523, 24fmptd 5862 . . . . . . 7  |-  ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  ->  ( x  e.  ( 0..^ ( L  -  F ) ) 
|->  ( S `  (
x  +  F ) ) ) : ( 0..^ ( L  -  F ) ) --> A )
26 iswrdi 12231 . . . . . . 7  |-  ( ( x  e.  ( 0..^ ( L  -  F
) )  |->  ( S `
 ( x  +  F ) ) ) : ( 0..^ ( L  -  F ) ) --> A  ->  (
x  e.  ( 0..^ ( L  -  F
) )  |->  ( S `
 ( x  +  F ) ) )  e. Word  A )
2725, 26syl 16 . . . . . 6  |-  ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( F..^ L
)  C_  dom  S )  ->  ( x  e.  ( 0..^ ( L  -  F ) ) 
|->  ( S `  (
x  +  F ) ) )  e. Word  A
)
28 wrd0 12244 . . . . . . 7  |-  (/)  e. Word  A
2928a1i 11 . . . . . 6  |-  ( ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  -.  ( F..^ L )  C_  dom  S )  ->  (/)  e. Word  A
)
3027, 29ifclda 3816 . . . . 5  |-  ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  if ( ( F..^ L
)  C_  dom  S , 
( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) ) ,  (/) )  e. Word  A )
319, 30eqeltrd 2512 . . . 4  |-  ( ( S  e. Word  A  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  ( S substr  <. F ,  L >. )  e. Word  A )
32313expb 1188 . . 3  |-  ( ( S  e. Word  A  /\  ( F  e.  ZZ  /\  L  e.  ZZ ) )  ->  ( S substr  <. F ,  L >. )  e. Word  A )
338, 32sylan2 474 . 2  |-  ( ( S  e. Word  A  /\  ( S substr  <. F ,  L >. )  =/=  (/) )  -> 
( S substr  <. F ,  L >. )  e. Word  A
)
3428a1i 11 . 2  |-  ( S  e. Word  A  ->  (/)  e. Word  A
)
351, 33, 34pm2.61ne 2681 1  |-  ( S  e. Word  A  ->  ( S substr  <. F ,  L >. )  e. Word  A )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 369    /\ w3a 965    = wceq 1369   E.wex 1586    e. wcel 1756    =/= wne 2601   _Vcvv 2967    C_ wss 3323   (/)c0 3632   ifcif 3786   <.cop 3878    e. cmpt 4345    X. cxp 4833   dom cdm 4835   -->wf 5409   ` cfv 5413  (class class class)co 6086   1stc1st 6570   2ndc2nd 6571   0cc0 9274    + caddc 9277    - cmin 9587   ZZcz 10638  ..^cfzo 11540   #chash 12095  Word cword 12213   substr csubstr 12217
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2419  ax-rep 4398  ax-sep 4408  ax-nul 4416  ax-pow 4465  ax-pr 4526  ax-un 6367  ax-cnex 9330  ax-resscn 9331  ax-1cn 9332  ax-icn 9333  ax-addcl 9334  ax-addrcl 9335  ax-mulcl 9336  ax-mulrcl 9337  ax-mulcom 9338  ax-addass 9339  ax-mulass 9340  ax-distr 9341  ax-i2m1 9342  ax-1ne0 9343  ax-1rid 9344  ax-rnegex 9345  ax-rrecex 9346  ax-cnre 9347  ax-pre-lttri 9348  ax-pre-lttrn 9349  ax-pre-ltadd 9350  ax-pre-mulgt0 9351
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2256  df-mo 2257  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2715  df-rex 2716  df-reu 2717  df-rab 2719  df-v 2969  df-sbc 3182  df-csb 3284  df-dif 3326  df-un 3328  df-in 3330  df-ss 3337  df-pss 3339  df-nul 3633  df-if 3787  df-pw 3857  df-sn 3873  df-pr 3875  df-tp 3877  df-op 3879  df-uni 4087  df-int 4124  df-iun 4168  df-br 4288  df-opab 4346  df-mpt 4347  df-tr 4381  df-eprel 4627  df-id 4631  df-po 4636  df-so 4637  df-fr 4674  df-we 4676  df-ord 4717  df-on 4718  df-lim 4719  df-suc 4720  df-xp 4841  df-rel 4842  df-cnv 4843  df-co 4844  df-dm 4845  df-rn 4846  df-res 4847  df-ima 4848  df-iota 5376  df-fun 5415  df-fn 5416  df-f 5417  df-f1 5418  df-fo 5419  df-f1o 5420  df-fv 5421  df-riota 6047  df-ov 6089  df-oprab 6090  df-mpt2 6091  df-om 6472  df-1st 6572  df-2nd 6573  df-recs 6824  df-rdg 6858  df-1o 6912  df-oadd 6916  df-er 7093  df-en 7303  df-dom 7304  df-sdom 7305  df-fin 7306  df-card 8101  df-pnf 9412  df-mnf 9413  df-xr 9414  df-ltxr 9415  df-le 9416  df-sub 9589  df-neg 9590  df-nn 10315  df-n0 10572  df-z 10639  df-uz 10854  df-fz 11430  df-fzo 11541  df-hash 12096  df-word 12221  df-substr 12225
This theorem is referenced by:  swrdid  12313  swrdf  12314  addlenswrd  12323  swrd0fvlsw  12331  swrdeq  12332  swrdsymbeq  12333  swrdspsleq  12334  swrds1  12337  ccatswrd  12342  swrdccat2  12344  swrdswrd  12346  lenrevcctswrd  12353  wrdind  12363  wrd2ind  12364  swrdccatin12  12374  swrdccat  12376  swrdccat3a  12377  swrdccat3blem  12378  splcl  12386  spllen  12388  splfv1  12389  splfv2a  12390  splval2  12391  cshwcl  12427  cshwlen  12428  cshwidxmod  12432  gsumspl  15513  psgnunilem5  15991  psgnunilem2  15992  efgsres  16226  efgredleme  16231  efgredlemc  16233  efgcpbllemb  16243  frgpuplem  16260  wrdsplex  26891  signsvtn0  26923  signstfveq0  26930  wwlknred  30308  wwlkextwrd  30313  wwlkm1edg  30320  clwlkisclwwlk  30404  clwwlkf  30409  wwlksubclwwlk  30419  clwlkfclwwlk  30470  extwwlkfablem2  30624
  Copyright terms: Public domain W3C validator