Metamath Proof Explorer


Theorem eqoreldif

Description: An element of a set is either equal to another element of the set or a member of the difference of the set and the singleton containing the other element. (Contributed by AV, 25-Aug-2020) (Proof shortened by JJ, 23-Jul-2021)

Ref Expression
Assertion eqoreldif ( 𝐵𝐶 → ( 𝐴𝐶 ↔ ( 𝐴 = 𝐵𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) ) ) )

Proof

Step Hyp Ref Expression
1 simpl ( ( 𝐴𝐶 ∧ ¬ 𝐴 = 𝐵 ) → 𝐴𝐶 )
2 elsni ( 𝐴 ∈ { 𝐵 } → 𝐴 = 𝐵 )
3 2 con3i ( ¬ 𝐴 = 𝐵 → ¬ 𝐴 ∈ { 𝐵 } )
4 3 adantl ( ( 𝐴𝐶 ∧ ¬ 𝐴 = 𝐵 ) → ¬ 𝐴 ∈ { 𝐵 } )
5 1 4 eldifd ( ( 𝐴𝐶 ∧ ¬ 𝐴 = 𝐵 ) → 𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) )
6 5 ex ( 𝐴𝐶 → ( ¬ 𝐴 = 𝐵𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) ) )
7 6 orrd ( 𝐴𝐶 → ( 𝐴 = 𝐵𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) ) )
8 eleq1a ( 𝐵𝐶 → ( 𝐴 = 𝐵𝐴𝐶 ) )
9 eldifi ( 𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) → 𝐴𝐶 )
10 9 a1i ( 𝐵𝐶 → ( 𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) → 𝐴𝐶 ) )
11 8 10 jaod ( 𝐵𝐶 → ( ( 𝐴 = 𝐵𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) ) → 𝐴𝐶 ) )
12 7 11 impbid2 ( 𝐵𝐶 → ( 𝐴𝐶 ↔ ( 𝐴 = 𝐵𝐴 ∈ ( 𝐶 ∖ { 𝐵 } ) ) ) )