Metamath Proof Explorer


Theorem uspgr2wlkeqi

Description: Conditions for two walks within the same simple pseudograph to be identical. It is sufficient that the vertices (in the same order) are identical. (Contributed by AV, 6-May-2021)

Ref Expression
Assertion uspgr2wlkeqi ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → 𝐴 = 𝐵 )

Proof

Step Hyp Ref Expression
1 wlkcpr ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ↔ ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) )
2 wlkcpr ( 𝐵 ∈ ( Walks ‘ 𝐺 ) ↔ ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) )
3 wlkcl ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) → ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 )
4 fveq2 ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ♯ ‘ ( 2nd𝐴 ) ) = ( ♯ ‘ ( 2nd𝐵 ) ) )
5 4 oveq1d ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ( ♯ ‘ ( 2nd𝐴 ) ) − 1 ) = ( ( ♯ ‘ ( 2nd𝐵 ) ) − 1 ) )
6 5 eqcomd ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ( ♯ ‘ ( 2nd𝐵 ) ) − 1 ) = ( ( ♯ ‘ ( 2nd𝐴 ) ) − 1 ) )
7 6 adantl ( ( ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) ∧ ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → ( ( ♯ ‘ ( 2nd𝐵 ) ) − 1 ) = ( ( ♯ ‘ ( 2nd𝐴 ) ) − 1 ) )
8 wlklenvm1 ( ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) → ( ♯ ‘ ( 1st𝐵 ) ) = ( ( ♯ ‘ ( 2nd𝐵 ) ) − 1 ) )
9 wlklenvm1 ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) → ( ♯ ‘ ( 1st𝐴 ) ) = ( ( ♯ ‘ ( 2nd𝐴 ) ) − 1 ) )
10 8 9 eqeqan12rd ( ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) ∧ ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) ) → ( ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ↔ ( ( ♯ ‘ ( 2nd𝐵 ) ) − 1 ) = ( ( ♯ ‘ ( 2nd𝐴 ) ) − 1 ) ) )
11 10 adantr ( ( ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) ∧ ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → ( ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ↔ ( ( ♯ ‘ ( 2nd𝐵 ) ) − 1 ) = ( ( ♯ ‘ ( 2nd𝐴 ) ) − 1 ) ) )
12 7 11 mpbird ( ( ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) ∧ ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) )
13 12 anim2i ( ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) ∧ ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) ) → ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) )
14 13 exp44 ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 → ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) → ( ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) ) ) )
15 3 14 mpcom ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) → ( ( 1st𝐵 ) ( Walks ‘ 𝐺 ) ( 2nd𝐵 ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) ) )
16 2 15 syl5bi ( ( 1st𝐴 ) ( Walks ‘ 𝐺 ) ( 2nd𝐴 ) → ( 𝐵 ∈ ( Walks ‘ 𝐺 ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) ) )
17 1 16 sylbi ( 𝐴 ∈ ( Walks ‘ 𝐺 ) → ( 𝐵 ∈ ( Walks ‘ 𝐺 ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) ) )
18 17 imp31 ( ( ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) )
19 18 3adant1 ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) )
20 simpl ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) → 𝐺 ∈ USPGraph )
21 simpl ( ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) → ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 )
22 20 21 anim12i ( ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) ∧ ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) → ( 𝐺 ∈ USPGraph ∧ ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ) )
23 simpl ( ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) → 𝐴 ∈ ( Walks ‘ 𝐺 ) )
24 23 adantl ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) → 𝐴 ∈ ( Walks ‘ 𝐺 ) )
25 eqidd ( ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) → ( ♯ ‘ ( 1st𝐴 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) )
26 24 25 anim12i ( ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) ∧ ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) → ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ ( ♯ ‘ ( 1st𝐴 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) )
27 simpr ( ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) → 𝐵 ∈ ( Walks ‘ 𝐺 ) )
28 27 adantl ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) → 𝐵 ∈ ( Walks ‘ 𝐺 ) )
29 simpr ( ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) → ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) )
30 28 29 anim12i ( ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) ∧ ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) → ( 𝐵 ∈ ( Walks ‘ 𝐺 ) ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) )
31 uspgr2wlkeq2 ( ( ( 𝐺 ∈ USPGraph ∧ ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ) ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ ( ♯ ‘ ( 1st𝐴 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ∧ ( 𝐵 ∈ ( Walks ‘ 𝐺 ) ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → 𝐴 = 𝐵 ) )
32 22 26 30 31 syl3anc ( ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) ∧ ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → 𝐴 = 𝐵 ) )
33 32 ex ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) → ( ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → 𝐴 = 𝐵 ) ) )
34 33 com23 ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ) → ( ( 2nd𝐴 ) = ( 2nd𝐵 ) → ( ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) → 𝐴 = 𝐵 ) ) )
35 34 3impia ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → ( ( ( ♯ ‘ ( 1st𝐴 ) ) ∈ ℕ0 ∧ ( ♯ ‘ ( 1st𝐵 ) ) = ( ♯ ‘ ( 1st𝐴 ) ) ) → 𝐴 = 𝐵 ) )
36 19 35 mpd ( ( 𝐺 ∈ USPGraph ∧ ( 𝐴 ∈ ( Walks ‘ 𝐺 ) ∧ 𝐵 ∈ ( Walks ‘ 𝐺 ) ) ∧ ( 2nd𝐴 ) = ( 2nd𝐵 ) ) → 𝐴 = 𝐵 )