Metamath Proof Explorer


Theorem dlwwlknondlwlknonf1olem1

Description: Lemma 1 for dlwwlknondlwlknonf1o . (Contributed by AV, 29-May-2022) (Revised by AV, 1-Nov-2022)

Ref Expression
Assertion dlwwlknondlwlknonf1olem1 ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ( ( 2nd𝑐 ) prefix ( ♯ ‘ ( 1st𝑐 ) ) ) ‘ ( 𝑁 − 2 ) ) = ( ( 2nd𝑐 ) ‘ ( 𝑁 − 2 ) ) )

Proof

Step Hyp Ref Expression
1 clwlkwlk ( 𝑐 ∈ ( ClWalks ‘ 𝐺 ) → 𝑐 ∈ ( Walks ‘ 𝐺 ) )
2 wlkcpr ( 𝑐 ∈ ( Walks ‘ 𝐺 ) ↔ ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) )
3 1 2 sylib ( 𝑐 ∈ ( ClWalks ‘ 𝐺 ) → ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) )
4 eqid ( Vtx ‘ 𝐺 ) = ( Vtx ‘ 𝐺 )
5 4 wlkpwrd ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) )
6 3 5 syl ( 𝑐 ∈ ( ClWalks ‘ 𝐺 ) → ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) )
7 6 3ad2ant2 ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) )
8 eluzge2nn0 ( 𝑁 ∈ ( ℤ ‘ 2 ) → 𝑁 ∈ ℕ0 )
9 8 3ad2ant3 ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → 𝑁 ∈ ℕ0 )
10 eleq1 ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁 → ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0𝑁 ∈ ℕ0 ) )
11 10 3ad2ant1 ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0𝑁 ∈ ℕ0 ) )
12 9 11 mpbird ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 )
13 nn0fz0 ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 ↔ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ♯ ‘ ( 1st𝑐 ) ) ) )
14 12 13 sylib ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ♯ ‘ ( 1st𝑐 ) ) ) )
15 fzelp1 ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ♯ ‘ ( 1st𝑐 ) ) ) → ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
16 14 15 syl ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
17 wlklenvp1 ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( ♯ ‘ ( 2nd𝑐 ) ) = ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) )
18 17 eqcomd ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) = ( ♯ ‘ ( 2nd𝑐 ) ) )
19 3 18 syl ( 𝑐 ∈ ( ClWalks ‘ 𝐺 ) → ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) = ( ♯ ‘ ( 2nd𝑐 ) ) )
20 19 oveq2d ( 𝑐 ∈ ( ClWalks ‘ 𝐺 ) → ( 0 ... ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) = ( 0 ... ( ♯ ‘ ( 2nd𝑐 ) ) ) )
21 20 eleq2d ( 𝑐 ∈ ( ClWalks ‘ 𝐺 ) → ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) ↔ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ♯ ‘ ( 2nd𝑐 ) ) ) ) )
22 21 3ad2ant2 ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) ↔ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ♯ ‘ ( 2nd𝑐 ) ) ) ) )
23 16 22 mpbid ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ♯ ‘ ( 2nd𝑐 ) ) ) )
24 2nn 2 ∈ ℕ
25 24 a1i ( 𝑁 ∈ ( ℤ ‘ 2 ) → 2 ∈ ℕ )
26 eluz2nn ( 𝑁 ∈ ( ℤ ‘ 2 ) → 𝑁 ∈ ℕ )
27 eluzle ( 𝑁 ∈ ( ℤ ‘ 2 ) → 2 ≤ 𝑁 )
28 elfz1b ( 2 ∈ ( 1 ... 𝑁 ) ↔ ( 2 ∈ ℕ ∧ 𝑁 ∈ ℕ ∧ 2 ≤ 𝑁 ) )
29 25 26 27 28 syl3anbrc ( 𝑁 ∈ ( ℤ ‘ 2 ) → 2 ∈ ( 1 ... 𝑁 ) )
30 ubmelfzo ( 2 ∈ ( 1 ... 𝑁 ) → ( 𝑁 − 2 ) ∈ ( 0 ..^ 𝑁 ) )
31 29 30 syl ( 𝑁 ∈ ( ℤ ‘ 2 ) → ( 𝑁 − 2 ) ∈ ( 0 ..^ 𝑁 ) )
32 31 3ad2ant3 ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( 𝑁 − 2 ) ∈ ( 0 ..^ 𝑁 ) )
33 oveq2 ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁 → ( 0 ..^ ( ♯ ‘ ( 1st𝑐 ) ) ) = ( 0 ..^ 𝑁 ) )
34 33 eleq2d ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁 → ( ( 𝑁 − 2 ) ∈ ( 0 ..^ ( ♯ ‘ ( 1st𝑐 ) ) ) ↔ ( 𝑁 − 2 ) ∈ ( 0 ..^ 𝑁 ) ) )
35 34 3ad2ant1 ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ( 𝑁 − 2 ) ∈ ( 0 ..^ ( ♯ ‘ ( 1st𝑐 ) ) ) ↔ ( 𝑁 − 2 ) ∈ ( 0 ..^ 𝑁 ) ) )
36 32 35 mpbird ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( 𝑁 − 2 ) ∈ ( 0 ..^ ( ♯ ‘ ( 1st𝑐 ) ) ) )
37 pfxfv ( ( ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ( 0 ... ( ♯ ‘ ( 2nd𝑐 ) ) ) ∧ ( 𝑁 − 2 ) ∈ ( 0 ..^ ( ♯ ‘ ( 1st𝑐 ) ) ) ) → ( ( ( 2nd𝑐 ) prefix ( ♯ ‘ ( 1st𝑐 ) ) ) ‘ ( 𝑁 − 2 ) ) = ( ( 2nd𝑐 ) ‘ ( 𝑁 − 2 ) ) )
38 7 23 36 37 syl3anc ( ( ( ♯ ‘ ( 1st𝑐 ) ) = 𝑁𝑐 ∈ ( ClWalks ‘ 𝐺 ) ∧ 𝑁 ∈ ( ℤ ‘ 2 ) ) → ( ( ( 2nd𝑐 ) prefix ( ♯ ‘ ( 1st𝑐 ) ) ) ‘ ( 𝑁 − 2 ) ) = ( ( 2nd𝑐 ) ‘ ( 𝑁 − 2 ) ) )