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

Theorem swrds2 11576
Description: Extract two adjacent symbols from a word. (Contributed by Stefan O'Rear, 23-Aug-2015.) (Revised by Mario Carneiro, 26-Feb-2016.)
Assertion
Ref Expression
swrds2  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. I ,  ( I  +  2 )
>. )  =  <" ( W `  I
) ( W `  ( I  +  1
) ) "> )

Proof of Theorem swrds2
StepHypRef Expression
1 simp1 955 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  W  e. Word  A )
2 simp2 956 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  NN0 )
3 elfzo0 10920 . . . . . . . 8  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  <->  ( ( I  +  1 )  e. 
NN0  /\  ( # `  W
)  e.  NN  /\  ( I  +  1
)  <  ( # `  W
) ) )
43simp2bi 971 . . . . . . 7  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  ->  ( # `  W
)  e.  NN )
543ad2ant3 978 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( # `
 W )  e.  NN )
62nn0red 10035 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  RR )
7 peano2nn0 10020 . . . . . . . . 9  |-  ( I  e.  NN0  ->  ( I  +  1 )  e. 
NN0 )
82, 7syl 15 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  e.  NN0 )
98nn0red 10035 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  e.  RR )
105nnred 9777 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( # `
 W )  e.  RR )
116lep1d 9704 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  <_  ( I  +  1 ) )
12 elfzolt2 10899 . . . . . . . 8  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  ->  ( I  +  1 )  < 
( # `  W ) )
13123ad2ant3 978 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <  ( # `  W
) )
146, 9, 10, 11, 13lelttrd 8990 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  <  ( # `  W
) )
15 elfzo0 10920 . . . . . 6  |-  ( I  e.  ( 0..^ (
# `  W )
)  <->  ( I  e. 
NN0  /\  ( # `  W
)  e.  NN  /\  I  <  ( # `  W
) ) )
162, 5, 14, 15syl3anbrc 1136 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  ( 0..^ ( # `  W ) ) )
17 swrds1 11489 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  ( 0..^ ( # `  W
) ) )  -> 
( W substr  <. I ,  ( I  +  1 ) >. )  =  <" ( W `  I
) "> )
181, 16, 17syl2anc 642 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. I ,  ( I  +  1 )
>. )  =  <" ( W `  I
) "> )
19 nn0cn 9991 . . . . . . . . 9  |-  ( I  e.  NN0  ->  I  e.  CC )
20193ad2ant2 977 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  CC )
21 ax-1cn 8811 . . . . . . . . . 10  |-  1  e.  CC
22 addass 8840 . . . . . . . . . 10  |-  ( ( I  e.  CC  /\  1  e.  CC  /\  1  e.  CC )  ->  (
( I  +  1 )  +  1 )  =  ( I  +  ( 1  +  1 ) ) )
2321, 21, 22mp3an23 1269 . . . . . . . . 9  |-  ( I  e.  CC  ->  (
( I  +  1 )  +  1 )  =  ( I  +  ( 1  +  1 ) ) )
24 df-2 9820 . . . . . . . . . 10  |-  2  =  ( 1  +  1 )
2524oveq2i 5885 . . . . . . . . 9  |-  ( I  +  2 )  =  ( I  +  ( 1  +  1 ) )
2623, 25syl6reqr 2347 . . . . . . . 8  |-  ( I  e.  CC  ->  (
I  +  2 )  =  ( ( I  +  1 )  +  1 ) )
2720, 26syl 15 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  =  ( ( I  +  1 )  +  1 ) )
2827opeq2d 3819 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  <. (
I  +  1 ) ,  ( I  + 
2 ) >.  =  <. ( I  +  1 ) ,  ( ( I  +  1 )  +  1 ) >. )
2928oveq2d 5890 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. ( I  + 
1 ) ,  ( I  +  2 )
>. )  =  ( W substr  <. ( I  + 
1 ) ,  ( ( I  +  1 )  +  1 )
>. ) )
30 swrds1 11489 . . . . . 6  |-  ( ( W  e. Word  A  /\  ( I  +  1
)  e.  ( 0..^ ( # `  W
) ) )  -> 
( W substr  <. ( I  +  1 ) ,  ( ( I  + 
1 )  +  1 ) >. )  =  <" ( W `  (
I  +  1 ) ) "> )
31303adant2 974 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. ( I  + 
1 ) ,  ( ( I  +  1 )  +  1 )
>. )  =  <" ( W `  (
I  +  1 ) ) "> )
3229, 31eqtrd 2328 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. ( I  + 
1 ) ,  ( I  +  2 )
>. )  =  <" ( W `  (
I  +  1 ) ) "> )
3318, 32oveq12d 5892 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
( W substr  <. I ,  ( I  +  1 ) >. ) concat  ( W substr  <.
( I  +  1 ) ,  ( I  +  2 ) >.
) )  =  (
<" ( W `  I ) "> concat  <" ( W `  ( I  +  1
) ) "> ) )
34 df-s2 11514 . . 3  |-  <" ( W `  I )
( W `  (
I  +  1 ) ) ">  =  ( <" ( W `
 I ) "> concat  <" ( W `
 ( I  + 
1 ) ) "> )
3533, 34syl6reqr 2347 . 2  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  <" ( W `  I )
( W `  (
I  +  1 ) ) ">  =  ( ( W substr  <. I ,  ( I  +  1 ) >. ) concat  ( W substr  <.
( I  +  1 ) ,  ( I  +  2 ) >.
) ) )
36 elfz2nn0 10837 . . . 4  |-  ( I  e.  ( 0 ... ( I  +  1 ) )  <->  ( I  e.  NN0  /\  ( I  +  1 )  e. 
NN0  /\  I  <_  ( I  +  1 ) ) )
372, 8, 11, 36syl3anbrc 1136 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  ( 0 ... (
I  +  1 ) ) )
38 peano2nn0 10020 . . . . . 6  |-  ( ( I  +  1 )  e.  NN0  ->  ( ( I  +  1 )  +  1 )  e. 
NN0 )
398, 38syl 15 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
( I  +  1 )  +  1 )  e.  NN0 )
4027, 39eqeltrd 2370 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  e.  NN0 )
419lep1d 9704 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <_  ( ( I  +  1 )  +  1 ) )
4241, 27breqtrrd 4065 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <_  ( I  + 
2 ) )
43 elfz2nn0 10837 . . . 4  |-  ( ( I  +  1 )  e.  ( 0 ... ( I  +  2 ) )  <->  ( (
I  +  1 )  e.  NN0  /\  (
I  +  2 )  e.  NN0  /\  (
I  +  1 )  <_  ( I  + 
2 ) ) )
448, 40, 42, 43syl3anbrc 1136 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  e.  ( 0 ... ( I  +  2 ) ) )
45 fzofzp1 10932 . . . . 5  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  ->  ( (
I  +  1 )  +  1 )  e.  ( 0 ... ( # `
 W ) ) )
46453ad2ant3 978 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
( I  +  1 )  +  1 )  e.  ( 0 ... ( # `  W
) ) )
4727, 46eqeltrd 2370 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  e.  ( 0 ... ( # `  W
) ) )
48 ccatswrd 11475 . . 3  |-  ( ( W  e. Word  A  /\  ( I  e.  (
0 ... ( I  + 
1 ) )  /\  ( I  +  1
)  e.  ( 0 ... ( I  + 
2 ) )  /\  ( I  +  2
)  e.  ( 0 ... ( # `  W
) ) ) )  ->  ( ( W substr  <. I ,  ( I  +  1 ) >.
) concat  ( W substr  <. (
I  +  1 ) ,  ( I  + 
2 ) >. )
)  =  ( W substr  <. I ,  ( I  +  2 ) >.
) )
491, 37, 44, 47, 48syl13anc 1184 . 2  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
( W substr  <. I ,  ( I  +  1 ) >. ) concat  ( W substr  <.
( I  +  1 ) ,  ( I  +  2 ) >.
) )  =  ( W substr  <. I ,  ( I  +  2 )
>. ) )
5035, 49eqtr2d 2329 1  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. I ,  ( I  +  2 )
>. )  =  <" ( W `  I
) ( W `  ( I  +  1
) ) "> )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ w3a 934    = wceq 1632    e. wcel 1696   <.cop 3656   class class class wbr 4039   ` cfv 5271  (class class class)co 5874   CCcc 8751   0cc0 8753   1c1 8754    + caddc 8756    < clt 8883    <_ cle 8884   NNcn 9762   2c2 9811   NN0cn0 9981   ...cfz 10798  ..^cfzo 10886   #chash 11353  Word cword 11419   concat cconcat 11420   <"cs1 11421   substr csubstr 11422   <"cs2 11507
This theorem is referenced by:  psgnunilem2  27521
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-rep 4147  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528  ax-cnex 8809  ax-resscn 8810  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-addrcl 8814  ax-mulcl 8815  ax-mulrcl 8816  ax-mulcom 8817  ax-addass 8818  ax-mulass 8819  ax-distr 8820  ax-i2m1 8821  ax-1ne0 8822  ax-1rid 8823  ax-rnegex 8824  ax-rrecex 8825  ax-cnre 8826  ax-pre-lttri 8827  ax-pre-lttrn 8828  ax-pre-ltadd 8829  ax-pre-mulgt0 8830
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 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-nel 2462  df-ral 2561  df-rex 2562  df-reu 2563  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-pss 3181  df-nul 3469  df-if 3579  df-pw 3640  df-sn 3659  df-pr 3660  df-tp 3661  df-op 3662  df-uni 3844  df-int 3879  df-iun 3923  df-br 4040  df-opab 4094  df-mpt 4095  df-tr 4130  df-eprel 4321  df-id 4325  df-po 4330  df-so 4331  df-fr 4368  df-we 4370  df-ord 4411  df-on 4412  df-lim 4413  df-suc 4414  df-om 4673  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-1st 6138  df-2nd 6139  df-riota 6320  df-recs 6404  df-rdg 6439  df-1o 6495  df-oadd 6499  df-er 6676  df-en 6880  df-dom 6881  df-sdom 6882  df-fin 6883  df-card 7588  df-pnf 8885  df-mnf 8886  df-xr 8887  df-ltxr 8888  df-le 8889  df-sub 9055  df-neg 9056  df-nn 9763  df-2 9820  df-n0 9982  df-z 10041  df-uz 10247  df-fz 10799  df-fzo 10887  df-hash 11354  df-word 11425  df-concat 11426  df-s1 11427  df-substr 11428  df-s2 11514
  Copyright terms: Public domain W3C validator