diff --git a/examples/PrecompileCategoryOfSkeletalFinSetsWithMorphismsGivenByLists.g b/examples/PrecompileCategoryOfSkeletalFinSetsWithMorphismsGivenByLists.g index dd0ac45..cbbfc77 100644 --- a/examples/PrecompileCategoryOfSkeletalFinSetsWithMorphismsGivenByLists.g +++ b/examples/PrecompileCategoryOfSkeletalFinSetsWithMorphismsGivenByLists.g @@ -8,7 +8,7 @@ LoadPackage( "FinSetsForCAP", false ); #! true -LoadPackage( "CompilerForCAP", false ); +LoadPackage( "CompilerForCAP", ">= 2023.10-03", false ); #! true ReadPackage( "FinSetsForCAP", "gap/CompilerLogic.gi" ); @@ -24,6 +24,7 @@ primitive_operations := category_constructor( : no_precompiled_code := true ) );; list_of_operations := SortedList( Concatenation( primitive_operations, [ + "AstrictionToCoimage", "CoastrictionToImage", "IsHomSetInhabited", "TruthMorphismOfImplies", diff --git a/gap/SkeletalFinSets.gi b/gap/SkeletalFinSets.gi index d1cfb35..19e4fbd 100644 --- a/gap/SkeletalFinSets.gi +++ b/gap/SkeletalFinSets.gi @@ -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 ); + ## Limits ## diff --git a/gap/precompiled_categories/SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled.gi b/gap/precompiled_categories/SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled.gi index 6abe118..d5e783e 100644 --- a/gap/precompiled_categories/SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled.gi +++ b/gap/precompiled_categories/SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled.gi @@ -5,6 +5,32 @@ # BindGlobal( "ADD_FUNCTIONS_FOR_SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled", function ( cat ) + ## + AddAstrictionToCoimage( cat, + +######## +function ( cat_1, alpha_1 ) + local deduped_3_1, hoisted_4_1, deduped_5_1, deduped_6_1, deduped_7_1; + deduped_7_1 := AsList( alpha_1 ); + deduped_6_1 := DuplicateFreeList( deduped_7_1 ); + deduped_5_1 := BigInt( Length( deduped_6_1 ) ); + hoisted_4_1 := BigInt( 0 ); + deduped_3_1 := List( [ 0 .. Length( Source( alpha_1 ) ) - 1 ], function ( i_2 ) + return -1 + SafePosition( deduped_6_1, deduped_7_1[(1 + i_2)] ); + end ); + return CreateCapCategoryMorphismWithAttributes( cat_1, CreateCapCategoryObjectWithAttributes( cat_1, Length, deduped_5_1 ), Range( alpha_1 ), AsList, List( [ 0 .. deduped_5_1 - 1 ], function ( y_2 ) + if not y_2 in deduped_3_1 then + return hoisted_4_1; + else + return deduped_7_1[SafePosition( deduped_3_1, y_2 )]; + fi; + return; + end ) ); +end +######## + + , 202 : IsPrecompiledDerivation := true ); + ## AddCartesianBraidingInverseWithGivenDirectProducts( cat, @@ -184,6 +210,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,