This commit is contained in:
2019-03-28 21:45:04 +01:00
commit a67cd02e55
5 changed files with 162 additions and 0 deletions

26
Distrib.agda Normal file
View File

@@ -0,0 +1,26 @@
module distrib where
data __ (A B : Set) : Set where
inl : A A B
inr : B A B
data _∧_ (A B : Set) : Set where
_and_ : A B A B
and_dist_over_or : {a b c : Set} a (b c) (a b) (a c)
and_dist_over_or (a₁ and (inl x)) = inl (a₁ and x)
and_dist_over_or (a₁ and (inr x)) = inr (a₁ and x)
and_dist_over_or : {a b c : Set} (a b) (a c) a (b c)
and_dist_over_or (inl (x and x)) = x and (inl x)
and_dist_over_or (inr (x and x)) = x and (inr x)
or_dist_over_and : {a b c : Set} (a b) (a c) -> a (b c)
or_dist_over_and ((inl x) and (inl y)) = inl x
or_dist_over_and ((inl x) and (inr y)) = inl x
or_dist_over_and ((inr x) and (inl y)) = inl y
or_dist_over_and ((inr x) and (inr y)) = inr (x and y)
or_dist_over_and : {a b c : Set} a (b c) (a b) (a c)
or_dist_over_and (inl x) = (inl x) and (inl x)
or_dist_over_and (inr (x and y)) = (inr x) and (inr y)