Skip to content

Commit b6023ef

Browse files
updated example files
1 parent 7046e21 commit b6023ef

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

examples/doc/IntegersAsMonoid.g

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ LoadPackage( "Algebroids" );
77
#! @Example
88
q := RightQuiver( "q(o)[m:o->o,i:o->o]" );
99
#! q(o)[m:o->o,i:o->o]
10-
L := [ [ q.m * q.i, q.o ], [ q.i * q.m, q.o ] ];
10+
o := q.o;
11+
#! (o)
12+
m := q.m;
13+
#! (m)
14+
i := q.i;
15+
#! (i)
16+
L := [ [ m * i, o ], [ i * m, o ] ];
1117
#! [ [ (m*i), (o) ], [ (i*m), (o) ] ]
1218
#! @EndExample
1319

@@ -20,6 +26,8 @@ IsCommutative( ZZ );
2026
#! true
2127
ZZ.o;
2228
#! <(o)>
29+
IsWellDefined( ZZ.o );
30+
#! true
2331
m := ZZ.m;
2432
#! (o)-[(m)]->(o)
2533
i := ZZ.i;
@@ -30,24 +38,26 @@ SetOfGeneratingMorphisms( ZZ );
3038
#! [ (o)-[(m)]->(o), (o)-[(i)]->(o) ]
3139
SetOfGeneratingMorphisms( ZZ, ZZ.o, ZZ.o );
3240
#! [ (o)-[(m)]->(o), (o)-[(i)]->(o) ]
33-
ObjectInFpCategory( ZZ, q.o ) = ZZ.o;
41+
ObjectInFpCategory( ZZ, o ) = ZZ.o;
3442
#! true
35-
ZZ.o = q.o / ZZ;
43+
ZZ.o = o / ZZ;
3644
#! true
45+
IdentityMorphism( ZZ.o );
46+
#! (o)-[(o)]->(o)
3747
MorphismInFpCategory( ZZ, q.m ) = ZZ.m;
3848
#! true
3949
ZZ.m = q.m / ZZ;
4050
#! true
41-
IdentityMorphism( ZZ.o );
42-
#! (o)-[(o)]->(o)
4351
#! @EndExample
4452

4553
#! We can compute in the algebroids.
4654
#! For instance we can form compositions.
4755

4856
#! @Example
49-
PreCompose( [ m, i, m, m, i, m, i, m ] );
57+
m2 := PreCompose( [ m, i, m, m, i, m, i, m ] );
5058
#! (o)-[(m*m)]->(o)
59+
IsWellDefined( m2 );
60+
#! true
5161
unit := Unit( ZZ );
5262
#! Functor from Monoid generated by the right quiver *(1)[]
5363
#! -> Monoid generated by the right quiver q(o)[m:o->o,i:o->o]

examples/doc/NaturalNumbersAsMonoid.g

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ LoadPackage( "Algebroids" );
77
#! @Example
88
q := RightQuiver( "q(o)[m:o->o]" );
99
#! q(o)[m:o->o]
10+
o := q.o;
11+
#! (o)
12+
m := q.m;
13+
#! (m)
1014
#! @EndExample
1115

1216
#! Create a monoid from $q$.
@@ -26,16 +30,16 @@ SetOfGeneratingMorphisms( N );
2630
#! [ (o)-[(m)]->(o) ]
2731
SetOfGeneratingMorphisms( N, N.o, N.o );
2832
#! [ (o)-[(m)]->(o) ]
29-
ObjectInFpCategory( N, q.o ) = N.o;
33+
ObjectInFpCategory( N, o ) = N.o;
3034
#! true
31-
N.o = q.o / N;
32-
#! true
33-
MorphismInFpCategory( N, q.m ) = N.m;
34-
#! true
35-
N.m = q.m / N;
35+
N.o = o / N;
3636
#! true
3737
IdentityMorphism( N.o );
3838
#! (o)-[(o)]->(o)
39+
MorphismInFpCategory( N, m ) = N.m;
40+
#! true
41+
N.m = m / N;
42+
#! true
3943
#! @EndExample
4044

4145
#! We can compute in the algebroids.

0 commit comments

Comments
 (0)