Skip to content

Commit ab85ff2

Browse files
use ObjectConstructor/MorphismConstructor
instead of FinSet/MapOfFinSets
1 parent 540838d commit ab85ff2

File tree

5 files changed

+45
-45
lines changed

5 files changed

+45
-45
lines changed

PackageInfo.g

Lines changed: 1 addition & 1 deletion
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.05-08",
13+
Version := "2023.05-09",
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",

examples/doc/SkeletalFinSet.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Display( m );
1010
IsWellDefined( m );
1111
#! true
1212
String( m );
13-
#! "FinSet( SkeletalFinSets, 7 )"
13+
#! "ObjectConstructor( SkeletalFinSets, 7 )"
1414
Display( List( m, x -> x^2 ) );
1515
#! [ 0, 1, 4, 9, 16, 25, 36 ]
1616
L := ObjectDatum( m );

examples/doc/SkeletalMapOfFinSets.g

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ IsWellDefined( phi );
1616
Display( phi );
1717
#! { 0, 1, 2 } ⱶ[ 6, 4, 4 ]→ { 0,..., 6 }
1818
String( phi );
19-
#! "MapOfFinSets( SkeletalFinSets, FinSet( SkeletalFinSets, 3 ), [ 6, 4, 4 ], Fin\
20-
#! Set( SkeletalFinSets, 7 ) )"
19+
#! "MorphismConstructor( SkeletalFinSets, ObjectConstructor( SkeletalFinSets, 3 )\
20+
#! , [ 6, 4, 4 ], ObjectConstructor( SkeletalFinSets, 7 ) )"
2121

2222
s := ObjectConstructor( SkeletalFinSets, BigInt( 3 ) );
2323
#! |3|

gap/CompilerLogic.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ CapJitAddLogicFunction( function ( tree )
9494

9595
pre_func :=
9696
function ( tree, additional_arguments )
97-
local args, is_big_int, values;
97+
local args;
9898

9999
if CapJitIsCallToGlobalFunction( tree, "{}" ) then
100100

gap/SkeletalFinSets.gi

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ InstallMethod( CategoryOfSkeletalFinSets,
5151
end );
5252

5353
##
54-
InstallMethodForCompilerForCAP( FinSetOp,
54+
InstallMethod( FinSetOp,
5555
[ IsCategoryOfSkeletalFinSets, IsBigInt ],
5656

5757
function ( cat, n )
@@ -85,7 +85,7 @@ end );
8585
## Morphisms
8686

8787
##
88-
InstallOtherMethodForCompilerForCAP( MapOfFinSets,
88+
InstallOtherMethod( MapOfFinSets,
8989
"for a category of skeletal finite sets, two CAP skeletal finite sets and a list",
9090
[ IsCategoryOfSkeletalFinSets, IsSkeletalFiniteSet, IsList, IsSkeletalFiniteSet ],
9191

@@ -343,7 +343,7 @@ end );
343343
AddIdentityMorphism( SkeletalFinSets,
344344
function ( cat, n )
345345

346-
return MapOfFinSets( cat, n, [ 0 .. Length( n ) - 1 ], n );
346+
return MorphismConstructor( cat, n, [ 0 .. Length( n ) - 1 ], n );
347347

348348
end );
349349

@@ -360,15 +360,15 @@ AddPreCompose( SkeletalFinSets,
360360

361361
cmp := List( s, i -> im_post[1 + im_pre[1 + i]] );
362362

363-
return MapOfFinSets( cat, s, cmp, t );
363+
return MorphismConstructor( cat, s, cmp, t );
364364

365365
end );
366366

367367
##
368368
AddImageObject( SkeletalFinSets,
369369
function ( cat, phi )
370370

371-
return FinSet( cat, BigInt( Length( Set( AsList( phi ) ) ) ) );
371+
return ObjectConstructor( cat, BigInt( Length( Set( AsList( phi ) ) ) ) );
372372

373373
end );
374374

@@ -446,7 +446,7 @@ AddLift( SkeletalFinSets,
446446
gg := AsList( g );
447447
ff := AsList( f );
448448

449-
return MapOfFinSets( cat, S, List( S, x -> -1 + BigInt( SafePosition( gg, ff[1 + x] ) ) ), T );
449+
return MorphismConstructor( cat, S, List( S, x -> -1 + BigInt( SafePosition( gg, ff[1 + x] ) ) ), T );
450450

451451
end );
452452

@@ -482,15 +482,15 @@ AddColift( SkeletalFinSets,
482482
return gg[SafePosition( ff, y )];
483483
end;
484484

485-
return MapOfFinSets( cat, S, List( S, y -> chi(y) ), T );
485+
return MorphismConstructor( cat, S, List( S, y -> chi(y) ), T );
486486

487487
end );
488488

489489
##
490490
AddImageEmbeddingWithGivenImageObject( SkeletalFinSets,
491491
function ( cat, phi, image )
492492

493-
return MapOfFinSets( cat, image, Set( AsList( phi ) ), Range( phi ) );
493+
return MorphismConstructor( cat, image, Set( AsList( phi ) ), Range( phi ) );
494494

495495
end );
496496

@@ -507,7 +507,7 @@ AddCoastrictionToImageWithGivenImageObject( SkeletalFinSets,
507507

508508
L := List( s, i -> -1 + BigInt( SafePosition( images, G[1 + i] ) ) );
509509

510-
pi := MapOfFinSets( cat, s, L, image_object );
510+
pi := MorphismConstructor( cat, s, L, image_object );
511511

512512
#% CAP_JIT_DROP_NEXT_STATEMENT
513513
Assert( 3, IsEpimorphism( cat, pi ) );
@@ -531,23 +531,23 @@ end );
531531
AddTerminalObject( SkeletalFinSets,
532532
function ( cat )
533533

534-
return FinSet( cat, BigInt( 1 ) );
534+
return ObjectConstructor( cat, BigInt( 1 ) );
535535

536536
end );
537537

538538
##
539539
AddUniversalMorphismIntoTerminalObjectWithGivenTerminalObject( SkeletalFinSets,
540540
function ( cat, m, t )
541541

542-
return MapOfFinSets( cat, m, ListWithIdenticalEntries( Length( m ), BigInt( 0 ) ), t );
542+
return MorphismConstructor( cat, m, ListWithIdenticalEntries( Length( m ), BigInt( 0 ) ), t );
543543

544544
end );
545545

546546
##
547547
AddDirectProduct( SkeletalFinSets,
548548
function ( cat, L )
549549

550-
return FinSet( cat, Product( List( L, Length ) ) );
550+
return ObjectConstructor( cat, Product( List( L, Length ) ) );
551551

552552
end );
553553

@@ -562,7 +562,7 @@ AddProjectionInFactorOfDirectProductWithGivenDirectProduct( SkeletalFinSets,
562562

563563
a := Product( List( D{[ 1 .. k - 1 ]}, Length ) );
564564

565-
return MapOfFinSets( cat, P, List( P, i -> RemInt( QuoInt( i, a ), l ) ), T );
565+
return MorphismConstructor( cat, P, List( P, i -> RemInt( QuoInt( i, a ), l ) ), T );
566566

567567
end );
568568

@@ -580,7 +580,7 @@ AddUniversalMorphismIntoDirectProductWithGivenDirectProduct( SkeletalFinSets,
580580
taus := List( tau, AsList );
581581

582582
# if l = 0, then Sum( [ 0 .. l - 1 ], j -> ... ) = 0 ∈ TerminalObject = P
583-
return MapOfFinSets( cat, T, List( T, i -> Sum( [ 0 .. l - 1 ], j -> taus[1 + j][1 + i] * dd[1 + j] ) ), P );
583+
return MorphismConstructor( cat, T, List( T, i -> Sum( [ 0 .. l - 1 ], j -> taus[1 + j][1 + i] * dd[1 + j] ) ), P );
584584

585585
end );
586586

@@ -593,7 +593,7 @@ AddEqualizer( SkeletalFinSets,
593593

594594
Eq := Filtered( [ 0 .. Length( s ) - 1 ], x -> ForAll( [ 1 .. Length( D ) - 1 ], j -> D2[j][1 + x] = D2[j + 1][1 + x] ) );
595595

596-
return FinSet( cat, Length( Eq ) );
596+
return ObjectConstructor( cat, Length( Eq ) );
597597

598598
end );
599599

@@ -606,7 +606,7 @@ AddEmbeddingOfEqualizerWithGivenEqualizer( SkeletalFinSets,
606606

607607
Eq := Filtered( [ 0 .. Length( s ) - 1 ], x -> ForAll( [ 1 .. Length( D ) - 1 ], j -> D2[j][1 + x] = D2[j + 1][1 + x] ) );
608608

609-
return MapOfFinSets( cat, E, Eq, s );
609+
return MorphismConstructor( cat, E, Eq, s );
610610

611611
end );
612612

@@ -621,7 +621,7 @@ AddUniversalMorphismIntoEqualizerWithGivenEqualizer( SkeletalFinSets,
621621

622622
t := AsList( tau );
623623

624-
return MapOfFinSets( cat, test_object, List( test_object, x -> -1 + BigInt( SafePosition( Eq, t[1 + x] ) ) ), E );
624+
return MorphismConstructor( cat, test_object, List( test_object, x -> -1 + BigInt( SafePosition( Eq, t[1 + x] ) ) ), E );
625625

626626
end );
627627

@@ -640,15 +640,15 @@ end );
640640
AddInitialObject( SkeletalFinSets,
641641
function ( cat )
642642

643-
return FinSet( cat, BigInt( 0 ) );
643+
return ObjectConstructor( cat, BigInt( 0 ) );
644644

645645
end );
646646

647647
##
648648
AddUniversalMorphismFromInitialObjectWithGivenInitialObject( SkeletalFinSets,
649649
function ( cat, m, I )
650650

651-
return MapOfFinSets( cat, I, [ ], m );
651+
return MorphismConstructor( cat, I, [ ], m );
652652

653653
end );
654654

@@ -692,15 +692,15 @@ end );
692692
AddMonomorphismIntoSomeInjectiveObjectWithGivenSomeInjectiveObject( SkeletalFinSets,
693693
function ( cat, M, injective_object )
694694

695-
return MapOfFinSets( cat, M, [ 0 .. Length( M ) - 1 ], injective_object );
695+
return MorphismConstructor( cat, M, [ 0 .. Length( M ) - 1 ], injective_object );
696696

697697
end );
698698

699699
##
700700
AddCoproduct( SkeletalFinSets,
701701
function ( cat, L )
702702

703-
return FinSet( cat, Sum( List( L, Length ) ) );
703+
return ObjectConstructor( cat, Sum( List( L, Length ) ) );
704704

705705
end );
706706

@@ -715,7 +715,7 @@ AddInjectionOfCofactorOfCoproductWithGivenCoproduct( SkeletalFinSets,
715715

716716
s := L[i];
717717

718-
return MapOfFinSets( cat, s, [ sum .. sum + Length( s ) - 1 ], coproduct );
718+
return MorphismConstructor( cat, s, [ sum .. sum + Length( s ) - 1 ], coproduct );
719719

720720
end );
721721

@@ -726,15 +726,15 @@ AddUniversalMorphismFromCoproductWithGivenCoproduct( SkeletalFinSets,
726726

727727
concat := Concatenation( List( tau, AsList ) );
728728

729-
return MapOfFinSets( cat, S, concat, test_object );
729+
return MorphismConstructor( cat, S, concat, test_object );
730730

731731
end );
732732

733733
##
734734
AddCoequalizer( SkeletalFinSets,
735735
function ( cat, s, D )
736736

737-
return FinSet( cat, BigInt( Length( SKELETAL_FIN_SETS_ExplicitCoequalizer( s, D ) ) ) );
737+
return ObjectConstructor( cat, BigInt( Length( SKELETAL_FIN_SETS_ExplicitCoequalizer( s, D ) ) ) );
738738

739739
end );
740740

@@ -747,7 +747,7 @@ AddProjectionOntoCoequalizerWithGivenCoequalizer( SkeletalFinSets,
747747

748748
cmp := List( s, x -> -1 + BigInt( SafeUniquePositionProperty( Cq, c -> x in c ) ) );
749749

750-
return MapOfFinSets( cat, s, cmp, C );
750+
return MorphismConstructor( cat, s, cmp, C );
751751

752752
end );
753753

@@ -758,7 +758,7 @@ AddUniversalMorphismFromCoequalizerWithGivenCoequalizer( SkeletalFinSets,
758758

759759
Cq := SKELETAL_FIN_SETS_ExplicitCoequalizer( s, D );
760760

761-
return MapOfFinSets( cat, C, List( Cq, x -> tau( x[1] ) ), Range( tau ) );
761+
return MorphismConstructor( cat, C, List( Cq, x -> tau( x[1] ) ), Range( tau ) );
762762

763763
end );
764764

@@ -805,7 +805,7 @@ AddCartesianBraidingInverseWithGivenDirectProducts( SkeletalFinSets,
805805

806806
n := Length( N );
807807

808-
return MapOfFinSets( cat, MN, List( MN , i -> RemInt( i, n ) * m + QuoInt( i, n ) ), NM );
808+
return MorphismConstructor( cat, MN, List( MN , i -> RemInt( i, n ) * m + QuoInt( i, n ) ), NM );
809809

810810
end );
811811

@@ -817,7 +817,7 @@ AddExponentialOnObjects( SkeletalFinSets,
817817
m := Length( M );
818818
n := Length( N );
819819

820-
return FinSet( cat, n ^ m );
820+
return ObjectConstructor( cat, n ^ m );
821821

822822
end );
823823

@@ -831,7 +831,7 @@ AddCartesianLambdaElimination( SkeletalFinSets,
831831

832832
v := AsList( intro )[1];
833833

834-
return MapOfFinSets( cat,
834+
return MorphismConstructor( cat,
835835
M,
836836
List( [ 0 .. m - 1 ], i -> RemInt( QuoInt( v, n^i ), n ) ),
837837
N );
@@ -850,7 +850,7 @@ AddCartesianLambdaIntroduction( SkeletalFinSets,
850850

851851
images := AsList( map );
852852

853-
return MapOfFinSets( cat,
853+
return MorphismConstructor( cat,
854854
TerminalObject( cat ),
855855
[ Sum( List( [ 0 .. m - 1 ], k -> images[1 + k] * n^k ) ) ],
856856
ExponentialOnObjects( cat, M, N ) );
@@ -864,7 +864,7 @@ AddExactCoverWithGlobalElements( SkeletalFinSets,
864864

865865
T := TerminalObject( cat );
866866

867-
return List( [ 0 .. Length( A ) - 1 ], i -> MapOfFinSets( cat, T, [ i ], A ) );
867+
return List( [ 0 .. Length( A ) - 1 ], i -> MorphismConstructor( cat, T, [ i ], A ) );
868868

869869
end );
870870

@@ -880,7 +880,7 @@ AddExponentialOnMorphismsWithGivenExponentials( SkeletalFinSets,
880880

881881
mors := ExactCoverWithGlobalElements( cat, MN );
882882

883-
return MapOfFinSets( cat,
883+
return MorphismConstructor( cat,
884884
S,
885885
List( mors, mor ->
886886
AsList( CartesianLambdaIntroduction( cat,
@@ -893,7 +893,7 @@ AddExponentialOnMorphismsWithGivenExponentials( SkeletalFinSets,
893893
mor ),
894894
beta ] ) ) )[1 + 0] ),
895895
T );
896-
896+
897897
end, 1 + Sum( [ [ "ExponentialOnObjects", 1 ],
898898
[ "ExactCoverWithGlobalElements", 1 ],
899899
[ "PreComposeList", 2 ],
@@ -911,7 +911,7 @@ AddCartesianEvaluationMorphismWithGivenSource( SkeletalFinSets,
911911

912912
exp := n ^ m;
913913

914-
return MapOfFinSets( cat, HM_NxM, List( [ 0 .. ( n^m * m ) - 1 ], i -> RemInt( QuoInt( i, n^QuoInt( i, exp ) ), n ) ), N );
914+
return MorphismConstructor( cat, HM_NxM, List( [ 0 .. ( n^m * m ) - 1 ], i -> RemInt( QuoInt( i, n^QuoInt( i, exp ) ), n ) ), N );
915915

916916
end );
917917

@@ -925,17 +925,17 @@ AddCartesianCoevaluationMorphismWithGivenRange( SkeletalFinSets,
925925

926926
mn := m * n;
927927

928-
#return MapOfFinSets( cat, M, List( [ 0 .. m - 1 ], i -> Sum( [ 0 .. n - 1 ], j -> ( i + m * j ) * (m*n)^j ) ), HN_MxN );
928+
#return MorphismConstructor( cat, M, List( [ 0 .. m - 1 ], i -> Sum( [ 0 .. n - 1 ], j -> ( i + m * j ) * (m*n)^j ) ), HN_MxN );
929929

930-
return MapOfFinSets( cat, M, List( [ 0 .. m - 1 ], i -> i * GeometricSum( mn, n ) + m * mn * GeometricSumDiff1( mn, n ) ), HN_MxN );
930+
return MorphismConstructor( cat, M, List( [ 0 .. m - 1 ], i -> i * GeometricSum( mn, n ) + m * mn * GeometricSumDiff1( mn, n ) ), HN_MxN );
931931

932932
end );
933933

934934
##
935935
AddSubobjectClassifier( SkeletalFinSets,
936936
function ( cat )
937937

938-
return FinSet( cat, BigInt( 2 ) );
938+
return ObjectConstructor( cat, BigInt( 2 ) );
939939

940940
end );
941941

@@ -959,7 +959,7 @@ AddClassifyingMorphismOfSubobjectWithGivenSubobjectClassifier( SkeletalFinSets,
959959

960960
end );
961961

962-
return MapOfFinSets( cat, range, chi, Omega );
962+
return MorphismConstructor( cat, range, chi, Omega );
963963

964964
end );
965965

@@ -991,7 +991,7 @@ InstallMethod( String,
991991
[ IsSkeletalFiniteSet ],
992992

993993
function ( s )
994-
return Concatenation( "FinSet( SkeletalFinSets, ", String( Length( s ) ), " )" );
994+
return Concatenation( "ObjectConstructor( SkeletalFinSets, ", String( Length( s ) ), " )" );
995995
end );
996996

997997
##
@@ -1000,7 +1000,7 @@ InstallMethod( String,
10001000
[ IsSkeletalFiniteSetMap ],
10011001

10021002
function ( phi )
1003-
return Concatenation( "MapOfFinSets( SkeletalFinSets, ", String( Source( phi ) ), ", ", String( AsList( phi ) ), ", ", String( Range( phi ) ), " )" );
1003+
return Concatenation( "MorphismConstructor( SkeletalFinSets, ", String( Source( phi ) ), ", ", String( AsList( phi ) ), ", ", String( Range( phi ) ), " )" );
10041004
end );
10051005

10061006
##

0 commit comments

Comments
 (0)