Metamath Proof Explorer


Theorem ifclda

Description: Conditional closure. (Contributed by Jeff Madsen, 2-Sep-2009)

Ref Expression
Hypotheses ifclda.1 ( ( 𝜑𝜓 ) → 𝐴𝐶 )
ifclda.2 ( ( 𝜑 ∧ ¬ 𝜓 ) → 𝐵𝐶 )
Assertion ifclda ( 𝜑 → if ( 𝜓 , 𝐴 , 𝐵 ) ∈ 𝐶 )

Proof

Step Hyp Ref Expression
1 ifclda.1 ( ( 𝜑𝜓 ) → 𝐴𝐶 )
2 ifclda.2 ( ( 𝜑 ∧ ¬ 𝜓 ) → 𝐵𝐶 )
3 iftrue ( 𝜓 → if ( 𝜓 , 𝐴 , 𝐵 ) = 𝐴 )
4 3 adantl ( ( 𝜑𝜓 ) → if ( 𝜓 , 𝐴 , 𝐵 ) = 𝐴 )
5 4 1 eqeltrd ( ( 𝜑𝜓 ) → if ( 𝜓 , 𝐴 , 𝐵 ) ∈ 𝐶 )
6 iffalse ( ¬ 𝜓 → if ( 𝜓 , 𝐴 , 𝐵 ) = 𝐵 )
7 6 adantl ( ( 𝜑 ∧ ¬ 𝜓 ) → if ( 𝜓 , 𝐴 , 𝐵 ) = 𝐵 )
8 7 2 eqeltrd ( ( 𝜑 ∧ ¬ 𝜓 ) → if ( 𝜓 , 𝐴 , 𝐵 ) ∈ 𝐶 )
9 5 8 pm2.61dan ( 𝜑 → if ( 𝜓 , 𝐴 , 𝐵 ) ∈ 𝐶 )