Metamath Proof Explorer


Theorem iftrueb

Description: When the branches are not equal, an "if" condition results in the first branch if and only if its condition is true. (Contributed by SN, 16-Oct-2025)

Ref Expression
Assertion iftrueb ( 𝐴𝐵 → ( if ( 𝜑 , 𝐴 , 𝐵 ) = 𝐴𝜑 ) )

Proof

Step Hyp Ref Expression
1 necom ( 𝐴𝐵𝐵𝐴 )
2 1 biimpi ( 𝐴𝐵𝐵𝐴 )
3 iffalse ( ¬ 𝜑 → if ( 𝜑 , 𝐴 , 𝐵 ) = 𝐵 )
4 3 neeq1d ( ¬ 𝜑 → ( if ( 𝜑 , 𝐴 , 𝐵 ) ≠ 𝐴𝐵𝐴 ) )
5 2 4 syl5ibrcom ( 𝐴𝐵 → ( ¬ 𝜑 → if ( 𝜑 , 𝐴 , 𝐵 ) ≠ 𝐴 ) )
6 5 necon4bd ( 𝐴𝐵 → ( if ( 𝜑 , 𝐴 , 𝐵 ) = 𝐴𝜑 ) )
7 iftrue ( 𝜑 → if ( 𝜑 , 𝐴 , 𝐵 ) = 𝐴 )
8 6 7 impbid1 ( 𝐴𝐵 → ( if ( 𝜑 , 𝐴 , 𝐵 ) = 𝐴𝜑 ) )