Skip to content

Commit f243961

Browse files
AddCoimageObject & AddCoimageProjectionWithGivenCoimageObject
ImageObject( phi ) ⤳ Set CoimageObject( phi ) ⤳ DuplicateFreeList
1 parent 3082d39 commit f243961

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

examples/PrecompileCategoryOfSkeletalFinSetsWithMorphismsGivenByLists.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
LoadPackage( "FinSetsForCAP", false );
1010
#! true
11-
LoadPackage( "CompilerForCAP", false );
11+
LoadPackage( "CompilerForCAP", ">= 2023.10-03", false );
1212
#! true
1313

1414
ReadPackage( "FinSetsForCAP", "gap/CompilerLogic.gi" );

gap/SkeletalFinSets.gi

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@ AddImageObject( SkeletalFinSets,
364364

365365
end );
366366

367+
##
368+
AddCoimageObject( SkeletalFinSets,
369+
function ( cat, phi )
370+
371+
return ImageObject( cat, phi );
372+
373+
end );
374+
367375
## the function SKELETAL_FIN_SETS_IsEpimorphism
368376
## has linear runtime complexity
369377
AddIsEpimorphism( SkeletalFinSets,
@@ -483,7 +491,23 @@ AddImageEmbeddingWithGivenImageObject( SkeletalFinSets,
483491
function ( cat, phi, image )
484492

485493
return MorphismConstructor( cat, image, Set( AsList( phi ) ), Range( phi ) );
494+
495+
end );
486496

497+
##
498+
AddCoimageProjectionWithGivenCoimageObject( SkeletalFinSets,
499+
function ( cat, phi, coimage )
500+
local L, imgs, map;
501+
502+
L := AsList( phi );
503+
504+
imgs := DuplicateFreeList( L );
505+
506+
map := List( [ 0 .. Length( Source( phi ) ) - 1 ], i ->
507+
-1 + SafePosition( imgs, L[1 + i] ) );
508+
509+
return MorphismConstructor( cat, Source( phi ), map, coimage );
510+
487511
end );
488512

489513
##

gap/precompiled_categories/SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled.gi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,34 @@ end
184184

185185
, 100 );
186186

187+
##
188+
AddCoimageObject( cat,
189+
190+
########
191+
function ( cat_1, arg2_1 )
192+
return CreateCapCategoryObjectWithAttributes( cat_1, Length, BigInt( Length( SSortedList( AsList( arg2_1 ) ) ) ) );
193+
end
194+
########
195+
196+
, 100 );
197+
198+
##
199+
AddCoimageProjectionWithGivenCoimageObject( cat,
200+
201+
########
202+
function ( cat_1, alpha_1, C_1 )
203+
local hoisted_2_1, deduped_3_1, deduped_4_1;
204+
deduped_4_1 := AsList( alpha_1 );
205+
deduped_3_1 := Source( alpha_1 );
206+
hoisted_2_1 := DuplicateFreeList( deduped_4_1 );
207+
return CreateCapCategoryMorphismWithAttributes( cat_1, deduped_3_1, C_1, AsList, List( [ 0 .. Length( deduped_3_1 ) - 1 ], function ( i_2 )
208+
return -1 + SafePosition( hoisted_2_1, deduped_4_1[(1 + i_2)] );
209+
end ) );
210+
end
211+
########
212+
213+
, 100 );
214+
187215
##
188216
AddColift( cat,
189217

0 commit comments

Comments
 (0)