Metamath Proof Explorer


Theorem clwwlkf

Description: Lemma 1 for clwwlkf1o : F is a function. (Contributed by Alexander van der Vekens, 27-Sep-2018) (Revised by AV, 26-Apr-2021) (Revised by AV, 1-Nov-2022)

Ref Expression
Hypotheses clwwlkf1o.d D = w N WWalksN G | lastS w = w 0
clwwlkf1o.f F = t D t prefix N
Assertion clwwlkf N F : D N ClWWalksN G

Proof

Step Hyp Ref Expression
1 clwwlkf1o.d D = w N WWalksN G | lastS w = w 0
2 clwwlkf1o.f F = t D t prefix N
3 fveq2 w = t lastS w = lastS t
4 fveq1 w = t w 0 = t 0
5 3 4 eqeq12d w = t lastS w = w 0 lastS t = t 0
6 5 1 elrab2 t D t N WWalksN G lastS t = t 0
7 nnnn0 N N 0
8 iswwlksn N 0 t N WWalksN G t WWalks G t = N + 1
9 7 8 syl N t N WWalksN G t WWalks G t = N + 1
10 eqid Vtx G = Vtx G
11 eqid Edg G = Edg G
12 10 11 iswwlks t WWalks G t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G
13 12 a1i N t WWalks G t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G
14 13 anbi1d N t WWalks G t = N + 1 t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1
15 9 14 bitrd N t N WWalksN G t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1
16 simpll t Word Vtx G t = N + 1 N t Word Vtx G
17 peano2nn0 N 0 N + 1 0
18 7 17 syl N N + 1 0
19 nnre N N
20 19 lep1d N N N + 1
21 elfz2nn0 N 0 N + 1 N 0 N + 1 0 N N + 1
22 7 18 20 21 syl3anbrc N N 0 N + 1
23 22 adantl t Word Vtx G t = N + 1 N N 0 N + 1
24 oveq2 t = N + 1 0 t = 0 N + 1
25 24 eleq2d t = N + 1 N 0 t N 0 N + 1
26 25 adantl t Word Vtx G t = N + 1 N 0 t N 0 N + 1
27 26 adantr t Word Vtx G t = N + 1 N N 0 t N 0 N + 1
28 23 27 mpbird t Word Vtx G t = N + 1 N N 0 t
29 16 28 jca t Word Vtx G t = N + 1 N t Word Vtx G N 0 t
30 pfxlen t Word Vtx G N 0 t t prefix N = N
31 29 30 syl t Word Vtx G t = N + 1 N t prefix N = N
32 31 ex t Word Vtx G t = N + 1 N t prefix N = N
33 32 3ad2antl2 t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N t prefix N = N
34 33 impcom N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t prefix N = N
35 34 adantr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N = N
36 pfxcl t Word Vtx G t prefix N Word Vtx G
37 36 3ad2ant2 t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t prefix N Word Vtx G
38 37 ad2antrl N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t prefix N Word Vtx G
39 38 ad2antrl t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N Word Vtx G
40 oveq1 t = N + 1 t 1 = N + 1 - 1
41 40 oveq2d t = N + 1 0 ..^ t 1 = 0 ..^ N + 1 - 1
42 nncn N N
43 1cnd N 1
44 42 43 pncand N N + 1 - 1 = N
45 44 oveq2d N 0 ..^ N + 1 - 1 = 0 ..^ N
46 41 45 sylan9eqr N t = N + 1 0 ..^ t 1 = 0 ..^ N
47 46 raleqdv N t = N + 1 i 0 ..^ t 1 t i t i + 1 Edg G i 0 ..^ N t i t i + 1 Edg G
48 nnz N N
49 peano2zm N N 1
50 48 49 syl N N 1
51 19 lem1d N N 1 N
52 eluz2 N N 1 N 1 N N 1 N
53 50 48 51 52 syl3anbrc N N N 1
54 fzoss2 N N 1 0 ..^ N 1 0 ..^ N
55 53 54 syl N 0 ..^ N 1 0 ..^ N
56 55 adantr N t = N + 1 0 ..^ N 1 0 ..^ N
57 ssralv 0 ..^ N 1 0 ..^ N i 0 ..^ N t i t i + 1 Edg G i 0 ..^ N 1 t i t i + 1 Edg G
58 56 57 syl N t = N + 1 i 0 ..^ N t i t i + 1 Edg G i 0 ..^ N 1 t i t i + 1 Edg G
59 simplr N t = N + 1 t Word Vtx G i 0 ..^ N 1 t Word Vtx G
60 22 adantr N t = N + 1 N 0 N + 1
61 25 adantl N t = N + 1 N 0 t N 0 N + 1
62 60 61 mpbird N t = N + 1 N 0 t
63 62 ad2antrr N t = N + 1 t Word Vtx G i 0 ..^ N 1 N 0 t
64 55 sseld N i 0 ..^ N 1 i 0 ..^ N
65 64 ad2antrr N t = N + 1 t Word Vtx G i 0 ..^ N 1 i 0 ..^ N
66 65 imp N t = N + 1 t Word Vtx G i 0 ..^ N 1 i 0 ..^ N
67 pfxfv t Word Vtx G N 0 t i 0 ..^ N t prefix N i = t i
68 67 eqcomd t Word Vtx G N 0 t i 0 ..^ N t i = t prefix N i
69 59 63 66 68 syl3anc N t = N + 1 t Word Vtx G i 0 ..^ N 1 t i = t prefix N i
70 48 ad2antrr N t = N + 1 t Word Vtx G N
71 elfzom1elp1fzo N i 0 ..^ N 1 i + 1 0 ..^ N
72 70 71 sylan N t = N + 1 t Word Vtx G i 0 ..^ N 1 i + 1 0 ..^ N
73 pfxfv t Word Vtx G N 0 t i + 1 0 ..^ N t prefix N i + 1 = t i + 1
74 73 eqcomd t Word Vtx G N 0 t i + 1 0 ..^ N t i + 1 = t prefix N i + 1
75 59 63 72 74 syl3anc N t = N + 1 t Word Vtx G i 0 ..^ N 1 t i + 1 = t prefix N i + 1
76 69 75 preq12d N t = N + 1 t Word Vtx G i 0 ..^ N 1 t i t i + 1 = t prefix N i t prefix N i + 1
77 76 eleq1d N t = N + 1 t Word Vtx G i 0 ..^ N 1 t i t i + 1 Edg G t prefix N i t prefix N i + 1 Edg G
78 77 ralbidva N t = N + 1 t Word Vtx G i 0 ..^ N 1 t i t i + 1 Edg G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
79 78 biimpd N t = N + 1 t Word Vtx G i 0 ..^ N 1 t i t i + 1 Edg G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
80 79 ex N t = N + 1 t Word Vtx G i 0 ..^ N 1 t i t i + 1 Edg G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
81 80 com23 N t = N + 1 i 0 ..^ N 1 t i t i + 1 Edg G t Word Vtx G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
82 58 81 syld N t = N + 1 i 0 ..^ N t i t i + 1 Edg G t Word Vtx G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
83 47 82 sylbid N t = N + 1 i 0 ..^ t 1 t i t i + 1 Edg G t Word Vtx G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
84 83 ex N t = N + 1 i 0 ..^ t 1 t i t i + 1 Edg G t Word Vtx G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
85 84 com23 N i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t Word Vtx G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
86 85 com14 t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
87 86 imp t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
88 87 3adant1 t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
89 88 imp t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
90 89 impcom N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
91 90 ad2antrl t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
92 oveq1 t prefix N = N t prefix N 1 = N 1
93 92 oveq2d t prefix N = N 0 ..^ t prefix N 1 = 0 ..^ N 1
94 93 adantr t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 0 ..^ t prefix N 1 = 0 ..^ N 1
95 94 raleqdv t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G i 0 ..^ N 1 t prefix N i t prefix N i + 1 Edg G
96 91 95 mpbird t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G
97 simprl2 N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t Word Vtx G
98 20 ancli N N N N + 1
99 48 peano2zd N N + 1
100 fznn N + 1 N 1 N + 1 N N N + 1
101 99 100 syl N N 1 N + 1 N N N + 1
102 98 101 mpbird N N 1 N + 1
103 102 adantr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N 1 N + 1
104 oveq2 t = N + 1 1 t = 1 N + 1
105 104 eleq2d t = N + 1 N 1 t N 1 N + 1
106 105 adantl t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N 1 t N 1 N + 1
107 106 adantl N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N 1 t N 1 N + 1
108 103 107 mpbird N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N 1 t
109 97 108 jca N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t Word Vtx G N 1 t
110 109 adantr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t Word Vtx G N 1 t
111 pfxfvlsw t Word Vtx G N 1 t lastS t prefix N = t N 1
112 110 111 syl N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 lastS t prefix N = t N 1
113 pfxfv0 t Word Vtx G N 1 t t prefix N 0 = t 0
114 109 113 syl N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t prefix N 0 = t 0
115 114 adantr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N 0 = t 0
116 112 115 preq12d N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 lastS t prefix N t prefix N 0 = t N 1 t 0
117 eqcom lastS t = t 0 t 0 = lastS t
118 117 biimpi lastS t = t 0 t 0 = lastS t
119 118 adantl N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t 0 = lastS t
120 lsw t Word Vtx G lastS t = t t 1
121 120 3ad2ant2 t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G lastS t = t t 1
122 121 ad2antrl N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t t 1
123 122 adantr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 lastS t = t t 1
124 40 adantl t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t 1 = N + 1 - 1
125 124 44 sylan9eqr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t 1 = N
126 125 adantr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t 1 = N
127 126 fveq2d N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t t 1 = t N
128 119 123 127 3eqtrd N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t 0 = t N
129 128 preq2d N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t N 1 t 0 = t N 1 t N
130 40 44 sylan9eq t = N + 1 N t 1 = N
131 130 oveq2d t = N + 1 N 0 ..^ t 1 = 0 ..^ N
132 131 raleqdv t = N + 1 N i 0 ..^ t 1 t i t i + 1 Edg G i 0 ..^ N t i t i + 1 Edg G
133 fzo0end N N 1 0 ..^ N
134 fveq2 i = N 1 t i = t N 1
135 fvoveq1 i = N 1 t i + 1 = t N - 1 + 1
136 134 135 preq12d i = N 1 t i t i + 1 = t N 1 t N - 1 + 1
137 136 eleq1d i = N 1 t i t i + 1 Edg G t N 1 t N - 1 + 1 Edg G
138 137 rspcva N 1 0 ..^ N i 0 ..^ N t i t i + 1 Edg G t N 1 t N - 1 + 1 Edg G
139 133 138 sylan N i 0 ..^ N t i t i + 1 Edg G t N 1 t N - 1 + 1 Edg G
140 42 43 npcand N N - 1 + 1 = N
141 140 fveq2d N t N - 1 + 1 = t N
142 141 preq2d N t N 1 t N - 1 + 1 = t N 1 t N
143 142 eleq1d N t N 1 t N - 1 + 1 Edg G t N 1 t N Edg G
144 143 biimpd N t N 1 t N - 1 + 1 Edg G t N 1 t N Edg G
145 144 adantr N i 0 ..^ N t i t i + 1 Edg G t N 1 t N - 1 + 1 Edg G t N 1 t N Edg G
146 139 145 mpd N i 0 ..^ N t i t i + 1 Edg G t N 1 t N Edg G
147 146 ex N i 0 ..^ N t i t i + 1 Edg G t N 1 t N Edg G
148 147 adantl t = N + 1 N i 0 ..^ N t i t i + 1 Edg G t N 1 t N Edg G
149 132 148 sylbid t = N + 1 N i 0 ..^ t 1 t i t i + 1 Edg G t N 1 t N Edg G
150 149 ex t = N + 1 N i 0 ..^ t 1 t i t i + 1 Edg G t N 1 t N Edg G
151 150 com3r i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N t N 1 t N Edg G
152 151 3ad2ant3 t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N t N 1 t N Edg G
153 152 imp t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 N t N 1 t N Edg G
154 153 impcom N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 t N 1 t N Edg G
155 154 adantr N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t N 1 t N Edg G
156 129 155 eqeltrd N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t N 1 t 0 Edg G
157 116 156 eqeltrd N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 lastS t prefix N t prefix N 0 Edg G
158 157 adantl t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 lastS t prefix N t prefix N 0 Edg G
159 39 96 158 3jca t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G
160 simpl t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N = N
161 159 160 jca t prefix N = N N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G t prefix N = N
162 35 161 mpancom N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G t prefix N = N
163 162 exp31 N t t Word Vtx G i 0 ..^ t 1 t i t i + 1 Edg G t = N + 1 lastS t = t 0 t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G t prefix N = N
164 15 163 sylbid N t N WWalksN G lastS t = t 0 t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G t prefix N = N
165 164 imp32 N t N WWalksN G lastS t = t 0 t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G t prefix N = N
166 10 11 isclwwlknx N t prefix N N ClWWalksN G t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G t prefix N = N
167 166 adantr N t N WWalksN G lastS t = t 0 t prefix N N ClWWalksN G t prefix N Word Vtx G i 0 ..^ t prefix N 1 t prefix N i t prefix N i + 1 Edg G lastS t prefix N t prefix N 0 Edg G t prefix N = N
168 165 167 mpbird N t N WWalksN G lastS t = t 0 t prefix N N ClWWalksN G
169 6 168 sylan2b N t D t prefix N N ClWWalksN G
170 169 2 fmptd N F : D N ClWWalksN G