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

Theorem clwlkisclwwlk 25502
Description: A closed walk as word corresponds to a closed walk in an undirected graph. (Contributed by Alexander van der Vekens, 22-Jun-2018.)
Assertion
Ref Expression
clwlkisclwwlk  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( E. f 
f ( V ClWalks  E
) P  <->  ( ( lastS  `  P )  =  ( P `  0 )  /\  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. )  e.  ( V ClWWalks  E ) ) ) )
Distinct variable groups:    f, E    P, f    f, V

Proof of Theorem clwlkisclwwlk
Dummy variable  i is distinct from all other variables.
StepHypRef Expression
1 clwlkisclwwlklem0 25501 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( E. f
( ( f  e. Word  dom  E  /\  P :
( 0 ... ( # `
 f ) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f ) ) ( E `  ( f `
 i ) )  =  { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) )  <->  ( ( lastS  `  P )  =  ( P `  0 )  /\  ( A. i  e.  ( 0..^ ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) ) { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E  /\  { ( P `  (
( # `  P )  -  2 ) ) ,  ( P ` 
0 ) }  e.  ran  E ) ) ) )
2 lencl 12679 . . . . . . . . . . . . . 14  |-  ( P  e. Word  V  ->  ( # `
 P )  e. 
NN0 )
3 ige2m1fz 11884 . . . . . . . . . . . . . 14  |-  ( ( ( # `  P
)  e.  NN0  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  e.  ( 0 ... ( # `
 P ) ) )
42, 3sylan 473 . . . . . . . . . . . . 13  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  e.  ( 0 ... ( # `
 P ) ) )
5 swrd0len 12768 . . . . . . . . . . . . 13  |-  ( ( P  e. Word  V  /\  ( ( # `  P
)  -  1 )  e.  ( 0 ... ( # `  P
) ) )  -> 
( # `  ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) )  =  ( ( # `  P
)  -  1 ) )
64, 5syldan 472 . . . . . . . . . . . 12  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( # `
 ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  =  ( ( # `  P
)  -  1 ) )
72nn0cnd 10927 . . . . . . . . . . . . . . . 16  |-  ( P  e. Word  V  ->  ( # `
 P )  e.  CC )
8 1cnd 9659 . . . . . . . . . . . . . . . 16  |-  ( P  e. Word  V  ->  1  e.  CC )
97, 8subcld 9986 . . . . . . . . . . . . . . 15  |-  ( P  e. Word  V  ->  (
( # `  P )  -  1 )  e.  CC )
109subid1d 9975 . . . . . . . . . . . . . 14  |-  ( P  e. Word  V  ->  (
( ( # `  P
)  -  1 )  -  0 )  =  ( ( # `  P
)  -  1 ) )
1110eqcomd 2430 . . . . . . . . . . . . 13  |-  ( P  e. Word  V  ->  (
( # `  P )  -  1 )  =  ( ( ( # `  P )  -  1 )  -  0 ) )
1211adantr 466 . . . . . . . . . . . 12  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  =  ( ( ( # `  P )  -  1 )  -  0 ) )
136, 12eqtrd 2463 . . . . . . . . . . 11  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( # `
 ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  =  ( ( ( # `  P )  -  1 )  -  0 ) )
1413oveq1d 6316 . . . . . . . . . 10  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) )  -  1 )  =  ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) )
1514oveq2d 6317 . . . . . . . . 9  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  - 
1 ) )  =  ( 0..^ ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) ) )
166oveq1d 6316 . . . . . . . . . . . . 13  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) )  -  1 )  =  ( ( ( # `  P
)  -  1 )  -  1 ) )
1716oveq2d 6317 . . . . . . . . . . . 12  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  - 
1 ) )  =  ( 0..^ ( ( ( # `  P
)  -  1 )  -  1 ) ) )
1817eleq2d 2492 . . . . . . . . . . 11  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) )  <->  i  e.  ( 0..^ ( ( (
# `  P )  -  1 )  - 
1 ) ) ) )
19 simpll 758 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  P  e. Word  V )
20 wrdlenge2n0 12695 . . . . . . . . . . . . . . . 16  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  P  =/=  (/) )
2120adantr 466 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  P  =/=  (/) )
22 nn0z 10960 . . . . . . . . . . . . . . . . . . 19  |-  ( (
# `  P )  e.  NN0  ->  ( # `  P
)  e.  ZZ )
23 peano2zm 10980 . . . . . . . . . . . . . . . . . . 19  |-  ( (
# `  P )  e.  ZZ  ->  ( ( # `
 P )  - 
1 )  e.  ZZ )
2422, 23syl 17 . . . . . . . . . . . . . . . . . 18  |-  ( (
# `  P )  e.  NN0  ->  ( ( # `
 P )  - 
1 )  e.  ZZ )
252, 24syl 17 . . . . . . . . . . . . . . . . 17  |-  ( P  e. Word  V  ->  (
( # `  P )  -  1 )  e.  ZZ )
2625adantr 466 . . . . . . . . . . . . . . . 16  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  e.  ZZ )
27 elfzom1elfzo 11981 . . . . . . . . . . . . . . . 16  |-  ( ( ( ( # `  P
)  -  1 )  e.  ZZ  /\  i  e.  ( 0..^ ( ( ( # `  P
)  -  1 )  -  1 ) ) )  ->  i  e.  ( 0..^ ( ( # `  P )  -  1 ) ) )
2826, 27sylan 473 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  i  e.  ( 0..^ ( (
# `  P )  -  1 ) ) )
29 swrdtrcfv 12787 . . . . . . . . . . . . . . 15  |-  ( ( P  e. Word  V  /\  P  =/=  (/)  /\  i  e.  ( 0..^ ( (
# `  P )  -  1 ) ) )  ->  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  i )  =  ( P `  i ) )
3019, 21, 28, 29syl3anc 1264 . . . . . . . . . . . . . 14  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  (
( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  i )  =  ( P `  i ) )
312adantr 466 . . . . . . . . . . . . . . . 16  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( # `
 P )  e. 
NN0 )
32 elfzom1elp1fzo 11980 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( # `  P
)  -  1 )  e.  ZZ  /\  i  e.  ( 0..^ ( ( ( # `  P
)  -  1 )  -  1 ) ) )  ->  ( i  +  1 )  e.  ( 0..^ ( (
# `  P )  -  1 ) ) )
3324, 32sylan 473 . . . . . . . . . . . . . . . 16  |-  ( ( ( # `  P
)  e.  NN0  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  (
i  +  1 )  e.  ( 0..^ ( ( # `  P
)  -  1 ) ) )
3431, 33sylan 473 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  (
i  +  1 )  e.  ( 0..^ ( ( # `  P
)  -  1 ) ) )
35 swrdtrcfv 12787 . . . . . . . . . . . . . . 15  |-  ( ( P  e. Word  V  /\  P  =/=  (/)  /\  ( i  +  1 )  e.  ( 0..^ ( (
# `  P )  -  1 ) ) )  ->  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) )  =  ( P `  ( i  +  1 ) ) )
3619, 21, 34, 35syl3anc 1264 . . . . . . . . . . . . . 14  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  (
( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) )  =  ( P `  ( i  +  1 ) ) )
3730, 36preq12d 4084 . . . . . . . . . . . . 13  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  =  { ( P `  i ) ,  ( P `  ( i  +  1 ) ) } )
3837eleq1d 2491 . . . . . . . . . . . 12  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  ( { ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) `  i ) ,  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E ) )
3938ex 435 . . . . . . . . . . 11  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) )  ->  ( {
( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E ) ) )
4018, 39sylbid 218 . . . . . . . . . 10  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) )  ->  ( { ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) `  i ) ,  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E ) ) )
4140imp 430 . . . . . . . . 9  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) )  -> 
( { ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  i ) ,  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) `  ( i  +  1 ) ) }  e.  ran  E  <->  { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E ) )
4215, 41raleqbidva 3041 . . . . . . . 8  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( A. i  e.  (
0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  - 
1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  <->  A. i  e.  ( 0..^ ( ( ( (
# `  P )  -  1 )  - 
0 )  -  1 ) ) { ( P `  i ) ,  ( P `  ( i  +  1 ) ) }  e.  ran  E ) )
43 swrdtrcfvl 12796 . . . . . . . . . 10  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  =  ( P `  (
( # `  P )  -  2 ) ) )
44 swrdtrcfv0 12788 . . . . . . . . . 10  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  0 )  =  ( P ` 
0 ) )
4543, 44preq12d 4084 . . . . . . . . 9  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  =  {
( P `  (
( # `  P )  -  2 ) ) ,  ( P ` 
0 ) } )
4645eleq1d 2491 . . . . . . . 8  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( { ( lastS  `  ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E  <->  { ( P `  ( ( # `  P
)  -  2 ) ) ,  ( P `
 0 ) }  e.  ran  E ) )
4742, 46anbi12d 715 . . . . . . 7  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( A. i  e.  ( 0..^ ( (
# `  ( P substr  <.
0 ,  ( (
# `  P )  -  1 ) >.
) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E )  <->  ( A. i  e.  ( 0..^ ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) ) { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E  /\  { ( P `  (
( # `  P )  -  2 ) ) ,  ( P ` 
0 ) }  e.  ran  E ) ) )
4847bicomd 204 . . . . . 6  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( A. i  e.  ( 0..^ ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) ) { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E  /\  { ( P `  (
( # `  P )  -  2 ) ) ,  ( P ` 
0 ) }  e.  ran  E )  <->  ( A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) )
49483adant1 1023 . . . . 5  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( ( A. i  e.  ( 0..^ ( ( ( (
# `  P )  -  1 )  - 
0 )  -  1 ) ) { ( P `  i ) ,  ( P `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( P `  ( (
# `  P )  -  2 ) ) ,  ( P ` 
0 ) }  e.  ran  E )  <->  ( A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) )
50 swrdcl 12765 . . . . . . 7  |-  ( P  e. Word  V  ->  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. )  e. Word  V )
51503ad2ant2 1027 . . . . . 6  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. )  e. Word  V
)
52513biant1d 1373 . . . . 5  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( ( A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E )  <->  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
)  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) )
5349, 52bitrd 256 . . . 4  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( ( A. i  e.  ( 0..^ ( ( ( (
# `  P )  -  1 )  - 
0 )  -  1 ) ) { ( P `  i ) ,  ( P `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( P `  ( (
# `  P )  -  2 ) ) ,  ( P ` 
0 ) }  e.  ran  E )  <->  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. )  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) )
5453anbi2d 708 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( ( ( lastS  `  P )  =  ( P `  0 )  /\  ( A. i  e.  ( 0..^ ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) ) { ( P `  i
) ,  ( P `
 ( i  +  1 ) ) }  e.  ran  E  /\  { ( P `  (
( # `  P )  -  2 ) ) ,  ( P ` 
0 ) }  e.  ran  E ) )  <->  ( ( lastS  `  P )  =  ( P `  0 )  /\  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
)  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) ) )
551, 54bitrd 256 . 2  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( E. f
( ( f  e. Word  dom  E  /\  P :
( 0 ... ( # `
 f ) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f ) ) ( E `  ( f `
 i ) )  =  { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) )  <->  ( ( lastS  `  P )  =  ( P `  0 )  /\  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
)  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) ) )
56 usgrav 25051 . . . . . 6  |-  ( V USGrph  E  ->  ( V  e. 
_V  /\  E  e.  _V ) )
57 isclwlk 25469 . . . . . . 7  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( f ( V ClWalks  E ) P  <->  ( (
f  e. Word  dom  E  /\  P : ( 0 ... ( # `  f
) ) --> V )  /\  ( A. i  e.  ( 0..^ ( # `  f ) ) ( E `  ( f `
 i ) )  =  { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) }  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) ) ) ) )
58 3an4anass 1229 . . . . . . 7  |-  ( ( ( f  e. Word  dom  E  /\  P : ( 0 ... ( # `  f ) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f ) ) ( E `  ( f `
 i ) )  =  { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) )  <->  ( (
f  e. Word  dom  E  /\  P : ( 0 ... ( # `  f
) ) --> V )  /\  ( A. i  e.  ( 0..^ ( # `  f ) ) ( E `  ( f `
 i ) )  =  { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) }  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) ) ) )
5957, 58syl6bbr 266 . . . . . 6  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( f ( V ClWalks  E ) P  <->  ( (
f  e. Word  dom  E  /\  P : ( 0 ... ( # `  f
) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f
) ) ( E `
 ( f `  i ) )  =  { ( P `  i ) ,  ( P `  ( i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) ) ) )
6056, 59syl 17 . . . . 5  |-  ( V USGrph  E  ->  ( f ( V ClWalks  E ) P  <->  ( (
f  e. Word  dom  E  /\  P : ( 0 ... ( # `  f
) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f
) ) ( E `
 ( f `  i ) )  =  { ( P `  i ) ,  ( P `  ( i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) ) ) )
6160adantr 466 . . . 4  |-  ( ( V USGrph  E  /\  P  e. Word  V )  ->  (
f ( V ClWalks  E
) P  <->  ( (
f  e. Word  dom  E  /\  P : ( 0 ... ( # `  f
) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f
) ) ( E `
 ( f `  i ) )  =  { ( P `  i ) ,  ( P `  ( i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) ) ) )
6261exbidv 1758 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V )  ->  ( E. f  f ( V ClWalks  E ) P  <->  E. f
( ( f  e. Word  dom  E  /\  P :
( 0 ... ( # `
 f ) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f ) ) ( E `  ( f `
 i ) )  =  { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) ) ) )
63623adant3 1025 . 2  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( E. f 
f ( V ClWalks  E
) P  <->  E. f
( ( f  e. Word  dom  E  /\  P :
( 0 ... ( # `
 f ) ) --> V  /\  A. i  e.  ( 0..^ ( # `  f ) ) ( E `  ( f `
 i ) )  =  { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) } )  /\  ( P `  0 )  =  ( P `  ( # `  f ) ) ) ) )
64 isclwwlk 25481 . . . . 5  |-  ( ( V  e.  _V  /\  E  e.  _V )  ->  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. )  e.  ( V ClWWalks  E )  <->  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. )  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) )
6556, 64syl 17 . . . 4  |-  ( V USGrph  E  ->  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
)  e.  ( V ClWWalks  E )  <->  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. )  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) )
66653ad2ant1 1026 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
)  e.  ( V ClWWalks  E )  <->  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. )  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) )
6766anbi2d 708 . 2  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( ( ( lastS  `  P )  =  ( P `  0 )  /\  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. )  e.  ( V ClWWalks  E ) )  <->  ( ( lastS  `  P )  =  ( P `  0 )  /\  ( ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
)  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) ) { ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  i
) ,  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) ) ,  ( ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) `  0
) }  e.  ran  E ) ) ) )
6855, 63, 673bitr4d 288 1  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( E. f 
f ( V ClWalks  E
) P  <->  ( ( lastS  `  P )  =  ( P `  0 )  /\  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. )  e.  ( V ClWWalks  E ) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 187    /\ wa 370    /\ w3a 982    = wceq 1437   E.wex 1659    e. wcel 1868    =/= wne 2618   A.wral 2775   _Vcvv 3081   (/)c0 3761   {cpr 3998   <.cop 4002   class class class wbr 4420   dom cdm 4849   ran crn 4850   -->wf 5593   ` cfv 5597  (class class class)co 6301   0cc0 9539   1c1 9540    + caddc 9542    <_ cle 9676    - cmin 9860   2c2 10659   NN0cn0 10869   ZZcz 10937   ...cfz 11784  ..^cfzo 11915   #chash 12514  Word cword 12648   lastS clsw 12649   substr csubstr 12652   USGrph cusg 25043   ClWalks cclwlk 25460   ClWWalks cclwwlk 25461
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1665  ax-4 1678  ax-5 1748  ax-6 1794  ax-7 1839  ax-8 1870  ax-9 1872  ax-10 1887  ax-11 1892  ax-12 1905  ax-13 2053  ax-ext 2400  ax-rep 4533  ax-sep 4543  ax-nul 4551  ax-pow 4598  ax-pr 4656  ax-un 6593  ax-cnex 9595  ax-resscn 9596  ax-1cn 9597  ax-icn 9598  ax-addcl 9599  ax-addrcl 9600  ax-mulcl 9601  ax-mulrcl 9602  ax-mulcom 9603  ax-addass 9604  ax-mulass 9605  ax-distr 9606  ax-i2m1 9607  ax-1ne0 9608  ax-1rid 9609  ax-rnegex 9610  ax-rrecex 9611  ax-cnre 9612  ax-pre-lttri 9613  ax-pre-lttrn 9614  ax-pre-ltadd 9615  ax-pre-mulgt0 9616
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3or 983  df-3an 984  df-tru 1440  df-ex 1660  df-nf 1664  df-sb 1787  df-eu 2269  df-mo 2270  df-clab 2408  df-cleq 2414  df-clel 2417  df-nfc 2572  df-ne 2620  df-nel 2621  df-ral 2780  df-rex 2781  df-reu 2782  df-rmo 2783  df-rab 2784  df-v 3083  df-sbc 3300  df-csb 3396  df-dif 3439  df-un 3441  df-in 3443  df-ss 3450  df-pss 3452  df-nul 3762  df-if 3910  df-pw 3981  df-sn 3997  df-pr 3999  df-tp 4001  df-op 4003  df-uni 4217  df-int 4253  df-iun 4298  df-br 4421  df-opab 4480  df-mpt 4481  df-tr 4516  df-eprel 4760  df-id 4764  df-po 4770  df-so 4771  df-fr 4808  df-we 4810  df-xp 4855  df-rel 4856  df-cnv 4857  df-co 4858  df-dm 4859  df-rn 4860  df-res 4861  df-ima 4862  df-pred 5395  df-ord 5441  df-on 5442  df-lim 5443  df-suc 5444  df-iota 5561  df-fun 5599  df-fn 5600  df-f 5601  df-f1 5602  df-fo 5603  df-f1o 5604  df-fv 5605  df-riota 6263  df-ov 6304  df-oprab 6305  df-mpt2 6306  df-om 6703  df-1st 6803  df-2nd 6804  df-wrecs 7032  df-recs 7094  df-rdg 7132  df-1o 7186  df-oadd 7190  df-er 7367  df-map 7478  df-pm 7479  df-en 7574  df-dom 7575  df-sdom 7576  df-fin 7577  df-card 8374  df-cda 8598  df-pnf 9677  df-mnf 9678  df-xr 9679  df-ltxr 9680  df-le 9681  df-sub 9862  df-neg 9863  df-nn 10610  df-2 10668  df-n0 10870  df-z 10938  df-uz 11160  df-fz 11785  df-fzo 11916  df-hash 12515  df-word 12656  df-lsw 12657  df-substr 12660  df-usgra 25046  df-wlk 25221  df-clwlk 25463  df-clwwlk 25464
This theorem is referenced by:  clwlkisclwwlk2  25503
  Copyright terms: Public domain W3C validator