view sandbox/modus-ponens.agda @ 77:a2e6f61d5f2b default tip

Add modus-ponens
author atton <atton@cr.ie.u-ryukyu.ac.jp>
date Thu, 09 Feb 2017 06:32:03 +0000
parents
children
line wrap: on
line source

module modus-ponens where

data _×_ (A B : Set) : Set where
  <_,_> : A -> B -> A × B

fst : {A B : Set} -> A × B -> A
fst < a , _ > = a

snd : {A B : Set} -> A × B -> B
snd < _ , b > = b

f : {A B C : Set} -> (A -> B) × (B -> C) -> (A -> C)
f = (\p x -> snd p ((fst p) x))