Metamath Proof Explorer


Theorem difunieq

Description: The difference of unions is a subset of the union of the difference. (Contributed by ML, 29-Mar-2021)

Ref Expression
Assertion difunieq ( 𝐴 𝐵 ) ⊆ ( 𝐴𝐵 )

Proof

Step Hyp Ref Expression
1 eluni ( 𝑥 𝐴 ↔ ∃ 𝑦 ( 𝑥𝑦𝑦𝐴 ) )
2 eluni ( 𝑥 𝐵 ↔ ∃ 𝑦 ( 𝑥𝑦𝑦𝐵 ) )
3 2 notbii ( ¬ 𝑥 𝐵 ↔ ¬ ∃ 𝑦 ( 𝑥𝑦𝑦𝐵 ) )
4 alinexa ( ∀ 𝑦 ( 𝑥𝑦 → ¬ 𝑦𝐵 ) ↔ ¬ ∃ 𝑦 ( 𝑥𝑦𝑦𝐵 ) )
5 nfa1 𝑦𝑦 ( 𝑥𝑦 → ¬ 𝑦𝐵 )
6 sp ( ∀ 𝑦 ( 𝑥𝑦 → ¬ 𝑦𝐵 ) → ( 𝑥𝑦 → ¬ 𝑦𝐵 ) )
7 6 adantrd ( ∀ 𝑦 ( 𝑥𝑦 → ¬ 𝑦𝐵 ) → ( ( 𝑥𝑦𝑦𝐴 ) → ¬ 𝑦𝐵 ) )
8 7 ancld ( ∀ 𝑦 ( 𝑥𝑦 → ¬ 𝑦𝐵 ) → ( ( 𝑥𝑦𝑦𝐴 ) → ( ( 𝑥𝑦𝑦𝐴 ) ∧ ¬ 𝑦𝐵 ) ) )
9 anass ( ( ( 𝑥𝑦𝑦𝐴 ) ∧ ¬ 𝑦𝐵 ) ↔ ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) )
10 8 9 syl6ib ( ∀ 𝑦 ( 𝑥𝑦 → ¬ 𝑦𝐵 ) → ( ( 𝑥𝑦𝑦𝐴 ) → ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) ) )
11 5 10 eximd ( ∀ 𝑦 ( 𝑥𝑦 → ¬ 𝑦𝐵 ) → ( ∃ 𝑦 ( 𝑥𝑦𝑦𝐴 ) → ∃ 𝑦 ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) ) )
12 4 11 sylbir ( ¬ ∃ 𝑦 ( 𝑥𝑦𝑦𝐵 ) → ( ∃ 𝑦 ( 𝑥𝑦𝑦𝐴 ) → ∃ 𝑦 ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) ) )
13 12 impcom ( ( ∃ 𝑦 ( 𝑥𝑦𝑦𝐴 ) ∧ ¬ ∃ 𝑦 ( 𝑥𝑦𝑦𝐵 ) ) → ∃ 𝑦 ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) )
14 1 3 13 syl2anb ( ( 𝑥 𝐴 ∧ ¬ 𝑥 𝐵 ) → ∃ 𝑦 ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) )
15 eldif ( 𝑥 ∈ ( 𝐴 𝐵 ) ↔ ( 𝑥 𝐴 ∧ ¬ 𝑥 𝐵 ) )
16 eluni ( 𝑥 ( 𝐴𝐵 ) ↔ ∃ 𝑦 ( 𝑥𝑦𝑦 ∈ ( 𝐴𝐵 ) ) )
17 eldif ( 𝑦 ∈ ( 𝐴𝐵 ) ↔ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) )
18 17 anbi2i ( ( 𝑥𝑦𝑦 ∈ ( 𝐴𝐵 ) ) ↔ ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) )
19 18 exbii ( ∃ 𝑦 ( 𝑥𝑦𝑦 ∈ ( 𝐴𝐵 ) ) ↔ ∃ 𝑦 ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) )
20 16 19 bitri ( 𝑥 ( 𝐴𝐵 ) ↔ ∃ 𝑦 ( 𝑥𝑦 ∧ ( 𝑦𝐴 ∧ ¬ 𝑦𝐵 ) ) )
21 14 15 20 3imtr4i ( 𝑥 ∈ ( 𝐴 𝐵 ) → 𝑥 ( 𝐴𝐵 ) )
22 21 ssriv ( 𝐴 𝐵 ) ⊆ ( 𝐴𝐵 )