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

Theorem numclwlk1lem2foa 25296
Description: Going forth and back form the end of a (closed) walk. (Contributed by Alexander van der Vekens, 22-Sep-2018.)
Hypotheses
Ref Expression
numclwwlk.c  |-  C  =  ( n  e.  NN0  |->  ( ( V ClWWalksN  E ) `
 n ) )
numclwwlk.f  |-  F  =  ( v  e.  V ,  n  e.  NN0  |->  { w  e.  ( C `  n )  |  ( w ` 
0 )  =  v } )
numclwwlk.g  |-  G  =  ( v  e.  V ,  n  e.  ( ZZ>=
`  2 )  |->  { w  e.  ( C `
 n )  |  ( ( w ` 
0 )  =  v  /\  ( w `  ( n  -  2
) )  =  ( w `  0 ) ) } )
Assertion
Ref Expression
numclwlk1lem2foa  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( ( P  e.  ( X F ( N  - 
2 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  ( ( P ++  <" X "> ) ++  <" Q "> )  e.  ( X G N ) ) )
Distinct variable groups:    n, E    n, N    n, V    w, C    w, N    C, n, v, w    v, N    n, X, v, w    v, V   
w, E    w, V    w, F    w, P    w, Q
Allowed substitution hints:    P( v, n)    Q( v, n)    E( v)    F( v, n)    G( w, v, n)

Proof of Theorem numclwlk1lem2foa
Dummy variable  i is distinct from all other variables.
StepHypRef Expression
1 simp1 994 . . . . . . . . . 10  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  V USGrph  E )
2 uzuzle23 11122 . . . . . . . . . . . 12  |-  ( N  e.  ( ZZ>= `  3
)  ->  N  e.  ( ZZ>= `  2 )
)
3 uznn0sub 11113 . . . . . . . . . . . 12  |-  ( N  e.  ( ZZ>= `  2
)  ->  ( N  -  2 )  e. 
NN0 )
42, 3syl 16 . . . . . . . . . . 11  |-  ( N  e.  ( ZZ>= `  3
)  ->  ( N  -  2 )  e. 
NN0 )
543ad2ant3 1017 . . . . . . . . . 10  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( N  -  2 )  e. 
NN0 )
6 simp2 995 . . . . . . . . . 10  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  X  e.  V )
7 numclwwlk.c . . . . . . . . . . 11  |-  C  =  ( n  e.  NN0  |->  ( ( V ClWWalksN  E ) `
 n ) )
8 numclwwlk.f . . . . . . . . . . 11  |-  F  =  ( v  e.  V ,  n  e.  NN0  |->  { w  e.  ( C `  n )  |  ( w ` 
0 )  =  v } )
97, 8numclwwlkovfel2 25288 . . . . . . . . . 10  |-  ( ( V USGrph  E  /\  ( N  -  2 )  e.  NN0  /\  X  e.  V )  ->  ( P  e.  ( X F ( N  - 
2 ) )  <->  ( ( P  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  P
)  -  1 ) ) { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  P
) ,  ( P `
 0 ) }  e.  ran  E )  /\  ( # `  P
)  =  ( N  -  2 )  /\  ( P `  0 )  =  X ) ) )
101, 5, 6, 9syl3anc 1226 . . . . . . . . 9  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( P  e.  ( X F ( N  -  2 ) )  <->  ( ( P  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  P
)  -  1 ) ) { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  P
) ,  ( P `
 0 ) }  e.  ran  E )  /\  ( # `  P
)  =  ( N  -  2 )  /\  ( P `  0 )  =  X ) ) )
11 simplll 757 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
) )
12 simpr 459 . . . . . . . . . . . . . . . . . 18  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  Q  e.  ( <. V ,  E >. Neighbors  X ) )
1312adantr 463 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  Q  e.  ( <. V ,  E >. Neighbors  X ) )
14 simpr 459 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  P  e.  ( X F ( N  -  2 ) ) )
157, 8numclwwlkovf2ex 25291 . . . . . . . . . . . . . . . . 17  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  ( ( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N ) )
1611, 13, 14, 15syl3anc 1226 . . . . . . . . . . . . . . . 16  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  (
( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N ) )
17 nbgraisvtx 24636 . . . . . . . . . . . . . . . . . . . . . . . 24  |-  ( V USGrph  E  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  Q  e.  V ) )
18173ad2ant1 1015 . . . . . . . . . . . . . . . . . . . . . . 23  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  Q  e.  V ) )
1918adantr 463 . . . . . . . . . . . . . . . . . . . . . 22  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  Q  e.  V
) )
20 simplll 757 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  P  e. Word  V )
21 s1cl 12606 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30  |-  ( X  e.  V  ->  <" X ">  e. Word  V )
22213ad2ant2 1016 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  <" X ">  e. Word  V )
2322adantl 464 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  ->  <" X ">  e. Word  V )
2423adantr 463 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  <" X ">  e. Word  V )
25 s1cl 12606 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( Q  e.  V  ->  <" Q ">  e. Word  V )
2625adantl 464 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  <" Q ">  e. Word  V )
27 ccatass 12597 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( ( P  e. Word  V  /\  <" X ">  e. Word  V  /\  <" Q ">  e. Word  V )  ->  ( ( P ++  <" X "> ) ++  <" Q "> )  =  ( P ++  ( <" X "> ++  <" Q "> ) ) )
2827oveq1d 6285 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( P  e. Word  V  /\  <" X ">  e. Word  V  /\  <" Q ">  e. Word  V )  ->  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  =  ( ( P ++  ( <" X "> ++  <" Q "> ) ) substr  <. 0 ,  ( N  -  2 ) >. ) )
2920, 24, 26, 28syl3anc 1226 . . . . . . . . . . . . . . . . . . . . . . . . . 26  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  (
( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 )
>. )  =  (
( P ++  ( <" X "> ++  <" Q "> ) ) substr  <. 0 ,  ( N  -  2 ) >. ) )
30 ccatcl 12585 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( (
<" X ">  e. Word  V  /\  <" Q ">  e. Word  V )  ->  ( <" X "> ++  <" Q "> )  e. Word  V )
3123, 25, 30syl2an 475 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  ( <" X "> ++  <" Q "> )  e. Word  V )
32 simpr 459 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30  |-  ( ( P  e. Word  V  /\  ( # `  P )  =  ( N  - 
2 ) )  -> 
( # `  P )  =  ( N  - 
2 ) )
3332eqcomd 2462 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29  |-  ( ( P  e. Word  V  /\  ( # `  P )  =  ( N  - 
2 ) )  -> 
( N  -  2 )  =  ( # `  P ) )
3433adantr 463 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  ->  ( N  -  2 )  =  ( # `  P
) )
3534adantr 463 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  ( N  -  2 )  =  ( # `  P
) )
36 swrdccatid 12716 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( P  e. Word  V  /\  ( <" X "> ++  <" Q "> )  e. Word  V  /\  ( N  -  2
)  =  ( # `  P ) )  -> 
( ( P ++  ( <" X "> ++  <" Q "> ) ) substr  <. 0 ,  ( N  -  2 ) >. )  =  P )
3720, 31, 35, 36syl3anc 1226 . . . . . . . . . . . . . . . . . . . . . . . . . 26  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  (
( P ++  ( <" X "> ++  <" Q "> ) ) substr  <. 0 ,  ( N  -  2 ) >. )  =  P )
3829, 37eqtr2d 2496 . . . . . . . . . . . . . . . . . . . . . . . . 25  |-  ( ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) ) )  /\  Q  e.  V )  ->  P  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. ) )
3938exp31 602 . . . . . . . . . . . . . . . . . . . . . . . 24  |-  ( ( P  e. Word  V  /\  ( # `  P )  =  ( N  - 
2 ) )  -> 
( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  ->  ( Q  e.  V  ->  P  =  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. ) ) ) )
4039adantr 463 . . . . . . . . . . . . . . . . . . . . . . 23  |-  ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X )  ->  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( Q  e.  V  ->  P  =  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. ) ) ) )
4140impcom 428 . . . . . . . . . . . . . . . . . . . . . 22  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  V  ->  P  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. ) ) )
4219, 41syld 44 . . . . . . . . . . . . . . . . . . . . 21  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  P  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 )
>. ) ) )
4342imp 427 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  P  =  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. ) )
4443eleq1d 2523 . . . . . . . . . . . . . . . . . . 19  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  ( P  e.  ( X F ( N  -  2 ) )  <->  ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) ) ) )
4544biimpd 207 . . . . . . . . . . . . . . . . . 18  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  ( P  e.  ( X F ( N  -  2 ) )  ->  ( (
( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) ) ) )
4645imp 427 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  (
( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 )
>. )  e.  ( X F ( N  - 
2 ) ) )
47 simplrl 759 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) ) )
486adantr 463 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  X  e.  V )
4948anim1i 566 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  ( X  e.  V  /\  Q  e.  V
) )
5047, 49jca 530 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( X  e.  V  /\  Q  e.  V ) ) )
51 ccatw2s1p2 12633 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( X  e.  V  /\  Q  e.  V ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( ( N  -  2 )  +  1 ) )  =  Q )
5250, 51syl 16 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( ( N  -  2 )  +  1 ) )  =  Q )
53 eluzelcn 11093 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33  |-  ( N  e.  ( ZZ>= `  3
)  ->  N  e.  CC )
54 2cnd 10604 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33  |-  ( N  e.  ( ZZ>= `  3
)  ->  2  e.  CC )
55 1cnd 9601 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33  |-  ( N  e.  ( ZZ>= `  3
)  ->  1  e.  CC )
56 subsub 9840 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34  |-  ( ( N  e.  CC  /\  2  e.  CC  /\  1  e.  CC )  ->  ( N  -  ( 2  -  1 ) )  =  ( ( N  -  2 )  +  1 ) )
5756eqcomd 2462 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33  |-  ( ( N  e.  CC  /\  2  e.  CC  /\  1  e.  CC )  ->  (
( N  -  2 )  +  1 )  =  ( N  -  ( 2  -  1 ) ) )
5853, 54, 55, 57syl3anc 1226 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32  |-  ( N  e.  ( ZZ>= `  3
)  ->  ( ( N  -  2 )  +  1 )  =  ( N  -  (
2  -  1 ) ) )
59 2m1e1 10646 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34  |-  ( 2  -  1 )  =  1
6059a1i 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33  |-  ( N  e.  ( ZZ>= `  3
)  ->  ( 2  -  1 )  =  1 )
6160oveq2d 6286 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32  |-  ( N  e.  ( ZZ>= `  3
)  ->  ( N  -  ( 2  -  1 ) )  =  ( N  -  1 ) )
6258, 61eqtrd 2495 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31  |-  ( N  e.  ( ZZ>= `  3
)  ->  ( ( N  -  2 )  +  1 )  =  ( N  -  1 ) )
63623ad2ant3 1017 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( ( N  -  2 )  +  1 )  =  ( N  -  1 ) )
6463adantr 463 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  (
( N  -  2 )  +  1 )  =  ( N  - 
1 ) )
6564adantr 463 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  ( ( N  - 
2 )  +  1 )  =  ( N  -  1 ) )
6665fveq2d 5852 . . . . . . . . . . . . . . . . . . . . . . . . . . 27  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( ( N  -  2 )  +  1 ) )  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) ) )
6752, 66eqtr3d 2497 . . . . . . . . . . . . . . . . . . . . . . . . . 26  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  Q  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) ) )
6867ex 432 . . . . . . . . . . . . . . . . . . . . . . . . 25  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  V  ->  Q  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) ) ) )
6919, 68syld 44 . . . . . . . . . . . . . . . . . . . . . . . 24  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  Q  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) ) ) )
7069impcom 428 . . . . . . . . . . . . . . . . . . . . . . 23  |-  ( ( Q  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) ) )  ->  Q  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) ) )
7170eleq1d 2523 . . . . . . . . . . . . . . . . . . . . . 22  |-  ( ( Q  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  <->  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
) ) )
7271biimpd 207 . . . . . . . . . . . . . . . . . . . . 21  |-  ( ( Q  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  (
( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X ) ) )
7372ex 432 . . . . . . . . . . . . . . . . . . . 20  |-  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  (
( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  -> 
( Q  e.  (
<. V ,  E >. Neighbors  X
)  ->  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
) ) ) )
7473pm2.43a 49 . . . . . . . . . . . . . . . . . . 19  |-  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  (
( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X ) ) )
7574impcom 428 . . . . . . . . . . . . . . . . . 18  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
) )
7675adantr 463 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  (
( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X ) )
77 ccatw2s1p1 12632 . . . . . . . . . . . . . . . . . . . . . 22  |-  ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( X  e.  V  /\  Q  e.  V ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X )
7850, 77syl 16 . . . . . . . . . . . . . . . . . . . . 21  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  V )  ->  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X )
7978ex 432 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  V  ->  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) )
8019, 79syld 44 . . . . . . . . . . . . . . . . . . 19  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) )
8180imp 427 . . . . . . . . . . . . . . . . . 18  |-  ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X )
8281adantr 463 . . . . . . . . . . . . . . . . 17  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  (
( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X )
8346, 76, 823jca 1174 . . . . . . . . . . . . . . . 16  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  (
( ( ( P ++ 
<" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) )
8416, 83jca 530 . . . . . . . . . . . . . . 15  |-  ( ( ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  /\  ( ( P  e. Word  V  /\  ( # `
 P )  =  ( N  -  2 ) )  /\  ( P `  0 )  =  X ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  /\  P  e.  ( X F ( N  -  2 ) ) )  ->  (
( ( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  (
( ( ( P ++ 
<" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) )
8584exp31 602 . . . . . . . . . . . . . 14  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( P  e.  ( X F ( N  -  2 ) )  ->  ( (
( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) )
8685expcom 433 . . . . . . . . . . . . 13  |-  ( ( ( P  e. Word  V  /\  ( # `  P
)  =  ( N  -  2 ) )  /\  ( P ` 
0 )  =  X )  ->  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( P  e.  ( X F ( N  - 
2 ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) ) )
8786exp31 602 . . . . . . . . . . . 12  |-  ( P  e. Word  V  ->  (
( # `  P )  =  ( N  - 
2 )  ->  (
( P `  0
)  =  X  -> 
( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( P  e.  ( X F ( N  - 
2 ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) ) ) ) )
88873ad2ant1 1015 . . . . . . . . . . 11  |-  ( ( P  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  P
)  -  1 ) ) { ( P `
 i ) ,  ( P `  (
i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  P
) ,  ( P `
 0 ) }  e.  ran  E )  ->  ( ( # `  P )  =  ( N  -  2 )  ->  ( ( P `
 0 )  =  X  ->  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( P  e.  ( X F ( N  - 
2 ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) ) ) ) )
89883imp 1188 . . . . . . . . . 10  |-  ( ( ( P  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  P )  -  1 ) ) { ( P `  i ) ,  ( P `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  P ) ,  ( P `  0 ) }  e.  ran  E
)  /\  ( # `  P
)  =  ( N  -  2 )  /\  ( P `  0 )  =  X )  -> 
( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( P  e.  ( X F ( N  - 
2 ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) ) )
9089com12 31 . . . . . . . . 9  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( (
( P  e. Word  V  /\  A. i  e.  ( 0..^ ( ( # `  P )  -  1 ) ) { ( P `  i ) ,  ( P `  ( i  +  1 ) ) }  e.  ran  E  /\  { ( lastS  `  P ) ,  ( P `  0 ) }  e.  ran  E
)  /\  ( # `  P
)  =  ( N  -  2 )  /\  ( P `  0 )  =  X )  -> 
( Q  e.  (
<. V ,  E >. Neighbors  X
)  ->  ( P  e.  ( X F ( N  -  2 ) )  ->  ( (
( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) ) )
9110, 90sylbid 215 . . . . . . . 8  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( P  e.  ( X F ( N  -  2 ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( P  e.  ( X F ( N  - 
2 ) )  -> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) ) )
9291com14 88 . . . . . . 7  |-  ( P  e.  ( X F ( N  -  2 ) )  ->  ( P  e.  ( X F ( N  - 
2 ) )  -> 
( Q  e.  (
<. V ,  E >. Neighbors  X
)  ->  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( (
( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) ) )
9392pm2.43i 47 . . . . . 6  |-  ( P  e.  ( X F ( N  -  2 ) )  ->  ( Q  e.  ( <. V ,  E >. Neighbors  X )  ->  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>=
`  3 ) )  ->  ( ( ( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) ) )
9493imp 427 . . . . 5  |-  ( ( P  e.  ( X F ( N  - 
2 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( (
( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) ) )
9594impcom 428 . . . 4  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( P  e.  ( X F ( N  - 
2 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) ) )  ->  (
( ( P ++  <" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  (
( ( ( P ++ 
<" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) )
96 oveq1 6277 . . . . . . 7  |-  ( w  =  ( ( P ++ 
<" X "> ) ++  <" Q "> )  ->  ( w substr  <. 0 ,  ( N  -  2 ) >.
)  =  ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. ) )
9796eleq1d 2523 . . . . . 6  |-  ( w  =  ( ( P ++ 
<" X "> ) ++  <" Q "> )  ->  ( ( w substr  <. 0 ,  ( N  -  2 )
>. )  e.  ( X F ( N  - 
2 ) )  <->  ( (
( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) ) ) )
98 fveq1 5847 . . . . . . 7  |-  ( w  =  ( ( P ++ 
<" X "> ) ++  <" Q "> )  ->  ( w `
 ( N  - 
1 ) )  =  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( N  -  1 ) ) )
9998eleq1d 2523 . . . . . 6  |-  ( w  =  ( ( P ++ 
<" X "> ) ++  <" Q "> )  ->  ( ( w `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X )  <->  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
) ) )
100 fveq1 5847 . . . . . . 7  |-  ( w  =  ( ( P ++ 
<" X "> ) ++  <" Q "> )  ->  ( w `
 ( N  - 
2 ) )  =  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( N  -  2 ) ) )
101100eqeq1d 2456 . . . . . 6  |-  ( w  =  ( ( P ++ 
<" X "> ) ++  <" Q "> )  ->  ( ( w `  ( N  -  2 ) )  =  X  <->  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) )
10297, 99, 1013anbi123d 1297 . . . . 5  |-  ( w  =  ( ( P ++ 
<" X "> ) ++  <" Q "> )  ->  ( ( ( w substr  <. 0 ,  ( N  - 
2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( w `
 ( N  - 
1 ) )  e.  ( <. V ,  E >. Neighbors  X )  /\  (
w `  ( N  -  2 ) )  =  X )  <->  ( (
( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 )
>. )  e.  ( X F ( N  - 
2 ) )  /\  ( ( ( P ++ 
<" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X )  /\  (
( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) )
103102elrab 3254 . . . 4  |-  ( ( ( P ++  <" X "> ) ++  <" Q "> )  e.  {
w  e.  ( C `
 N )  |  ( ( w substr  <. 0 ,  ( N  - 
2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( w `
 ( N  - 
1 ) )  e.  ( <. V ,  E >. Neighbors  X )  /\  (
w `  ( N  -  2 ) )  =  X ) }  <-> 
( ( ( P ++ 
<" X "> ) ++  <" Q "> )  e.  ( C `  N )  /\  ( ( ( ( P ++  <" X "> ) ++  <" Q "> ) substr  <. 0 ,  ( N  -  2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( ( ( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( (
( P ++  <" X "> ) ++  <" Q "> ) `  ( N  -  2 ) )  =  X ) ) )
10495, 103sylibr 212 . . 3  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( P  e.  ( X F ( N  - 
2 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) ) )  ->  (
( P ++  <" X "> ) ++  <" Q "> )  e.  {
w  e.  ( C `
 N )  |  ( ( w substr  <. 0 ,  ( N  - 
2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( w `
 ( N  - 
1 ) )  e.  ( <. V ,  E >. Neighbors  X )  /\  (
w `  ( N  -  2 ) )  =  X ) } )
105 numclwwlk.g . . . . 5  |-  G  =  ( v  e.  V ,  n  e.  ( ZZ>=
`  2 )  |->  { w  e.  ( C `
 n )  |  ( ( w ` 
0 )  =  v  /\  ( w `  ( n  -  2
) )  =  ( w `  0 ) ) } )
1067, 8, 105extwwlkfab 25295 . . . 4  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( X G N )  =  {
w  e.  ( C `
 N )  |  ( ( w substr  <. 0 ,  ( N  - 
2 ) >. )  e.  ( X F ( N  -  2 ) )  /\  ( w `
 ( N  - 
1 ) )  e.  ( <. V ,  E >. Neighbors  X )  /\  (
w `  ( N  -  2 ) )  =  X ) } )
107106adantr 463 . . 3  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( P  e.  ( X F ( N  - 
2 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) ) )  ->  ( X G N )  =  { w  e.  ( C `  N )  |  ( ( w substr  <. 0 ,  ( N  -  2 ) >.
)  e.  ( X F ( N  - 
2 ) )  /\  ( w `  ( N  -  1 ) )  e.  ( <. V ,  E >. Neighbors  X
)  /\  ( w `  ( N  -  2 ) )  =  X ) } )
108104, 107eleqtrrd 2545 . 2  |-  ( ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= ` 
3 ) )  /\  ( P  e.  ( X F ( N  - 
2 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) ) )  ->  (
( P ++  <" X "> ) ++  <" Q "> )  e.  ( X G N ) )
109108ex 432 1  |-  ( ( V USGrph  E  /\  X  e.  V  /\  N  e.  ( ZZ>= `  3 )
)  ->  ( ( P  e.  ( X F ( N  - 
2 ) )  /\  Q  e.  ( <. V ,  E >. Neighbors  X ) )  ->  ( ( P ++  <" X "> ) ++  <" Q "> )  e.  ( X G N ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 367    /\ w3a 971    = wceq 1398    e. wcel 1823   A.wral 2804   {crab 2808   {cpr 4018   <.cop 4022   class class class wbr 4439    |-> cmpt 4497   ran crn 4989   ` cfv 5570  (class class class)co 6270    |-> cmpt2 6272   CCcc 9479   0cc0 9481   1c1 9482    + caddc 9484    - cmin 9796   2c2 10581   3c3 10582   NN0cn0 10791   ZZ>=cuz 11082  ..^cfzo 11799   #chash 12390  Word cword 12521   lastS clsw 12522   ++ cconcat 12523   <"cs1 12524   substr csubstr 12525   USGrph cusg 24535   Neighbors cnbgra 24622   ClWWalksN cclwwlkn 24954
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1623  ax-4 1636  ax-5 1709  ax-6 1752  ax-7 1795  ax-8 1825  ax-9 1827  ax-10 1842  ax-11 1847  ax-12 1859  ax-13 2004  ax-ext 2432  ax-rep 4550  ax-sep 4560  ax-nul 4568  ax-pow 4615  ax-pr 4676  ax-un 6565  ax-cnex 9537  ax-resscn 9538  ax-1cn 9539  ax-icn 9540  ax-addcl 9541  ax-addrcl 9542  ax-mulcl 9543  ax-mulrcl 9544  ax-mulcom 9545  ax-addass 9546  ax-mulass 9547  ax-distr 9548  ax-i2m1 9549  ax-1ne0 9550  ax-1rid 9551  ax-rnegex 9552  ax-rrecex 9553  ax-cnre 9554  ax-pre-lttri 9555  ax-pre-lttrn 9556  ax-pre-ltadd 9557  ax-pre-mulgt0 9558
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 972  df-3an 973  df-tru 1401  df-ex 1618  df-nf 1622  df-sb 1745  df-eu 2288  df-mo 2289  df-clab 2440  df-cleq 2446  df-clel 2449  df-nfc 2604  df-ne 2651  df-nel 2652  df-ral 2809  df-rex 2810  df-reu 2811  df-rmo 2812  df-rab 2813  df-v 3108  df-sbc 3325  df-csb 3421  df-dif 3464  df-un 3466  df-in 3468  df-ss 3475  df-pss 3477  df-nul 3784  df-if 3930  df-pw 4001  df-sn 4017  df-pr 4019  df-tp 4021  df-op 4023  df-uni 4236  df-int 4272  df-iun 4317  df-br 4440  df-opab 4498  df-mpt 4499  df-tr 4533  df-eprel 4780  df-id 4784  df-po 4789  df-so 4790  df-fr 4827  df-we 4829  df-ord 4870  df-on 4871  df-lim 4872  df-suc 4873  df-xp 4994  df-rel 4995  df-cnv 4996  df-co 4997  df-dm 4998  df-rn 4999  df-res 5000  df-ima 5001  df-iota 5534  df-fun 5572  df-fn 5573  df-f 5574  df-f1 5575  df-fo 5576  df-f1o 5577  df-fv 5578  df-riota 6232  df-ov 6273  df-oprab 6274  df-mpt2 6275  df-om 6674  df-1st 6773  df-2nd 6774  df-recs 7034  df-rdg 7068  df-1o 7122  df-oadd 7126  df-er 7303  df-map 7414  df-pm 7415  df-en 7510  df-dom 7511  df-sdom 7512  df-fin 7513  df-card 8311  df-cda 8539  df-pnf 9619  df-mnf 9620  df-xr 9621  df-ltxr 9622  df-le 9623  df-sub 9798  df-neg 9799  df-nn 10532  df-2 10590  df-3 10591  df-n0 10792  df-z 10861  df-uz 11083  df-rp 11222  df-fz 11676  df-fzo 11800  df-hash 12391  df-word 12529  df-lsw 12530  df-concat 12531  df-s1 12532  df-substr 12533  df-usgra 24538  df-nbgra 24625  df-clwwlk 24956  df-clwwlkn 24957
This theorem is referenced by:  numclwlk1lem2fo  25300
  Copyright terms: Public domain W3C validator