Metamath Proof Explorer


Theorem numclwwlk7

Description: Statement 14 in Huneke p. 2: "The total number of closed walks of length p [in a friendship graph] is (k(k-1)+1)f(p)=1 (mod p)", since the number of vertices in a friendship graph is (k(k-1)+1), see frrusgrord0 or frrusgrord , and p divides (k-1), i.e., (k-1) mod p = 0 => k(k-1) mod p = 0 => k(k-1)+1 mod p = 1. Since the null graph is a friendship graph, see frgr0 , as well as k-regular (for any k), see 0vtxrgr , but has no closed walk, see 0clwlk0 , this theorem would be false for a null graph: ( ( #( P ClWWalksN G ) ) mod P ) = 0 =/= 1 , so this case must be excluded (by assuming V =/= (/) ). (Contributed by Alexander van der Vekens, 1-Sep-2018) (Revised by AV, 3-Jun-2021)

Ref Expression
Hypothesis numclwwlk6.v V = Vtx G
Assertion numclwwlk7 G RegUSGraph K G FriendGraph V V Fin P P K 1 P ClWWalksN G mod P = 1

Proof

Step Hyp Ref Expression
1 numclwwlk6.v V = Vtx G
2 simpll G RegUSGraph K G FriendGraph V V Fin G RegUSGraph K
3 simplr G RegUSGraph K G FriendGraph V V Fin G FriendGraph
4 simprr G RegUSGraph K G FriendGraph V V Fin V Fin
5 2 3 4 3jca G RegUSGraph K G FriendGraph V V Fin G RegUSGraph K G FriendGraph V Fin
6 1 numclwwlk6 G RegUSGraph K G FriendGraph V Fin P P K 1 P ClWWalksN G mod P = V mod P
7 5 6 stoic3 G RegUSGraph K G FriendGraph V V Fin P P K 1 P ClWWalksN G mod P = V mod P
8 simp2 G RegUSGraph K G FriendGraph V V Fin P P K 1 V V Fin
9 8 ancomd G RegUSGraph K G FriendGraph V V Fin P P K 1 V Fin V
10 simp1 G RegUSGraph K G FriendGraph V V Fin P P K 1 G RegUSGraph K G FriendGraph
11 10 ancomd G RegUSGraph K G FriendGraph V V Fin P P K 1 G FriendGraph G RegUSGraph K
12 1 frrusgrord V Fin V G FriendGraph G RegUSGraph K V = K K 1 + 1
13 9 11 12 sylc G RegUSGraph K G FriendGraph V V Fin P P K 1 V = K K 1 + 1
14 13 oveq1d G RegUSGraph K G FriendGraph V V Fin P P K 1 V mod P = K K 1 + 1 mod P
15 1 numclwwlk7lem G RegUSGraph K G FriendGraph V V Fin K 0
16 nn0cn K 0 K
17 peano2cnm K K 1
18 16 17 syl K 0 K 1
19 16 18 mulcomd K 0 K K 1 = K 1 K
20 19 oveq1d K 0 K K 1 mod P = K 1 K mod P
21 20 adantr K 0 P P K 1 K K 1 mod P = K 1 K mod P
22 prmnn P P
23 22 ad2antrl K 0 P P K 1 P
24 nn0z K 0 K
25 peano2zm K K 1
26 24 25 syl K 0 K 1
27 26 adantr K 0 P P K 1 K 1
28 24 adantr K 0 P P K 1 K
29 23 27 28 3jca K 0 P P K 1 P K 1 K
30 simprr K 0 P P K 1 P K 1
31 mulmoddvds P K 1 K P K 1 K 1 K mod P = 0
32 29 30 31 sylc K 0 P P K 1 K 1 K mod P = 0
33 21 32 eqtrd K 0 P P K 1 K K 1 mod P = 0
34 22 nnred P P
35 prmgt1 P 1 < P
36 34 35 jca P P 1 < P
37 36 ad2antrl K 0 P P K 1 P 1 < P
38 1mod P 1 < P 1 mod P = 1
39 37 38 syl K 0 P P K 1 1 mod P = 1
40 33 39 oveq12d K 0 P P K 1 K K 1 mod P + 1 mod P = 0 + 1
41 40 oveq1d K 0 P P K 1 K K 1 mod P + 1 mod P mod P = 0 + 1 mod P
42 nn0re K 0 K
43 peano2rem K K 1
44 42 43 syl K 0 K 1
45 42 44 remulcld K 0 K K 1
46 45 adantr K 0 P P K 1 K K 1
47 1red K 0 P P K 1 1
48 22 nnrpd P P +
49 48 ad2antrl K 0 P P K 1 P +
50 modaddabs K K 1 1 P + K K 1 mod P + 1 mod P mod P = K K 1 + 1 mod P
51 46 47 49 50 syl3anc K 0 P P K 1 K K 1 mod P + 1 mod P mod P = K K 1 + 1 mod P
52 0p1e1 0 + 1 = 1
53 52 oveq1i 0 + 1 mod P = 1 mod P
54 34 35 38 syl2anc P 1 mod P = 1
55 54 ad2antrl K 0 P P K 1 1 mod P = 1
56 53 55 eqtrid K 0 P P K 1 0 + 1 mod P = 1
57 41 51 56 3eqtr3d K 0 P P K 1 K K 1 + 1 mod P = 1
58 15 57 stoic3 G RegUSGraph K G FriendGraph V V Fin P P K 1 K K 1 + 1 mod P = 1
59 7 14 58 3eqtrd G RegUSGraph K G FriendGraph V V Fin P P K 1 P ClWWalksN G mod P = 1