Skip to content

Commit 01be04e

Browse files
AddIsColiftable + AddColift for FinSets
1 parent ab3dc26 commit 01be04e

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

doc/Doc.autodoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
@Subsection Lift
5959
@InsertChunk Lift
6060

61+
@Subsection Colift
62+
@InsertChunk Colift
63+
6164
@Subsection Singleton morphism
6265
@InsertChunk SingletonMorphism
6366

examples/Colift.g

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#! @Chunk Colift
2+
3+
LoadPackage( "FinSetsForCAP" );
4+
5+
#! @Example
6+
m := FinSet( [ 1 .. 5 ] );
7+
#! <An object in FinSets>
8+
n := FinSet( [ 1 .. 4 ] );
9+
#! <An object in FinSets>
10+
f := MapOfFinSets(
11+
m,
12+
[ [ 1, 2 ], [ 2, 2 ], [ 3, 1 ], [ 4, 1 ], [ 5, 3 ] ],
13+
n );
14+
#! <A morphism in FinSets>
15+
g := MapOfFinSets(
16+
m,
17+
[ [ 1, 5 ], [ 2, 5 ], [ 3, 4 ], [ 4, 4 ], [ 5, 5 ] ],
18+
m );
19+
#! <A morphism in FinSets>
20+
IsColiftable( f, g );
21+
#! true
22+
chi := Colift( f, g );
23+
#! <A morphism in FinSets>
24+
Display( chi );
25+
#! [ [ 1 .. 4 ], [ [ 1, 4 ], [ 2, 5 ], [ 3, 5 ], [ 4, 1 ] ], [ 1 .. 5 ] ]
26+
PreCompose( f, Colift( f, g ) ) = g;
27+
#! true
28+
IsColiftable( g, f );
29+
#! false
30+
#! @EndExample

gap/FinSets.gd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ DeclareOperation( "ProjectionOfFinSets",
222222
DeclareOperation( "Preimage",
223223
[ IsMorphismInCategoryOfFiniteSets, IsObjectInCategoryOfFiniteSets ] );
224224

225+
#! @Description
226+
#! Compute an element of the preimage of the element <A>y</A> under the morphism <A>f</A>.
227+
#! @Arguments f, y
228+
#! @Returns a GAP object
229+
DeclareOperation( "ElementOfPreimage",
230+
[ IsMorphismInCategoryOfFiniteSets, IsObject ] );
231+
225232
#! @Description
226233
#! Compute the image of <A>S_</A> under the morphism <A>f</A>.
227234
#! @Arguments f, S_

gap/FinSets.gi

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,17 @@ InstallMethod( Preimage,
374374

375375
end );
376376

377+
##
378+
InstallMethod( ElementOfPreimage,
379+
"for a CAP map of finite sets and a GAP object",
380+
[ IsMorphismInCategoryOfFiniteSets, IsObject ],
381+
382+
function ( f, y )
383+
384+
return First( Source( f ), x -> IsEqualForElementsOfFinSets( f(x), y ) );
385+
386+
end );
387+
377388
##
378389
InstallMethod( ImageObject,
379390
"for a CAP map of finite sets and a CAP finite set",
@@ -785,6 +796,43 @@ AddLift( category_of_finite_sets,
785796

786797
end );
787798

799+
## beta \circ alpha^{-1} is again an ordinary function,
800+
## i.e., fibers of alpha are mapped under beta to the same element
801+
AddIsColiftable( category_of_finite_sets,
802+
function ( category_of_finite_sets, alpha, beta )
803+
804+
return ForAll( AsList( ImageObject( alpha ) ),
805+
i -> Length( DuplicateFreeList( List( Preimage( alpha, FinSetNC( category_of_finite_sets, [ i ] ) ), beta ) ) ) = 1 );
806+
807+
end );
808+
809+
##
810+
AddColift( category_of_finite_sets,
811+
function ( category_of_finite_sets, alpha, beta )
812+
local S, T, im_alpha, elm_T, chi;
813+
814+
S := Range( alpha );
815+
T := Range( beta );
816+
817+
im_alpha := AsList( ImageObject( alpha ) );
818+
819+
## this is, e.g., implied by not IsInitial( S ), since we assume a colift exists
820+
if not IsInitial( T ) then
821+
elm_T := AsList( T )[1];
822+
fi;
823+
824+
chi :=
825+
function ( y )
826+
if not y in im_alpha then
827+
return [ y, elm_T ];
828+
fi;
829+
return [ y, beta( ElementOfPreimage( alpha, y ) ) ];
830+
end;
831+
832+
return MapOfFinSets( S, List( AsList( S ), chi ), T );
833+
834+
end );
835+
788836
##
789837
AddImageEmbedding( category_of_finite_sets,
790838
function ( category_of_finite_sets, phi )

0 commit comments

Comments
 (0)