Metamath Proof Explorer


Theorem clwwlkext2edg

Description: If a word concatenated with a vertex represents a closed walk in (in a graph), there is an edge between this vertex and the last vertex of the word, and between this vertex and the first vertex of the word. (Contributed by Alexander van der Vekens, 3-Oct-2018) (Revised by AV, 27-Apr-2021) (Proof shortened by AV, 22-Mar-2022)

Ref Expression
Hypotheses clwwlkext2edg.v V = Vtx G
clwwlkext2edg.e E = Edg G
Assertion clwwlkext2edg W Word V Z V N 2 W ++ ⟨“ Z ”⟩ N ClWWalksN G lastS W Z E Z W 0 E

Proof

Step Hyp Ref Expression
1 clwwlkext2edg.v V = Vtx G
2 clwwlkext2edg.e E = Edg G
3 clwwlknnn W ++ ⟨“ Z ”⟩ N ClWWalksN G N
4 1 2 isclwwlknx N W ++ ⟨“ Z ”⟩ N ClWWalksN G W ++ ⟨“ Z ”⟩ Word V i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N
5 ige2m2fzo N 2 N 2 0 ..^ N 1
6 5 3ad2ant3 W Word V Z V N 2 N 2 0 ..^ N 1
7 6 adantr W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N N 2 0 ..^ N 1
8 oveq1 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ 1 = N 1
9 8 oveq2d W ++ ⟨“ Z ”⟩ = N 0 ..^ W ++ ⟨“ Z ”⟩ 1 = 0 ..^ N 1
10 9 eleq2d W ++ ⟨“ Z ”⟩ = N N 2 0 ..^ W ++ ⟨“ Z ”⟩ 1 N 2 0 ..^ N 1
11 10 adantl W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N N 2 0 ..^ W ++ ⟨“ Z ”⟩ 1 N 2 0 ..^ N 1
12 7 11 mpbird W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N N 2 0 ..^ W ++ ⟨“ Z ”⟩ 1
13 fveq2 i = N 2 W ++ ⟨“ Z ”⟩ i = W ++ ⟨“ Z ”⟩ N 2
14 fvoveq1 i = N 2 W ++ ⟨“ Z ”⟩ i + 1 = W ++ ⟨“ Z ”⟩ N - 2 + 1
15 13 14 preq12d i = N 2 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 = W ++ ⟨“ Z ”⟩ N 2 W ++ ⟨“ Z ”⟩ N - 2 + 1
16 15 eleq1d i = N 2 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E W ++ ⟨“ Z ”⟩ N 2 W ++ ⟨“ Z ”⟩ N - 2 + 1 E
17 16 rspcv N 2 0 ..^ W ++ ⟨“ Z ”⟩ 1 i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E W ++ ⟨“ Z ”⟩ N 2 W ++ ⟨“ Z ”⟩ N - 2 + 1 E
18 12 17 syl W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E W ++ ⟨“ Z ”⟩ N 2 W ++ ⟨“ Z ”⟩ N - 2 + 1 E
19 wrdlenccats1lenm1 W Word V W ++ ⟨“ Z ”⟩ 1 = W
20 19 eqcomd W Word V W = W ++ ⟨“ Z ”⟩ 1
21 20 adantr W Word V Z V W = W ++ ⟨“ Z ”⟩ 1
22 21 8 sylan9eq W Word V Z V W ++ ⟨“ Z ”⟩ = N W = N 1
23 22 ex W Word V Z V W ++ ⟨“ Z ”⟩ = N W = N 1
24 23 3adant3 W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W = N 1
25 eluzelcn N 2 N
26 1cnd N 2 1
27 25 26 26 subsub4d N 2 N - 1 - 1 = N 1 + 1
28 1p1e2 1 + 1 = 2
29 28 a1i N 2 1 + 1 = 2
30 29 oveq2d N 2 N 1 + 1 = N 2
31 27 30 eqtr2d N 2 N 2 = N - 1 - 1
32 31 3ad2ant3 W Word V Z V N 2 N 2 = N - 1 - 1
33 oveq1 W = N 1 W 1 = N - 1 - 1
34 33 eqcomd W = N 1 N - 1 - 1 = W 1
35 32 34 sylan9eq W Word V Z V N 2 W = N 1 N 2 = W 1
36 35 ex W Word V Z V N 2 W = N 1 N 2 = W 1
37 24 36 syld W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N N 2 = W 1
38 37 imp W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N N 2 = W 1
39 38 fveq2d W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ N 2 = W ++ ⟨“ Z ”⟩ W 1
40 simpl1 W Word V Z V N 2 W = N 1 W Word V
41 s1cl Z V ⟨“ Z ”⟩ Word V
42 41 3ad2ant2 W Word V Z V N 2 ⟨“ Z ”⟩ Word V
43 42 adantr W Word V Z V N 2 W = N 1 ⟨“ Z ”⟩ Word V
44 eluz2 N 2 2 N 2 N
45 zre N N
46 1red N 2 N 1
47 2re 2
48 47 a1i N 2 N 2
49 simpl N 2 N N
50 1lt2 1 < 2
51 50 a1i N 2 N 1 < 2
52 simpr N 2 N 2 N
53 46 48 49 51 52 ltletrd N 2 N 1 < N
54 1red N 1
55 id N N
56 54 55 posdifd N 1 < N 0 < N 1
57 56 adantr N 2 N 1 < N 0 < N 1
58 53 57 mpbid N 2 N 0 < N 1
59 58 ex N 2 N 0 < N 1
60 45 59 syl N 2 N 0 < N 1
61 60 a1i 2 N 2 N 0 < N 1
62 61 3imp 2 N 2 N 0 < N 1
63 44 62 sylbi N 2 0 < N 1
64 63 ad2antlr W Word V N 2 W = N 1 0 < N 1
65 breq2 W = N 1 0 < W 0 < N 1
66 65 adantl W Word V N 2 W = N 1 0 < W 0 < N 1
67 64 66 mpbird W Word V N 2 W = N 1 0 < W
68 hashneq0 W Word V 0 < W W
69 68 adantr W Word V N 2 0 < W W
70 69 adantr W Word V N 2 W = N 1 0 < W W
71 67 70 mpbid W Word V N 2 W = N 1 W
72 71 3adantl2 W Word V Z V N 2 W = N 1 W
73 40 43 72 3jca W Word V Z V N 2 W = N 1 W Word V ⟨“ Z ”⟩ Word V W
74 73 ex W Word V Z V N 2 W = N 1 W Word V ⟨“ Z ”⟩ Word V W
75 24 74 syld W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W Word V ⟨“ Z ”⟩ Word V W
76 75 imp W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W Word V ⟨“ Z ”⟩ Word V W
77 ccatval1lsw W Word V ⟨“ Z ”⟩ Word V W W ++ ⟨“ Z ”⟩ W 1 = lastS W
78 76 77 syl W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ W 1 = lastS W
79 39 78 eqtrd W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ N 2 = lastS W
80 2m1e1 2 1 = 1
81 80 a1i N 2 2 1 = 1
82 81 eqcomd N 2 1 = 2 1
83 82 oveq2d N 2 N 1 = N 2 1
84 2cnd N 2 2
85 25 84 26 subsubd N 2 N 2 1 = N - 2 + 1
86 83 85 eqtr2d N 2 N - 2 + 1 = N 1
87 86 3ad2ant3 W Word V Z V N 2 N - 2 + 1 = N 1
88 eqeq2 W = N 1 N - 2 + 1 = W N - 2 + 1 = N 1
89 87 88 syl5ibrcom W Word V Z V N 2 W = N 1 N - 2 + 1 = W
90 24 89 syld W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N N - 2 + 1 = W
91 90 imp W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N N - 2 + 1 = W
92 91 fveq2d W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ N - 2 + 1 = W ++ ⟨“ Z ”⟩ W
93 id W Word V Z V W Word V Z V
94 93 3adant3 W Word V Z V N 2 W Word V Z V
95 94 adantr W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W Word V Z V
96 ccatws1ls W Word V Z V W ++ ⟨“ Z ”⟩ W = Z
97 95 96 syl W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ W = Z
98 92 97 eqtrd W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ N - 2 + 1 = Z
99 79 98 preq12d W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ N 2 W ++ ⟨“ Z ”⟩ N - 2 + 1 = lastS W Z
100 99 eleq1d W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N W ++ ⟨“ Z ”⟩ N 2 W ++ ⟨“ Z ”⟩ N - 2 + 1 E lastS W Z E
101 18 100 sylibd W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W Z E
102 101 ex W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W Z E
103 102 com13 i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 lastS W Z E
104 103 3ad2ant2 W ++ ⟨“ Z ”⟩ Word V i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 lastS W Z E
105 104 imp31 W ++ ⟨“ Z ”⟩ Word V i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 lastS W Z E
106 94 adantr W Word V Z V N 2 W = N 1 W Word V Z V
107 lswccats1 W Word V Z V lastS W ++ ⟨“ Z ”⟩ = Z
108 106 107 syl W Word V Z V N 2 W = N 1 lastS W ++ ⟨“ Z ”⟩ = Z
109 63 3ad2ant3 W Word V Z V N 2 0 < N 1
110 109 adantr W Word V Z V N 2 W = N 1 0 < N 1
111 65 adantl W Word V Z V N 2 W = N 1 0 < W 0 < N 1
112 110 111 mpbird W Word V Z V N 2 W = N 1 0 < W
113 ccatfv0 W Word V ⟨“ Z ”⟩ Word V 0 < W W ++ ⟨“ Z ”⟩ 0 = W 0
114 40 43 112 113 syl3anc W Word V Z V N 2 W = N 1 W ++ ⟨“ Z ”⟩ 0 = W 0
115 108 114 preq12d W Word V Z V N 2 W = N 1 lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 = Z W 0
116 115 ex W Word V Z V N 2 W = N 1 lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 = Z W 0
117 24 116 syld W Word V Z V N 2 W ++ ⟨“ Z ”⟩ = N lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 = Z W 0
118 117 impcom W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 = Z W 0
119 118 eleq1d W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E Z W 0 E
120 119 biimpcd lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 Z W 0 E
121 120 3ad2ant3 W ++ ⟨“ Z ”⟩ Word V i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 Z W 0 E
122 121 impl W ++ ⟨“ Z ”⟩ Word V i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 Z W 0 E
123 105 122 jca W ++ ⟨“ Z ”⟩ Word V i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 lastS W Z E Z W 0 E
124 123 ex W ++ ⟨“ Z ”⟩ Word V i 0 ..^ W ++ ⟨“ Z ”⟩ 1 W ++ ⟨“ Z ”⟩ i W ++ ⟨“ Z ”⟩ i + 1 E lastS W ++ ⟨“ Z ”⟩ W ++ ⟨“ Z ”⟩ 0 E W ++ ⟨“ Z ”⟩ = N W Word V Z V N 2 lastS W Z E Z W 0 E
125 4 124 syl6bi N W ++ ⟨“ Z ”⟩ N ClWWalksN G W Word V Z V N 2 lastS W Z E Z W 0 E
126 3 125 mpcom W ++ ⟨“ Z ”⟩ N ClWWalksN G W Word V Z V N 2 lastS W Z E Z W 0 E
127 126 impcom W Word V Z V N 2 W ++ ⟨“ Z ”⟩ N ClWWalksN G lastS W Z E Z W 0 E