Metamath Proof Explorer


Theorem wwlksubclwwlk

Description: Any prefix of a word representing a closed walk represents a walk. (Contributed by Alexander van der Vekens, 5-Oct-2018) (Revised by AV, 28-Apr-2021) (Revised by AV, 1-Nov-2022)

Ref Expression
Assertion wwlksubclwwlk M N M + 1 X N ClWWalksN G X prefix M M 1 WWalksN G

Proof

Step Hyp Ref Expression
1 eqid Vtx G = Vtx G
2 eqid Edg G = Edg G
3 1 2 clwwlknp X N ClWWalksN G X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G lastS X X 0 Edg G
4 pfxcl X Word Vtx G X prefix M Word Vtx G
5 4 adantr X Word Vtx G X = N X prefix M Word Vtx G
6 5 ad2antrr X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 X prefix M Word Vtx G
7 nnz M M
8 eluzp1m1 M N M + 1 N 1 M
9 8 ex M N M + 1 N 1 M
10 7 9 syl M N M + 1 N 1 M
11 peano2zm M M 1
12 7 11 syl M M 1
13 nnre M M
14 13 lem1d M M 1 M
15 eluzuzle M 1 M 1 M N 1 M N 1 M 1
16 12 14 15 syl2anc M N 1 M N 1 M 1
17 10 16 syld M N M + 1 N 1 M 1
18 17 imp M N M + 1 N 1 M 1
19 fzoss2 N 1 M 1 0 ..^ M 1 0 ..^ N 1
20 18 19 syl M N M + 1 0 ..^ M 1 0 ..^ N 1
21 20 adantl X Word Vtx G X = N M N M + 1 0 ..^ M 1 0 ..^ N 1
22 ssralv 0 ..^ M 1 0 ..^ N 1 i 0 ..^ N 1 X i X i + 1 Edg G i 0 ..^ M 1 X i X i + 1 Edg G
23 21 22 syl X Word Vtx G X = N M N M + 1 i 0 ..^ N 1 X i X i + 1 Edg G i 0 ..^ M 1 X i X i + 1 Edg G
24 simpll X Word Vtx G X = N M N M + 1 X Word Vtx G
25 24 adantr X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X Word Vtx G
26 eluz2 N M + 1 M + 1 N M + 1 N
27 13 adantr M N M + 1 N M
28 peano2re M M + 1
29 13 28 syl M M + 1
30 29 adantr M N M + 1 N M + 1
31 zre N N
32 31 ad2antrl M N M + 1 N N
33 13 lep1d M M M + 1
34 33 adantr M N M + 1 N M M + 1
35 simpr N M + 1 N M + 1 N
36 35 adantl M N M + 1 N M + 1 N
37 27 30 32 34 36 letrd M N M + 1 N M N
38 nnnn0 M M 0
39 38 ad2antrr M N M + 1 N M N M 0
40 simpr M N N
41 40 adantr M N M N N
42 0red M N 0
43 13 adantr M N M
44 31 adantl M N N
45 42 43 44 3jca M N 0 M N
46 45 adantr M N M N 0 M N
47 38 nn0ge0d M 0 M
48 47 adantr M N 0 M
49 48 anim1i M N M N 0 M M N
50 letr 0 M N 0 M M N 0 N
51 46 49 50 sylc M N M N 0 N
52 elnn0z N 0 N 0 N
53 41 51 52 sylanbrc M N M N N 0
54 53 adantlrr M N M + 1 N M N N 0
55 simpr M N M + 1 N M N M N
56 39 54 55 3jca M N M + 1 N M N M 0 N 0 M N
57 37 56 mpdan M N M + 1 N M 0 N 0 M N
58 57 expcom N M + 1 N M M 0 N 0 M N
59 58 3adant1 M + 1 N M + 1 N M M 0 N 0 M N
60 26 59 sylbi N M + 1 M M 0 N 0 M N
61 60 impcom M N M + 1 M 0 N 0 M N
62 elfz2nn0 M 0 N M 0 N 0 M N
63 61 62 sylibr M N M + 1 M 0 N
64 63 adantl X Word Vtx G X = N M N M + 1 M 0 N
65 oveq2 X = N 0 X = 0 N
66 65 eleq2d X = N M 0 X M 0 N
67 66 adantl X Word Vtx G X = N M 0 X M 0 N
68 67 adantr X Word Vtx G X = N M N M + 1 M 0 X M 0 N
69 64 68 mpbird X Word Vtx G X = N M N M + 1 M 0 X
70 69 adantr X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 M 0 X
71 eluz2 M M 1 M 1 M M 1 M
72 12 7 14 71 syl3anbrc M M M 1
73 fzoss2 M M 1 0 ..^ M 1 0 ..^ M
74 72 73 syl M 0 ..^ M 1 0 ..^ M
75 74 sseld M i 0 ..^ M 1 i 0 ..^ M
76 75 ad2antrl X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 i 0 ..^ M
77 76 imp X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 i 0 ..^ M
78 pfxfv X Word Vtx G M 0 X i 0 ..^ M X prefix M i = X i
79 25 70 77 78 syl3anc X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X prefix M i = X i
80 79 eqcomd X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X i = X prefix M i
81 fzonn0p1p1 i 0 ..^ M 1 i + 1 0 ..^ M - 1 + 1
82 nncn M M
83 npcan1 M M - 1 + 1 = M
84 82 83 syl M M - 1 + 1 = M
85 84 oveq2d M 0 ..^ M - 1 + 1 = 0 ..^ M
86 85 eleq2d M i + 1 0 ..^ M - 1 + 1 i + 1 0 ..^ M
87 81 86 syl5ib M i 0 ..^ M 1 i + 1 0 ..^ M
88 87 ad2antrl X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 i + 1 0 ..^ M
89 88 imp X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 i + 1 0 ..^ M
90 pfxfv X Word Vtx G M 0 X i + 1 0 ..^ M X prefix M i + 1 = X i + 1
91 25 70 89 90 syl3anc X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X prefix M i + 1 = X i + 1
92 91 eqcomd X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X i + 1 = X prefix M i + 1
93 80 92 preq12d X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X i X i + 1 = X prefix M i X prefix M i + 1
94 93 eleq1d X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X i X i + 1 Edg G X prefix M i X prefix M i + 1 Edg G
95 94 ralbidva X Word Vtx G X = N M N M + 1 i 0 ..^ M 1 X i X i + 1 Edg G i 0 ..^ M 1 X prefix M i X prefix M i + 1 Edg G
96 23 95 sylibd X Word Vtx G X = N M N M + 1 i 0 ..^ N 1 X i X i + 1 Edg G i 0 ..^ M 1 X prefix M i X prefix M i + 1 Edg G
97 96 impancom X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 i 0 ..^ M 1 X prefix M i X prefix M i + 1 Edg G
98 97 imp X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 i 0 ..^ M 1 X prefix M i X prefix M i + 1 Edg G
99 24 69 jca X Word Vtx G X = N M N M + 1 X Word Vtx G M 0 X
100 99 adantlr X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 X Word Vtx G M 0 X
101 pfxlen X Word Vtx G M 0 X X prefix M = M
102 100 101 syl X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 X prefix M = M
103 102 oveq1d X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 X prefix M 1 = M 1
104 103 oveq2d X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 0 ..^ X prefix M 1 = 0 ..^ M 1
105 104 raleqdv X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G i 0 ..^ M 1 X prefix M i X prefix M i + 1 Edg G
106 98 105 mpbird X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G
107 24 69 101 syl2anc X Word Vtx G X = N M N M + 1 X prefix M = M
108 84 eqcomd M M = M - 1 + 1
109 108 ad2antrl X Word Vtx G X = N M N M + 1 M = M - 1 + 1
110 107 109 eqtrd X Word Vtx G X = N M N M + 1 X prefix M = M - 1 + 1
111 110 adantlr X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 X prefix M = M - 1 + 1
112 6 106 111 3jca X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 X prefix M Word Vtx G i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G X prefix M = M - 1 + 1
113 112 ex X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G M N M + 1 X prefix M Word Vtx G i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G X prefix M = M - 1 + 1
114 113 3adant3 X Word Vtx G X = N i 0 ..^ N 1 X i X i + 1 Edg G lastS X X 0 Edg G M N M + 1 X prefix M Word Vtx G i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G X prefix M = M - 1 + 1
115 3 114 syl X N ClWWalksN G M N M + 1 X prefix M Word Vtx G i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G X prefix M = M - 1 + 1
116 115 impcom M N M + 1 X N ClWWalksN G X prefix M Word Vtx G i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G X prefix M = M - 1 + 1
117 nnm1nn0 M M 1 0
118 117 ad2antrr M N M + 1 X N ClWWalksN G M 1 0
119 1 2 iswwlksnx M 1 0 X prefix M M 1 WWalksN G X prefix M Word Vtx G i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G X prefix M = M - 1 + 1
120 118 119 syl M N M + 1 X N ClWWalksN G X prefix M M 1 WWalksN G X prefix M Word Vtx G i 0 ..^ X prefix M 1 X prefix M i X prefix M i + 1 Edg G X prefix M = M - 1 + 1
121 116 120 mpbird M N M + 1 X N ClWWalksN G X prefix M M 1 WWalksN G
122 121 ex M N M + 1 X N ClWWalksN G X prefix M M 1 WWalksN G