Metamath Proof Explorer


Theorem difrab

Description: Difference of two restricted class abstractions. (Contributed by NM, 23-Oct-2004)

Ref Expression
Assertion difrab ( { 𝑥𝐴𝜑 } ∖ { 𝑥𝐴𝜓 } ) = { 𝑥𝐴 ∣ ( 𝜑 ∧ ¬ 𝜓 ) }

Proof

Step Hyp Ref Expression
1 df-rab { 𝑥𝐴𝜑 } = { 𝑥 ∣ ( 𝑥𝐴𝜑 ) }
2 df-rab { 𝑥𝐴𝜓 } = { 𝑥 ∣ ( 𝑥𝐴𝜓 ) }
3 1 2 difeq12i ( { 𝑥𝐴𝜑 } ∖ { 𝑥𝐴𝜓 } ) = ( { 𝑥 ∣ ( 𝑥𝐴𝜑 ) } ∖ { 𝑥 ∣ ( 𝑥𝐴𝜓 ) } )
4 df-rab { 𝑥𝐴 ∣ ( 𝜑 ∧ ¬ 𝜓 ) } = { 𝑥 ∣ ( 𝑥𝐴 ∧ ( 𝜑 ∧ ¬ 𝜓 ) ) }
5 difab ( { 𝑥 ∣ ( 𝑥𝐴𝜑 ) } ∖ { 𝑥 ∣ ( 𝑥𝐴𝜓 ) } ) = { 𝑥 ∣ ( ( 𝑥𝐴𝜑 ) ∧ ¬ ( 𝑥𝐴𝜓 ) ) }
6 anass ( ( ( 𝑥𝐴𝜑 ) ∧ ¬ 𝜓 ) ↔ ( 𝑥𝐴 ∧ ( 𝜑 ∧ ¬ 𝜓 ) ) )
7 simpr ( ( 𝑥𝐴𝜓 ) → 𝜓 )
8 7 con3i ( ¬ 𝜓 → ¬ ( 𝑥𝐴𝜓 ) )
9 8 anim2i ( ( ( 𝑥𝐴𝜑 ) ∧ ¬ 𝜓 ) → ( ( 𝑥𝐴𝜑 ) ∧ ¬ ( 𝑥𝐴𝜓 ) ) )
10 pm3.2 ( 𝑥𝐴 → ( 𝜓 → ( 𝑥𝐴𝜓 ) ) )
11 10 adantr ( ( 𝑥𝐴𝜑 ) → ( 𝜓 → ( 𝑥𝐴𝜓 ) ) )
12 11 con3d ( ( 𝑥𝐴𝜑 ) → ( ¬ ( 𝑥𝐴𝜓 ) → ¬ 𝜓 ) )
13 12 imdistani ( ( ( 𝑥𝐴𝜑 ) ∧ ¬ ( 𝑥𝐴𝜓 ) ) → ( ( 𝑥𝐴𝜑 ) ∧ ¬ 𝜓 ) )
14 9 13 impbii ( ( ( 𝑥𝐴𝜑 ) ∧ ¬ 𝜓 ) ↔ ( ( 𝑥𝐴𝜑 ) ∧ ¬ ( 𝑥𝐴𝜓 ) ) )
15 6 14 bitr3i ( ( 𝑥𝐴 ∧ ( 𝜑 ∧ ¬ 𝜓 ) ) ↔ ( ( 𝑥𝐴𝜑 ) ∧ ¬ ( 𝑥𝐴𝜓 ) ) )
16 15 abbii { 𝑥 ∣ ( 𝑥𝐴 ∧ ( 𝜑 ∧ ¬ 𝜓 ) ) } = { 𝑥 ∣ ( ( 𝑥𝐴𝜑 ) ∧ ¬ ( 𝑥𝐴𝜓 ) ) }
17 5 16 eqtr4i ( { 𝑥 ∣ ( 𝑥𝐴𝜑 ) } ∖ { 𝑥 ∣ ( 𝑥𝐴𝜓 ) } ) = { 𝑥 ∣ ( 𝑥𝐴 ∧ ( 𝜑 ∧ ¬ 𝜓 ) ) }
18 4 17 eqtr4i { 𝑥𝐴 ∣ ( 𝜑 ∧ ¬ 𝜓 ) } = ( { 𝑥 ∣ ( 𝑥𝐴𝜑 ) } ∖ { 𝑥 ∣ ( 𝑥𝐴𝜓 ) } )
19 3 18 eqtr4i ( { 𝑥𝐴𝜑 } ∖ { 𝑥𝐴𝜓 } ) = { 𝑥𝐴 ∣ ( 𝜑 ∧ ¬ 𝜓 ) }