Skip to content

Commit 088e6c3

Browse files
Merge pull request #233 from mohamed-barakat/devel
d&i CategoryFromNerveData/DataTables using IndicesOfGeneratingMorphisms
2 parents 09ffa18 + e69a029 commit 088e6c3

9 files changed

+135
-21
lines changed

PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "Algebroids",
1212
Subtitle := "Algebroids and bialgebroids as preadditive categories generated by enhanced quivers",
13-
Version := "2022.12-26",
13+
Version := "2022.12-29",
1414

1515
Date := ~.Version{[ 1 .. 10 ]},
1616
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),

examples/CategoryFromDataTables.g

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ LoadPackage( "Algebroids" );
66
Delta1 := SimplicialCategoryTruncatedInDegree( 1 );
77
#! FreeCategory( RightQuiver( "Delta(C0,C1)[id:C1->C0,s:C0->C1,t:C0->C1]" ) )
88
#! / [ s*id = C0, t*id = C0 ]
9-
C := CategoryFromDataTables( Name( Delta1 ),
10-
RangeCategoryOfHomomorphismStructure( Delta1 ),
11-
DataTablesOfCategory( Delta1 ),
12-
[ 1, 2, 3 ],
13-
[ [ "C0", "C1" ],
14-
[ "id", "s", "t" ] ] );
9+
C := CategoryFromDataTables( Delta1 );
1510
#! FreeCategory( RightQuiver( "Delta(C0,C1)[id:C1->C0,s:C0->C1,t:C0->C1]" ) )
1611
#! / [ s*id = C0, t*id = C0 ]
1712
NerveTruncatedInDegree2Data( Delta1 ) = NerveTruncatedInDegree2Data( C );
1813
#! true
19-
InfoOfInstalledOperationsOfCategory( C );
14+
Display( C );
15+
#! A CAP category with name
16+
#! FreeCategory( RightQuiver( "Delta(C0,C1)[id:C1->C0,s:C0->C1,t:C0->C1]" ) )
17+
#! / [ s*id = C0, t*id = C0 ]:
18+
#!
2019
#! 16 primitive operations were used to derive 50 operations for this category
2120
#! which algorithmically
2221
#! * IsEquippedWithHomomorphismStructure

examples/CategoryFromNerveData.g

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ Delta1 := SimplicialCategoryTruncatedInDegree( 1 );
99
N1 := NerveTruncatedInDegree2Data( Delta1 );;
1010
N1[1];
1111
#! [ |2|, |7|, |26| ]
12-
C := CategoryFromNerveData( Name( Delta1 ), N1,
13-
[ 1, 2, 3 ], [ [ "C0", "C1" ], [ "id", "s", "t" ] ] );
12+
C := CategoryFromNerveData( Delta1 );
1413
#! FreeCategory( RightQuiver( "Delta(C0,C1)[id:C1->C0,s:C0->C1,t:C0->C1]" ) )
1514
#! / [ s*id = C0, t*id = C0 ]
1615
NerveTruncatedInDegree2Data( C ) = N1;
1716
#! true
18-
InfoOfInstalledOperationsOfCategory( C );
17+
Display( C );
18+
#! A CAP category with name
19+
#! FreeCategory( RightQuiver( "Delta(C0,C1)[id:C1->C0,s:C0->C1,t:C0->C1]" ) )
20+
#! / [ s*id = C0, t*id = C0 ]:
21+
#!
1922
#! 16 primitive operations were used to derive 50 operations for this category
2023
#! which algorithmically
2124
#! * IsEquippedWithHomomorphismStructure

gap/CategoryFromDataTables.gd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,17 @@ DeclareAttribute( "OppositeCategoryFromDataTables",
182182
####################################
183183

184184
#! @Description
185-
#! Construct a <A>V</A>-enriched category with name <A>str</A> from the given <A>data_tables</A>.
185+
#! Construct a <A>V</A>-enriched category with name <A>str</A> from the given <A>data_tables</A> (of a f.p. category <A>C</A>).
186186
#! @Arguments str, V, data_tables, indices_of_generating_morphisms, labels
187187
#! @Returns a &CAP; category
188188
DeclareOperation( "CategoryFromDataTables",
189189
[ IsString, IsCapCategory, IsList, IsList, IsList ] );
190190
#! @InsertChunk CategoryFromDataTables
191191

192+
#! @Arguments C
193+
DeclareAttribute( "CategoryFromDataTables",
194+
IsFpCategory );
195+
192196
#! @Description
193197
#! Construct the <A>o</A>-th object in the category <A>C</A> created from data tables.
194198
#! @Arguments C, o

gap/CategoryFromDataTables.gi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,22 @@ InstallMethod( CategoryFromDataTables,
258258

259259
end );
260260

261+
##
262+
InstallMethod( CategoryFromDataTables,
263+
"for a f.p. category",
264+
[ IsFpCategory ],
265+
266+
function( C )
267+
268+
return CategoryFromDataTables( Name( C ),
269+
RangeCategoryOfHomomorphismStructure( C ),
270+
DataTablesOfCategory( C ),
271+
IndicesOfGeneratingMorphisms( C ),
272+
[ List( SetOfObjects( C ), Label ),
273+
List( SetOfGeneratingMorphisms( C ), Label ) ] );
274+
275+
end );
276+
261277
##
262278
InstallMethodForCompilerForCAP( CreateObject,
263279
"for a category from data tables and an integer",

gap/CategoryFromNerveData.gd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,17 @@ DeclareAttribute( "OppositeCategoryFromNerveData",
167167
####################################
168168

169169
#! @Description
170-
#! Construct a category with name <A>str</A> from the given <A>nerve_data</A>.
170+
#! Construct a category with name <A>str</A> from the given <A>nerve_data</A> (of a f.p. category <A>C</A>).
171171
#! @Arguments str, nerve_data, indices_of_generating_morphisms, labels
172172
#! @Returns a &CAP; category
173173
DeclareOperation( "CategoryFromNerveData",
174174
[ IsString, IsList, IsList, IsList ] );
175175
#! @InsertChunk CategoryFromNerveData
176176

177+
#! @Arguments C
178+
DeclareAttribute( "CategoryFromNerveData",
179+
IsFpCategory );
180+
177181
#! @Description
178182
#! Construct the <A>o</A>-th object in the category <A>C</A> created from nerve data.
179183
#! @Arguments C, o

gap/CategoryFromNerveData.gi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,21 @@ InstallMethod( CategoryFromNerveData,
476476

477477
end );
478478

479+
##
480+
InstallMethod( CategoryFromNerveData,
481+
"for a f.p. category",
482+
[ IsFpCategory ],
483+
484+
function( C )
485+
486+
return CategoryFromNerveData( Name( C ),
487+
NerveTruncatedInDegree2Data( C ),
488+
IndicesOfGeneratingMorphisms( C ),
489+
[ List( SetOfObjects( C ), Label ),
490+
List( SetOfGeneratingMorphisms( C ), Label ) ] );
491+
492+
end );
493+
479494
##
480495
InstallMethod( CreateObject,
481496
"for a category from nerve data and an integer",

gap/FpCategories.gd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ DeclareOperation( "SetOfGeneratingMorphisms",
210210
DeclareOperation( "SetOfGeneratingMorphisms",
211211
[ IsFpCategory, IsInt, IsInt ] );
212212

213+
DeclareAttribute( "IndicesOfGeneratingMorphisms",
214+
IsFpCategory );
215+
213216
#! @Description
214217
#! Assigns the generating morphisms of the finitely presented category <A>C</A> to global variables.
215218
#! Names of the variables are the concatenation of <A>label</A> with the names of the defining arrows.
@@ -226,6 +229,9 @@ DeclareOperation( "AssignSetOfGeneratingMorphisms",
226229
DeclareAttribute( "RelationsOfFpCategory",
227230
IsFpCategory );
228231

232+
DeclareAttribute( "RelationsOfFpCategoryData",
233+
IsFpCategory );
234+
229235
#! @Description
230236
#! The finitely presented category defined by the opposite of the underlying quiver with relations.
231237
#! @Arguments C

gap/FpCategories.gi

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,80 @@ InstallOtherMethod( AssignSetOfGeneratingMorphisms,
159159

160160
end );
161161

162+
##
163+
InstallMethod( RelationsOfFpCategoryData,
164+
"for a f.p. category",
165+
[ IsFpCategory ],
166+
167+
function( C )
168+
local relations, objs, mors, func;
169+
170+
relations := RelationsOfFpCategory( C );
171+
172+
if IsEmpty( relations ) then
173+
return [ ];
174+
fi;
175+
176+
Assert( 0, IsQuotientOfPathAlgebra( UnderlyingQuiverAlgebra( C ) ) );
177+
178+
objs := List( SetOfObjects( C ), UnderlyingVertex );
179+
180+
mors := List( SetOfGeneratingMorphisms( C ), p -> BasisPathOfPathAlgebraBasisElement( UnderlyingQuiverAlgebraElement( p ) ) );
181+
182+
func :=
183+
function( path )
184+
if IsQuiverVertex( path ) then
185+
return [ ];
186+
fi;
187+
188+
return List( ArrowList( path ), g -> 1 + SafePosition( mors, g ) );
189+
end;
190+
191+
return List( relations, pair -> Pair( func( pair[1] ), func( pair[2] ) ) );
192+
193+
end );
194+
195+
##
196+
InstallMethod( IndicesOfGeneratingMorphisms,
197+
"for a f.p. category",
198+
[ IsFpCategory ],
199+
200+
function( C )
201+
local V, C0, N0, D00, N0N0, p21, p22, C1, T, st, mors;
202+
203+
V := RangeCategoryOfHomomorphismStructure( C );
204+
205+
C0 := SetOfObjects( C );
206+
N0 := FinSet( V, Length( C0 ) );
207+
208+
D00 := [ N0, N0 ];
209+
210+
## N0 × N0 -> N0
211+
p21 := ProjectionInFactorOfDirectProduct( V, D00, 1 );
212+
p22 := ProjectionInFactorOfDirectProduct( V, D00, 2 );
213+
214+
C1 := List( DirectProduct( V, D00 ), i ->
215+
HomomorphismStructureOnObjects( C,
216+
C0[1 + AsList( p21 )[1 + i]],
217+
C0[1 + AsList( p22 )[1 + i]] ) );
218+
219+
T := DistinguishedObjectOfHomomorphismStructure( C );
220+
221+
st := List( DefiningPairOfUnderlyingQuiver( C )[2], pair ->
222+
UniversalMorphismIntoDirectProduct( V,
223+
D00,
224+
T,
225+
[ MapOfFinSets( V, T, [ pair[1] ], N0 ),
226+
MapOfFinSets( V, T, [ pair[2] ], N0 ) ] ) );
227+
228+
mors := SetOfGeneratingMorphisms( C );
229+
230+
return List( [ 1 .. Length( st ) ], i ->
231+
Sum( C1{[ 1 .. AsList( st[i] )[1 + 0] ]}, Length ) +
232+
AsList( InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( C, mors[i] ) )[1 + 0] );
233+
234+
end );
235+
162236
##
163237
InstallMethod( DataTablesOfCategory,
164238
"for a f.p. category",
@@ -391,15 +465,8 @@ InstallMethod( BasisPathOfPathAlgebraBasisElement,
391465
[ IsQuotientOfPathAlgebraElement ],
392466

393467
function( basis_element )
394-
local representative, paths;
395-
396-
representative := Representative( basis_element );
397-
398-
paths := Paths( representative );
399468

400-
Assert( 0, Length( paths ) = 1 and Coefficients( representative ) = [ 1 ] );
401-
402-
return paths[1];
469+
return BasisPathOfPathAlgebraBasisElement( Representative( basis_element ) );
403470

404471
end );
405472

0 commit comments

Comments
 (0)