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

Theorem swrds2 12633
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 988 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  W  e. Word  A )
2 simp2 989 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  NN0 )
3 elfzo0 11674 . . . . . . . 8  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  <->  ( ( I  +  1 )  e. 
NN0  /\  ( # `  W
)  e.  NN  /\  ( I  +  1
)  <  ( # `  W
) ) )
43simp2bi 1004 . . . . . . 7  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  ->  ( # `  W
)  e.  NN )
543ad2ant3 1011 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( # `
 W )  e.  NN )
62nn0red 10724 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  RR )
7 peano2nn0 10707 . . . . . . . . 9  |-  ( I  e.  NN0  ->  ( I  +  1 )  e. 
NN0 )
82, 7syl 16 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  e.  NN0 )
98nn0red 10724 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  e.  RR )
105nnred 10424 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( # `
 W )  e.  RR )
116lep1d 10351 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  <_  ( I  +  1 ) )
12 elfzolt2 11648 . . . . . . . 8  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  ->  ( I  +  1 )  < 
( # `  W ) )
13123ad2ant3 1011 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <  ( # `  W
) )
146, 9, 10, 11, 13lelttrd 9616 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  <  ( # `  W
) )
15 elfzo0 11674 . . . . . 6  |-  ( I  e.  ( 0..^ (
# `  W )
)  <->  ( I  e. 
NN0  /\  ( # `  W
)  e.  NN  /\  I  <  ( # `  W
) ) )
162, 5, 14, 15syl3anbrc 1172 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  ( 0..^ ( # `  W ) ) )
17 swrds1 12433 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  ( 0..^ ( # `  W
) ) )  -> 
( W substr  <. I ,  ( I  +  1 ) >. )  =  <" ( W `  I
) "> )
181, 16, 17syl2anc 661 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. I ,  ( I  +  1 )
>. )  =  <" ( W `  I
) "> )
19 nn0cn 10676 . . . . . . . . 9  |-  ( I  e.  NN0  ->  I  e.  CC )
20193ad2ant2 1010 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  CC )
21 ax-1cn 9427 . . . . . . . . . 10  |-  1  e.  CC
22 addass 9456 . . . . . . . . . 10  |-  ( ( I  e.  CC  /\  1  e.  CC  /\  1  e.  CC )  ->  (
( I  +  1 )  +  1 )  =  ( I  +  ( 1  +  1 ) ) )
2321, 21, 22mp3an23 1307 . . . . . . . . 9  |-  ( I  e.  CC  ->  (
( I  +  1 )  +  1 )  =  ( I  +  ( 1  +  1 ) ) )
24 df-2 10467 . . . . . . . . . 10  |-  2  =  ( 1  +  1 )
2524oveq2i 6187 . . . . . . . . 9  |-  ( I  +  2 )  =  ( I  +  ( 1  +  1 ) )
2623, 25syl6reqr 2509 . . . . . . . 8  |-  ( I  e.  CC  ->  (
I  +  2 )  =  ( ( I  +  1 )  +  1 ) )
2720, 26syl 16 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  =  ( ( I  +  1 )  +  1 ) )
2827opeq2d 4150 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  <. (
I  +  1 ) ,  ( I  + 
2 ) >.  =  <. ( I  +  1 ) ,  ( ( I  +  1 )  +  1 ) >. )
2928oveq2d 6192 . . . . 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 12433 . . . . . 6  |-  ( ( W  e. Word  A  /\  ( I  +  1
)  e.  ( 0..^ ( # `  W
) ) )  -> 
( W substr  <. ( I  +  1 ) ,  ( ( I  + 
1 )  +  1 ) >. )  =  <" ( W `  (
I  +  1 ) ) "> )
31303adant2 1007 . . . . 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 2490 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. ( I  + 
1 ) ,  ( I  +  2 )
>. )  =  <" ( W `  (
I  +  1 ) ) "> )
3318, 32oveq12d 6194 . . 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 12563 . . 3  |-  <" ( W `  I )
( W `  (
I  +  1 ) ) ">  =  ( <" ( W `
 I ) "> concat  <" ( W `
 ( I  + 
1 ) ) "> )
3533, 34syl6reqr 2509 . 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 11567 . . . 4  |-  ( I  e.  ( 0 ... ( I  +  1 ) )  <->  ( I  e.  NN0  /\  ( I  +  1 )  e. 
NN0  /\  I  <_  ( I  +  1 ) ) )
372, 8, 11, 36syl3anbrc 1172 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  ( 0 ... (
I  +  1 ) ) )
38 peano2nn0 10707 . . . . . 6  |-  ( ( I  +  1 )  e.  NN0  ->  ( ( I  +  1 )  +  1 )  e. 
NN0 )
398, 38syl 16 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
( I  +  1 )  +  1 )  e.  NN0 )
4027, 39eqeltrd 2536 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  e.  NN0 )
419lep1d 10351 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <_  ( ( I  +  1 )  +  1 ) )
4241, 27breqtrrd 4402 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <_  ( I  + 
2 ) )
43 elfz2nn0 11567 . . . 4  |-  ( ( I  +  1 )  e.  ( 0 ... ( I  +  2 ) )  <->  ( (
I  +  1 )  e.  NN0  /\  (
I  +  2 )  e.  NN0  /\  (
I  +  1 )  <_  ( I  + 
2 ) ) )
448, 40, 42, 43syl3anbrc 1172 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  e.  ( 0 ... ( I  +  2 ) ) )
45 fzofzp1 11711 . . . . 5  |-  ( ( I  +  1 )  e.  ( 0..^ (
# `  W )
)  ->  ( (
I  +  1 )  +  1 )  e.  ( 0 ... ( # `
 W ) ) )
46453ad2ant3 1011 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
( I  +  1 )  +  1 )  e.  ( 0 ... ( # `  W
) ) )
4727, 46eqeltrd 2536 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  e.  ( 0 ... ( # `  W
) ) )
48 ccatswrd 12438 . . 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 1221 . 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 2491 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 setvar class
Syntax hints:    -> wi 4    /\ w3a 965    = wceq 1370    e. wcel 1757   <.cop 3967   class class class wbr 4376   ` cfv 5502  (class class class)co 6176   CCcc 9367   0cc0 9369   1c1 9370    + caddc 9372    < clt 9505    <_ cle 9506   NNcn 10409   2c2 10458   NN0cn0 10666   ...cfz 11524  ..^cfzo 11635   #chash 12190  Word cword 12309   concat cconcat 12311   <"cs1 12312   substr csubstr 12313   <"cs2 12556
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 1709  ax-7 1729  ax-8 1759  ax-9 1761  ax-10 1776  ax-11 1781  ax-12 1793  ax-13 1944  ax-ext 2429  ax-rep 4487  ax-sep 4497  ax-nul 4505  ax-pow 4554  ax-pr 4615  ax-un 6458  ax-cnex 9425  ax-resscn 9426  ax-1cn 9427  ax-icn 9428  ax-addcl 9429  ax-addrcl 9430  ax-mulcl 9431  ax-mulrcl 9432  ax-mulcom 9433  ax-addass 9434  ax-mulass 9435  ax-distr 9436  ax-i2m1 9437  ax-1ne0 9438  ax-1rid 9439  ax-rnegex 9440  ax-rrecex 9441  ax-cnre 9442  ax-pre-lttri 9443  ax-pre-lttrn 9444  ax-pre-ltadd 9445  ax-pre-mulgt0 9446
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 1702  df-eu 2263  df-mo 2264  df-clab 2436  df-cleq 2442  df-clel 2445  df-nfc 2598  df-ne 2643  df-nel 2644  df-ral 2797  df-rex 2798  df-reu 2799  df-rab 2801  df-v 3056  df-sbc 3271  df-csb 3373  df-dif 3415  df-un 3417  df-in 3419  df-ss 3426  df-pss 3428  df-nul 3722  df-if 3876  df-pw 3946  df-sn 3962  df-pr 3964  df-tp 3966  df-op 3968  df-uni 4176  df-int 4213  df-iun 4257  df-br 4377  df-opab 4435  df-mpt 4436  df-tr 4470  df-eprel 4716  df-id 4720  df-po 4725  df-so 4726  df-fr 4763  df-we 4765  df-ord 4806  df-on 4807  df-lim 4808  df-suc 4809  df-xp 4930  df-rel 4931  df-cnv 4932  df-co 4933  df-dm 4934  df-rn 4935  df-res 4936  df-ima 4937  df-iota 5465  df-fun 5504  df-fn 5505  df-f 5506  df-f1 5507  df-fo 5508  df-f1o 5509  df-fv 5510  df-riota 6137  df-ov 6179  df-oprab 6180  df-mpt2 6181  df-om 6563  df-1st 6663  df-2nd 6664  df-recs 6918  df-rdg 6952  df-1o 7006  df-oadd 7010  df-er 7187  df-en 7397  df-dom 7398  df-sdom 7399  df-fin 7400  df-card 8196  df-pnf 9507  df-mnf 9508  df-xr 9509  df-ltxr 9510  df-le 9511  df-sub 9684  df-neg 9685  df-nn 10410  df-2 10467  df-n0 10667  df-z 10734  df-uz 10949  df-fz 11525  df-fzo 11636  df-hash 12191  df-word 12317  df-concat 12319  df-s1 12320  df-substr 12321  df-s2 12563
This theorem is referenced by:  swrd2lsw  12640  psgnunilem2  16089
  Copyright terms: Public domain W3C validator