Metamath Proof Explorer


Theorem wlkl1loop

Description: A walk of length 1 from a vertex to itself is a loop. (Contributed by AV, 23-Apr-2021)

Ref Expression
Assertion wlkl1loop ( ( ( Fun ( iEdg ‘ 𝐺 ) ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) )

Proof

Step Hyp Ref Expression
1 wlkv ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 → ( 𝐺 ∈ V ∧ 𝐹 ∈ V ∧ 𝑃 ∈ V ) )
2 simp3l ( ( 𝐺 ∈ V ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) ) → Fun ( iEdg ‘ 𝐺 ) )
3 simp2 ( ( 𝐺 ∈ V ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) ) → 𝐹 ( Walks ‘ 𝐺 ) 𝑃 )
4 c0ex 0 ∈ V
5 4 snid 0 ∈ { 0 }
6 oveq2 ( ( ♯ ‘ 𝐹 ) = 1 → ( 0 ..^ ( ♯ ‘ 𝐹 ) ) = ( 0 ..^ 1 ) )
7 fzo01 ( 0 ..^ 1 ) = { 0 }
8 6 7 eqtrdi ( ( ♯ ‘ 𝐹 ) = 1 → ( 0 ..^ ( ♯ ‘ 𝐹 ) ) = { 0 } )
9 5 8 eleqtrrid ( ( ♯ ‘ 𝐹 ) = 1 → 0 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) )
10 9 ad2antrl ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → 0 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) )
11 10 3ad2ant3 ( ( 𝐺 ∈ V ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) ) → 0 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) )
12 eqid ( iEdg ‘ 𝐺 ) = ( iEdg ‘ 𝐺 )
13 12 iedginwlk ( ( Fun ( iEdg ‘ 𝐺 ) ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ 0 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) → ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ∈ ran ( iEdg ‘ 𝐺 ) )
14 2 3 11 13 syl3anc ( ( 𝐺 ∈ V ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) ) → ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ∈ ran ( iEdg ‘ 𝐺 ) )
15 eqid ( Vtx ‘ 𝐺 ) = ( Vtx ‘ 𝐺 )
16 15 12 iswlkg ( 𝐺 ∈ V → ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ↔ ( 𝐹 ∈ Word dom ( iEdg ‘ 𝐺 ) ∧ 𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ ( Vtx ‘ 𝐺 ) ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ) ) )
17 8 raleqdv ( ( ♯ ‘ 𝐹 ) = 1 → ( ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ↔ ∀ 𝑘 ∈ { 0 } if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ) )
18 oveq1 ( 𝑘 = 0 → ( 𝑘 + 1 ) = ( 0 + 1 ) )
19 0p1e1 ( 0 + 1 ) = 1
20 18 19 eqtrdi ( 𝑘 = 0 → ( 𝑘 + 1 ) = 1 )
21 wkslem2 ( ( 𝑘 = 0 ∧ ( 𝑘 + 1 ) = 1 ) → ( if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ↔ if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ) )
22 20 21 mpdan ( 𝑘 = 0 → ( if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ↔ if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ) )
23 4 22 ralsn ( ∀ 𝑘 ∈ { 0 } if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ↔ if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) )
24 17 23 bitrdi ( ( ♯ ‘ 𝐹 ) = 1 → ( ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ↔ if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ) )
25 24 ad2antrl ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → ( ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ↔ if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ) )
26 ifptru ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) → ( if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ↔ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } ) )
27 26 biimpa ( ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ∧ if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ) → ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } )
28 27 eqcomd ( ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ∧ if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) )
29 28 ex ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) → ( if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) )
30 29 ad2antll ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → ( if- ( ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) = { ( 𝑃 ‘ 0 ) } , { ( 𝑃 ‘ 0 ) , ( 𝑃 ‘ 1 ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) )
31 25 30 sylbid ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → ( ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) )
32 31 com12 ( ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) → ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) )
33 32 3ad2ant3 ( ( 𝐹 ∈ Word dom ( iEdg ‘ 𝐺 ) ∧ 𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ ( Vtx ‘ 𝐺 ) ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹𝑘 ) ) ) ) → ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) )
34 16 33 syl6bi ( 𝐺 ∈ V → ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 → ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) ) ) )
35 34 3imp ( ( 𝐺 ∈ V ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) ) → { ( 𝑃 ‘ 0 ) } = ( ( iEdg ‘ 𝐺 ) ‘ ( 𝐹 ‘ 0 ) ) )
36 edgval ( Edg ‘ 𝐺 ) = ran ( iEdg ‘ 𝐺 )
37 36 a1i ( ( 𝐺 ∈ V ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) ) → ( Edg ‘ 𝐺 ) = ran ( iEdg ‘ 𝐺 ) )
38 14 35 37 3eltr4d ( ( 𝐺 ∈ V ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ∧ ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) )
39 38 3exp ( 𝐺 ∈ V → ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 → ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) ) ) )
40 39 3ad2ant1 ( ( 𝐺 ∈ V ∧ 𝐹 ∈ V ∧ 𝑃 ∈ V ) → ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 → ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) ) ) )
41 1 40 mpcom ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 → ( ( Fun ( iEdg ‘ 𝐺 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) ) )
42 41 expd ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 → ( Fun ( iEdg ‘ 𝐺 ) → ( ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) ) ) )
43 42 impcom ( ( Fun ( iEdg ‘ 𝐺 ) ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ) → ( ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) ) )
44 43 imp ( ( ( Fun ( iEdg ‘ 𝐺 ) ∧ 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ) ∧ ( ( ♯ ‘ 𝐹 ) = 1 ∧ ( 𝑃 ‘ 0 ) = ( 𝑃 ‘ 1 ) ) ) → { ( 𝑃 ‘ 0 ) } ∈ ( Edg ‘ 𝐺 ) )