Next Types Are Theorems; Programs Are Proofs 21

Example

1Assume (ab) ∧ a Assume we have z :: (a -> b, a)
2From (1), conclude ab
(∧E)

fst z :: a -> b
3From (1), conclude a
(∧E)

snd z :: a
4From (3) and (2), conclude b
(→E)

(fst z (snd z)) :: b
5From (1) and (4), conclude ((ab) ∧ a) → b
(→I) (disch. 1)

\z -> (fst z (snd z)) :: (a -> b, a) -> b


Next Next