Metamath Proof Explorer


Theorem nbumgr

Description: The set of neighbors of an arbitrary class in a multigraph. (Contributed by AV, 27-Nov-2020)

Ref Expression
Hypotheses nbuhgr.v 𝑉 = ( Vtx ‘ 𝐺 )
nbuhgr.e 𝐸 = ( Edg ‘ 𝐺 )
Assertion nbumgr ( 𝐺 ∈ UMGraph → ( 𝐺 NeighbVtx 𝑁 ) = { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } )

Proof

Step Hyp Ref Expression
1 nbuhgr.v 𝑉 = ( Vtx ‘ 𝐺 )
2 nbuhgr.e 𝐸 = ( Edg ‘ 𝐺 )
3 1 2 nbumgrvtx ( ( 𝐺 ∈ UMGraph ∧ 𝑁𝑉 ) → ( 𝐺 NeighbVtx 𝑁 ) = { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } )
4 3 expcom ( 𝑁𝑉 → ( 𝐺 ∈ UMGraph → ( 𝐺 NeighbVtx 𝑁 ) = { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } ) )
5 df-nel ( 𝑁𝑉 ↔ ¬ 𝑁𝑉 )
6 1 nbgrnvtx0 ( 𝑁𝑉 → ( 𝐺 NeighbVtx 𝑁 ) = ∅ )
7 5 6 sylbir ( ¬ 𝑁𝑉 → ( 𝐺 NeighbVtx 𝑁 ) = ∅ )
8 7 adantr ( ( ¬ 𝑁𝑉𝐺 ∈ UMGraph ) → ( 𝐺 NeighbVtx 𝑁 ) = ∅ )
9 1 2 umgrpredgv ( ( 𝐺 ∈ UMGraph ∧ { 𝑁 , 𝑛 } ∈ 𝐸 ) → ( 𝑁𝑉𝑛𝑉 ) )
10 9 simpld ( ( 𝐺 ∈ UMGraph ∧ { 𝑁 , 𝑛 } ∈ 𝐸 ) → 𝑁𝑉 )
11 10 ex ( 𝐺 ∈ UMGraph → ( { 𝑁 , 𝑛 } ∈ 𝐸𝑁𝑉 ) )
12 11 adantl ( ( 𝑛𝑉𝐺 ∈ UMGraph ) → ( { 𝑁 , 𝑛 } ∈ 𝐸𝑁𝑉 ) )
13 12 con3d ( ( 𝑛𝑉𝐺 ∈ UMGraph ) → ( ¬ 𝑁𝑉 → ¬ { 𝑁 , 𝑛 } ∈ 𝐸 ) )
14 13 ex ( 𝑛𝑉 → ( 𝐺 ∈ UMGraph → ( ¬ 𝑁𝑉 → ¬ { 𝑁 , 𝑛 } ∈ 𝐸 ) ) )
15 14 com13 ( ¬ 𝑁𝑉 → ( 𝐺 ∈ UMGraph → ( 𝑛𝑉 → ¬ { 𝑁 , 𝑛 } ∈ 𝐸 ) ) )
16 15 imp ( ( ¬ 𝑁𝑉𝐺 ∈ UMGraph ) → ( 𝑛𝑉 → ¬ { 𝑁 , 𝑛 } ∈ 𝐸 ) )
17 16 ralrimiv ( ( ¬ 𝑁𝑉𝐺 ∈ UMGraph ) → ∀ 𝑛𝑉 ¬ { 𝑁 , 𝑛 } ∈ 𝐸 )
18 rabeq0 ( { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } = ∅ ↔ ∀ 𝑛𝑉 ¬ { 𝑁 , 𝑛 } ∈ 𝐸 )
19 17 18 sylibr ( ( ¬ 𝑁𝑉𝐺 ∈ UMGraph ) → { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } = ∅ )
20 8 19 eqtr4d ( ( ¬ 𝑁𝑉𝐺 ∈ UMGraph ) → ( 𝐺 NeighbVtx 𝑁 ) = { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } )
21 20 ex ( ¬ 𝑁𝑉 → ( 𝐺 ∈ UMGraph → ( 𝐺 NeighbVtx 𝑁 ) = { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } ) )
22 4 21 pm2.61i ( 𝐺 ∈ UMGraph → ( 𝐺 NeighbVtx 𝑁 ) = { 𝑛𝑉 ∣ { 𝑁 , 𝑛 } ∈ 𝐸 } )