Metamath Proof Explorer


Theorem 2if2

Description: Resolve two nested conditionals. (Contributed by Alexander van der Vekens, 27-Mar-2018)

Ref Expression
Hypotheses 2if2.1 φψD=A
2if2.2 φ¬ψθD=B
2if2.3 φ¬ψ¬θD=C
Assertion 2if2 φD=ifψAifθBC

Proof

Step Hyp Ref Expression
1 2if2.1 φψD=A
2 2if2.2 φ¬ψθD=B
3 2if2.3 φ¬ψ¬θD=C
4 iftrue ψifψAifθBC=A
5 4 adantl φψifψAifθBC=A
6 1 5 eqtr4d φψD=ifψAifθBC
7 2 3expa φ¬ψθD=B
8 iftrue θifθBC=B
9 8 adantl φ¬ψθifθBC=B
10 7 9 eqtr4d φ¬ψθD=ifθBC
11 3 3expa φ¬ψ¬θD=C
12 iffalse ¬θifθBC=C
13 12 eqcomd ¬θC=ifθBC
14 13 adantl φ¬ψ¬θC=ifθBC
15 11 14 eqtrd φ¬ψ¬θD=ifθBC
16 10 15 pm2.61dan φ¬ψD=ifθBC
17 iffalse ¬ψifψAifθBC=ifθBC
18 17 adantl φ¬ψifψAifθBC=ifθBC
19 16 18 eqtr4d φ¬ψD=ifψAifθBC
20 6 19 pm2.61dan φD=ifψAifθBC