Metamath Proof Explorer


Theorem prnebg

Description: A (proper) pair is not equal to another (maybe improper) pair if and only if an element of the first pair is not contained in the second pair. (Contributed by Alexander van der Vekens, 16-Jan-2018)

Ref Expression
Assertion prnebg ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ∧ 𝐴𝐵 ) → ( ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) ↔ { 𝐴 , 𝐵 } ≠ { 𝐶 , 𝐷 } ) )

Proof

Step Hyp Ref Expression
1 prneimg ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ) → ( ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) → { 𝐴 , 𝐵 } ≠ { 𝐶 , 𝐷 } ) )
2 1 3adant3 ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ∧ 𝐴𝐵 ) → ( ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) → { 𝐴 , 𝐵 } ≠ { 𝐶 , 𝐷 } ) )
3 ioran ( ¬ ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) ↔ ( ¬ ( 𝐴𝐶𝐴𝐷 ) ∧ ¬ ( 𝐵𝐶𝐵𝐷 ) ) )
4 ianor ( ¬ ( 𝐴𝐶𝐴𝐷 ) ↔ ( ¬ 𝐴𝐶 ∨ ¬ 𝐴𝐷 ) )
5 nne ( ¬ 𝐴𝐶𝐴 = 𝐶 )
6 nne ( ¬ 𝐴𝐷𝐴 = 𝐷 )
7 5 6 orbi12i ( ( ¬ 𝐴𝐶 ∨ ¬ 𝐴𝐷 ) ↔ ( 𝐴 = 𝐶𝐴 = 𝐷 ) )
8 4 7 bitri ( ¬ ( 𝐴𝐶𝐴𝐷 ) ↔ ( 𝐴 = 𝐶𝐴 = 𝐷 ) )
9 ianor ( ¬ ( 𝐵𝐶𝐵𝐷 ) ↔ ( ¬ 𝐵𝐶 ∨ ¬ 𝐵𝐷 ) )
10 nne ( ¬ 𝐵𝐶𝐵 = 𝐶 )
11 nne ( ¬ 𝐵𝐷𝐵 = 𝐷 )
12 10 11 orbi12i ( ( ¬ 𝐵𝐶 ∨ ¬ 𝐵𝐷 ) ↔ ( 𝐵 = 𝐶𝐵 = 𝐷 ) )
13 9 12 bitri ( ¬ ( 𝐵𝐶𝐵𝐷 ) ↔ ( 𝐵 = 𝐶𝐵 = 𝐷 ) )
14 8 13 anbi12i ( ( ¬ ( 𝐴𝐶𝐴𝐷 ) ∧ ¬ ( 𝐵𝐶𝐵𝐷 ) ) ↔ ( ( 𝐴 = 𝐶𝐴 = 𝐷 ) ∧ ( 𝐵 = 𝐶𝐵 = 𝐷 ) ) )
15 3 14 bitri ( ¬ ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) ↔ ( ( 𝐴 = 𝐶𝐴 = 𝐷 ) ∧ ( 𝐵 = 𝐶𝐵 = 𝐷 ) ) )
16 anddi ( ( ( 𝐴 = 𝐶𝐴 = 𝐷 ) ∧ ( 𝐵 = 𝐶𝐵 = 𝐷 ) ) ↔ ( ( ( 𝐴 = 𝐶𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐶𝐵 = 𝐷 ) ) ∨ ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐷𝐵 = 𝐷 ) ) ) )
17 eqtr3 ( ( 𝐴 = 𝐶𝐵 = 𝐶 ) → 𝐴 = 𝐵 )
18 eqneqall ( 𝐴 = 𝐵 → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
19 17 18 syl ( ( 𝐴 = 𝐶𝐵 = 𝐶 ) → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
20 preq12 ( ( 𝐴 = 𝐶𝐵 = 𝐷 ) → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } )
21 20 a1d ( ( 𝐴 = 𝐶𝐵 = 𝐷 ) → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
22 19 21 jaoi ( ( ( 𝐴 = 𝐶𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐶𝐵 = 𝐷 ) ) → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
23 preq12 ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) → { 𝐴 , 𝐵 } = { 𝐷 , 𝐶 } )
24 prcom { 𝐷 , 𝐶 } = { 𝐶 , 𝐷 }
25 23 24 eqtrdi ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } )
26 25 a1d ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
27 eqtr3 ( ( 𝐴 = 𝐷𝐵 = 𝐷 ) → 𝐴 = 𝐵 )
28 27 18 syl ( ( 𝐴 = 𝐷𝐵 = 𝐷 ) → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
29 26 28 jaoi ( ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐷𝐵 = 𝐷 ) ) → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
30 22 29 jaoi ( ( ( ( 𝐴 = 𝐶𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐶𝐵 = 𝐷 ) ) ∨ ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐷𝐵 = 𝐷 ) ) ) → ( 𝐴𝐵 → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
31 30 com12 ( 𝐴𝐵 → ( ( ( ( 𝐴 = 𝐶𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐶𝐵 = 𝐷 ) ) ∨ ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐷𝐵 = 𝐷 ) ) ) → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
32 31 3ad2ant3 ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ∧ 𝐴𝐵 ) → ( ( ( ( 𝐴 = 𝐶𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐶𝐵 = 𝐷 ) ) ∨ ( ( 𝐴 = 𝐷𝐵 = 𝐶 ) ∨ ( 𝐴 = 𝐷𝐵 = 𝐷 ) ) ) → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
33 16 32 syl5bi ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ∧ 𝐴𝐵 ) → ( ( ( 𝐴 = 𝐶𝐴 = 𝐷 ) ∧ ( 𝐵 = 𝐶𝐵 = 𝐷 ) ) → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
34 15 33 syl5bi ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ∧ 𝐴𝐵 ) → ( ¬ ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) → { 𝐴 , 𝐵 } = { 𝐶 , 𝐷 } ) )
35 34 necon1ad ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ∧ 𝐴𝐵 ) → ( { 𝐴 , 𝐵 } ≠ { 𝐶 , 𝐷 } → ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) ) )
36 2 35 impbid ( ( ( 𝐴𝑈𝐵𝑉 ) ∧ ( 𝐶𝑋𝐷𝑌 ) ∧ 𝐴𝐵 ) → ( ( ( 𝐴𝐶𝐴𝐷 ) ∨ ( 𝐵𝐶𝐵𝐷 ) ) ↔ { 𝐴 , 𝐵 } ≠ { 𝐶 , 𝐷 } ) )