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

Theorem swrds2 11560
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 10904 . . . . . . . 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 10019 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  e.  RR )
7 peano2nn0 10004 . . . . . . . . 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 10019 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  e.  RR )
105nnred 9761 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( # `
 W )  e.  RR )
116lep1d 9688 . . . . . . 7  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  <_  ( I  +  1 ) )
12 elfzolt2 10883 . . . . . . . 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 8974 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  I  <  ( # `  W
) )
15 elfzo0 10904 . . . . . 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 11473 . . . . 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 9975 . . . . . . . . 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 8795 . . . . . . . . . 10  |-  1  e.  CC
22 addass 8824 . . . . . . . . . 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 9804 . . . . . . . . . 10  |-  2  =  ( 1  +  1 )
2524oveq2i 5869 . . . . . . . . 9  |-  ( I  +  2 )  =  ( I  +  ( 1  +  1 ) )
2623, 25syl6reqr 2334 . . . . . . . 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 3803 . . . . . 6  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  <. (
I  +  1 ) ,  ( I  + 
2 ) >.  =  <. ( I  +  1 ) ,  ( ( I  +  1 )  +  1 ) >. )
2928oveq2d 5874 . . . . 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 11473 . . . . . 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 2315 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  ( W substr  <. ( I  + 
1 ) ,  ( I  +  2 )
>. )  =  <" ( W `  (
I  +  1 ) ) "> )
3318, 32oveq12d 5876 . . 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 11498 . . 3  |-  <" ( W `  I )
( W `  (
I  +  1 ) ) ">  =  ( <" ( W `
 I ) "> concat  <" ( W `
 ( I  + 
1 ) ) "> )
3533, 34syl6reqr 2334 . 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 10821 . . . 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 10004 . . . . . 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 2357 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  e.  NN0 )
419lep1d 9688 . . . . 5  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <_  ( ( I  +  1 )  +  1 ) )
4241, 27breqtrrd 4049 . . . 4  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  1 )  <_  ( I  + 
2 ) )
43 elfz2nn0 10821 . . . 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 10916 . . . . 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 2357 . . 3  |-  ( ( W  e. Word  A  /\  I  e.  NN0  /\  (
I  +  1 )  e.  ( 0..^ (
# `  W )
) )  ->  (
I  +  2 )  e.  ( 0 ... ( # `  W
) ) )
48 ccatswrd 11459 . . 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 2316 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 1623    e. wcel 1684   <.cop 3643   class class class wbr 4023   ` cfv 5255  (class class class)co 5858   CCcc 8735   0cc0 8737   1c1 8738    + caddc 8740    < clt 8867    <_ cle 8868   NNcn 9746   2c2 9795   NN0cn0 9965   ...cfz 10782  ..^cfzo 10870   #chash 11337  Word cword 11403   concat cconcat 11404   <"cs1 11405   substr csubstr 11406   <"cs2 11491
This theorem is referenced by:  psgnunilem2  27418
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-2 9804  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-s1 11411  df-substr 11412  df-s2 11498
  Copyright terms: Public domain W3C validator