Metamath Proof Explorer


Theorem wwlksnextbi

Description: Extension of a walk (as word) by adding an edge/vertex. (Contributed by Alexander van der Vekens, 5-Aug-2018) (Revised by AV, 16-Apr-2021) (Proof shortened by AV, 27-Oct-2022)

Ref Expression
Hypotheses wwlksnext.v V = Vtx G
wwlksnext.e E = Edg G
Assertion wwlksnextbi N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W N + 1 WWalksN G T N WWalksN G

Proof

Step Hyp Ref Expression
1 wwlksnext.v V = Vtx G
2 wwlksnext.e E = Edg G
3 1 2 wwlknp W N + 1 WWalksN G W Word V W = N + 1 + 1 i 0 ..^ N + 1 W i W i + 1 E
4 wwlksnred N 0 W N + 1 WWalksN G W prefix N + 1 N WWalksN G
5 4 ad2antrr N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W N + 1 WWalksN G W prefix N + 1 N WWalksN G
6 fveqeq2 W = T ++ ⟨“ S ”⟩ W = N + 1 + 1 T ++ ⟨“ S ”⟩ = N + 1 + 1
7 6 3ad2ant2 T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 T ++ ⟨“ S ”⟩ = N + 1 + 1
8 7 adantl N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 T ++ ⟨“ S ”⟩ = N + 1 + 1
9 s1cl S V ⟨“ S ”⟩ Word V
10 9 adantl N 0 S V ⟨“ S ”⟩ Word V
11 10 anim1ci N 0 S V T Word V T Word V ⟨“ S ”⟩ Word V
12 ccatlen T Word V ⟨“ S ”⟩ Word V T ++ ⟨“ S ”⟩ = T + ⟨“ S ”⟩
13 11 12 syl N 0 S V T Word V T ++ ⟨“ S ”⟩ = T + ⟨“ S ”⟩
14 13 eqeq1d N 0 S V T Word V T ++ ⟨“ S ”⟩ = N + 1 + 1 T + ⟨“ S ”⟩ = N + 1 + 1
15 s1len ⟨“ S ”⟩ = 1
16 15 a1i N 0 S V T Word V ⟨“ S ”⟩ = 1
17 16 oveq2d N 0 S V T Word V T + ⟨“ S ”⟩ = T + 1
18 17 eqeq1d N 0 S V T Word V T + ⟨“ S ”⟩ = N + 1 + 1 T + 1 = N + 1 + 1
19 lencl T Word V T 0
20 19 nn0cnd T Word V T
21 20 adantl N 0 S V T Word V T
22 peano2nn0 N 0 N + 1 0
23 22 nn0cnd N 0 N + 1
24 23 ad2antrr N 0 S V T Word V N + 1
25 1cnd N 0 S V T Word V 1
26 21 24 25 addcan2d N 0 S V T Word V T + 1 = N + 1 + 1 T = N + 1
27 14 18 26 3bitrd N 0 S V T Word V T ++ ⟨“ S ”⟩ = N + 1 + 1 T = N + 1
28 oveq2 N + 1 = T T ++ ⟨“ S ”⟩ prefix N + 1 = T ++ ⟨“ S ”⟩ prefix T
29 28 eqcoms T = N + 1 T ++ ⟨“ S ”⟩ prefix N + 1 = T ++ ⟨“ S ”⟩ prefix T
30 pfxccat1 T Word V ⟨“ S ”⟩ Word V T ++ ⟨“ S ”⟩ prefix T = T
31 11 30 syl N 0 S V T Word V T ++ ⟨“ S ”⟩ prefix T = T
32 29 31 sylan9eqr N 0 S V T Word V T = N + 1 T ++ ⟨“ S ”⟩ prefix N + 1 = T
33 32 ex N 0 S V T Word V T = N + 1 T ++ ⟨“ S ”⟩ prefix N + 1 = T
34 27 33 sylbid N 0 S V T Word V T ++ ⟨“ S ”⟩ = N + 1 + 1 T ++ ⟨“ S ”⟩ prefix N + 1 = T
35 34 3ad2antr1 N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E T ++ ⟨“ S ”⟩ = N + 1 + 1 T ++ ⟨“ S ”⟩ prefix N + 1 = T
36 8 35 sylbid N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 T ++ ⟨“ S ”⟩ prefix N + 1 = T
37 36 imp N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 T ++ ⟨“ S ”⟩ prefix N + 1 = T
38 oveq1 W = T ++ ⟨“ S ”⟩ W prefix N + 1 = T ++ ⟨“ S ”⟩ prefix N + 1
39 38 eqeq1d W = T ++ ⟨“ S ”⟩ W prefix N + 1 = T T ++ ⟨“ S ”⟩ prefix N + 1 = T
40 39 3ad2ant2 T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W prefix N + 1 = T T ++ ⟨“ S ”⟩ prefix N + 1 = T
41 40 ad2antlr N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 W prefix N + 1 = T T ++ ⟨“ S ”⟩ prefix N + 1 = T
42 37 41 mpbird N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 W prefix N + 1 = T
43 42 eleq1d N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 W prefix N + 1 N WWalksN G T N WWalksN G
44 43 biimpd N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 W prefix N + 1 N WWalksN G T N WWalksN G
45 44 ex N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W = N + 1 + 1 W prefix N + 1 N WWalksN G T N WWalksN G
46 45 com23 N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W prefix N + 1 N WWalksN G W = N + 1 + 1 T N WWalksN G
47 5 46 syld N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W N + 1 WWalksN G W = N + 1 + 1 T N WWalksN G
48 47 com13 W = N + 1 + 1 W N + 1 WWalksN G N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E T N WWalksN G
49 48 3ad2ant2 W Word V W = N + 1 + 1 i 0 ..^ N + 1 W i W i + 1 E W N + 1 WWalksN G N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E T N WWalksN G
50 3 49 mpcom W N + 1 WWalksN G N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E T N WWalksN G
51 50 com12 N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W N + 1 WWalksN G T N WWalksN G
52 1 2 wwlksnext T N WWalksN G S V lastS T S E T ++ ⟨“ S ”⟩ N + 1 WWalksN G
53 eleq1 W = T ++ ⟨“ S ”⟩ W N + 1 WWalksN G T ++ ⟨“ S ”⟩ N + 1 WWalksN G
54 52 53 syl5ibrcom T N WWalksN G S V lastS T S E W = T ++ ⟨“ S ”⟩ W N + 1 WWalksN G
55 54 3exp T N WWalksN G S V lastS T S E W = T ++ ⟨“ S ”⟩ W N + 1 WWalksN G
56 55 com23 T N WWalksN G lastS T S E S V W = T ++ ⟨“ S ”⟩ W N + 1 WWalksN G
57 56 com14 W = T ++ ⟨“ S ”⟩ lastS T S E S V T N WWalksN G W N + 1 WWalksN G
58 57 imp W = T ++ ⟨“ S ”⟩ lastS T S E S V T N WWalksN G W N + 1 WWalksN G
59 58 3adant1 T Word V W = T ++ ⟨“ S ”⟩ lastS T S E S V T N WWalksN G W N + 1 WWalksN G
60 59 com12 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E T N WWalksN G W N + 1 WWalksN G
61 60 adantl N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E T N WWalksN G W N + 1 WWalksN G
62 61 imp N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E T N WWalksN G W N + 1 WWalksN G
63 51 62 impbid N 0 S V T Word V W = T ++ ⟨“ S ”⟩ lastS T S E W N + 1 WWalksN G T N WWalksN G