Metamath Proof Explorer


Theorem dfdif3

Description: Alternate definition of class difference. (Contributed by BJ and Jim Kingdon, 16-Jun-2022)

Ref Expression
Assertion dfdif3 ( 𝐴𝐵 ) = { 𝑥𝐴 ∣ ∀ 𝑦𝐵 𝑥𝑦 }

Proof

Step Hyp Ref Expression
1 dfdif2 ( 𝐴𝐵 ) = { 𝑥𝐴 ∣ ¬ 𝑥𝐵 }
2 ax6ev 𝑦 𝑦 = 𝑥
3 2 biantrur ( ¬ 𝑥𝐵 ↔ ( ∃ 𝑦 𝑦 = 𝑥 ∧ ¬ 𝑥𝐵 ) )
4 19.41v ( ∃ 𝑦 ( 𝑦 = 𝑥 ∧ ¬ 𝑥𝐵 ) ↔ ( ∃ 𝑦 𝑦 = 𝑥 ∧ ¬ 𝑥𝐵 ) )
5 3 4 bitr4i ( ¬ 𝑥𝐵 ↔ ∃ 𝑦 ( 𝑦 = 𝑥 ∧ ¬ 𝑥𝐵 ) )
6 sbalex ( ∃ 𝑦 ( 𝑦 = 𝑥 ∧ ¬ 𝑥𝐵 ) ↔ ∀ 𝑦 ( 𝑦 = 𝑥 → ¬ 𝑥𝐵 ) )
7 equcom ( 𝑦 = 𝑥𝑥 = 𝑦 )
8 7 imbi1i ( ( 𝑦 = 𝑥 → ¬ 𝑥𝐵 ) ↔ ( 𝑥 = 𝑦 → ¬ 𝑥𝐵 ) )
9 eleq1w ( 𝑥 = 𝑦 → ( 𝑥𝐵𝑦𝐵 ) )
10 9 notbid ( 𝑥 = 𝑦 → ( ¬ 𝑥𝐵 ↔ ¬ 𝑦𝐵 ) )
11 10 pm5.74i ( ( 𝑥 = 𝑦 → ¬ 𝑥𝐵 ) ↔ ( 𝑥 = 𝑦 → ¬ 𝑦𝐵 ) )
12 con2b ( ( 𝑥 = 𝑦 → ¬ 𝑦𝐵 ) ↔ ( 𝑦𝐵 → ¬ 𝑥 = 𝑦 ) )
13 df-ne ( 𝑥𝑦 ↔ ¬ 𝑥 = 𝑦 )
14 13 bicomi ( ¬ 𝑥 = 𝑦𝑥𝑦 )
15 14 imbi2i ( ( 𝑦𝐵 → ¬ 𝑥 = 𝑦 ) ↔ ( 𝑦𝐵𝑥𝑦 ) )
16 11 12 15 3bitri ( ( 𝑥 = 𝑦 → ¬ 𝑥𝐵 ) ↔ ( 𝑦𝐵𝑥𝑦 ) )
17 8 16 bitri ( ( 𝑦 = 𝑥 → ¬ 𝑥𝐵 ) ↔ ( 𝑦𝐵𝑥𝑦 ) )
18 17 albii ( ∀ 𝑦 ( 𝑦 = 𝑥 → ¬ 𝑥𝐵 ) ↔ ∀ 𝑦 ( 𝑦𝐵𝑥𝑦 ) )
19 5 6 18 3bitri ( ¬ 𝑥𝐵 ↔ ∀ 𝑦 ( 𝑦𝐵𝑥𝑦 ) )
20 df-ral ( ∀ 𝑦𝐵 𝑥𝑦 ↔ ∀ 𝑦 ( 𝑦𝐵𝑥𝑦 ) )
21 19 20 bitr4i ( ¬ 𝑥𝐵 ↔ ∀ 𝑦𝐵 𝑥𝑦 )
22 21 rabbii { 𝑥𝐴 ∣ ¬ 𝑥𝐵 } = { 𝑥𝐴 ∣ ∀ 𝑦𝐵 𝑥𝑦 }
23 1 22 eqtri ( 𝐴𝐵 ) = { 𝑥𝐴 ∣ ∀ 𝑦𝐵 𝑥𝑦 }