Metamath Proof Explorer


Theorem dfif3

Description: Alternate definition of the conditional operator df-if . Note that ph is independent of x i.e. a constant true or false. (Contributed by NM, 25-Aug-2013) (Revised by Mario Carneiro, 8-Sep-2013)

Ref Expression
Hypothesis dfif3.1 𝐶 = { 𝑥𝜑 }
Assertion dfif3 if ( 𝜑 , 𝐴 , 𝐵 ) = ( ( 𝐴𝐶 ) ∪ ( 𝐵 ∩ ( V ∖ 𝐶 ) ) )

Proof

Step Hyp Ref Expression
1 dfif3.1 𝐶 = { 𝑥𝜑 }
2 dfif6 if ( 𝜑 , 𝐴 , 𝐵 ) = ( { 𝑦𝐴𝜑 } ∪ { 𝑦𝐵 ∣ ¬ 𝜑 } )
3 biidd ( 𝑥 = 𝑦 → ( 𝜑𝜑 ) )
4 3 cbvabv { 𝑥𝜑 } = { 𝑦𝜑 }
5 1 4 eqtri 𝐶 = { 𝑦𝜑 }
6 5 ineq2i ( 𝐴𝐶 ) = ( 𝐴 ∩ { 𝑦𝜑 } )
7 dfrab3 { 𝑦𝐴𝜑 } = ( 𝐴 ∩ { 𝑦𝜑 } )
8 6 7 eqtr4i ( 𝐴𝐶 ) = { 𝑦𝐴𝜑 }
9 dfrab3 { 𝑦𝐵 ∣ ¬ 𝜑 } = ( 𝐵 ∩ { 𝑦 ∣ ¬ 𝜑 } )
10 biidd ( 𝑦 = 𝑧 → ( 𝜑𝜑 ) )
11 10 notabw { 𝑦 ∣ ¬ 𝜑 } = ( V ∖ { 𝑧𝜑 } )
12 biidd ( 𝑥 = 𝑧 → ( 𝜑𝜑 ) )
13 12 cbvabv { 𝑥𝜑 } = { 𝑧𝜑 }
14 1 13 eqtri 𝐶 = { 𝑧𝜑 }
15 14 difeq2i ( V ∖ 𝐶 ) = ( V ∖ { 𝑧𝜑 } )
16 11 15 eqtr4i { 𝑦 ∣ ¬ 𝜑 } = ( V ∖ 𝐶 )
17 16 ineq2i ( 𝐵 ∩ { 𝑦 ∣ ¬ 𝜑 } ) = ( 𝐵 ∩ ( V ∖ 𝐶 ) )
18 9 17 eqtr2i ( 𝐵 ∩ ( V ∖ 𝐶 ) ) = { 𝑦𝐵 ∣ ¬ 𝜑 }
19 8 18 uneq12i ( ( 𝐴𝐶 ) ∪ ( 𝐵 ∩ ( V ∖ 𝐶 ) ) ) = ( { 𝑦𝐴𝜑 } ∪ { 𝑦𝐵 ∣ ¬ 𝜑 } )
20 2 19 eqtr4i if ( 𝜑 , 𝐴 , 𝐵 ) = ( ( 𝐴𝐶 ) ∪ ( 𝐵 ∩ ( V ∖ 𝐶 ) ) )