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

Theorem clwwlkn2 24902
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 24465 . . 3  |-  ( V USGrph  E  ->  ( V  e. 
_V  /\  E  e.  _V ) )
2 2nn0 10833 . . . . 5  |-  2  e.  NN0
3 isclwwlkn 24896 . . . . 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 1313 . . . 4  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( W  e.  ( ( V ClWWalksN  E ) `  2 )  <->  ( W  e.  ( V ClWWalks  E )  /\  ( # `  W
)  =  2 ) ) )
5 isclwwlk 24895 . . . . 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 704 . . . 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 253 . . 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 16 . 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 977 . . . . 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 6303 . . . . . . . . . . . 12  |-  ( (
# `  W )  =  2  ->  (
( # `  W )  -  1 )  =  ( 2  -  1 ) )
1110oveq2d 6312 . . . . . . . . . . 11  |-  ( (
# `  W )  =  2  ->  (
0..^ ( ( # `  W )  -  1 ) )  =  ( 0..^ ( 2  -  1 ) ) )
1211raleqdv 3060 . . . . . . . . . 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 726 . . . . . . . . 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 10671 . . . . . . . . . . . . 13  |-  ( 2  -  1 )  =  1
1514oveq2i 6307 . . . . . . . . . . . 12  |-  ( 0..^ ( 2  -  1 ) )  =  ( 0..^ 1 )
16 fzo01 11900 . . . . . . . . . . . 12  |-  ( 0..^ 1 )  =  {
0 }
1715, 16eqtri 2486 . . . . . . . . . . 11  |-  ( 0..^ ( 2  -  1 ) )  =  {
0 }
1817a1i 11 . . . . . . . . . 10  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( 0..^ ( 2  -  1 ) )  =  { 0 } )
1918raleqdv 3060 . . . . . . . . 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 9607 . . . . . . . . . 10  |-  0  e.  _V
21 fveq2 5872 . . . . . . . . . . . . 13  |-  ( i  =  0  ->  ( W `  i )  =  ( W ` 
0 ) )
22 oveq1 6303 . . . . . . . . . . . . . . 15  |-  ( i  =  0  ->  (
i  +  1 )  =  ( 0  +  1 ) )
23 0p1e1 10668 . . . . . . . . . . . . . . 15  |-  ( 0  +  1 )  =  1
2422, 23syl6eq 2514 . . . . . . . . . . . . . 14  |-  ( i  =  0  ->  (
i  +  1 )  =  1 )
2524fveq2d 5876 . . . . . . . . . . . . 13  |-  ( i  =  0  ->  ( W `  ( i  +  1 ) )  =  ( W ` 
1 ) )
2621, 25preq12d 4119 . . . . . . . . . . . 12  |-  ( i  =  0  ->  { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  =  { ( W ` 
0 ) ,  ( W `  1 ) } )
2726eleq1d 2526 . . . . . . . . . . 11  |-  ( i  =  0  ->  ( { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E ) )
2827ralsng 4067 . . . . . . . . . 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 12 . . . . . . . . 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 279 . . . . . . . 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 704 . . . . . . 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 12593 . . . . . . . . . . . . . 14  |-  ( W  e. Word  V  ->  ( lastS  `  W )  =  ( W `  ( (
# `  W )  -  1 ) ) )
3332adantl 466 . . . . . . . . . . . . 13  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( lastS  `  W )  =  ( W `  ( ( # `  W
)  -  1 ) ) )
3410ad2antlr 726 . . . . . . . . . . . . . . 15  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( # `  W
)  -  1 )  =  ( 2  -  1 ) )
3534, 14syl6eq 2514 . . . . . . . . . . . . . 14  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( # `  W
)  -  1 )  =  1 )
3635fveq2d 5876 . . . . . . . . . . . . 13  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( W `  (
( # `  W )  -  1 ) )  =  ( W ` 
1 ) )
3733, 36eqtr2d 2499 . . . . . . . . . . . 12  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( W `  1
)  =  ( lastS  `  W
) )
3837preq2d 4118 . . . . . . . . . . 11  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  { ( W ` 
0 ) ,  ( W `  1 ) }  =  { ( W `  0 ) ,  ( lastS  `  W
) } )
39 prcom 4110 . . . . . . . . . . 11  |-  { ( W `  0 ) ,  ( lastS  `  W
) }  =  {
( lastS  `  W ) ,  ( W `  0
) }
4038, 39syl6eq 2514 . . . . . . . . . 10  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  { ( W ` 
0 ) ,  ( W `  1 ) }  =  { ( lastS  `  W ) ,  ( W `  0 ) } )
4140eleq1d 2526 . . . . . . . . 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 207 . . . . . . . 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 634 . . . . . . 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 256 . . . . . 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 641 . . . . 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 257 . . . 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 434 . . 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 640 . 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 977 . . . 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 450 . . . 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 250 . . 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 279 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 184    /\ wa 369    /\ w3a 973    = wceq 1395    e. wcel 1819   A.wral 2807   _Vcvv 3109   {csn 4032   {cpr 4034   class class class wbr 4456   ran crn 5009   ` cfv 5594  (class class class)co 6296   0cc0 9509   1c1 9510    + caddc 9512    - cmin 9824   2c2 10606   NN0cn0 10816  ..^cfzo 11821   #chash 12408  Word cword 12538   lastS clsw 12539   USGrph cusg 24457   ClWWalks cclwwlk 24875   ClWWalksN cclwwlkn 24876
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1619  ax-4 1632  ax-5 1705  ax-6 1748  ax-7 1791  ax-8 1821  ax-9 1823  ax-10 1838  ax-11 1843  ax-12 1855  ax-13 2000  ax-ext 2435  ax-rep 4568  ax-sep 4578  ax-nul 4586  ax-pow 4634  ax-pr 4695  ax-un 6591  ax-cnex 9565  ax-resscn 9566  ax-1cn 9567  ax-icn 9568  ax-addcl 9569  ax-addrcl 9570  ax-mulcl 9571  ax-mulrcl 9572  ax-mulcom 9573  ax-addass 9574  ax-mulass 9575  ax-distr 9576  ax-i2m1 9577  ax-1ne0 9578  ax-1rid 9579  ax-rnegex 9580  ax-rrecex 9581  ax-cnre 9582  ax-pre-lttri 9583  ax-pre-lttrn 9584  ax-pre-ltadd 9585  ax-pre-mulgt0 9586
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1398  df-ex 1614  df-nf 1618  df-sb 1741  df-eu 2287  df-mo 2288  df-clab 2443  df-cleq 2449  df-clel 2452  df-nfc 2607  df-ne 2654  df-nel 2655  df-ral 2812  df-rex 2813  df-reu 2814  df-rmo 2815  df-rab 2816  df-v 3111  df-sbc 3328  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3794  df-if 3945  df-pw 4017  df-sn 4033  df-pr 4035  df-tp 4037  df-op 4039  df-uni 4252  df-int 4289  df-iun 4334  df-br 4457  df-opab 4516  df-mpt 4517  df-tr 4551  df-eprel 4800  df-id 4804  df-po 4809  df-so 4810  df-fr 4847  df-we 4849  df-ord 4890  df-on 4891  df-lim 4892  df-suc 4893  df-xp 5014  df-rel 5015  df-cnv 5016  df-co 5017  df-dm 5018  df-rn 5019  df-res 5020  df-ima 5021  df-iota 5557  df-fun 5596  df-fn 5597  df-f 5598  df-f1 5599  df-fo 5600  df-f1o 5601  df-fv 5602  df-riota 6258  df-ov 6299  df-oprab 6300  df-mpt2 6301  df-om 6700  df-1st 6799  df-2nd 6800  df-recs 7060  df-rdg 7094  df-1o 7148  df-oadd 7152  df-er 7329  df-map 7440  df-pm 7441  df-en 7536  df-dom 7537  df-sdom 7538  df-fin 7539  df-card 8337  df-cda 8565  df-pnf 9647  df-mnf 9648  df-xr 9649  df-ltxr 9650  df-le 9651  df-sub 9826  df-neg 9827  df-nn 10557  df-2 10615  df-n0 10817  df-z 10886  df-uz 11107  df-fz 11698  df-fzo 11822  df-hash 12409  df-word 12546  df-lsw 12547  df-usgra 24460  df-clwwlk 24878  df-clwwlkn 24879
This theorem is referenced by:  numclwwlkovf2  25211
  Copyright terms: Public domain W3C validator