Skip to content

Commit 240dcdf

Browse files
AddAstrictionToCoimage
ImageEmbedding( phi ) ⤳ Set AstrictionToCoimage( phi ) ⤳ DuplicateFreeList and compiled CoimageProjection needs Toposes v2023.10-13
1 parent e3ee93e commit 240dcdf

7 files changed

+88
-5
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-02",
13+
Version := "2023.10-03",
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",
@@ -100,7 +100,7 @@ Dependencies := rec(
100100
NeededOtherPackages := [
101101
[ "CAP", ">= 2023.09-11" ],
102102
[ "CartesianCategories", ">= 2023.08-13" ],
103-
[ "Toposes", ">= 2023.10-01" ],
103+
[ "Toposes", ">= 2023.10-13" ],
104104
],
105105
SuggestedOtherPackages := [ ],
106106
ExternalConditions := [ ],

doc/Doc.autodoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
@InsertChunk SkeletalImageEmbedding
107107
@InsertChunk SkeletalCoastrictionToImage
108108

109+
@Subsection Skeletal Coimage
110+
@InsertChunk SkeletalCoimageObject
111+
109112
@Subsection Skeletal Preimage
110113
@InsertChunk SkeletalPreimage
111114

examples/CoimageObject.g

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ IsEpimorphism( phi );
2222
#! false
2323
IsSplitEpimorphism( phi );
2424
#! false
25-
iota := AstrictionToCoimage( phi );
26-
#! <A morphism in FinSets>
2725
pi := CoimageProjection( phi );
2826
#! <An epimorphism in FinSets>
27+
iota := AstrictionToCoimage( phi );
28+
#! <A morphism in FinSets>
2929
PreCompose( pi, iota ) = phi;
3030
#! true
31+
3132
#! @EndExample

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",

examples/SkeletalCoimageObject.g

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#! @Chunk SkeletalCoimageObject
2+
3+
#! @Example
4+
LoadPackage( "FinSetsForCAP", false );
5+
#! true
6+
m := FinSet( 3 );
7+
#! |3|
8+
n := FinSet( 3 );
9+
#! |3|
10+
phi := MapOfFinSets( m, [ 1, 0, 1 ], n );
11+
#! |3| → |3|
12+
I := CoimageObject( phi );
13+
#! |2|
14+
IsMonomorphism( phi );
15+
#! false
16+
IsSplitMonomorphism( phi );
17+
#! false
18+
IsEpimorphism( phi );
19+
#! false
20+
IsSplitEpimorphism( phi );
21+
#! false
22+
pi := CoimageProjection( phi );
23+
#! |3| → |2|
24+
iota := AstrictionToCoimage( phi );
25+
#! |2| → |3|
26+
PreCompose( pi, iota ) = phi;
27+
#! true
28+
Display( iota );
29+
#! { 0, 1 } ⱶ[ 1, 0 ]→ { 0, 1, 2 }
30+
Display( ImageEmbedding( phi ) );
31+
#! { 0, 1 } ⱶ[ 0, 1 ]→ { 0, 1, 2 }
32+
#! @EndExample

gap/SkeletalFinSets.gi

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

487487
end );
488488

489+
##
490+
AddAstrictionToCoimage( SkeletalFinSets,
491+
function ( cat, phi )
492+
local L, map;
493+
494+
L := AsList( phi );
495+
496+
## unlike ImageObject which is a subobject of the range,
497+
## the CoimageObject is a factor object of the source,
498+
## and we want to retain the sorting of the source:
499+
map := DuplicateFreeList( L );
500+
501+
return MorphismConstructor( cat, ObjectConstructor( cat, BigInt( Length( map ) ) ), map, Range( phi ) );
502+
503+
end );
504+
489505
## Limits
490506

491507
##

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)