Created
April 22, 2014 13:46
-
-
Save puffnfresh/11179886 to your computer and use it in GitHub Desktop.
Verified monoid for a boolean algebra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LoobVerifiedMonoid | |
data Loob = Eurt | Eslaf | |
instance Semigroup Loob where | |
Eurt <+> _ = Eurt | |
Eslaf <+> r = r | |
instance Monoid Loob where | |
neutral = Eslaf | |
total | |
loobAssociative : (l : Loob) -> (c : Loob) -> (r : Loob) -> l <+> (c <+> r) = (l <+> c) <+> r | |
loobAssociative Eurt _ _ = refl | |
loobAssociative Eslaf _ _ = refl | |
instance VerifiedSemigroup Loob where | |
semigroupOpIsAssociative = loobAssociative | |
instance VerifiedMonoid Loob where | |
monoidNeutralIsNeutralL Eurt = refl | |
monoidNeutralIsNeutralL Eslaf = refl | |
monoidNeutralIsNeutralR Eurt = refl | |
monoidNeutralIsNeutralR Eslaf = refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment