Metamath Proof Explorer


Theorem numclwwlk3

Description: Statement 12 in Huneke p. 2: "Thus f(n) = (k - 1)f(n - 2) + k^(n-2)." - the number of the closed walks v(0) ... v(n-2) v(n-1) v(n) is the sum of the number of the closed walks v(0) ... v(n-2) v(n-1) v(n) with v(n-2) = v(n) (see numclwwlk1 ) and with v(n-2) =/= v(n) (see numclwwlk2 ): f(n) = kf(n-2) + k^(n-2) - f(n-2) = (k-1)f(n-2) + k^(n-2). (Contributed by Alexander van der Vekens, 26-Aug-2018) (Revised by AV, 6-Mar-2022)

Ref Expression
Hypothesis numclwwlk3.v V = Vtx G
Assertion numclwwlk3 G RegUSGraph K G FriendGraph V Fin X V N 3 X ClWWalksNOn G N = K 1 X ClWWalksNOn G N 2 + K N 2

Proof

Step Hyp Ref Expression
1 numclwwlk3.v V = Vtx G
2 simpl G RegUSGraph K G FriendGraph G RegUSGraph K
3 simp1 V Fin X V N 3 V Fin
4 1 finrusgrfusgr G RegUSGraph K V Fin G FinUSGraph
5 2 3 4 syl2an G RegUSGraph K G FriendGraph V Fin X V N 3 G FinUSGraph
6 simpr2 G RegUSGraph K G FriendGraph V Fin X V N 3 X V
7 uzuzle23 N 3 N 2
8 7 3ad2ant3 V Fin X V N 3 N 2
9 8 adantl G RegUSGraph K G FriendGraph V Fin X V N 3 N 2
10 eqid v V , n 2 w v ClWWalksNOn G n | w n 2 = v = v V , n 2 w v ClWWalksNOn G n | w n 2 = v
11 eqid v V , n 2 w v ClWWalksNOn G n | w n 2 v = v V , n 2 w v ClWWalksNOn G n | w n 2 v
12 10 11 numclwwlk3lem2 G FinUSGraph X V N 2 X ClWWalksNOn G N = X v V , n 2 w v ClWWalksNOn G n | w n 2 v N + X v V , n 2 w v ClWWalksNOn G n | w n 2 = v N
13 5 6 9 12 syl21anc G RegUSGraph K G FriendGraph V Fin X V N 3 X ClWWalksNOn G N = X v V , n 2 w v ClWWalksNOn G n | w n 2 v N + X v V , n 2 w v ClWWalksNOn G n | w n 2 = v N
14 eqid v V , n w n WWalksN G | w 0 = v lastS w v = v V , n w n WWalksN G | w 0 = v lastS w v
15 1 14 11 numclwwlk2 G RegUSGraph K G FriendGraph V Fin X V N 3 X v V , n 2 w v ClWWalksNOn G n | w n 2 v N = K N 2 X ClWWalksNOn G N 2
16 2 3 anim12ci G RegUSGraph K G FriendGraph V Fin X V N 3 V Fin G RegUSGraph K
17 3simpc V Fin X V N 3 X V N 3
18 17 adantl G RegUSGraph K G FriendGraph V Fin X V N 3 X V N 3
19 eqid X ClWWalksNOn G N 2 = X ClWWalksNOn G N 2
20 1 10 19 numclwwlk1 V Fin G RegUSGraph K X V N 3 X v V , n 2 w v ClWWalksNOn G n | w n 2 = v N = K X ClWWalksNOn G N 2
21 16 18 20 syl2anc G RegUSGraph K G FriendGraph V Fin X V N 3 X v V , n 2 w v ClWWalksNOn G n | w n 2 = v N = K X ClWWalksNOn G N 2
22 15 21 oveq12d G RegUSGraph K G FriendGraph V Fin X V N 3 X v V , n 2 w v ClWWalksNOn G n | w n 2 v N + X v V , n 2 w v ClWWalksNOn G n | w n 2 = v N = K N 2 - X ClWWalksNOn G N 2 + K X ClWWalksNOn G N 2
23 simpll G RegUSGraph K G FriendGraph V Fin X V N 3 G RegUSGraph K
24 ne0i X V V
25 24 3ad2ant2 V Fin X V N 3 V
26 25 adantl G RegUSGraph K G FriendGraph V Fin X V N 3 V
27 1 frusgrnn0 G FinUSGraph G RegUSGraph K V K 0
28 5 23 26 27 syl3anc G RegUSGraph K G FriendGraph V Fin X V N 3 K 0
29 28 nn0cnd G RegUSGraph K G FriendGraph V Fin X V N 3 K
30 uz3m2nn N 3 N 2
31 30 3anim3i V Fin X V N 3 V Fin X V N 2
32 31 adantl G RegUSGraph K G FriendGraph V Fin X V N 3 V Fin X V N 2
33 1 clwwlknonfin V Fin X ClWWalksNOn G N 2 Fin
34 33 3ad2ant1 V Fin X V N 2 X ClWWalksNOn G N 2 Fin
35 hashcl X ClWWalksNOn G N 2 Fin X ClWWalksNOn G N 2 0
36 35 nn0cnd X ClWWalksNOn G N 2 Fin X ClWWalksNOn G N 2
37 32 34 36 3syl G RegUSGraph K G FriendGraph V Fin X V N 3 X ClWWalksNOn G N 2
38 numclwwlk3lem1 K X ClWWalksNOn G N 2 N 2 K N 2 - X ClWWalksNOn G N 2 + K X ClWWalksNOn G N 2 = K 1 X ClWWalksNOn G N 2 + K N 2
39 29 37 9 38 syl3anc G RegUSGraph K G FriendGraph V Fin X V N 3 K N 2 - X ClWWalksNOn G N 2 + K X ClWWalksNOn G N 2 = K 1 X ClWWalksNOn G N 2 + K N 2
40 13 22 39 3eqtrd G RegUSGraph K G FriendGraph V Fin X V N 3 X ClWWalksNOn G N = K 1 X ClWWalksNOn G N 2 + K N 2