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

Theorem 2if2 4086
Description: Resolve two nested conditionals. (Contributed by Alexander van der Vekens, 27-Mar-2018.)
Hypotheses
Ref Expression
2if2.1 ((𝜑𝜓) → 𝐷 = 𝐴)
2if2.2 ((𝜑 ∧ ¬ 𝜓𝜃) → 𝐷 = 𝐵)
2if2.3 ((𝜑 ∧ ¬ 𝜓 ∧ ¬ 𝜃) → 𝐷 = 𝐶)
Assertion
Ref Expression
2if2 (𝜑𝐷 = if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)))

Proof of Theorem 2if2
StepHypRef Expression
1 2if2.1 . . 3 ((𝜑𝜓) → 𝐷 = 𝐴)
2 iftrue 4042 . . . 4 (𝜓 → if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)) = 𝐴)
32adantl 481 . . 3 ((𝜑𝜓) → if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)) = 𝐴)
41, 3eqtr4d 2647 . 2 ((𝜑𝜓) → 𝐷 = if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)))
5 2if2.2 . . . . . 6 ((𝜑 ∧ ¬ 𝜓𝜃) → 𝐷 = 𝐵)
653expa 1257 . . . . 5 (((𝜑 ∧ ¬ 𝜓) ∧ 𝜃) → 𝐷 = 𝐵)
7 iftrue 4042 . . . . . 6 (𝜃 → if(𝜃, 𝐵, 𝐶) = 𝐵)
87adantl 481 . . . . 5 (((𝜑 ∧ ¬ 𝜓) ∧ 𝜃) → if(𝜃, 𝐵, 𝐶) = 𝐵)
96, 8eqtr4d 2647 . . . 4 (((𝜑 ∧ ¬ 𝜓) ∧ 𝜃) → 𝐷 = if(𝜃, 𝐵, 𝐶))
10 2if2.3 . . . . . 6 ((𝜑 ∧ ¬ 𝜓 ∧ ¬ 𝜃) → 𝐷 = 𝐶)
11103expa 1257 . . . . 5 (((𝜑 ∧ ¬ 𝜓) ∧ ¬ 𝜃) → 𝐷 = 𝐶)
12 iffalse 4045 . . . . . . 7 𝜃 → if(𝜃, 𝐵, 𝐶) = 𝐶)
1312eqcomd 2616 . . . . . 6 𝜃𝐶 = if(𝜃, 𝐵, 𝐶))
1413adantl 481 . . . . 5 (((𝜑 ∧ ¬ 𝜓) ∧ ¬ 𝜃) → 𝐶 = if(𝜃, 𝐵, 𝐶))
1511, 14eqtrd 2644 . . . 4 (((𝜑 ∧ ¬ 𝜓) ∧ ¬ 𝜃) → 𝐷 = if(𝜃, 𝐵, 𝐶))
169, 15pm2.61dan 828 . . 3 ((𝜑 ∧ ¬ 𝜓) → 𝐷 = if(𝜃, 𝐵, 𝐶))
17 iffalse 4045 . . . 4 𝜓 → if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)) = if(𝜃, 𝐵, 𝐶))
1817adantl 481 . . 3 ((𝜑 ∧ ¬ 𝜓) → if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)) = if(𝜃, 𝐵, 𝐶))
1916, 18eqtr4d 2647 . 2 ((𝜑 ∧ ¬ 𝜓) → 𝐷 = if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)))
204, 19pm2.61dan 828 1 (𝜑𝐷 = if(𝜓, 𝐴, if(𝜃, 𝐵, 𝐶)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 383  w3a 1031   = wceq 1475  ifcif 4036
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1713  ax-4 1728  ax-5 1827  ax-6 1875  ax-7 1922  ax-10 2006  ax-11 2021  ax-12 2034  ax-13 2234  ax-ext 2590
This theorem depends on definitions:  df-bi 196  df-or 384  df-an 385  df-3an 1033  df-tru 1478  df-ex 1696  df-nf 1701  df-sb 1868  df-clab 2597  df-cleq 2603  df-clel 2606  df-if 4037
This theorem is referenced by:  swrdccat3  13343  swrdccat  13344  swrdccat3a  13345  swrdccat3b  13347  pfxccat3  40289
  Copyright terms: Public domain W3C validator