@@ -5,7 +5,7 @@ import Builtins
5-- XXX: change?
5-- XXX: change?
6infixl 6 <->
6infixl 6 <->
7infixl 6 <+>
7infixl 6 <+>
8−infixl 6 <*>
8+infixl 6 <.>
9infixl 5 <#>
9infixl 5 <#>
11%access public
11%access public
@@ -96,18 +96,18 @@ class (VerifiedGroup a, AbelianGroup a) => VerifiedAbelianGroup a where
96||| + Inverse for `<+>`:
96||| + Inverse for `<+>`:
97||| forall a, a <+> inverse a == neutral
97||| forall a, a <+> inverse a == neutral
98||| forall a, inverse a <+> a == neutral
98||| forall a, inverse a <+> a == neutral
99−||| + Associativity of `<*>`:
99+||| + Associativity of `<.>`:
100−||| forall a b c, a <*> (b <*> c) == (a <*> b) <*> c
100+||| forall a b c, a <.> (b <.> c) == (a <.> b) <.> c
101−||| + Distributivity of `<*>` and `<->`:
101+||| + Distributivity of `<.>` and `<->`:
102−||| forall a b c, a <*> (b <+> c) == (a <*> b) <+> (a <*> c)
102+||| forall a b c, a <.> (b <+> c) == (a <.> b) <+> (a <.> c)
103−||| forall a b c, (a <+> b) <*> c == (a <*> c) <+> (b <*> c)
103+||| forall a b c, (a <+> b) <.> c == (a <.> c) <+> (b <.> c)
104class AbelianGroup a => Ring a where
104class AbelianGroup a => Ring a where
105− (<*>) : a -> a -> a
105+ (<.>) : a -> a -> a
107class (VerifiedAbelianGroup a, Ring a) => VerifiedRing a where
107class (VerifiedAbelianGroup a, Ring a) => VerifiedRing a where
108− total ringOpIsAssociative : (l, c, r : a) -> l <*> (c <*> r) = (l <*> 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)
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)
110+ total ringOpIsDistributiveR : (l, c, r : a) -> (l <+> c) <.> r = (l <.> r) <+> (c <.> r)
112||| Sets equipped with two binary operations, one associative and commutative
112||| Sets equipped with two binary operations, one associative and commutative
113||| supplied with a neutral element, and the other associative supplied with a
113||| supplied with a neutral element, and the other associative supplied with a
@@ -124,20 +124,20 @@ class (VerifiedAbelianGroup a, Ring a) => VerifiedRing a where
124||| + Inverse for `<+>`:
124||| + Inverse for `<+>`:
125||| forall a, a <+> inverse a == neutral
125||| forall a, a <+> inverse a == neutral
126||| forall a, inverse a <+> a == neutral
126||| forall a, inverse a <+> a == neutral
127−||| + Associativity of `<*>`:
127+||| + Associativity of `<.>`:
128−||| forall a b c, a <*> (b <*> c) == (a <*> b) <*> c
128+||| forall a b c, a <.> (b <.> c) == (a <.> b) <.> c
129−||| + Neutral for `<*>`:
129+||| + Neutral for `<.>`:
130−||| forall a, a <*> unity == a
130+||| forall a, a <.> unity == a
131−||| forall a, unity <*> a == a
131+||| forall a, unity <.> a == a
132−||| + Distributivity of `<*>` and `<->`:
132+||| + Distributivity of `<.>` and `<->`:
133−||| forall a b c, a <*> (b <+> c) == (a <*> b) <+> (a <*> c)
133+||| forall a b c, a <.> (b <+> c) == (a <.> b) <+> (a <.> c)
134−||| forall a b c, (a <+> b) <*> c == (a <*> c) <+> (b <*> c)
134+||| forall a b c, (a <+> b) <.> c == (a <.> c) <+> (b <.> c)
135class Ring a => RingWithUnity a where
135class Ring a => RingWithUnity a where
136 unity : a
136 unity : a
138class (VerifiedRing a, RingWithUnity a) => VerifiedRingWithUnity a where
138class (VerifiedRing a, RingWithUnity a) => VerifiedRingWithUnity a where
139− total ringWithUnityIsUnityL : (l : a) -> l <*> unity = l
139+ total ringWithUnityIsUnityL : (l : a) -> l <.> unity = l
140− total ringWithUnityIsUnityR : (r : a) -> unity <*> r = r
140+ total ringWithUnityIsUnityR : (r : a) -> unity <.> r = r
142||| Sets equipped with a binary operation that is commutative, associative and
142||| Sets equipped with a binary operation that is commutative, associative and
143||| idempotent. Must satisfy the following laws:
143||| idempotent. Must satisfy the following laws:
@@ -281,31 +281,31 @@ class (VerifiedBoundedJoinSemilattice a, VerifiedBoundedMeetSemilattice a, Verif
281||| + Inverse for `<+>`:
281||| + Inverse for `<+>`:
282||| forall a, a <+> inverse a == neutral
282||| forall a, a <+> inverse a == neutral
283||| forall a, inverse a <+> a == neutral
283||| forall a, inverse a <+> a == neutral
284−||| + Associativity of `<*>`:
284+||| + Associativity of `<.>`:
285−||| forall a b c, a <*> (b <*> c) == (a <*> b) <*> c
285+||| forall a b c, a <.> (b <.> c) == (a <.> b) <.> c
286−||| + Unity for `<*>`:
286+||| + Unity for `<.>`:
287−||| forall a, a <*> unity == a
287+||| forall a, a <.> unity == a
288−||| forall a, unity <*> a == a
288+||| forall a, unity <.> a == a
289−||| + InverseM of `<*>`:
289+||| + InverseM of `<.>`:
290−||| forall a, a <*> inverseM a == unity
290+||| forall a, a <.> inverseM a == unity
291−||| forall a, inverseM a <*> a == unity
291+||| forall a, inverseM a <.> a == unity
292−||| + Distributivity of `<*>` and `<->`:
292+||| + Distributivity of `<.>` and `<->`:
293−||| forall a b c, a <*> (b <+> c) == (a <*> b) <+> (a <*> c)
293+||| forall a b c, a <.> (b <+> c) == (a <.> b) <+> (a <.> c)
294−||| forall a b c, (a <+> b) <*> c == (a <*> c) <+> (b <*> c)
294+||| forall a b c, (a <+> b) <.> c == (a <.> c) <+> (b <.> c)
295class RingWithUnity a => Field a where
295class RingWithUnity a => Field a where
296 inverseM : a -> a
296 inverseM : a -> a
298class (VerifiedRing a, Field a) => VerifiedField a where
298class (VerifiedRing a, Field a) => VerifiedField a where
299− total fieldInverseIsInverseL : (l : a) -> l <*> inverseM l = unity
299+ total fieldInverseIsInverseL : (l : a) -> l <.> inverseM l = unity
300− total fieldInverseIsInverseR : (r : a) -> inverseM r <*> r = unity
300+ total fieldInverseIsInverseR : (r : a) -> inverseM r <.> r = unity
302||| A module over a ring is an additive abelian group of 'vectors' endowed with a
302||| 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
303+||| scale operation multiplying vectors by ring elements, and distributivity laws
304−||| relating the scale operation to both ring addition and module addition.
304+||| relating the scale operation to both ring addition and module addition.
305||| Must satisfy the following laws:
305||| Must satisfy the following laws:
307||| + Compatibility of scalar multiplication with ring multiplication:
307||| + 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
309||| + Ring unity is the identity element of scalar multiplication:
309||| + Ring unity is the identity element of scalar multiplication:
310||| forall v, unity <#> v = v
310||| forall v, unity <#> v = v
311||| + Distributivity of `<#>` and `<+>`:
311||| + Distributivity of `<#>` and `<+>`:
@@ -315,7 +315,7 @@ class (RingWithUnity a, AbelianGroup b) => Module a b where
315 (<#>) : a -> b -> b
315 (<#>) : a -> b -> b
317class (VerifiedRingWithUnity a, VerifiedAbelianGroup b, Module a b) => VerifiedModule a b where
317class (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
319 total moduleScalarUnityIsUnity : (v : b) -> unity <#> v = v
319 total moduleScalarUnityIsUnity : (v : b) -> unity <#> v = v
320 total moduleScalarMultDistributiveWRTVectorAddition : (s : a) -> (v, w : b) -> s <#> (v <+> w) = (s <#> v) <+> (s <#> w)
320 total moduleScalarMultDistributiveWRTVectorAddition : (s : a) -> (v, w : b) -> s <#> (v <+> w) = (s <#> v) <+> (s <#> w)
321 total moduleScalarMultDistributiveWRTModuleAddition : (s, t : a) -> (v : b) -> (s <+> t) <#> v = (s <#> v) <+> (t <#> v)
321 total moduleScalarMultDistributiveWRTModuleAddition : (s, t : a) -> (v : b) -> (s <+> t) <#> v = (s <#> v) <+> (t <#> v)