@@ -17,12 +17,10 @@ class Functor f => VerifiedFunctor (f : Type -> Type) where
1717 (g1 : a -> b) -> (g2 : b -> c) ->
1818 map (g2 . g1) x = (map g2 . map g1) x
1919
20−
21−
2220class (Applicative f, VerifiedFunctor f) => VerifiedApplicative (f : Type -> Type) where
2321 applicativeMap : (x : f a) -> (g : a -> b) ->
2422 map g x = pure g <*> x
25− applicativeIdentity : (x : f a) -> pure id <*> x = x
23+ applicativeIdentity : (x : f a) -> pure Basics.id <*> x = x
2624 applicativeComposition : (x : f a) -> (g1 : f (a -> b)) -> (g2 : f (b -> c)) ->
2725 ((pure (.) <*> g2) <*> g1) <*> x = g2 <*> (g1 <*> x)
2826 applicativeHomomorphism : (x : a) -> (g : a -> b) ->
@@ -30,14 +28,13 @@ class (Applicative f, VerifiedFunctor f) => VerifiedApplicative (f : Type -> Typ
3028 applicativeInterchange : (x : a) -> (g : f (a -> b)) ->
3129 g <*> pure x = pure (\g' : a -> b => g' x) <*> g
3230
33−
3431class (Monad m, VerifiedApplicative m) => VerifiedMonad (m : Type -> Type) where
3532 monadApplicative : (mf : m (a -> b)) -> (mx : m a) ->
3633 mf <*> mx = mf >>= \f =>
3734 mx >>= \x =>
3835 pure (f x)
3936 monadLeftIdentity : (x : a) -> (f : a -> m b) -> return x >>= f = f x
40− monadRightIdentity : (mx : m a) -> mx >>= return = mx
37+ monadRightIdentity : (mx : m a) -> mx >>= Monad.return = mx
4138 monadAssociativity : (mx : m a) -> (f : a -> m b) -> (g : b -> m c) ->
4239 (mx >>= f) >>= g = mx >>= (\x => f x >>= g)
4340
@@ -53,8 +50,8 @@ instance VerifiedSemigroup (List a) where
5350
5451
5552class (VerifiedSemigroup a, Monoid a) => VerifiedMonoid a where
56− total monoidNeutralIsNeutralL : (l : a) -> l <+> neutral = l
57− total monoidNeutralIsNeutralR : (r : a) -> neutral <+> r = r
53+ total monoidNeutralIsNeutralL : (l : a) -> l <+> Algebra.neutral = l
54+ total monoidNeutralIsNeutralR : (r : a) -> Algebra.neutral <+> r = r
5855
5956-- instance VerifiedMonoid Nat where
6057-- monoidNeutralIsNeutralL = plusZeroRightNeutral
@@ -65,8 +62,8 @@ instance VerifiedMonoid (List a) where
6562 monoidNeutralIsNeutralR xs = Refl
6663
6764class (VerifiedMonoid a, Group a) => VerifiedGroup a where
68− total groupInverseIsInverseL : (l : a) -> l <+> inverse l = neutral
69− total groupInverseIsInverseR : (r : a) -> inverse r <+> r = neutral
65+ total groupInverseIsInverseL : (l : a) -> l <+> inverse l = Algebra.neutral
66+ total groupInverseIsInverseR : (r : a) -> inverse r <+> r = Algebra.neutral
7067
7168class (VerifiedGroup a, AbelianGroup a) => VerifiedAbelianGroup a where
7269 total abelianGroupOpIsCommutative : (l, r : a) -> l <+> r = r <+> l
@@ -77,12 +74,12 @@ class (VerifiedAbelianGroup a, Ring a) => VerifiedRing a where
7774 total ringOpIsDistributiveR : (l, c, r : a) -> (l <+> c) <.> r = (l <.> r) <+> (c <.> r)
7875
7976class (VerifiedRing a, RingWithUnity a) => VerifiedRingWithUnity a where
80− total ringWithUnityIsUnityL : (l : a) -> l <.> unity = l
81− total ringWithUnityIsUnityR : (r : a) -> unity <.> r = r
77+ total ringWithUnityIsUnityL : (l : a) -> l <.> Algebra.unity = l
78+ total ringWithUnityIsUnityR : (r : a) -> Algebra.unity <.> r = r
8279
8380--class (VerifiedRingWithUnity a, Field a) => VerifiedField a where
84−-- total fieldInverseIsInverseL : (l : a) -> (notId : Not (l = neutral)) -> l <.> (inverseM l notId) = unity
85−-- total fieldInverseIsInverseR : (r : a) -> (notId : Not (r = neutral)) -> (inverseM r notId) <.> r = unity
81+-- total fieldInverseIsInverseL : (l : a) -> (notId : Not (l = neutral)) -> l <.> (inverseM l notId) = Algebra.unity
82+-- total fieldInverseIsInverseR : (r : a) -> (notId : Not (r = neutral)) -> (inverseM r notId) <.> r = Algebra.unity
8683
8784
8885class JoinSemilattice a => VerifiedJoinSemilattice a where
@@ -96,10 +93,10 @@ class MeetSemilattice a => VerifiedMeetSemilattice a where
9693 total meetSemilatticeMeetIsIdempotent : (e : a) -> meet e e = e
9794
9895class (VerifiedJoinSemilattice a, BoundedJoinSemilattice a) => VerifiedBoundedJoinSemilattice a where
99− total boundedJoinSemilatticeBottomIsBottom : (e : a) -> join e bottom = e
96+ total boundedJoinSemilatticeBottomIsBottom : (e : a) -> join e Algebra.bottom = e
10097
10198class (VerifiedMeetSemilattice a, BoundedMeetSemilattice a) => VerifiedBoundedMeetSemilattice a where
102− total boundedMeetSemilatticeTopIsTop : (e : a) -> meet e top = e
99+ total boundedMeetSemilatticeTopIsTop : (e : a) -> meet e Algebra.top = e
103100
104101class (VerifiedJoinSemilattice a, VerifiedMeetSemilattice a) => VerifiedLattice a where
105102 total latticeMeetAbsorbsJoin : (l, r : a) -> meet l (join l r) = l
@@ -110,7 +107,7 @@ class (VerifiedBoundedJoinSemilattice a, VerifiedBoundedMeetSemilattice a, Verif
110107
111108--class (VerifiedRingWithUnity a, VerifiedAbelianGroup b, Module a b) => VerifiedModule a b where
112109-- total moduleScalarMultiplyComposition : (x,y : a) -> (v : b) -> x <#> (y <#> v) = (x <.> y) <#> v
113−-- total moduleScalarUnityIsUnity : (v : b) -> unity {a} <#> v = v
110+-- total moduleScalarUnityIsUnity : (v : b) -> Algebra.unity {a} <#> v = v
114111-- total moduleScalarMultDistributiveWRTVectorAddition : (s : a) -> (v, w : b) -> s <#> (v <+> w) = (s <#> v) <+> (s <#> w)
115112-- total moduleScalarMultDistributiveWRTModuleAddition : (s, t : a) -> (v : b) -> (s <+> t) <#> v = (s <#> v) <+> (t <#> v)
116113