Metamath Proof Explorer


Theorem pthhashvtx

Description: A graph containing a path has at least as many vertices as there are edges in the path. (Contributed by BTernaryTau, 5-Oct-2023)

Ref Expression
Hypothesis pthhashvtx.1 𝑉 = ( Vtx ‘ 𝐺 )
Assertion pthhashvtx ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ♯ ‘ 𝐹 ) ≤ ( ♯ ‘ 𝑉 ) )

Proof

Step Hyp Ref Expression
1 pthhashvtx.1 𝑉 = ( Vtx ‘ 𝐺 )
2 hashfz0 ( ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 → ( ♯ ‘ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) = ( ( ( ♯ ‘ 𝐹 ) − 1 ) + 1 ) )
3 pthiswlk ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃𝐹 ( Walks ‘ 𝐺 ) 𝑃 )
4 wlkcl ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 → ( ♯ ‘ 𝐹 ) ∈ ℕ0 )
5 3 4 syl ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ♯ ‘ 𝐹 ) ∈ ℕ0 )
6 nn0cn ( ( ♯ ‘ 𝐹 ) ∈ ℕ0 → ( ♯ ‘ 𝐹 ) ∈ ℂ )
7 npcan1 ( ( ♯ ‘ 𝐹 ) ∈ ℂ → ( ( ( ♯ ‘ 𝐹 ) − 1 ) + 1 ) = ( ♯ ‘ 𝐹 ) )
8 5 6 7 3syl ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ( ( ♯ ‘ 𝐹 ) − 1 ) + 1 ) = ( ♯ ‘ 𝐹 ) )
9 2 8 sylan9eqr ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ♯ ‘ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) = ( ♯ ‘ 𝐹 ) )
10 1 wlkp ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 )
11 3 10 syl ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 )
12 11 ffnd ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃𝑃 Fn ( 0 ... ( ♯ ‘ 𝐹 ) ) )
13 fzfi ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ∈ Fin
14 resfnfinfin ( ( 𝑃 Fn ( 0 ... ( ♯ ‘ 𝐹 ) ) ∧ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ∈ Fin ) → ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ∈ Fin )
15 12 13 14 sylancl ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ∈ Fin )
16 simpr ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 )
17 fzssp1 ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⊆ ( 0 ... ( ( ( ♯ ‘ 𝐹 ) − 1 ) + 1 ) )
18 8 oveq2d ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 0 ... ( ( ( ♯ ‘ 𝐹 ) − 1 ) + 1 ) ) = ( 0 ... ( ♯ ‘ 𝐹 ) ) )
19 17 18 sseqtrid ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⊆ ( 0 ... ( ♯ ‘ 𝐹 ) ) )
20 11 19 fssresd ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⟶ 𝑉 )
21 20 adantr ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⟶ 𝑉 )
22 fz1ssfz0 ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⊆ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) )
23 22 a1i ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⊆ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
24 20 23 fssresd ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⟶ 𝑉 )
25 ispth ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ↔ ( 𝐹 ( Trails ‘ 𝐺 ) 𝑃 ∧ Fun ( 𝑃 ↾ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) ∧ ( ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ∩ ( 𝑃 “ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) ) = ∅ ) )
26 25 simp2bi ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → Fun ( 𝑃 ↾ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) )
27 nn0z ( ( ♯ ‘ 𝐹 ) ∈ ℕ0 → ( ♯ ‘ 𝐹 ) ∈ ℤ )
28 fzoval ( ( ♯ ‘ 𝐹 ) ∈ ℤ → ( 1 ..^ ( ♯ ‘ 𝐹 ) ) = ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
29 27 28 syl ( ( ♯ ‘ 𝐹 ) ∈ ℕ0 → ( 1 ..^ ( ♯ ‘ 𝐹 ) ) = ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
30 5 29 syl ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 1 ..^ ( ♯ ‘ 𝐹 ) ) = ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
31 30 reseq2d ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 𝑃 ↾ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) = ( 𝑃 ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) )
32 resabs1 ( ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⊆ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) = ( 𝑃 ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) )
33 22 32 ax-mp ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) = ( 𝑃 ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
34 31 33 eqtr4di ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 𝑃 ↾ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) = ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) )
35 34 cnveqd ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ( 𝑃 ↾ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) = ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) )
36 35 funeqd ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( Fun ( 𝑃 ↾ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) ↔ Fun ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ) )
37 26 36 mpbid ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → Fun ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) )
38 df-f1 ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) –1-1𝑉 ↔ ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⟶ 𝑉 ∧ Fun ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ) )
39 24 37 38 sylanbrc ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) –1-1𝑉 )
40 39 adantr ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ↾ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) –1-1𝑉 )
41 snsspr1 { 0 } ⊆ { 0 , ( ♯ ‘ 𝐹 ) }
42 imass2 ( { 0 } ⊆ { 0 , ( ♯ ‘ 𝐹 ) } → ( 𝑃 “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) )
43 41 42 ax-mp ( 𝑃 “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } )
44 0elfz ( ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 → 0 ∈ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
45 44 snssd ( ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 → { 0 } ⊆ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
46 resima2 ( { 0 } ⊆ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) = ( 𝑃 “ { 0 } ) )
47 sseq1 ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) = ( 𝑃 “ { 0 } ) → ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ↔ ( 𝑃 “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ) )
48 45 46 47 3syl ( ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 → ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ↔ ( 𝑃 “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ) )
49 43 48 mpbiri ( ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) )
50 resima2 ( ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ⊆ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) = ( 𝑃 “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) )
51 22 50 ax-mp ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) = ( 𝑃 “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) )
52 30 imaeq2d ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( 𝑃 “ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) = ( 𝑃 “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) )
53 51 52 eqtr4id ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) = ( 𝑃 “ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) )
54 53 ineq2d ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ∩ ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ) = ( ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ∩ ( 𝑃 “ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) ) )
55 25 simp3bi ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ∩ ( 𝑃 “ ( 1 ..^ ( ♯ ‘ 𝐹 ) ) ) ) = ∅ )
56 54 55 eqtrd ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ∩ ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ) = ∅ )
57 ssdisj ( ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) ⊆ ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ∧ ( ( 𝑃 “ { 0 , ( ♯ ‘ 𝐹 ) } ) ∩ ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ) = ∅ ) → ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) ∩ ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ) = ∅ )
58 49 56 57 syl2anr ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ { 0 } ) ∩ ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) “ ( 1 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ) = ∅ )
59 16 21 40 58 f1resfz0f1d ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) –1-1𝑉 )
60 1 fvexi 𝑉 ∈ V
61 hashf1dmcdm ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ∈ Fin ∧ 𝑉 ∈ V ∧ ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) –1-1𝑉 ) → ( ♯ ‘ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ≤ ( ♯ ‘ 𝑉 ) )
62 60 61 mp3an2 ( ( ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ∈ Fin ∧ ( 𝑃 ↾ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) : ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) –1-1𝑉 ) → ( ♯ ‘ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ≤ ( ♯ ‘ 𝑉 ) )
63 15 59 62 syl2an2r ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ♯ ‘ ( 0 ... ( ( ♯ ‘ 𝐹 ) − 1 ) ) ) ≤ ( ♯ ‘ 𝑉 ) )
64 9 63 eqbrtrrd ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ♯ ‘ 𝐹 ) ≤ ( ♯ ‘ 𝑉 ) )
65 0nn0m1nnn0 ( ( ♯ ‘ 𝐹 ) = 0 ↔ ( ( ♯ ‘ 𝐹 ) ∈ ℕ0 ∧ ¬ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) )
66 65 biimpri ( ( ( ♯ ‘ 𝐹 ) ∈ ℕ0 ∧ ¬ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ♯ ‘ 𝐹 ) = 0 )
67 5 66 sylan ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ¬ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ♯ ‘ 𝐹 ) = 0 )
68 hashge0 ( 𝑉 ∈ V → 0 ≤ ( ♯ ‘ 𝑉 ) )
69 60 68 ax-mp 0 ≤ ( ♯ ‘ 𝑉 )
70 67 69 eqbrtrdi ( ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 ∧ ¬ ( ( ♯ ‘ 𝐹 ) − 1 ) ∈ ℕ0 ) → ( ♯ ‘ 𝐹 ) ≤ ( ♯ ‘ 𝑉 ) )
71 64 70 pm2.61dan ( 𝐹 ( Paths ‘ 𝐺 ) 𝑃 → ( ♯ ‘ 𝐹 ) ≤ ( ♯ ‘ 𝑉 ) )