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

Theorem clwlkisclwwlk 24915
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 24914 . . 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 12568 . . . . . . . . . . . . . 14  |-  ( P  e. Word  V  ->  ( # `
 P )  e. 
NN0 )
3 ige2m1fz 11793 . . . . . . . . . . . . . 14  |-  ( ( ( # `  P
)  e.  NN0  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  e.  ( 0 ... ( # `
 P ) ) )
42, 3sylan 471 . . . . . . . . . . . . 13  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  e.  ( 0 ... ( # `
 P ) ) )
5 swrd0len 12657 . . . . . . . . . . . . 13  |-  ( ( P  e. Word  V  /\  ( ( # `  P
)  -  1 )  e.  ( 0 ... ( # `  P
) ) )  -> 
( # `  ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) )  =  ( ( # `  P
)  -  1 ) )
64, 5syldan 470 . . . . . . . . . . . 12  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( # `
 ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  =  ( ( # `  P
)  -  1 ) )
72nn0cnd 10875 . . . . . . . . . . . . . . . 16  |-  ( P  e. Word  V  ->  ( # `
 P )  e.  CC )
8 1cnd 9629 . . . . . . . . . . . . . . . 16  |-  ( P  e. Word  V  ->  1  e.  CC )
97, 8subcld 9950 . . . . . . . . . . . . . . 15  |-  ( P  e. Word  V  ->  (
( # `  P )  -  1 )  e.  CC )
109subid1d 9939 . . . . . . . . . . . . . 14  |-  ( P  e. Word  V  ->  (
( ( # `  P
)  -  1 )  -  0 )  =  ( ( # `  P
)  -  1 ) )
1110eqcomd 2465 . . . . . . . . . . . . 13  |-  ( P  e. Word  V  ->  (
( # `  P )  -  1 )  =  ( ( ( # `  P )  -  1 )  -  0 ) )
1211adantr 465 . . . . . . . . . . . 12  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  =  ( ( ( # `  P )  -  1 )  -  0 ) )
136, 12eqtrd 2498 . . . . . . . . . . 11  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( # `
 ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  =  ( ( ( # `  P )  -  1 )  -  0 ) )
1413oveq1d 6311 . . . . . . . . . 10  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) )  -  1 )  =  ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) )
1514oveq2d 6312 . . . . . . . . 9  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  - 
1 ) )  =  ( 0..^ ( ( ( ( # `  P
)  -  1 )  -  0 )  - 
1 ) ) )
166oveq1d 6311 . . . . . . . . . . . . 13  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  ( P substr  <. 0 ,  ( (
# `  P )  -  1 ) >.
) )  -  1 )  =  ( ( ( # `  P
)  -  1 )  -  1 ) )
1716oveq2d 6312 . . . . . . . . . . . 12  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  - 
1 ) )  =  ( 0..^ ( ( ( # `  P
)  -  1 )  -  1 ) ) )
1817eleq2d 2527 . . . . . . . . . . 11  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
i  e.  ( 0..^ ( ( # `  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) )  -  1 ) )  <->  i  e.  ( 0..^ ( ( (
# `  P )  -  1 )  - 
1 ) ) ) )
19 simpll 753 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  P  e. Word  V )
20 wrdlenge2n0 12584 . . . . . . . . . . . . . . . 16  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  P  =/=  (/) )
2120adantr 465 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  P  =/=  (/) )
22 nn0z 10908 . . . . . . . . . . . . . . . . . . 19  |-  ( (
# `  P )  e.  NN0  ->  ( # `  P
)  e.  ZZ )
23 peano2zm 10928 . . . . . . . . . . . . . . . . . . 19  |-  ( (
# `  P )  e.  ZZ  ->  ( ( # `
 P )  - 
1 )  e.  ZZ )
2422, 23syl 16 . . . . . . . . . . . . . . . . . 18  |-  ( (
# `  P )  e.  NN0  ->  ( ( # `
 P )  - 
1 )  e.  ZZ )
252, 24syl 16 . . . . . . . . . . . . . . . . 17  |-  ( P  e. Word  V  ->  (
( # `  P )  -  1 )  e.  ZZ )
2625adantr 465 . . . . . . . . . . . . . . . 16  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( # `  P )  -  1 )  e.  ZZ )
27 elfzom1elfzo 11886 . . . . . . . . . . . . . . . 16  |-  ( ( ( ( # `  P
)  -  1 )  e.  ZZ  /\  i  e.  ( 0..^ ( ( ( # `  P
)  -  1 )  -  1 ) ) )  ->  i  e.  ( 0..^ ( ( # `  P )  -  1 ) ) )
2826, 27sylan 471 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  i  e.  ( 0..^ ( (
# `  P )  -  1 ) ) )
29 swrdtrcfv 12676 . . . . . . . . . . . . . . 15  |-  ( ( P  e. Word  V  /\  P  =/=  (/)  /\  i  e.  ( 0..^ ( (
# `  P )  -  1 ) ) )  ->  ( ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  i )  =  ( P `  i ) )
3019, 21, 28, 29syl3anc 1228 . . . . . . . . . . . . . 14  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  (
( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  i )  =  ( P `  i ) )
312adantr 465 . . . . . . . . . . . . . . . 16  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( # `
 P )  e. 
NN0 )
32 elfzom1elp1fzo 11885 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( # `  P
)  -  1 )  e.  ZZ  /\  i  e.  ( 0..^ ( ( ( # `  P
)  -  1 )  -  1 ) ) )  ->  ( i  +  1 )  e.  ( 0..^ ( (
# `  P )  -  1 ) ) )
3324, 32sylan 471 . . . . . . . . . . . . . . . 16  |-  ( ( ( # `  P
)  e.  NN0  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  (
i  +  1 )  e.  ( 0..^ ( ( # `  P
)  -  1 ) ) )
3431, 33sylan 471 . . . . . . . . . . . . . . 15  |-  ( ( ( P  e. Word  V  /\  2  <_  ( # `  P ) )  /\  i  e.  ( 0..^ ( ( ( # `  P )  -  1 )  -  1 ) ) )  ->  (
i  +  1 )  e.  ( 0..^ ( ( # `  P
)  -  1 ) ) )
35 swrdtrcfv 12676 . . . . . . . . . . . . . . 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 1228 . . . . . . . . . . . . . 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 4119 . . . . . . . . . . . . 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 2526 . . . . . . . . . . . 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 434 . . . . . . . . . . 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 215 . . . . . . . . . 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 429 . . . . . . . . 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 3070 . . . . . . . 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 12686 . . . . . . . . . 10  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  ( lastS  `  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. ) )  =  ( P `  (
( # `  P )  -  2 ) ) )
44 swrdtrcfv0 12677 . . . . . . . . . 10  |-  ( ( P  e. Word  V  /\  2  <_  ( # `  P
) )  ->  (
( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. ) `  0 )  =  ( P ` 
0 ) )
4543, 44preq12d 4119 . . . . . . . . 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 2526 . . . . . . . 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 710 . . . . . . 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 201 . . . . . 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 1014 . . . . 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 12654 . . . . . . 7  |-  ( P  e. Word  V  ->  ( P substr  <. 0 ,  ( ( # `  P
)  -  1 )
>. )  e. Word  V )
51503ad2ant2 1018 . . . . . 6  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  2  <_  ( # `
 P ) )  ->  ( P substr  <. 0 ,  ( ( # `  P )  -  1 ) >. )  e. Word  V
)
52513biant1d 1337 . . . . 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 253 . . . 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 703 . . 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 253 . 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 24464 . . . . . 6  |-  ( V USGrph  E  ->  ( V  e. 
_V  /\  E  e.  _V ) )
57 isclwlk 24882 . . . . . . 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 1219 . . . . . . 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 263 . . . . . 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 16 . . . . 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 465 . . . 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 1715 . . 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 1016 . 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 24894 . . . . 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 16 . . . 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 1017 . . 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 703 . 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 285 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 184    /\ wa 369    /\ w3a 973    = wceq 1395   E.wex 1613    e. wcel 1819    =/= wne 2652   A.wral 2807   _Vcvv 3109   (/)c0 3793   {cpr 4034   <.cop 4038   class class class wbr 4456   dom cdm 5008   ran crn 5009   -->wf 5590   ` cfv 5594  (class class class)co 6296   0cc0 9509   1c1 9510    + caddc 9512    <_ cle 9646    - cmin 9824   2c2 10606   NN0cn0 10816   ZZcz 10885   ...cfz 11697  ..^cfzo 11820   #chash 12407  Word cword 12537   lastS clsw 12538   substr csubstr 12541   USGrph cusg 24456   ClWalks cclwlk 24873   ClWWalks cclwwlk 24874
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 11821  df-hash 12408  df-word 12545  df-lsw 12546  df-substr 12549  df-usgra 24459  df-wlk 24634  df-clwlk 24876  df-clwwlk 24877
This theorem is referenced by:  clwlkisclwwlk2  24916
  Copyright terms: Public domain W3C validator