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

Theorem clwwlkn2 25582
Description: In an undirected simple graph, a closed walk of length 2 represented as word is a word consisting of 2 symbols representing vertices connected by an edge. (Contributed by Alexander van der Vekens, 19-Sep-2018.)
Assertion
Ref Expression
clwwlkn2  |-  ( V USGrph  E  ->  ( W  e.  ( ( V ClWWalksN  E ) `
 2 )  <->  ( ( # `
 W )  =  2  /\  W  e. Word  V  /\  { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E ) ) )

Proof of Theorem clwwlkn2
Dummy variable  i is distinct from all other variables.
StepHypRef Expression
1 usgrav 25144 . . 3  |-  ( V USGrph  E  ->  ( V  e. 
_V  /\  E  e.  _V ) )
2 2nn0 10910 . . . . 5  |-  2  e.  NN0
3 isclwwlkn 25576 . . . . 5  |-  ( ( V  e.  _V  /\  E  e.  _V  /\  2  e.  NN0 )  ->  ( W  e.  ( ( V ClWWalksN  E ) `  2
)  <->  ( W  e.  ( V ClWWalks  E )  /\  ( # `  W
)  =  2 ) ) )
42, 3mp3an3 1379 . . . 4  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( W  e.  ( ( V ClWWalksN  E ) `  2 )  <->  ( W  e.  ( V ClWWalks  E )  /\  ( # `  W
)  =  2 ) ) )
5 isclwwlk 25575 . . . . 5  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( W  e.  ( V ClWWalks  E )  <->  ( W  e. Word  V  /\  A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E ) ) )
65anbi1d 719 . . . 4  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( ( W  e.  ( V ClWWalks  E )  /\  ( # `  W
)  =  2 )  <-> 
( ( W  e. Word  V  /\  A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  /\  ( # `  W
)  =  2 ) ) )
74, 6bitrd 261 . . 3  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( W  e.  ( ( V ClWWalksN  E ) `  2 )  <->  ( ( W  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  W
)  -  1 ) ) { ( W `
 i ) ,  ( W `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  /\  ( # `  W
)  =  2 ) ) )
81, 7syl 17 . 2  |-  ( V USGrph  E  ->  ( W  e.  ( ( V ClWWalksN  E ) `
 2 )  <->  ( ( W  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  W
)  -  1 ) ) { ( W `
 i ) ,  ( W `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  /\  ( # `  W
)  =  2 ) ) )
9 3anass 1011 . . . . 5  |-  ( ( W  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  W
)  -  1 ) ) { ( W `
 i ) ,  ( W `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  <-> 
( W  e. Word  V  /\  ( A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E ) ) )
10 oveq1 6315 . . . . . . . . . . . 12  |-  ( (
# `  W )  =  2  ->  (
( # `  W )  -  1 )  =  ( 2  -  1 ) )
1110oveq2d 6324 . . . . . . . . . . 11  |-  ( (
# `  W )  =  2  ->  (
0..^ ( ( # `  W )  -  1 ) )  =  ( 0..^ ( 2  -  1 ) ) )
1211raleqdv 2979 . . . . . . . . . 10  |-  ( (
# `  W )  =  2  ->  ( A. i  e.  (
0..^ ( ( # `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  <->  A. i  e.  ( 0..^ ( 2  -  1 ) ) { ( W `  i
) ,  ( W `
 ( i  +  1 ) ) }  e.  ran  E ) )
1312ad2antlr 741 . . . . . . . . 9  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  <->  A. i  e.  ( 0..^ ( 2  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E ) )
14 2m1e1 10746 . . . . . . . . . . . . 13  |-  ( 2  -  1 )  =  1
1514oveq2i 6319 . . . . . . . . . . . 12  |-  ( 0..^ ( 2  -  1 ) )  =  ( 0..^ 1 )
16 fzo01 12024 . . . . . . . . . . . 12  |-  ( 0..^ 1 )  =  {
0 }
1715, 16eqtri 2493 . . . . . . . . . . 11  |-  ( 0..^ ( 2  -  1 ) )  =  {
0 }
1817a1i 11 . . . . . . . . . 10  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( 0..^ ( 2  -  1 ) )  =  { 0 } )
1918raleqdv 2979 . . . . . . . . 9  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( A. i  e.  ( 0..^ ( 2  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  <->  A. i  e.  { 0 }  { ( W `
 i ) ,  ( W `  (
i  +  1 ) ) }  e.  ran  E ) )
20 c0ex 9655 . . . . . . . . . 10  |-  0  e.  _V
21 fveq2 5879 . . . . . . . . . . . . 13  |-  ( i  =  0  ->  ( W `  i )  =  ( W ` 
0 ) )
22 oveq1 6315 . . . . . . . . . . . . . . 15  |-  ( i  =  0  ->  (
i  +  1 )  =  ( 0  +  1 ) )
23 0p1e1 10743 . . . . . . . . . . . . . . 15  |-  ( 0  +  1 )  =  1
2422, 23syl6eq 2521 . . . . . . . . . . . . . 14  |-  ( i  =  0  ->  (
i  +  1 )  =  1 )
2524fveq2d 5883 . . . . . . . . . . . . 13  |-  ( i  =  0  ->  ( W `  ( i  +  1 ) )  =  ( W ` 
1 ) )
2621, 25preq12d 4050 . . . . . . . . . . . 12  |-  ( i  =  0  ->  { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  =  { ( W ` 
0 ) ,  ( W `  1 ) } )
2726eleq1d 2533 . . . . . . . . . . 11  |-  ( i  =  0  ->  ( { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E ) )
2827ralsng 3997 . . . . . . . . . 10  |-  ( 0  e.  _V  ->  ( A. i  e.  { 0 }  { ( W `
 i ) ,  ( W `  (
i  +  1 ) ) }  e.  ran  E  <->  { ( W ` 
0 ) ,  ( W `  1 ) }  e.  ran  E
) )
2920, 28mp1i 13 . . . . . . . . 9  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( A. i  e. 
{ 0 }  {
( W `  i
) ,  ( W `
 ( i  +  1 ) ) }  e.  ran  E  <->  { ( W `  0 ) ,  ( W ` 
1 ) }  e.  ran  E ) )
3013, 19, 293bitrd 287 . . . . . . . 8  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E ) )
3130anbi1d 719 . . . . . . 7  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  <-> 
( { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E ) ) )
32 lsw 12762 . . . . . . . . . . . . . 14  |-  ( W  e. Word  V  ->  ( lastS  `  W )  =  ( W `  ( (
# `  W )  -  1 ) ) )
3332adantl 473 . . . . . . . . . . . . 13  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( lastS  `  W )  =  ( W `  ( ( # `  W
)  -  1 ) ) )
3410ad2antlr 741 . . . . . . . . . . . . . . 15  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( # `  W
)  -  1 )  =  ( 2  -  1 ) )
3534, 14syl6eq 2521 . . . . . . . . . . . . . 14  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( # `  W
)  -  1 )  =  1 )
3635fveq2d 5883 . . . . . . . . . . . . 13  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( W `  (
( # `  W )  -  1 ) )  =  ( W ` 
1 ) )
3733, 36eqtr2d 2506 . . . . . . . . . . . 12  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( W `  1
)  =  ( lastS  `  W
) )
3837preq2d 4049 . . . . . . . . . . 11  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  { ( W ` 
0 ) ,  ( W `  1 ) }  =  { ( W `  0 ) ,  ( lastS  `  W
) } )
39 prcom 4041 . . . . . . . . . . 11  |-  { ( W `  0 ) ,  ( lastS  `  W
) }  =  {
( lastS  `  W ) ,  ( W `  0
) }
4038, 39syl6eq 2521 . . . . . . . . . 10  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  { ( W ` 
0 ) ,  ( W `  1 ) }  =  { ( lastS  `  W ) ,  ( W `  0 ) } )
4140eleq1d 2533 . . . . . . . . 9  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E  <->  { ( lastS  `  W ) ,  ( W ` 
0 ) }  e.  ran  E ) )
4241biimpd 212 . . . . . . . 8  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E  ->  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E ) )
4342pm4.71d 646 . . . . . . 7  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E  <-> 
( { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E ) ) )
4431, 43bitr4d 264 . . . . . 6  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  <->  { ( W ` 
0 ) ,  ( W `  1 ) }  e.  ran  E
) )
4544pm5.32da 653 . . . . 5  |-  ( ( V USGrph  E  /\  ( # `
 W )  =  2 )  ->  (
( W  e. Word  V  /\  ( A. i  e.  ( 0..^ ( (
# `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E ) )  <->  ( W  e. Word  V  /\  { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E ) ) )
469, 45syl5bb 265 . . . 4  |-  ( ( V USGrph  E  /\  ( # `
 W )  =  2 )  ->  (
( W  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  W )  -  1 ) ) { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W ) ,  ( W `  0 ) }  e.  ran  E
)  <->  ( W  e. Word  V  /\  { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E ) ) )
4746ex 441 . . 3  |-  ( V USGrph  E  ->  ( ( # `  W )  =  2  ->  ( ( W  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  W
)  -  1 ) ) { ( W `
 i ) ,  ( W `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  <-> 
( W  e. Word  V  /\  { ( W ` 
0 ) ,  ( W `  1 ) }  e.  ran  E
) ) ) )
4847pm5.32rd 652 . 2  |-  ( V USGrph  E  ->  ( ( ( W  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  W
)  -  1 ) ) { ( W `
 i ) ,  ( W `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  W
) ,  ( W `
 0 ) }  e.  ran  E )  /\  ( # `  W
)  =  2 )  <-> 
( ( W  e. Word  V  /\  { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E )  /\  ( # `  W )  =  2 ) ) )
49 3anass 1011 . . . 4  |-  ( ( ( # `  W
)  =  2  /\  W  e. Word  V  /\  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E )  <-> 
( ( # `  W
)  =  2  /\  ( W  e. Word  V  /\  { ( W ` 
0 ) ,  ( W `  1 ) }  e.  ran  E
) ) )
50 ancom 457 . . . 4  |-  ( ( ( # `  W
)  =  2  /\  ( W  e. Word  V  /\  { ( W ` 
0 ) ,  ( W `  1 ) }  e.  ran  E
) )  <->  ( ( W  e. Word  V  /\  {
( W `  0
) ,  ( W `
 1 ) }  e.  ran  E )  /\  ( # `  W
)  =  2 ) )
5149, 50bitr2i 258 . . 3  |-  ( ( ( W  e. Word  V  /\  { ( W ` 
0 ) ,  ( W `  1 ) }  e.  ran  E
)  /\  ( # `  W
)  =  2 )  <-> 
( ( # `  W
)  =  2  /\  W  e. Word  V  /\  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E ) )
5251a1i 11 . 2  |-  ( V USGrph  E  ->  ( ( ( W  e. Word  V  /\  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E )  /\  ( # `  W
)  =  2 )  <-> 
( ( # `  W
)  =  2  /\  W  e. Word  V  /\  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E ) ) )
538, 48, 523bitrd 287 1  |-  ( V USGrph  E  ->  ( W  e.  ( ( V ClWWalksN  E ) `
 2 )  <->  ( ( # `
 W )  =  2  /\  W  e. Word  V  /\  { ( W `
 0 ) ,  ( W `  1
) }  e.  ran  E ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 189    /\ wa 376    /\ w3a 1007    = wceq 1452    e. wcel 1904   A.wral 2756   _Vcvv 3031   {csn 3959   {cpr 3961   class class class wbr 4395   ran crn 4840   ` cfv 5589  (class class class)co 6308   0cc0 9557   1c1 9558    + caddc 9560    - cmin 9880   2c2 10681   NN0cn0 10893  ..^cfzo 11942   #chash 12553  Word cword 12703   lastS clsw 12704   USGrph cusg 25136   ClWWalks cclwwlk 25555   ClWWalksN cclwwlkn 25556
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1677  ax-4 1690  ax-5 1766  ax-6 1813  ax-7 1859  ax-8 1906  ax-9 1913  ax-10 1932  ax-11 1937  ax-12 1950  ax-13 2104  ax-ext 2451  ax-rep 4508  ax-sep 4518  ax-nul 4527  ax-pow 4579  ax-pr 4639  ax-un 6602  ax-cnex 9613  ax-resscn 9614  ax-1cn 9615  ax-icn 9616  ax-addcl 9617  ax-addrcl 9618  ax-mulcl 9619  ax-mulrcl 9620  ax-mulcom 9621  ax-addass 9622  ax-mulass 9623  ax-distr 9624  ax-i2m1 9625  ax-1ne0 9626  ax-1rid 9627  ax-rnegex 9628  ax-rrecex 9629  ax-cnre 9630  ax-pre-lttri 9631  ax-pre-lttrn 9632  ax-pre-ltadd 9633  ax-pre-mulgt0 9634
This theorem depends on definitions:  df-bi 190  df-or 377  df-an 378  df-3or 1008  df-3an 1009  df-tru 1455  df-ex 1672  df-nf 1676  df-sb 1806  df-eu 2323  df-mo 2324  df-clab 2458  df-cleq 2464  df-clel 2467  df-nfc 2601  df-ne 2643  df-nel 2644  df-ral 2761  df-rex 2762  df-reu 2763  df-rmo 2764  df-rab 2765  df-v 3033  df-sbc 3256  df-csb 3350  df-dif 3393  df-un 3395  df-in 3397  df-ss 3404  df-pss 3406  df-nul 3723  df-if 3873  df-pw 3944  df-sn 3960  df-pr 3962  df-tp 3964  df-op 3966  df-uni 4191  df-int 4227  df-iun 4271  df-br 4396  df-opab 4455  df-mpt 4456  df-tr 4491  df-eprel 4750  df-id 4754  df-po 4760  df-so 4761  df-fr 4798  df-we 4800  df-xp 4845  df-rel 4846  df-cnv 4847  df-co 4848  df-dm 4849  df-rn 4850  df-res 4851  df-ima 4852  df-pred 5387  df-ord 5433  df-on 5434  df-lim 5435  df-suc 5436  df-iota 5553  df-fun 5591  df-fn 5592  df-f 5593  df-f1 5594  df-fo 5595  df-f1o 5596  df-fv 5597  df-riota 6270  df-ov 6311  df-oprab 6312  df-mpt2 6313  df-om 6712  df-1st 6812  df-2nd 6813  df-wrecs 7046  df-recs 7108  df-rdg 7146  df-1o 7200  df-oadd 7204  df-er 7381  df-map 7492  df-pm 7493  df-en 7588  df-dom 7589  df-sdom 7590  df-fin 7591  df-card 8391  df-cda 8616  df-pnf 9695  df-mnf 9696  df-xr 9697  df-ltxr 9698  df-le 9699  df-sub 9882  df-neg 9883  df-nn 10632  df-2 10690  df-n0 10894  df-z 10962  df-uz 11183  df-fz 11811  df-fzo 11943  df-hash 12554  df-word 12711  df-lsw 12712  df-usgra 25139  df-clwwlk 25558  df-clwwlkn 25559
This theorem is referenced by:  numclwwlkovf2  25891
  Copyright terms: Public domain W3C validator