Metamath Proof Explorer


Theorem ifan

Description: Rewrite a conjunction in a conditional as two nested conditionals. (Contributed by Mario Carneiro, 28-Jul-2014)

Ref Expression
Assertion ifan if ( ( 𝜑𝜓 ) , 𝐴 , 𝐵 ) = if ( 𝜑 , if ( 𝜓 , 𝐴 , 𝐵 ) , 𝐵 )

Proof

Step Hyp Ref Expression
1 iftrue ( 𝜑 → if ( 𝜑 , if ( 𝜓 , 𝐴 , 𝐵 ) , 𝐵 ) = if ( 𝜓 , 𝐴 , 𝐵 ) )
2 ibar ( 𝜑 → ( 𝜓 ↔ ( 𝜑𝜓 ) ) )
3 2 ifbid ( 𝜑 → if ( 𝜓 , 𝐴 , 𝐵 ) = if ( ( 𝜑𝜓 ) , 𝐴 , 𝐵 ) )
4 1 3 eqtr2d ( 𝜑 → if ( ( 𝜑𝜓 ) , 𝐴 , 𝐵 ) = if ( 𝜑 , if ( 𝜓 , 𝐴 , 𝐵 ) , 𝐵 ) )
5 simpl ( ( 𝜑𝜓 ) → 𝜑 )
6 5 con3i ( ¬ 𝜑 → ¬ ( 𝜑𝜓 ) )
7 6 iffalsed ( ¬ 𝜑 → if ( ( 𝜑𝜓 ) , 𝐴 , 𝐵 ) = 𝐵 )
8 iffalse ( ¬ 𝜑 → if ( 𝜑 , if ( 𝜓 , 𝐴 , 𝐵 ) , 𝐵 ) = 𝐵 )
9 7 8 eqtr4d ( ¬ 𝜑 → if ( ( 𝜑𝜓 ) , 𝐴 , 𝐵 ) = if ( 𝜑 , if ( 𝜓 , 𝐴 , 𝐵 ) , 𝐵 ) )
10 4 9 pm2.61i if ( ( 𝜑𝜓 ) , 𝐴 , 𝐵 ) = if ( 𝜑 , if ( 𝜓 , 𝐴 , 𝐵 ) , 𝐵 )