Skip to content

Commit e9a1437

Browse files
AddAstrictionToCoimage
ImageEmbedding( phi ) ⤳ Set AstrictionToCoimage( phi ) ⤳ DuplicateFreeList and compiled CoimageProjection needs CAP v2023.10-07
1 parent dfa939e commit e9a1437

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

PackageInfo.g

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "FinSetsForCAP",
1212
Subtitle := "The elementary topos of (skeletal) finite sets",
13-
Version := "2023.10-01",
13+
Version := "2023.10-02",
1414

1515
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
1616
License := "GPL-2.0-or-later",
@@ -98,7 +98,7 @@ PackageDoc := rec(
9898
Dependencies := rec(
9999
GAP := ">= 4.12.1",
100100
NeededOtherPackages := [
101-
[ "CAP", ">= 2023.09-11" ],
101+
[ "CAP", ">= 2023.10-07" ],
102102
[ "CartesianCategories", ">= 2023.08-13" ],
103103
[ "Toposes", ">= 2023.10-01" ],
104104
],

examples/PrecompileCategoryOfSkeletalFinSetsWithMorphismsGivenByLists.g

Lines changed: 2 additions & 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" );
@@ -25,6 +25,7 @@ primitive_operations :=
2525
list_of_operations :=
2626
SortedList( Concatenation( primitive_operations, [
2727
"CoastrictionToImage",
28+
"CoimageProjection",
2829
"IsHomSetInhabited",
2930
"TruthMorphismOfImplies",
3031
#"HasPushoutComplement",

gap/SkeletalFinSets.gi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,22 @@ AddImageEmbedding( SkeletalFinSets,
481481

482482
end );
483483

484+
##
485+
AddAstrictionToCoimage( SkeletalFinSets,
486+
function ( cat, phi )
487+
local L, 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 the source:
494+
map := DuplicateFreeList( L );
495+
496+
return MorphismConstructor( cat, ObjectConstructor( cat, BigInt( Length( map ) ) ), map, Range( phi ) );
497+
498+
end );
499+
484500
## Limits
485501

486502
##

gap/precompiled_categories/SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled.gi

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
#
66
BindGlobal( "ADD_FUNCTIONS_FOR_SkeletalCategoryOfFiniteSetsWithMorphismsGivenByListsPrecompiled", function ( cat )
77

8+
##
9+
AddAstrictionToCoimage( cat,
10+
11+
########
12+
function ( cat_1, alpha_1 )
13+
local deduped_1_1;
14+
deduped_1_1 := DuplicateFreeList( AsList( alpha_1 ) );
15+
return CreateCapCategoryMorphismWithAttributes( cat_1, CreateCapCategoryObjectWithAttributes( cat_1, Length, BigInt( Length( deduped_1_1 ) ) ), Range( alpha_1 ), AsList, deduped_1_1 );
16+
end
17+
########
18+
19+
, 100 );
20+
821
##
922
AddCartesianBraidingInverseWithGivenDirectProducts( cat,
1023

@@ -184,6 +197,23 @@ end
184197

185198
, 100 );
186199

200+
##
201+
AddCoimageProjection( cat,
202+
203+
########
204+
function ( cat_1, alpha_1 )
205+
local deduped_3_1, deduped_4_1, deduped_5_1;
206+
deduped_5_1 := AsList( alpha_1 );
207+
deduped_4_1 := Source( alpha_1 );
208+
deduped_3_1 := DuplicateFreeList( deduped_5_1 );
209+
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 ( x_2 )
210+
return -1 + BigInt( SafePosition( deduped_3_1, deduped_5_1[(1 + x_2)] ) );
211+
end ) );
212+
end
213+
########
214+
215+
, 202 : IsPrecompiledDerivation := true );
216+
187217
##
188218
AddColift( cat,
189219

0 commit comments

Comments
 (0)