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

Theorem 2if2 3963
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 3921 . . . 4  |-  ( ps 
->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  A )
32adantl 467 . . 3  |-  ( (
ph  /\  ps )  ->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  A )
41, 3eqtr4d 2473 . 2  |-  ( (
ph  /\  ps )  ->  D  =  if ( ps ,  A ,  if ( th ,  B ,  C ) ) )
5 2if2.2 . . . . . 6  |-  ( (
ph  /\  -.  ps  /\  th )  ->  D  =  B )
653expa 1205 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  th )  ->  D  =  B )
7 iftrue 3921 . . . . . 6  |-  ( th 
->  if ( th ,  B ,  C )  =  B )
87adantl 467 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  th )  ->  if ( th ,  B ,  C )  =  B )
96, 8eqtr4d 2473 . . . 4  |-  ( ( ( ph  /\  -.  ps )  /\  th )  ->  D  =  if ( th ,  B ,  C ) )
10 2if2.3 . . . . . 6  |-  ( (
ph  /\  -.  ps  /\  -.  th )  ->  D  =  C )
11103expa 1205 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  -.  th )  ->  D  =  C )
12 iffalse 3924 . . . . . . 7  |-  ( -. 
th  ->  if ( th ,  B ,  C
)  =  C )
1312eqcomd 2437 . . . . . 6  |-  ( -. 
th  ->  C  =  if ( th ,  B ,  C ) )
1413adantl 467 . . . . 5  |-  ( ( ( ph  /\  -.  ps )  /\  -.  th )  ->  C  =  if ( th ,  B ,  C ) )
1511, 14eqtrd 2470 . . . 4  |-  ( ( ( ph  /\  -.  ps )  /\  -.  th )  ->  D  =  if ( th ,  B ,  C ) )
169, 15pm2.61dan 798 . . 3  |-  ( (
ph  /\  -.  ps )  ->  D  =  if ( th ,  B ,  C ) )
17 iffalse 3924 . . . 4  |-  ( -. 
ps  ->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  if ( th ,  B ,  C )
)
1817adantl 467 . . 3  |-  ( (
ph  /\  -.  ps )  ->  if ( ps ,  A ,  if ( th ,  B ,  C ) )  =  if ( th ,  B ,  C )
)
1916, 18eqtr4d 2473 . 2  |-  ( (
ph  /\  -.  ps )  ->  D  =  if ( ps ,  A ,  if ( th ,  B ,  C ) ) )
204, 19pm2.61dan 798 1  |-  ( ph  ->  D  =  if ( ps ,  A ,  if ( th ,  B ,  C ) ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 370    /\ w3a 982    = wceq 1437   ifcif 3915
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1665  ax-4 1678  ax-5 1751  ax-6 1797  ax-7 1841  ax-10 1889  ax-11 1894  ax-12 1907  ax-13 2055  ax-ext 2407
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3an 984  df-tru 1440  df-ex 1660  df-nf 1664  df-sb 1790  df-clab 2415  df-cleq 2421  df-clel 2424  df-if 3916
This theorem is referenced by:  swrdccat3  12833  swrdccat  12834  swrdccat3a  12835  swrdccat3b  12837  pfxccat3  38356
  Copyright terms: Public domain W3C validator