Metamath Proof Explorer


Theorem opabex3rd

Description: Existence of an ordered pair abstraction if the second components are elements of a set. (Contributed by AV, 17-Sep-2023) (Revised by AV, 9-Aug-2024)

Ref Expression
Hypotheses opabex3rd.1 ( 𝜑𝐴𝑉 )
opabex3rd.2 ( ( 𝜑𝑦𝐴 ) → { 𝑥𝜓 } ∈ V )
Assertion opabex3rd ( 𝜑 → { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( 𝑦𝐴𝜓 ) } ∈ V )

Proof

Step Hyp Ref Expression
1 opabex3rd.1 ( 𝜑𝐴𝑉 )
2 opabex3rd.2 ( ( 𝜑𝑦𝐴 ) → { 𝑥𝜓 } ∈ V )
3 19.42v ( ∃ 𝑥 ( 𝑦𝐴 ∧ ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) ) ↔ ( 𝑦𝐴 ∧ ∃ 𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) ) )
4 an12 ( ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) ↔ ( 𝑦𝐴 ∧ ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) ) )
5 4 exbii ( ∃ 𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) ↔ ∃ 𝑥 ( 𝑦𝐴 ∧ ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) ) )
6 elxp ( 𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ↔ ∃ 𝑤𝑣 ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑤 ∈ { 𝑥𝜓 } ∧ 𝑣 ∈ { 𝑦 } ) ) )
7 ancom ( ( 𝑤 ∈ { 𝑥𝜓 } ∧ 𝑣 ∈ { 𝑦 } ) ↔ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) )
8 7 anbi2i ( ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑤 ∈ { 𝑥𝜓 } ∧ 𝑣 ∈ { 𝑦 } ) ) ↔ ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
9 8 2exbii ( ∃ 𝑤𝑣 ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑤 ∈ { 𝑥𝜓 } ∧ 𝑣 ∈ { 𝑦 } ) ) ↔ ∃ 𝑤𝑣 ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
10 6 9 bitri ( 𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ↔ ∃ 𝑤𝑣 ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
11 an12 ( ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) ↔ ( 𝑣 ∈ { 𝑦 } ∧ ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
12 velsn ( 𝑣 ∈ { 𝑦 } ↔ 𝑣 = 𝑦 )
13 12 anbi1i ( ( 𝑣 ∈ { 𝑦 } ∧ ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) ↔ ( 𝑣 = 𝑦 ∧ ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
14 11 13 bitri ( ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) ↔ ( 𝑣 = 𝑦 ∧ ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
15 14 exbii ( ∃ 𝑣 ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) ↔ ∃ 𝑣 ( 𝑣 = 𝑦 ∧ ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
16 opeq2 ( 𝑣 = 𝑦 → ⟨ 𝑤 , 𝑣 ⟩ = ⟨ 𝑤 , 𝑦 ⟩ )
17 16 eqeq2d ( 𝑣 = 𝑦 → ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ↔ 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ) )
18 17 anbi1d ( 𝑣 = 𝑦 → ( ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ↔ ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) )
19 18 equsexvw ( ∃ 𝑣 ( 𝑣 = 𝑦 ∧ ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) ↔ ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) )
20 15 19 bitri ( ∃ 𝑣 ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) ↔ ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) )
21 20 exbii ( ∃ 𝑤𝑣 ( 𝑧 = ⟨ 𝑤 , 𝑣 ⟩ ∧ ( 𝑣 ∈ { 𝑦 } ∧ 𝑤 ∈ { 𝑥𝜓 } ) ) ↔ ∃ 𝑤 ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) )
22 nfv 𝑥 𝑧 = ⟨ 𝑤 , 𝑦
23 nfsab1 𝑥 𝑤 ∈ { 𝑥𝜓 }
24 22 23 nfan 𝑥 ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } )
25 nfv 𝑤 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 )
26 opeq1 ( 𝑤 = 𝑥 → ⟨ 𝑤 , 𝑦 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ )
27 26 eqeq2d ( 𝑤 = 𝑥 → ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ↔ 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ) )
28 df-clab ( 𝑤 ∈ { 𝑥𝜓 } ↔ [ 𝑤 / 𝑥 ] 𝜓 )
29 sbequ12 ( 𝑥 = 𝑤 → ( 𝜓 ↔ [ 𝑤 / 𝑥 ] 𝜓 ) )
30 29 equcoms ( 𝑤 = 𝑥 → ( 𝜓 ↔ [ 𝑤 / 𝑥 ] 𝜓 ) )
31 28 30 bitr4id ( 𝑤 = 𝑥 → ( 𝑤 ∈ { 𝑥𝜓 } ↔ 𝜓 ) )
32 27 31 anbi12d ( 𝑤 = 𝑥 → ( ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ↔ ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) ) )
33 24 25 32 cbvexv1 ( ∃ 𝑤 ( 𝑧 = ⟨ 𝑤 , 𝑦 ⟩ ∧ 𝑤 ∈ { 𝑥𝜓 } ) ↔ ∃ 𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) )
34 10 21 33 3bitri ( 𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ↔ ∃ 𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) )
35 34 anbi2i ( ( 𝑦𝐴𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ) ↔ ( 𝑦𝐴 ∧ ∃ 𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ 𝜓 ) ) )
36 3 5 35 3bitr4ri ( ( 𝑦𝐴𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ) ↔ ∃ 𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) )
37 36 exbii ( ∃ 𝑦 ( 𝑦𝐴𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ) ↔ ∃ 𝑦𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) )
38 excom ( ∃ 𝑦𝑥 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) ↔ ∃ 𝑥𝑦 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) )
39 37 38 bitri ( ∃ 𝑦 ( 𝑦𝐴𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ) ↔ ∃ 𝑥𝑦 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) )
40 eliun ( 𝑧 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) ↔ ∃ 𝑦𝐴 𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) )
41 df-rex ( ∃ 𝑦𝐴 𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ↔ ∃ 𝑦 ( 𝑦𝐴𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ) )
42 40 41 bitri ( 𝑧 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) ↔ ∃ 𝑦 ( 𝑦𝐴𝑧 ∈ ( { 𝑥𝜓 } × { 𝑦 } ) ) )
43 elopab ( 𝑧 ∈ { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( 𝑦𝐴𝜓 ) } ↔ ∃ 𝑥𝑦 ( 𝑧 = ⟨ 𝑥 , 𝑦 ⟩ ∧ ( 𝑦𝐴𝜓 ) ) )
44 39 42 43 3bitr4i ( 𝑧 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) ↔ 𝑧 ∈ { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( 𝑦𝐴𝜓 ) } )
45 44 eqriv 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) = { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( 𝑦𝐴𝜓 ) }
46 snex { 𝑦 } ∈ V
47 xpexg ( ( { 𝑥𝜓 } ∈ V ∧ { 𝑦 } ∈ V ) → ( { 𝑥𝜓 } × { 𝑦 } ) ∈ V )
48 2 46 47 sylancl ( ( 𝜑𝑦𝐴 ) → ( { 𝑥𝜓 } × { 𝑦 } ) ∈ V )
49 48 ralrimiva ( 𝜑 → ∀ 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) ∈ V )
50 iunexg ( ( 𝐴𝑉 ∧ ∀ 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) ∈ V ) → 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) ∈ V )
51 1 49 50 syl2anc ( 𝜑 𝑦𝐴 ( { 𝑥𝜓 } × { 𝑦 } ) ∈ V )
52 45 51 eqeltrrid ( 𝜑 → { ⟨ 𝑥 , 𝑦 ⟩ ∣ ( 𝑦𝐴𝜓 ) } ∈ V )