# Metamath Proof Explorer

## Definition df-clwwlk

Description: Define the set of all closed walks (in an undirected graph) as words over the set of vertices. Such a word corresponds to the sequence p(0) p(1) ... p(n-1) of the vertices in a closed walk p(0) e(f(1)) p(1) e(f(2)) ... p(n-1) e(f(n)) p(n)=p(0) as defined in df-clwlks . Notice that the word does not contain the terminating vertex p(n) of the walk, because it is always equal to the first vertex of the closed walk. (Contributed by Alexander van der Vekens, 20-Mar-2018) (Revised by AV, 24-Apr-2021)

Ref Expression
Assertion df-clwwlk ${⊢}\mathrm{ClWWalks}=\left({g}\in \mathrm{V}⟼\left\{{w}\in \mathrm{Word}\mathrm{Vtx}\left({g}\right)|\left({w}\ne \varnothing \wedge \forall {i}\in \left(0..^\left|{w}\right|-1\right)\phantom{\rule{.4em}{0ex}}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}\in \mathrm{Edg}\left({g}\right)\wedge \left\{\mathrm{lastS}\left({w}\right),{w}\left(0\right)\right\}\in \mathrm{Edg}\left({g}\right)\right)\right\}\right)$

### Detailed syntax breakdown

Step Hyp Ref Expression
0 cclwwlk ${class}\mathrm{ClWWalks}$
1 vg ${setvar}{g}$
2 cvv ${class}\mathrm{V}$
3 vw ${setvar}{w}$
4 cvtx ${class}\mathrm{Vtx}$
5 1 cv ${setvar}{g}$
6 5 4 cfv ${class}\mathrm{Vtx}\left({g}\right)$
7 6 cword ${class}\mathrm{Word}\mathrm{Vtx}\left({g}\right)$
8 3 cv ${setvar}{w}$
9 c0 ${class}\varnothing$
10 8 9 wne ${wff}{w}\ne \varnothing$
11 vi ${setvar}{i}$
12 cc0 ${class}0$
13 cfzo ${class}..^$
14 chash ${class}\left|.\right|$
15 8 14 cfv ${class}\left|{w}\right|$
16 cmin ${class}-$
17 c1 ${class}1$
18 15 17 16 co ${class}\left(\left|{w}\right|-1\right)$
19 12 18 13 co ${class}\left(0..^\left|{w}\right|-1\right)$
20 11 cv ${setvar}{i}$
21 20 8 cfv ${class}{w}\left({i}\right)$
22 caddc ${class}+$
23 20 17 22 co ${class}\left({i}+1\right)$
24 23 8 cfv ${class}{w}\left({i}+1\right)$
25 21 24 cpr ${class}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}$
26 cedg ${class}\mathrm{Edg}$
27 5 26 cfv ${class}\mathrm{Edg}\left({g}\right)$
28 25 27 wcel ${wff}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}\in \mathrm{Edg}\left({g}\right)$
29 28 11 19 wral ${wff}\forall {i}\in \left(0..^\left|{w}\right|-1\right)\phantom{\rule{.4em}{0ex}}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}\in \mathrm{Edg}\left({g}\right)$
30 clsw ${class}\mathrm{lastS}$
31 8 30 cfv ${class}\mathrm{lastS}\left({w}\right)$
32 12 8 cfv ${class}{w}\left(0\right)$
33 31 32 cpr ${class}\left\{\mathrm{lastS}\left({w}\right),{w}\left(0\right)\right\}$
34 33 27 wcel ${wff}\left\{\mathrm{lastS}\left({w}\right),{w}\left(0\right)\right\}\in \mathrm{Edg}\left({g}\right)$
35 10 29 34 w3a ${wff}\left({w}\ne \varnothing \wedge \forall {i}\in \left(0..^\left|{w}\right|-1\right)\phantom{\rule{.4em}{0ex}}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}\in \mathrm{Edg}\left({g}\right)\wedge \left\{\mathrm{lastS}\left({w}\right),{w}\left(0\right)\right\}\in \mathrm{Edg}\left({g}\right)\right)$
36 35 3 7 crab ${class}\left\{{w}\in \mathrm{Word}\mathrm{Vtx}\left({g}\right)|\left({w}\ne \varnothing \wedge \forall {i}\in \left(0..^\left|{w}\right|-1\right)\phantom{\rule{.4em}{0ex}}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}\in \mathrm{Edg}\left({g}\right)\wedge \left\{\mathrm{lastS}\left({w}\right),{w}\left(0\right)\right\}\in \mathrm{Edg}\left({g}\right)\right)\right\}$
37 1 2 36 cmpt ${class}\left({g}\in \mathrm{V}⟼\left\{{w}\in \mathrm{Word}\mathrm{Vtx}\left({g}\right)|\left({w}\ne \varnothing \wedge \forall {i}\in \left(0..^\left|{w}\right|-1\right)\phantom{\rule{.4em}{0ex}}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}\in \mathrm{Edg}\left({g}\right)\wedge \left\{\mathrm{lastS}\left({w}\right),{w}\left(0\right)\right\}\in \mathrm{Edg}\left({g}\right)\right)\right\}\right)$
38 0 37 wceq ${wff}\mathrm{ClWWalks}=\left({g}\in \mathrm{V}⟼\left\{{w}\in \mathrm{Word}\mathrm{Vtx}\left({g}\right)|\left({w}\ne \varnothing \wedge \forall {i}\in \left(0..^\left|{w}\right|-1\right)\phantom{\rule{.4em}{0ex}}\left\{{w}\left({i}\right),{w}\left({i}+1\right)\right\}\in \mathrm{Edg}\left({g}\right)\wedge \left\{\mathrm{lastS}\left({w}\right),{w}\left(0\right)\right\}\in \mathrm{Edg}\left({g}\right)\right)\right\}\right)$