ChainReasoning.agda 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. module Logic.ChainReasoning where
  2. module Mono where
  3. module Homogenous
  4. { A : Set }
  5. ( _==_ : A -> A -> Set )
  6. (refl : (x : A) -> x == x)
  7. (trans : (x y z : A) -> x == y -> y == z -> x == z)
  8. where
  9. infix 3 chain>_
  10. infixl 2 _===_
  11. infix 3 _by_
  12. chain>_ : (x : A) -> x == x
  13. chain> x = refl _
  14. _===_ : {x y z : A} -> x == y -> y == z -> x == z
  15. xy === yz = trans _ _ _ xy yz
  16. _by_ : {x : A}(y : A) -> x == y -> x == y
  17. y by eq = eq
  18. module Poly where
  19. module Homogenous
  20. ( _==_ : {A : Set} -> A -> A -> Set )
  21. (refl : {A : Set}(x : A) -> x == x)
  22. (trans : {A : Set}(x y z : A) -> x == y -> y == z -> x == z)
  23. where
  24. infix 3 chain>_
  25. infixl 2 _===_
  26. infix 3 _by_
  27. chain>_ : {A : Set}(x : A) -> x == x
  28. chain> x = refl _
  29. _===_ : {A : Set}{x y z : A} -> x == y -> y == z -> x == z
  30. xy === yz = trans _ _ _ xy yz
  31. _by_ : {A : Set}{x : A}(y : A) -> x == y -> x == y
  32. y by eq = eq
  33. module Heterogenous
  34. ( _==_ : {A B : Set} -> A -> B -> Set )
  35. (refl : {A : Set}(x : A) -> x == x)
  36. (trans : {A B C : Set}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
  37. where
  38. infix 3 chain>_
  39. infixl 2 _===_
  40. infix 3 _by_
  41. chain>_ : {A : Set}(x : A) -> x == x
  42. chain> x = refl _
  43. _===_ : {A B C : Set}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
  44. xy === yz = trans _ _ _ xy yz
  45. _by_ : {A B : Set}{x : A}(y : B) -> x == y -> x == y
  46. y by eq = eq
  47. module Heterogenous1
  48. ( _==_ : {A B : Set1} -> A -> B -> Set1 )
  49. (refl : {A : Set1}(x : A) -> x == x)
  50. (trans : {A B C : Set1}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
  51. where
  52. infix 3 chain>_
  53. infixl 2 _===_
  54. infix 3 _by_
  55. chain>_ : {A : Set1}(x : A) -> x == x
  56. chain> x = refl _
  57. _===_ : {A B C : Set1}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
  58. xy === yz = trans _ _ _ xy yz
  59. _by_ : {A B : Set1}{x : A}(y : B) -> x == y -> x == y
  60. y by eq = eq