For every type T, we have the function ifT : bool × T × T → T (where the subscript is omitted if T is understood) that, depending upon whether its first argument is true or false, respectively, yields either its second or third argument, respectively.
That is, its defining axioms are
(if.0a) if(true,a,b) = a
(if.0b) if(false,a,b) = b
From these, we can prove each of the following theorems:
(if.1) if(p,a,a) = a
(if.2) if(E=F,a[x:=E],b) = if(E=F,a[x:=F],b)
Distributivity Theorems:
(if.3a)
Provided that ⊕ has signature T × R → S:
ifT(p,a,b) ⊕ c =
ifS(p,a⊕c,b⊕c)
(if.3b)
Provided that ⊕ has signature R × T → S:
c ⊕ ifT(p,a,b) =
ifS(p,c⊕a,c⊕b)
(if.4a) ifbool(p,a,b) ≡
(p ⇒ a) ∧ (¬p ⇒ b)
(if.4b) ifbool(p,a,b) ≡
(p ∧ a) ∨ (¬p ∧ b)
(if.4c) ifbool(p,q,true) ≡ p ⇒ q
(if.5a) ifbool(p,a,b) ∧ ifbool(p,c,d)
≡ ifbool(p,a∧c,b∧d)
(if.5b) ifbool(p,a,b) ∨ ifbool(p,c,d)
≡ ifbool(p,a∨c,b∨d)