Metamath Proof Explorer


Theorem difuncomp

Description: Express a class difference using unions and class complements. (Contributed by Thierry Arnoux, 21-Jun-2020)

Ref Expression
Assertion difuncomp ( 𝐴𝐶 → ( 𝐴𝐵 ) = ( 𝐶 ∖ ( ( 𝐶𝐴 ) ∪ 𝐵 ) ) )

Proof

Step Hyp Ref Expression
1 sseqin2 ( 𝐴𝐶 ↔ ( 𝐶𝐴 ) = 𝐴 )
2 1 biimpi ( 𝐴𝐶 → ( 𝐶𝐴 ) = 𝐴 )
3 incom ( 𝐶𝐴 ) = ( 𝐴𝐶 )
4 2 3 eqtr3di ( 𝐴𝐶𝐴 = ( 𝐴𝐶 ) )
5 4 difeq1d ( 𝐴𝐶 → ( 𝐴𝐵 ) = ( ( 𝐴𝐶 ) ∖ 𝐵 ) )
6 difundi ( 𝐶 ∖ ( ( 𝐶𝐴 ) ∪ 𝐵 ) ) = ( ( 𝐶 ∖ ( 𝐶𝐴 ) ) ∩ ( 𝐶𝐵 ) )
7 dfss4 ( 𝐴𝐶 ↔ ( 𝐶 ∖ ( 𝐶𝐴 ) ) = 𝐴 )
8 7 biimpi ( 𝐴𝐶 → ( 𝐶 ∖ ( 𝐶𝐴 ) ) = 𝐴 )
9 8 ineq1d ( 𝐴𝐶 → ( ( 𝐶 ∖ ( 𝐶𝐴 ) ) ∩ ( 𝐶𝐵 ) ) = ( 𝐴 ∩ ( 𝐶𝐵 ) ) )
10 6 9 syl5eq ( 𝐴𝐶 → ( 𝐶 ∖ ( ( 𝐶𝐴 ) ∪ 𝐵 ) ) = ( 𝐴 ∩ ( 𝐶𝐵 ) ) )
11 indif2 ( 𝐴 ∩ ( 𝐶𝐵 ) ) = ( ( 𝐴𝐶 ) ∖ 𝐵 )
12 10 11 eqtrdi ( 𝐴𝐶 → ( 𝐶 ∖ ( ( 𝐶𝐴 ) ∪ 𝐵 ) ) = ( ( 𝐴𝐶 ) ∖ 𝐵 ) )
13 5 12 eqtr4d ( 𝐴𝐶 → ( 𝐴𝐵 ) = ( 𝐶 ∖ ( ( 𝐶𝐴 ) ∪ 𝐵 ) ) )