@@ -5,7 +5,7 @@ import Builtins
55-- XXX: change?
66infixl 6 <->
77infixl 6 <+>
8−infixl 6 <*>
8+infixl 6 <.>
99infixl 5 <#>
1010
1111%access public
@@ -96,18 +96,18 @@ class (VerifiedGroup a, AbelianGroup a) => VerifiedAbelianGroup a where
9696||| + Inverse for `<+>`:
9797||| forall a, a <+> inverse a == neutral
9898||| forall a, inverse a <+> a == neutral
99−||| + Associativity of `<*>`:
100−||| forall a b c, a <*> (b <*> c) == (a <*> b) <*> c
101−||| + Distributivity of `<*>` and `<->`:
102−||| forall a b c, a <*> (b <+> c) == (a <*> b) <+> (a <*> c)
103−||| forall a b c, (a <+> b) <*> c == (a <*> c) <+> (b <*> c)
99+||| + Associativity of `<.>`:
100+||| forall a b c, a <.> (b <.> c) == (a <.> b) <.> c
101+||| + Distributivity of `<.>` and `<->`:
102+||| forall a b c, a <.> (b <+> c) == (a <.> b) <+> (a <.> c)
103+||| forall a b c, (a <+> b) <.> c == (a <.> c) <+> (b <.> c)
104104class AbelianGroup a => Ring a where
105− (<*>) : a -> a -> a
105+ (<.>) : a -> a -> a
106106
107107class (VerifiedAbelianGroup a, Ring a) => VerifiedRing a where
108− total ringOpIsAssociative : (l, c, r : a) -> l <*> (c <*> r) = (l <*> c) <*> r
109− total ringOpIsDistributiveL : (l, c, r : a) -> l <*> (c <+> r) = (l <*> c) <+> (l <*> r)
110− total ringOpIsDistributiveR : (l, c, r : a) -> (l <+> c) <*> r = (l <*> r) <+> (c <*> r)
108+ total ringOpIsAssociative : (l, c, r : a) -> l <.> (c <.> r) = (l <.> c) <.> r
109+ total ringOpIsDistributiveL : (l, c, r : a) -> l <.> (c <+> r) = (l <.> c) <+> (l <.> r)
110+ total ringOpIsDistributiveR : (l, c, r : a) -> (l <+> c) <.> r = (l <.> r) <+> (c <.> r)
111111
112112||| Sets equipped with two binary operations, one associative and commutative
113113||| supplied with a neutral element, and the other associative supplied with a
@@ -124,20 +124,20 @@ class (VerifiedAbelianGroup a, Ring a) => VerifiedRing a where
124124||| + Inverse for `<+>`:
125125||| forall a, a <+> inverse a == neutral
126126||| forall a, inverse a <+> a == neutral
127−||| + Associativity of `<*>`:
128−||| forall a b c, a <*> (b <*> c) == (a <*> b) <*> c
129−||| + Neutral for `<*>`:
130−||| forall a, a <*> unity == a
131−||| forall a, unity <*> a == a
132−||| + Distributivity of `<*>` and `<->`:
133−||| forall a b c, a <*> (b <+> c) == (a <*> b) <+> (a <*> c)
134−||| forall a b c, (a <+> b) <*> c == (a <*> c) <+> (b <*> c)
127+||| + Associativity of `<.>`:
128+||| forall a b c, a <.> (b <.> c) == (a <.> b) <.> c
129+||| + Neutral for `<.>`:
130+||| forall a, a <.> unity == a
131+||| forall a, unity <.> a == a
132+||| + Distributivity of `<.>` and `<->`:
133+||| forall a b c, a <.> (b <+> c) == (a <.> b) <+> (a <.> c)
134+||| forall a b c, (a <+> b) <.> c == (a <.> c) <+> (b <.> c)
135135class Ring a => RingWithUnity a where
136136 unity : a
137137
138138class (VerifiedRing a, RingWithUnity a) => VerifiedRingWithUnity a where
139− total ringWithUnityIsUnityL : (l : a) -> l <*> unity = l
140− total ringWithUnityIsUnityR : (r : a) -> unity <*> r = r
139+ total ringWithUnityIsUnityL : (l : a) -> l <.> unity = l
140+ total ringWithUnityIsUnityR : (r : a) -> unity <.> r = r
141141
142142||| Sets equipped with a binary operation that is commutative, associative and
143143||| idempotent. Must satisfy the following laws:
@@ -281,31 +281,31 @@ class (VerifiedBoundedJoinSemilattice a, VerifiedBoundedMeetSemilattice a, Verif
281281||| + Inverse for `<+>`:
282282||| forall a, a <+> inverse a == neutral
283283||| forall a, inverse a <+> a == neutral
284−||| + Associativity of `<*>`:
285−||| forall a b c, a <*> (b <*> c) == (a <*> b) <*> c
286−||| + Unity for `<*>`:
287−||| forall a, a <*> unity == a
288−||| forall a, unity <*> a == a
289−||| + InverseM of `<*>`:
290−||| forall a, a <*> inverseM a == unity
291−||| forall a, inverseM a <*> a == unity
292−||| + Distributivity of `<*>` and `<->`:
293−||| forall a b c, a <*> (b <+> c) == (a <*> b) <+> (a <*> c)
294−||| forall a b c, (a <+> b) <*> c == (a <*> c) <+> (b <*> c)
284+||| + Associativity of `<.>`:
285+||| forall a b c, a <.> (b <.> c) == (a <.> b) <.> c
286+||| + Unity for `<.>`:
287+||| forall a, a <.> unity == a
288+||| forall a, unity <.> a == a
289+||| + InverseM of `<.>`:
290+||| forall a, a <.> inverseM a == unity
291+||| forall a, inverseM a <.> a == unity
292+||| + Distributivity of `<.>` and `<->`:
293+||| forall a b c, a <.> (b <+> c) == (a <.> b) <+> (a <.> c)
294+||| forall a b c, (a <+> b) <.> c == (a <.> c) <+> (b <.> c)
295295class RingWithUnity a => Field a where
296296 inverseM : a -> a
297297
298298class (VerifiedRing a, Field a) => VerifiedField a where
299− total fieldInverseIsInverseL : (l : a) -> l <*> inverseM l = unity
300− total fieldInverseIsInverseR : (r : a) -> inverseM r <*> r = unity
299+ total fieldInverseIsInverseL : (l : a) -> l <.> inverseM l = unity
300+ total fieldInverseIsInverseR : (r : a) -> inverseM r <.> r = unity
301301
302302||| A module over a ring is an additive abelian group of 'vectors' endowed with a
303−||| scale operation multiplying vectors by ring elements, and distributivity laws
304−||| relating the scale operation to both ring addition and module addition.
303+||| scale operation multiplying vectors by ring elements, and distributivity laws
304+||| relating the scale operation to both ring addition and module addition.
305305||| Must satisfy the following laws:
306306|||
307307||| + Compatibility of scalar multiplication with ring multiplication:
308−||| forall a b v, a <#> (b <#> v) = (a <*> b) <#> v
308+||| forall a b v, a <#> (b <#> v) = (a <.> b) <#> v
309309||| + Ring unity is the identity element of scalar multiplication:
310310||| forall v, unity <#> v = v
311311||| + Distributivity of `<#>` and `<+>`:
@@ -315,7 +315,7 @@ class (RingWithUnity a, AbelianGroup b) => Module a b where
315315 (<#>) : a -> b -> b
316316
317317class (VerifiedRingWithUnity a, VerifiedAbelianGroup b, Module a b) => VerifiedModule a b where
318− total moduleScalarMultiplyComposition : (x,y : a) -> (v : b) -> x <#> (y <#> v) = (x <*> y) <#> v
318+ total moduleScalarMultiplyComposition : (x,y : a) -> (v : b) -> x <#> (y <#> v) = (x <.> y) <#> v
319319 total moduleScalarUnityIsUnity : (v : b) -> unity <#> v = v
320320 total moduleScalarMultDistributiveWRTVectorAddition : (s : a) -> (v, w : b) -> s <#> (v <+> w) = (s <#> v) <+> (s <#> w)
321321 total moduleScalarMultDistributiveWRTModuleAddition : (s, t : a) -> (v : b) -> (s <+> t) <#> v = (s <#> v) <+> (t <#> v)