Metamath Proof Explorer


Theorem bj-elgab

Description: Elements of a generalized class abstraction. (Contributed by BJ, 4-Oct-2024)

Ref Expression
Hypotheses bj-elgab.nf ( 𝜑 → ∀ 𝑥 𝜑 )
bj-elgab.nfa ( 𝜑 𝑥 𝐴 )
bj-elgab.ex ( 𝜑𝐴𝑉 )
bj-elgab.is ( 𝜑 → ( ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ↔ 𝜒 ) )
Assertion bj-elgab ( 𝜑 → ( 𝐴 ∈ { 𝐵𝑥𝜓 } ↔ 𝜒 ) )

Proof

Step Hyp Ref Expression
1 bj-elgab.nf ( 𝜑 → ∀ 𝑥 𝜑 )
2 bj-elgab.nfa ( 𝜑 𝑥 𝐴 )
3 bj-elgab.ex ( 𝜑𝐴𝑉 )
4 bj-elgab.is ( 𝜑 → ( ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ↔ 𝜒 ) )
5 df-bj-gab { 𝐵𝑥𝜓 } = { 𝑦 ∣ ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) }
6 5 eleq2i ( 𝐴 ∈ { 𝐵𝑥𝜓 } ↔ 𝐴 ∈ { 𝑦 ∣ ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) } )
7 1 adantr ( ( 𝜑𝑦 = 𝐴 ) → ∀ 𝑥 𝜑 )
8 nfcvd ( 𝑥 𝐴 𝑥 𝑦 )
9 id ( 𝑥 𝐴 𝑥 𝐴 )
10 8 9 nfeqd ( 𝑥 𝐴 → Ⅎ 𝑥 𝑦 = 𝐴 )
11 10 nf5rd ( 𝑥 𝐴 → ( 𝑦 = 𝐴 → ∀ 𝑥 𝑦 = 𝐴 ) )
12 2 11 syl ( 𝜑 → ( 𝑦 = 𝐴 → ∀ 𝑥 𝑦 = 𝐴 ) )
13 12 imp ( ( 𝜑𝑦 = 𝐴 ) → ∀ 𝑥 𝑦 = 𝐴 )
14 19.26 ( ∀ 𝑥 ( 𝜑𝑦 = 𝐴 ) ↔ ( ∀ 𝑥 𝜑 ∧ ∀ 𝑥 𝑦 = 𝐴 ) )
15 7 13 14 sylanbrc ( ( 𝜑𝑦 = 𝐴 ) → ∀ 𝑥 ( 𝜑𝑦 = 𝐴 ) )
16 eqeq2 ( 𝑦 = 𝐴 → ( 𝐵 = 𝑦𝐵 = 𝐴 ) )
17 eqcom ( 𝐵 = 𝐴𝐴 = 𝐵 )
18 16 17 bitrdi ( 𝑦 = 𝐴 → ( 𝐵 = 𝑦𝐴 = 𝐵 ) )
19 18 anbi1d ( 𝑦 = 𝐴 → ( ( 𝐵 = 𝑦𝜓 ) ↔ ( 𝐴 = 𝐵𝜓 ) ) )
20 19 adantl ( ( 𝜑𝑦 = 𝐴 ) → ( ( 𝐵 = 𝑦𝜓 ) ↔ ( 𝐴 = 𝐵𝜓 ) ) )
21 15 20 exbidh ( ( 𝜑𝑦 = 𝐴 ) → ( ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) ↔ ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ) )
22 21 ex ( 𝜑 → ( 𝑦 = 𝐴 → ( ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) ↔ ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ) ) )
23 22 alrimiv ( 𝜑 → ∀ 𝑦 ( 𝑦 = 𝐴 → ( ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) ↔ ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ) ) )
24 elabgt ( ( 𝐴𝑉 ∧ ∀ 𝑦 ( 𝑦 = 𝐴 → ( ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) ↔ ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ) ) ) → ( 𝐴 ∈ { 𝑦 ∣ ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) } ↔ ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ) )
25 3 23 24 syl2anc ( 𝜑 → ( 𝐴 ∈ { 𝑦 ∣ ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) } ↔ ∃ 𝑥 ( 𝐴 = 𝐵𝜓 ) ) )
26 25 4 bitrd ( 𝜑 → ( 𝐴 ∈ { 𝑦 ∣ ∃ 𝑥 ( 𝐵 = 𝑦𝜓 ) } ↔ 𝜒 ) )
27 6 26 syl5bb ( 𝜑 → ( 𝐴 ∈ { 𝐵𝑥𝜓 } ↔ 𝜒 ) )