Metamath Proof Explorer


Theorem ifeq3da

Description: Given an expression C containing if ( ps , E , F ) , substitute (hypotheses .1 and .2) and evaluate (hypotheses .3 and .4) it for both cases at the same time. (Contributed by Thierry Arnoux, 13-Dec-2021)

Ref Expression
Hypotheses ifeq3da.1 ⊢ if ψ E F = E → C = G
ifeq3da.2 ⊢ if ψ E F = F → C = H
ifeq3da.3 ⊢ φ → G = A
ifeq3da.4 ⊢ φ → H = B
Assertion ifeq3da ⊢ φ → if ψ A B = C

Proof

Step Hyp Ref Expression
1 ifeq3da.1 ⊢ if ψ E F = E → C = G
2 ifeq3da.2 ⊢ if ψ E F = F → C = H
3 ifeq3da.3 ⊢ φ → G = A
4 ifeq3da.4 ⊢ φ → H = B
5 iftrue ⊢ ψ → if ψ E F = E
6 5 1 syl ⊢ ψ → C = G
7 6 adantl ⊢ φ ∧ ψ → C = G
8 3 adantr ⊢ φ ∧ ψ → G = A
9 7 8 eqtr2d ⊢ φ ∧ ψ → A = C
10 iffalse ⊢ ¬ ψ → if ψ E F = F
11 10 2 syl ⊢ ¬ ψ → C = H
12 11 adantl ⊢ φ ∧ ¬ ψ → C = H
13 4 adantr ⊢ φ ∧ ¬ ψ → H = B
14 12 13 eqtr2d ⊢ φ ∧ ¬ ψ → B = C
15 9 14 ifeqda ⊢ φ → if ψ A B = C