Metamath Proof Explorer


Theorem or2expropbi

Description: If two classes are strictly ordered, there is an ordered pair of both classes fulfilling a wff iff there is an unordered pair of both classes fulfilling the wff. (Contributed by AV, 26-Aug-2023)

Ref Expression
Assertion or2expropbi ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ∃ 𝑎𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ↔ ∃ 𝑎𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ) )

Proof

Step Hyp Ref Expression
1 nfv 𝑎 ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) )
2 nfv 𝑎𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦
3 nfcv 𝑎 𝑦
4 nfsbc1v 𝑎 [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 )
5 3 4 nfsbcw 𝑎 [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 )
6 2 5 nfan 𝑎 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) )
7 6 nfex 𝑎𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) )
8 7 nfex 𝑎𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) )
9 nfv 𝑏 ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) )
10 nfv 𝑏𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦
11 nfsbc1v 𝑏 [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 )
12 10 11 nfan 𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) )
13 12 nfex 𝑏𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) )
14 13 nfex 𝑏𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) )
15 vex 𝑎 ∈ V
16 vex 𝑏 ∈ V
17 preq12bg ( ( ( 𝐴𝑋𝐵𝑋 ) ∧ ( 𝑎 ∈ V ∧ 𝑏 ∈ V ) ) → ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ↔ ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) ∨ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) ) )
18 15 16 17 mpanr12 ( ( 𝐴𝑋𝐵𝑋 ) → ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ↔ ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) ∨ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) ) )
19 18 3adant3 ( ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) → ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ↔ ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) ∨ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) ) )
20 19 adantl ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ↔ ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) ∨ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) ) )
21 or2expropbilem1 ( ( 𝐴𝑋𝐵𝑋 ) → ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) → ( ( 𝑎 𝑅 𝑏𝜑 ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
22 21 3adant3 ( ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) → ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) → ( ( 𝑎 𝑅 𝑏𝜑 ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
23 22 adantl ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) → ( ( 𝑎 𝑅 𝑏𝜑 ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
24 breq12 ( ( 𝐵 = 𝑎𝐴 = 𝑏 ) → ( 𝐵 𝑅 𝐴𝑎 𝑅 𝑏 ) )
25 24 ancoms ( ( 𝐴 = 𝑏𝐵 = 𝑎 ) → ( 𝐵 𝑅 𝐴𝑎 𝑅 𝑏 ) )
26 25 adantl ( ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) ∧ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) → ( 𝐵 𝑅 𝐴𝑎 𝑅 𝑏 ) )
27 soasym ( ( 𝑅 Or 𝑋 ∧ ( 𝐴𝑋𝐵𝑋 ) ) → ( 𝐴 𝑅 𝐵 → ¬ 𝐵 𝑅 𝐴 ) )
28 27 ex ( 𝑅 Or 𝑋 → ( ( 𝐴𝑋𝐵𝑋 ) → ( 𝐴 𝑅 𝐵 → ¬ 𝐵 𝑅 𝐴 ) ) )
29 28 adantl ( ( 𝑋𝑉𝑅 Or 𝑋 ) → ( ( 𝐴𝑋𝐵𝑋 ) → ( 𝐴 𝑅 𝐵 → ¬ 𝐵 𝑅 𝐴 ) ) )
30 29 expd ( ( 𝑋𝑉𝑅 Or 𝑋 ) → ( 𝐴𝑋 → ( 𝐵𝑋 → ( 𝐴 𝑅 𝐵 → ¬ 𝐵 𝑅 𝐴 ) ) ) )
31 30 3imp2 ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ¬ 𝐵 𝑅 𝐴 )
32 31 pm2.21d ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( 𝐵 𝑅 𝐴 → ( 𝜑 → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
33 32 adantr ( ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) ∧ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) → ( 𝐵 𝑅 𝐴 → ( 𝜑 → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
34 26 33 sylbird ( ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) ∧ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) → ( 𝑎 𝑅 𝑏 → ( 𝜑 → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
35 34 impd ( ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) ∧ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) → ( ( 𝑎 𝑅 𝑏𝜑 ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
36 35 ex ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ( 𝐴 = 𝑏𝐵 = 𝑎 ) → ( ( 𝑎 𝑅 𝑏𝜑 ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
37 23 36 jaod ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ( ( 𝐴 = 𝑎𝐵 = 𝑏 ) ∨ ( 𝐴 = 𝑏𝐵 = 𝑎 ) ) → ( ( 𝑎 𝑅 𝑏𝜑 ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
38 20 37 sylbid ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } → ( ( 𝑎 𝑅 𝑏𝜑 ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) ) )
39 38 impd ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
40 9 14 39 exlimd ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ∃ 𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
41 1 8 40 exlimd ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ∃ 𝑎𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
42 or2expropbilem2 ( ∃ 𝑎𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ↔ ∃ 𝑥𝑦 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑥 , 𝑦 ⟩ ∧ [ 𝑦 / 𝑏 ] [ 𝑥 / 𝑎 ] ( 𝑎 𝑅 𝑏𝜑 ) ) )
43 41 42 syl6ibr ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ∃ 𝑎𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ∃ 𝑎𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
44 oppr ( ( 𝐴𝑋𝐵𝑋 ) → ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ → { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ) )
45 44 anim1d ( ( 𝐴𝑋𝐵𝑋 ) → ( ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
46 45 2eximdv ( ( 𝐴𝑋𝐵𝑋 ) → ( ∃ 𝑎𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ∃ 𝑎𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
47 46 3adant3 ( ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) → ( ∃ 𝑎𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ∃ 𝑎𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
48 47 adantl ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ∃ 𝑎𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) → ∃ 𝑎𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ) )
49 43 48 impbid ( ( ( 𝑋𝑉𝑅 Or 𝑋 ) ∧ ( 𝐴𝑋𝐵𝑋𝐴 𝑅 𝐵 ) ) → ( ∃ 𝑎𝑏 ( { 𝐴 , 𝐵 } = { 𝑎 , 𝑏 } ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ↔ ∃ 𝑎𝑏 ( ⟨ 𝐴 , 𝐵 ⟩ = ⟨ 𝑎 , 𝑏 ⟩ ∧ ( 𝑎 𝑅 𝑏𝜑 ) ) ) )