Skip to content

Commit 87a20f9

Browse files
AddCoimageProjection
ImageObject( phi ) ⤳ Set CoimageObject( phi ) ⤳ DuplicateFreeList
1 parent 2d531a3 commit 87a20f9

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,25 @@ AddImageEmbedding( SkeletalFinSets,
481481

482482
end );
483483

484+
##
485+
AddCoimageProjection( SkeletalFinSets,
486+
function ( cat, phi )
487+
local L, imgs, map;
488+
489+
L := AsList( phi );
490+
491+
## unlike ImageObject which is a subobject of the range,
492+
## the CoimageObject is a factor object of the source,
493+
## and we want to retain the sorting of source
494+
imgs := DuplicateFreeList( L );
495+
496+
map := List( [ 0 .. Length( Source( phi ) ) - 1 ], i ->
497+
-1 + SafePosition( imgs, L[1 + i] ) );
498+
499+
return MorphismConstructor( cat, Source( phi ), map, ObjectConstructor( cat, BigInt( Length( imgs ) ) ) );
500+
501+
end );
502+
484503
##
485504
AddCoastrictionToImageWithGivenImageObject( SkeletalFinSets,
486505
function ( cat, phi, image_object )

gap/precompiled_categories/SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled.gi

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

185185
, 100 );
186186

187+
##
188+
AddCoimageProjection( cat,
189+
190+
########
191+
function ( cat_1, alpha_1 )
192+
local deduped_3_1, deduped_4_1, deduped_5_1;
193+
deduped_5_1 := AsList( alpha_1 );
194+
deduped_4_1 := Source( alpha_1 );
195+
deduped_3_1 := DuplicateFreeList( deduped_5_1 );
196+
return CreateCapCategoryMorphismWithAttributes( cat_1, deduped_4_1, CreateCapCategoryObjectWithAttributes( cat_1, Length, BigInt( Length( deduped_3_1 ) ) ), AsList, List( [ 0 .. Length( deduped_4_1 ) - 1 ], function ( i_2 )
197+
return -1 + SafePosition( deduped_3_1, deduped_5_1[(1 + i_2)] );
198+
end ) );
199+
end
200+
########
201+
202+
, 100 );
203+
187204
##
188205
AddColift( cat,
189206

0 commit comments

Comments
 (0)