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

Theorem clwwlkn2 25496
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 25058 . . 3  |-  ( V USGrph  E  ->  ( V  e. 
_V  /\  E  e.  _V ) )
2 2nn0 10883 . . . . 5  |-  2  e.  NN0
3 isclwwlkn 25490 . . . . 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 1352 . . . 4  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( W  e.  ( ( V ClWWalksN  E ) `  2 )  <->  ( W  e.  ( V ClWWalks  E )  /\  ( # `  W
)  =  2 ) ) )
5 isclwwlk 25489 . . . . 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 710 . . . 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 257 . . 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 988 . . . . 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 6295 . . . . . . . . . . . 12  |-  ( (
# `  W )  =  2  ->  (
( # `  W )  -  1 )  =  ( 2  -  1 ) )
1110oveq2d 6304 . . . . . . . . . . 11  |-  ( (
# `  W )  =  2  ->  (
0..^ ( ( # `  W )  -  1 ) )  =  ( 0..^ ( 2  -  1 ) ) )
1211raleqdv 2992 . . . . . . . . . 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 732 . . . . . . . . 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 10721 . . . . . . . . . . . . 13  |-  ( 2  -  1 )  =  1
1514oveq2i 6299 . . . . . . . . . . . 12  |-  ( 0..^ ( 2  -  1 ) )  =  ( 0..^ 1 )
16 fzo01 11992 . . . . . . . . . . . 12  |-  ( 0..^ 1 )  =  {
0 }
1715, 16eqtri 2472 . . . . . . . . . . 11  |-  ( 0..^ ( 2  -  1 ) )  =  {
0 }
1817a1i 11 . . . . . . . . . 10  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( 0..^ ( 2  -  1 ) )  =  { 0 } )
1918raleqdv 2992 . . . . . . . . 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 9634 . . . . . . . . . 10  |-  0  e.  _V
21 fveq2 5863 . . . . . . . . . . . . 13  |-  ( i  =  0  ->  ( W `  i )  =  ( W ` 
0 ) )
22 oveq1 6295 . . . . . . . . . . . . . . 15  |-  ( i  =  0  ->  (
i  +  1 )  =  ( 0  +  1 ) )
23 0p1e1 10718 . . . . . . . . . . . . . . 15  |-  ( 0  +  1 )  =  1
2422, 23syl6eq 2500 . . . . . . . . . . . . . 14  |-  ( i  =  0  ->  (
i  +  1 )  =  1 )
2524fveq2d 5867 . . . . . . . . . . . . 13  |-  ( i  =  0  ->  ( W `  ( i  +  1 ) )  =  ( W ` 
1 ) )
2621, 25preq12d 4058 . . . . . . . . . . . 12  |-  ( i  =  0  ->  { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  =  { ( W ` 
0 ) ,  ( W `  1 ) } )
2726eleq1d 2512 . . . . . . . . . . 11  |-  ( i  =  0  ->  ( { ( W `  i ) ,  ( W `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( W `  0
) ,  ( W `
 1 ) }  e.  ran  E ) )
2827ralsng 4005 . . . . . . . . . 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 283 . . . . . . . 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 710 . . . . . . 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 12708 . . . . . . . . . . . . . 14  |-  ( W  e. Word  V  ->  ( lastS  `  W )  =  ( W `  ( (
# `  W )  -  1 ) ) )
3332adantl 468 . . . . . . . . . . . . 13  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( lastS  `  W )  =  ( W `  ( ( # `  W
)  -  1 ) ) )
3410ad2antlr 732 . . . . . . . . . . . . . . 15  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( # `  W
)  -  1 )  =  ( 2  -  1 ) )
3534, 14syl6eq 2500 . . . . . . . . . . . . . 14  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( ( # `  W
)  -  1 )  =  1 )
3635fveq2d 5867 . . . . . . . . . . . . 13  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( W `  (
( # `  W )  -  1 ) )  =  ( W ` 
1 ) )
3733, 36eqtr2d 2485 . . . . . . . . . . . 12  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  ( W `  1
)  =  ( lastS  `  W
) )
3837preq2d 4057 . . . . . . . . . . 11  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  { ( W ` 
0 ) ,  ( W `  1 ) }  =  { ( W `  0 ) ,  ( lastS  `  W
) } )
39 prcom 4049 . . . . . . . . . . 11  |-  { ( W `  0 ) ,  ( lastS  `  W
) }  =  {
( lastS  `  W ) ,  ( W `  0
) }
4038, 39syl6eq 2500 . . . . . . . . . 10  |-  ( ( ( V USGrph  E  /\  ( # `  W )  =  2 )  /\  W  e. Word  V )  ->  { ( W ` 
0 ) ,  ( W `  1 ) }  =  { ( lastS  `  W ) ,  ( W `  0 ) } )
4140eleq1d 2512 . . . . . . . . 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 211 . . . . . . . 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 639 . . . . . . 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 260 . . . . . 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 646 . . . . 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 261 . . . 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 436 . . 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 645 . 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 988 . . . 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 452 . . . 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 254 . . 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 283 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 188    /\ wa 371    /\ w3a 984    = wceq 1443    e. wcel 1886   A.wral 2736   _Vcvv 3044   {csn 3967   {cpr 3969   class class class wbr 4401   ran crn 4834   ` cfv 5581  (class class class)co 6288   0cc0 9536   1c1 9537    + caddc 9539    - cmin 9857   2c2 10656   NN0cn0 10866  ..^cfzo 11912   #chash 12512  Word cword 12653   lastS clsw 12654   USGrph cusg 25050   ClWWalks cclwwlk 25469   ClWWalksN cclwwlkn 25470
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1668  ax-4 1681  ax-5 1757  ax-6 1804  ax-7 1850  ax-8 1888  ax-9 1895  ax-10 1914  ax-11 1919  ax-12 1932  ax-13 2090  ax-ext 2430  ax-rep 4514  ax-sep 4524  ax-nul 4533  ax-pow 4580  ax-pr 4638  ax-un 6580  ax-cnex 9592  ax-resscn 9593  ax-1cn 9594  ax-icn 9595  ax-addcl 9596  ax-addrcl 9597  ax-mulcl 9598  ax-mulrcl 9599  ax-mulcom 9600  ax-addass 9601  ax-mulass 9602  ax-distr 9603  ax-i2m1 9604  ax-1ne0 9605  ax-1rid 9606  ax-rnegex 9607  ax-rrecex 9608  ax-cnre 9609  ax-pre-lttri 9610  ax-pre-lttrn 9611  ax-pre-ltadd 9612  ax-pre-mulgt0 9613
This theorem depends on definitions:  df-bi 189  df-or 372  df-an 373  df-3or 985  df-3an 986  df-tru 1446  df-ex 1663  df-nf 1667  df-sb 1797  df-eu 2302  df-mo 2303  df-clab 2437  df-cleq 2443  df-clel 2446  df-nfc 2580  df-ne 2623  df-nel 2624  df-ral 2741  df-rex 2742  df-reu 2743  df-rmo 2744  df-rab 2745  df-v 3046  df-sbc 3267  df-csb 3363  df-dif 3406  df-un 3408  df-in 3410  df-ss 3417  df-pss 3419  df-nul 3731  df-if 3881  df-pw 3952  df-sn 3968  df-pr 3970  df-tp 3972  df-op 3974  df-uni 4198  df-int 4234  df-iun 4279  df-br 4402  df-opab 4461  df-mpt 4462  df-tr 4497  df-eprel 4744  df-id 4748  df-po 4754  df-so 4755  df-fr 4792  df-we 4794  df-xp 4839  df-rel 4840  df-cnv 4841  df-co 4842  df-dm 4843  df-rn 4844  df-res 4845  df-ima 4846  df-pred 5379  df-ord 5425  df-on 5426  df-lim 5427  df-suc 5428  df-iota 5545  df-fun 5583  df-fn 5584  df-f 5585  df-f1 5586  df-fo 5587  df-f1o 5588  df-fv 5589  df-riota 6250  df-ov 6291  df-oprab 6292  df-mpt2 6293  df-om 6690  df-1st 6790  df-2nd 6791  df-wrecs 7025  df-recs 7087  df-rdg 7125  df-1o 7179  df-oadd 7183  df-er 7360  df-map 7471  df-pm 7472  df-en 7567  df-dom 7568  df-sdom 7569  df-fin 7570  df-card 8370  df-cda 8595  df-pnf 9674  df-mnf 9675  df-xr 9676  df-ltxr 9677  df-le 9678  df-sub 9859  df-neg 9860  df-nn 10607  df-2 10665  df-n0 10867  df-z 10935  df-uz 11157  df-fz 11782  df-fzo 11913  df-hash 12513  df-word 12661  df-lsw 12662  df-usgra 25053  df-clwwlk 25472  df-clwwlkn 25473
This theorem is referenced by:  numclwwlkovf2  25805
  Copyright terms: Public domain W3C validator