Operations.agda 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. module Logic.Operations where
  2. import Logic.Relations as Rel
  3. import Logic.Equivalence as Eq
  4. open Eq using (Equivalence; module Equivalence)
  5. BinOp : Set -> Set
  6. BinOp A = A -> A -> A
  7. module MonoEq {A : Set}(Eq : Equivalence A) where
  8. module EqEq = Equivalence Eq
  9. open EqEq
  10. Commutative : BinOp A -> Set
  11. Commutative _+_ = (x y : A) -> (x + y) == (y + x)
  12. Associative : BinOp A -> Set
  13. Associative _+_ = (x y z : A) -> (x + (y + z)) == ((x + y) + z)
  14. LeftIdentity : A -> BinOp A -> Set
  15. LeftIdentity z _+_ = (x : A) -> (z + x) == x
  16. RightIdentity : A -> BinOp A -> Set
  17. RightIdentity z _+_ = (x : A) -> (x + z) == x
  18. module Param where
  19. Commutative : {A : Set}(Eq : Equivalence A) -> BinOp A -> Set
  20. Commutative Eq = Op.Commutative
  21. where module Op = MonoEq Eq
  22. Associative : {A : Set}(Eq : Equivalence A) -> BinOp A -> Set
  23. Associative Eq = Op.Associative
  24. where module Op = MonoEq Eq
  25. LeftIdentity : {A : Set}(Eq : Equivalence A) -> A -> BinOp A -> Set
  26. LeftIdentity Eq = Op.LeftIdentity
  27. where module Op = MonoEq Eq
  28. RightIdentity : {A : Set}(Eq : Equivalence A) -> A -> BinOp A -> Set
  29. RightIdentity Eq = Op.RightIdentity
  30. where module Op = MonoEq Eq