Skip to content

Commit

Permalink
AddCoimageProjection
Browse files Browse the repository at this point in the history
ImageObject( phi )   ⤳ Set
CoimageObject( phi ) ⤳ DuplicateFreeList
  • Loading branch information
mohamed-barakat committed Oct 4, 2023
1 parent 2d531a3 commit 87a20f9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

LoadPackage( "FinSetsForCAP", false );
#! true
LoadPackage( "CompilerForCAP", false );
LoadPackage( "CompilerForCAP", ">= 2023.10-03", false );
#! true

ReadPackage( "FinSetsForCAP", "gap/CompilerLogic.gi" );
Expand Down
19 changes: 19 additions & 0 deletions gap/SkeletalFinSets.gi
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,25 @@ AddImageEmbedding( SkeletalFinSets,

end );

##
AddCoimageProjection( SkeletalFinSets,
function ( cat, phi )
local L, imgs, map;

L := AsList( phi );

## unlike ImageObject which is a subobject of the range,
## the CoimageObject is a factor object of the source,
## and we want to retain the sorting of source
imgs := DuplicateFreeList( L );

map := List( [ 0 .. Length( Source( phi ) ) - 1 ], i ->
-1 + SafePosition( imgs, L[1 + i] ) );

return MorphismConstructor( cat, Source( phi ), map, ObjectConstructor( cat, BigInt( Length( imgs ) ) ) );

end );

##
AddCoastrictionToImageWithGivenImageObject( SkeletalFinSets,
function ( cat, phi, image_object )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,23 @@ end

, 100 );

##
AddCoimageProjection( cat,

########
function ( cat_1, alpha_1 )
local deduped_3_1, deduped_4_1, deduped_5_1;
deduped_5_1 := AsList( alpha_1 );
deduped_4_1 := Source( alpha_1 );
deduped_3_1 := DuplicateFreeList( deduped_5_1 );
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 )
return -1 + SafePosition( deduped_3_1, deduped_5_1[(1 + i_2)] );
end ) );
end
########

, 100 );

##
AddColift( cat,

Expand Down

0 comments on commit 87a20f9

Please sign in to comment.