MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  2if2 Structured version   Unicode version

Theorem 2if2 3987
Description: Resolve two nested conditionals. (Contributed by Alexander van der Vekens, 27-Mar-2018.)
Hypotheses
Ref Expression
2if2.1  |-  ( (
ph  /\  ps )  ->  D  =  A )
2if2.2  |-  ( (
ph  /\  -.  ps  /\  th )  ->  D  =  B )
2if2.3  |-  ( (
ph  /\  -.  ps  /\  -.  th )  ->  D  =  C )
Assertion
Ref Expression
2if2  |-  ( ph  ->  D  =  if ( ps ,  A ,  if ( th ,  B ,  C ) ) )

Proof of Theorem 2if2
StepHypRef Expression
1 2if2.1 . . 3  |-  ( (
ph  /\  ps )  ->  D  =  A )
2 iftrue 3945 . . . 4  |-  ( ps 
->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  A )
32adantl 466 . . 3  |-  ( (
ph  /\  ps )  ->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  A )
41, 3eqtr4d 2511 . 2  |-  ( (
ph  /\  ps )  ->  D  =  if ( ps ,  A ,  if ( th ,  B ,  C ) ) )
5 2if2.2 . . . . . 6  |-  ( (
ph  /\  -.  ps  /\  th )  ->  D  =  B )
653expa 1196 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  th )  ->  D  =  B )
7 iftrue 3945 . . . . . 6  |-  ( th 
->  if ( th ,  B ,  C )  =  B )
87adantl 466 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  th )  ->  if ( th ,  B ,  C )  =  B )
96, 8eqtr4d 2511 . . . 4  |-  ( ( ( ph  /\  -.  ps )  /\  th )  ->  D  =  if ( th ,  B ,  C ) )
10 2if2.3 . . . . . 6  |-  ( (
ph  /\  -.  ps  /\  -.  th )  ->  D  =  C )
11103expa 1196 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  -.  th )  ->  D  =  C )
12 iffalse 3948 . . . . . . 7  |-  ( -. 
th  ->  if ( th ,  B ,  C
)  =  C )
1312eqcomd 2475 . . . . . 6  |-  ( -. 
th  ->  C  =  if ( th ,  B ,  C ) )
1413adantl 466 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  -.  th )  ->  C  =  if ( th ,  B ,  C ) )
1511, 14eqtrd 2508 . . . 4  |-  ( ( ( ph  /\  -.  ps )  /\  -.  th )  ->  D  =  if ( th ,  B ,  C ) )
169, 15pm2.61dan 789 . . 3  |-  ( (
ph  /\  -.  ps )  ->  D  =  if ( th ,  B ,  C ) )
17 iffalse 3948 . . . 4  |-  ( -. 
ps  ->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  if ( th ,  B ,  C )
)
1817adantl 466 . . 3  |-  ( (
ph  /\  -.  ps )  ->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  if ( th ,  B ,  C )
)
1916, 18eqtr4d 2511 . 2  |-  ( (
ph  /\  -.  ps )  ->  D  =  if ( ps ,  A ,  if ( th ,  B ,  C ) ) )
204, 19pm2.61dan 789 1  |-  ( ph  ->  D  =  if ( ps ,  A ,  if ( th ,  B ,  C ) ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 369    /\ w3a 973    = wceq 1379   ifcif 3939
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1601  ax-4 1612  ax-5 1680  ax-6 1719  ax-7 1739  ax-10 1786  ax-11 1791  ax-12 1803  ax-13 1968  ax-ext 2445
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3an 975  df-tru 1382  df-ex 1597  df-nf 1600  df-sb 1712  df-clab 2453  df-cleq 2459  df-clel 2462  df-if 3940
This theorem is referenced by:  swrdccat3  12679  swrdccat  12680  swrdccat3a  12681  swrdccat3b  12683
  Copyright terms: Public domain W3C validator