Metamath Proof Explorer


Theorem clwwlkvbij

Description: There is a bijection between the set of closed walks of a fixed length N on a fixed vertex X represented by walks (as word) and the set of closed walks (as words) of the fixed length N on the fixed vertex X . The difference between these two representations is that in the first case the fixed vertex is repeated at the end of the word, and in the second case it is not. (Contributed by Alexander van der Vekens, 29-Sep-2018) (Revised by AV, 26-Apr-2021) (Revised by AV, 7-Jul-2022) (Proof shortened by AV, 2-Nov-2022)

Ref Expression
Assertion clwwlkvbij X V N f f : w N WWalksN G | lastS w = w 0 w 0 = X 1-1 onto X ClWWalksNOn G N

Proof

Step Hyp Ref Expression
1 ovex N WWalksN G V
2 1 mptrabex w x N WWalksN G | lastS x = x 0 w prefix N V
3 2 resex w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X V
4 eqid w x N WWalksN G | lastS x = x 0 w prefix N = w x N WWalksN G | lastS x = x 0 w prefix N
5 eqid x N WWalksN G | lastS x = x 0 = x N WWalksN G | lastS x = x 0
6 5 4 clwwlkf1o N w x N WWalksN G | lastS x = x 0 w prefix N : x N WWalksN G | lastS x = x 0 1-1 onto N ClWWalksN G
7 fveq1 y = w prefix N y 0 = w prefix N 0
8 7 eqeq1d y = w prefix N y 0 = X w prefix N 0 = X
9 8 3ad2ant3 N w x N WWalksN G | lastS x = x 0 y = w prefix N y 0 = X w prefix N 0 = X
10 fveq2 x = w lastS x = lastS w
11 fveq1 x = w x 0 = w 0
12 10 11 eqeq12d x = w lastS x = x 0 lastS w = w 0
13 12 elrab w x N WWalksN G | lastS x = x 0 w N WWalksN G lastS w = w 0
14 eqid Vtx G = Vtx G
15 eqid Edg G = Edg G
16 14 15 wwlknp w N WWalksN G w Word Vtx G w = N + 1 i 0 ..^ N w i w i + 1 Edg G
17 simpll w Word Vtx G w = N + 1 N w Word Vtx G
18 nnz N N
19 uzid N N N
20 peano2uz N N N + 1 N
21 18 19 20 3syl N N + 1 N
22 elfz1end N N 1 N
23 22 biimpi N N 1 N
24 fzss2 N + 1 N 1 N 1 N + 1
25 24 sselda N + 1 N N 1 N N 1 N + 1
26 21 23 25 syl2anc N N 1 N + 1
27 26 adantl w Word Vtx G w = N + 1 N N 1 N + 1
28 oveq2 w = N + 1 1 w = 1 N + 1
29 28 eleq2d w = N + 1 N 1 w N 1 N + 1
30 29 adantl w Word Vtx G w = N + 1 N 1 w N 1 N + 1
31 30 adantr w Word Vtx G w = N + 1 N N 1 w N 1 N + 1
32 27 31 mpbird w Word Vtx G w = N + 1 N N 1 w
33 17 32 jca w Word Vtx G w = N + 1 N w Word Vtx G N 1 w
34 33 ex w Word Vtx G w = N + 1 N w Word Vtx G N 1 w
35 34 3adant3 w Word Vtx G w = N + 1 i 0 ..^ N w i w i + 1 Edg G N w Word Vtx G N 1 w
36 16 35 syl w N WWalksN G N w Word Vtx G N 1 w
37 36 adantr w N WWalksN G lastS w = w 0 N w Word Vtx G N 1 w
38 13 37 sylbi w x N WWalksN G | lastS x = x 0 N w Word Vtx G N 1 w
39 38 impcom N w x N WWalksN G | lastS x = x 0 w Word Vtx G N 1 w
40 pfxfv0 w Word Vtx G N 1 w w prefix N 0 = w 0
41 39 40 syl N w x N WWalksN G | lastS x = x 0 w prefix N 0 = w 0
42 41 eqeq1d N w x N WWalksN G | lastS x = x 0 w prefix N 0 = X w 0 = X
43 42 3adant3 N w x N WWalksN G | lastS x = x 0 y = w prefix N w prefix N 0 = X w 0 = X
44 9 43 bitrd N w x N WWalksN G | lastS x = x 0 y = w prefix N y 0 = X w 0 = X
45 4 6 44 f1oresrab N w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto y N ClWWalksN G | y 0 = X
46 45 adantl X V N w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto y N ClWWalksN G | y 0 = X
47 clwwlknon X ClWWalksNOn G N = y N ClWWalksN G | y 0 = X
48 47 a1i X V N X ClWWalksNOn G N = y N ClWWalksN G | y 0 = X
49 48 f1oeq3d X V N w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto y N ClWWalksN G | y 0 = X
50 46 49 mpbird X V N w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N
51 f1oeq1 f = w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X f : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N
52 51 spcegv w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X V w x N WWalksN G | lastS x = x 0 w prefix N w x N WWalksN G | lastS x = x 0 | w 0 = X : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N f f : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N
53 3 50 52 mpsyl X V N f f : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N
54 df-rab w N WWalksN G | lastS w = w 0 w 0 = X = w | w N WWalksN G lastS w = w 0 w 0 = X
55 anass w N WWalksN G lastS w = w 0 w 0 = X w N WWalksN G lastS w = w 0 w 0 = X
56 55 bicomi w N WWalksN G lastS w = w 0 w 0 = X w N WWalksN G lastS w = w 0 w 0 = X
57 56 abbii w | w N WWalksN G lastS w = w 0 w 0 = X = w | w N WWalksN G lastS w = w 0 w 0 = X
58 13 bicomi w N WWalksN G lastS w = w 0 w x N WWalksN G | lastS x = x 0
59 58 anbi1i w N WWalksN G lastS w = w 0 w 0 = X w x N WWalksN G | lastS x = x 0 w 0 = X
60 59 abbii w | w N WWalksN G lastS w = w 0 w 0 = X = w | w x N WWalksN G | lastS x = x 0 w 0 = X
61 df-rab w x N WWalksN G | lastS x = x 0 | w 0 = X = w | w x N WWalksN G | lastS x = x 0 w 0 = X
62 60 61 eqtr4i w | w N WWalksN G lastS w = w 0 w 0 = X = w x N WWalksN G | lastS x = x 0 | w 0 = X
63 54 57 62 3eqtri w N WWalksN G | lastS w = w 0 w 0 = X = w x N WWalksN G | lastS x = x 0 | w 0 = X
64 f1oeq2 w N WWalksN G | lastS w = w 0 w 0 = X = w x N WWalksN G | lastS x = x 0 | w 0 = X f : w N WWalksN G | lastS w = w 0 w 0 = X 1-1 onto X ClWWalksNOn G N f : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N
65 63 64 mp1i X V N f : w N WWalksN G | lastS w = w 0 w 0 = X 1-1 onto X ClWWalksNOn G N f : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N
66 65 exbidv X V N f f : w N WWalksN G | lastS w = w 0 w 0 = X 1-1 onto X ClWWalksNOn G N f f : w x N WWalksN G | lastS x = x 0 | w 0 = X 1-1 onto X ClWWalksNOn G N
67 53 66 mpbird X V N f f : w N WWalksN G | lastS w = w 0 w 0 = X 1-1 onto X ClWWalksNOn G N