Metamath Proof Explorer


Theorem clwlknf1oclwwlknlem1

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

Ref Expression
Assertion clwlknf1oclwwlknlem1 ( ( 𝐶 ∈ ( ClWalks ‘ 𝐺 ) ∧ 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ♯ ‘ ( 1st𝐶 ) ) )

Proof

Step Hyp Ref Expression
1 clwlkwlk ( 𝐶 ∈ ( ClWalks ‘ 𝐺 ) → 𝐶 ∈ ( Walks ‘ 𝐺 ) )
2 wlkcpr ( 𝐶 ∈ ( Walks ‘ 𝐺 ) ↔ ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) )
3 eqid ( Vtx ‘ 𝐺 ) = ( Vtx ‘ 𝐺 )
4 3 wlkpwrd ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( 2nd𝐶 ) ∈ Word ( Vtx ‘ 𝐺 ) )
5 lencl ( ( 2nd𝐶 ) ∈ Word ( Vtx ‘ 𝐺 ) → ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℕ0 )
6 4 5 syl ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℕ0 )
7 wlklenvm1 ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( ♯ ‘ ( 1st𝐶 ) ) = ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) )
8 7 breq2d ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ↔ 1 ≤ ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) )
9 1red ( ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℕ0 → 1 ∈ ℝ )
10 nn0re ( ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℕ0 → ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℝ )
11 9 9 10 leaddsub2d ( ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℕ0 → ( ( 1 + 1 ) ≤ ( ♯ ‘ ( 2nd𝐶 ) ) ↔ 1 ≤ ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) )
12 1p1e2 ( 1 + 1 ) = 2
13 12 breq1i ( ( 1 + 1 ) ≤ ( ♯ ‘ ( 2nd𝐶 ) ) ↔ 2 ≤ ( ♯ ‘ ( 2nd𝐶 ) ) )
14 13 biimpi ( ( 1 + 1 ) ≤ ( ♯ ‘ ( 2nd𝐶 ) ) → 2 ≤ ( ♯ ‘ ( 2nd𝐶 ) ) )
15 11 14 syl6bir ( ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℕ0 → ( 1 ≤ ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) → 2 ≤ ( ♯ ‘ ( 2nd𝐶 ) ) ) )
16 4 5 15 3syl ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( 1 ≤ ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) → 2 ≤ ( ♯ ‘ ( 2nd𝐶 ) ) ) )
17 8 16 sylbid ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) → 2 ≤ ( ♯ ‘ ( 2nd𝐶 ) ) ) )
18 17 imp ( ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) ∧ 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ) → 2 ≤ ( ♯ ‘ ( 2nd𝐶 ) ) )
19 ige2m1fz ( ( ( ♯ ‘ ( 2nd𝐶 ) ) ∈ ℕ0 ∧ 2 ≤ ( ♯ ‘ ( 2nd𝐶 ) ) ) → ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ∈ ( 0 ... ( ♯ ‘ ( 2nd𝐶 ) ) ) )
20 6 18 19 syl2an2r ( ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) ∧ 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ) → ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ∈ ( 0 ... ( ♯ ‘ ( 2nd𝐶 ) ) ) )
21 pfxlen ( ( ( 2nd𝐶 ) ∈ Word ( Vtx ‘ 𝐺 ) ∧ ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ∈ ( 0 ... ( ♯ ‘ ( 2nd𝐶 ) ) ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) )
22 4 20 21 syl2an2r ( ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) ∧ 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) )
23 7 eqcomd ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) = ( ♯ ‘ ( 1st𝐶 ) ) )
24 23 adantr ( ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) ∧ 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ) → ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) = ( ♯ ‘ ( 1st𝐶 ) ) )
25 22 24 eqtrd ( ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) ∧ 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ♯ ‘ ( 1st𝐶 ) ) )
26 25 ex ( ( 1st𝐶 ) ( Walks ‘ 𝐺 ) ( 2nd𝐶 ) → ( 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ♯ ‘ ( 1st𝐶 ) ) ) )
27 2 26 sylbi ( 𝐶 ∈ ( Walks ‘ 𝐺 ) → ( 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ♯ ‘ ( 1st𝐶 ) ) ) )
28 1 27 syl ( 𝐶 ∈ ( ClWalks ‘ 𝐺 ) → ( 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ♯ ‘ ( 1st𝐶 ) ) ) )
29 28 imp ( ( 𝐶 ∈ ( ClWalks ‘ 𝐺 ) ∧ 1 ≤ ( ♯ ‘ ( 1st𝐶 ) ) ) → ( ♯ ‘ ( ( 2nd𝐶 ) prefix ( ( ♯ ‘ ( 2nd𝐶 ) ) − 1 ) ) ) = ( ♯ ‘ ( 1st𝐶 ) ) )