@@ -87,10 +87,10 @@ class AbelianGroup a => Ring a where
8787class Ring a => RingWithUnity a where
8888 unity : a
8989
90−||| Sets equipped with two binary operations, both associative and commutative
91−||| supplied with a neutral element, with
92−||| distributivity laws relating the two operations. Must satisfy the following
93−||| laws:
90+||| Sets equipped with two binary operations – both associative, commutative and
91+||| possessing a neutral element – and distributivity laws relating the two
92+||| operations. All elements except the additive identity must have a
93+||| multiplicative inverse. Must satisfy the following laws:
9494|||
9595||| + Associativity of `<+>`:
9696||| forall a b c, a <+> (b <+> c) == (a <+> b) <+> c
@@ -107,14 +107,14 @@ class Ring a => RingWithUnity a where
107107||| + Unity for `<.>`:
108108||| forall a, a <.> unity == a
109109||| forall a, unity <.> a == a
110−||| + InverseM of `<.>`:
111−||| forall a, a <.> inverseM a == unity
112−||| forall a, inverseM a <.> a == unity
110+||| + InverseM of `<.>`, except for neutral
111+||| forall a /= neutral, a <.> inverseM a == unity
112+||| forall a /= neutral, inverseM a <.> a == unity
113113||| + Distributivity of `<.>` and `<->`:
114114||| forall a b c, a <.> (b <+> c) == (a <.> b) <+> (a <.> c)
115115||| forall a b c, (a <+> b) <.> c == (a <.> c) <+> (b <.> c)
116116class RingWithUnity a => Field a where
117− inverseM : a -> a
117+ inverseM : (x : a) -> Not (x = neutral) -> a
118118
119119
120120-- XXX todo: