Metamath Proof Explorer


Theorem iswlk

Description: Properties of a pair of functions to be a walk. (Contributed by AV, 30-Dec-2020)

Ref Expression
Hypotheses wksfval.v 𝑉 = ( Vtx ‘ 𝐺 )
wksfval.i 𝐼 = ( iEdg ‘ 𝐺 )
Assertion iswlk ( ( 𝐺𝑊𝐹𝑈𝑃𝑍 ) → ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ↔ ( 𝐹 ∈ Word dom 𝐼𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) ) ) )

Proof

Step Hyp Ref Expression
1 wksfval.v 𝑉 = ( Vtx ‘ 𝐺 )
2 wksfval.i 𝐼 = ( iEdg ‘ 𝐺 )
3 df-br ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ↔ ⟨ 𝐹 , 𝑃 ⟩ ∈ ( Walks ‘ 𝐺 ) )
4 1 2 wksfval ( 𝐺𝑊 → ( Walks ‘ 𝐺 ) = { ⟨ 𝑓 , 𝑝 ⟩ ∣ ( 𝑓 ∈ Word dom 𝐼𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ) } )
5 4 3ad2ant1 ( ( 𝐺𝑊𝐹𝑈𝑃𝑍 ) → ( Walks ‘ 𝐺 ) = { ⟨ 𝑓 , 𝑝 ⟩ ∣ ( 𝑓 ∈ Word dom 𝐼𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ) } )
6 5 eleq2d ( ( 𝐺𝑊𝐹𝑈𝑃𝑍 ) → ( ⟨ 𝐹 , 𝑃 ⟩ ∈ ( Walks ‘ 𝐺 ) ↔ ⟨ 𝐹 , 𝑃 ⟩ ∈ { ⟨ 𝑓 , 𝑝 ⟩ ∣ ( 𝑓 ∈ Word dom 𝐼𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ) } ) )
7 3 6 syl5bb ( ( 𝐺𝑊𝐹𝑈𝑃𝑍 ) → ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ↔ ⟨ 𝐹 , 𝑃 ⟩ ∈ { ⟨ 𝑓 , 𝑝 ⟩ ∣ ( 𝑓 ∈ Word dom 𝐼𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ) } ) )
8 eleq1 ( 𝑓 = 𝐹 → ( 𝑓 ∈ Word dom 𝐼𝐹 ∈ Word dom 𝐼 ) )
9 8 adantr ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( 𝑓 ∈ Word dom 𝐼𝐹 ∈ Word dom 𝐼 ) )
10 simpr ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → 𝑝 = 𝑃 )
11 fveq2 ( 𝑓 = 𝐹 → ( ♯ ‘ 𝑓 ) = ( ♯ ‘ 𝐹 ) )
12 11 oveq2d ( 𝑓 = 𝐹 → ( 0 ... ( ♯ ‘ 𝑓 ) ) = ( 0 ... ( ♯ ‘ 𝐹 ) ) )
13 12 adantr ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( 0 ... ( ♯ ‘ 𝑓 ) ) = ( 0 ... ( ♯ ‘ 𝐹 ) ) )
14 10 13 feq12d ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( 𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 ) )
15 11 oveq2d ( 𝑓 = 𝐹 → ( 0 ..^ ( ♯ ‘ 𝑓 ) ) = ( 0 ..^ ( ♯ ‘ 𝐹 ) ) )
16 15 adantr ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( 0 ..^ ( ♯ ‘ 𝑓 ) ) = ( 0 ..^ ( ♯ ‘ 𝐹 ) ) )
17 fveq1 ( 𝑝 = 𝑃 → ( 𝑝𝑘 ) = ( 𝑃𝑘 ) )
18 fveq1 ( 𝑝 = 𝑃 → ( 𝑝 ‘ ( 𝑘 + 1 ) ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) )
19 17 18 eqeq12d ( 𝑝 = 𝑃 → ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) ↔ ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) ) )
20 19 adantl ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) ↔ ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) ) )
21 fveq1 ( 𝑓 = 𝐹 → ( 𝑓𝑘 ) = ( 𝐹𝑘 ) )
22 21 fveq2d ( 𝑓 = 𝐹 → ( 𝐼 ‘ ( 𝑓𝑘 ) ) = ( 𝐼 ‘ ( 𝐹𝑘 ) ) )
23 17 sneqd ( 𝑝 = 𝑃 → { ( 𝑝𝑘 ) } = { ( 𝑃𝑘 ) } )
24 22 23 eqeqan12d ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } ↔ ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } ) )
25 17 18 preq12d ( 𝑝 = 𝑃 → { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } = { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } )
26 25 adantl ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } = { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } )
27 22 adantr ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( 𝐼 ‘ ( 𝑓𝑘 ) ) = ( 𝐼 ‘ ( 𝐹𝑘 ) ) )
28 26 27 sseq12d ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ↔ { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) )
29 20 24 28 ifpbi123d ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ↔ if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) ) )
30 16 29 raleqbidv ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ↔ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) ) )
31 9 14 30 3anbi123d ( ( 𝑓 = 𝐹𝑝 = 𝑃 ) → ( ( 𝑓 ∈ Word dom 𝐼𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ) ↔ ( 𝐹 ∈ Word dom 𝐼𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) ) ) )
32 31 opelopabga ( ( 𝐹𝑈𝑃𝑍 ) → ( ⟨ 𝐹 , 𝑃 ⟩ ∈ { ⟨ 𝑓 , 𝑝 ⟩ ∣ ( 𝑓 ∈ Word dom 𝐼𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ) } ↔ ( 𝐹 ∈ Word dom 𝐼𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) ) ) )
33 32 3adant1 ( ( 𝐺𝑊𝐹𝑈𝑃𝑍 ) → ( ⟨ 𝐹 , 𝑃 ⟩ ∈ { ⟨ 𝑓 , 𝑝 ⟩ ∣ ( 𝑓 ∈ Word dom 𝐼𝑝 : ( 0 ... ( ♯ ‘ 𝑓 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) if- ( ( 𝑝𝑘 ) = ( 𝑝 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝑓𝑘 ) ) = { ( 𝑝𝑘 ) } , { ( 𝑝𝑘 ) , ( 𝑝 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝑓𝑘 ) ) ) ) } ↔ ( 𝐹 ∈ Word dom 𝐼𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) ) ) )
34 7 33 bitrd ( ( 𝐺𝑊𝐹𝑈𝑃𝑍 ) → ( 𝐹 ( Walks ‘ 𝐺 ) 𝑃 ↔ ( 𝐹 ∈ Word dom 𝐼𝑃 : ( 0 ... ( ♯ ‘ 𝐹 ) ) ⟶ 𝑉 ∧ ∀ 𝑘 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) if- ( ( 𝑃𝑘 ) = ( 𝑃 ‘ ( 𝑘 + 1 ) ) , ( 𝐼 ‘ ( 𝐹𝑘 ) ) = { ( 𝑃𝑘 ) } , { ( 𝑃𝑘 ) , ( 𝑃 ‘ ( 𝑘 + 1 ) ) } ⊆ ( 𝐼 ‘ ( 𝐹𝑘 ) ) ) ) ) )