Files
agda-doodles/self/Distrib.agda
2020-06-05 09:18:15 +02:00

27 lines
1.0 KiB
Agda
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)