Skip to content

Commit 2b662bc

Browse files
installed ExactCoverWithGlobalElements primitively
and used it to "derive" MorphismsOfExternalHom
1 parent 5c6c6d5 commit 2b662bc

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
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-05",
13+
Version := "2023.05-06",
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",

gap/SkeletalFinSetsForCAP.gi

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -857,25 +857,34 @@ AddCartesianLambdaIntroduction( SkeletalFinSets,
857857

858858
end );
859859

860+
##
861+
AddExactCoverWithGlobalElements( SkeletalFinSets,
862+
function ( cat, A )
863+
local T;
864+
865+
T := TerminalObject( cat );
866+
867+
return List( [ 0 .. Length( A ) - 1 ], i -> MapOfFinSets( cat, T, [ i ], A ) );
868+
869+
end );
870+
860871
##
861872
AddExponentialOnMorphismsWithGivenExponentials( SkeletalFinSets,
862873
function ( cat, S, alpha, beta, T )
863-
local M, m, N, n, D, MN;
874+
local M, N, MN, mors;
864875

865876
M := Range( alpha );
866-
m := Length( M );
867877
N := Source( beta );
868-
n := Length( N );
869-
870-
D := TerminalObject( cat );
871878

872879
MN := ExponentialOnObjects( cat, M, N );
880+
881+
mors := ExactCoverWithGlobalElements( cat, MN );
873882

874883
return MapOfFinSets(
875884
cat,
876885
S,
877-
List( [ 0 .. n ^ m - 1 ],
878-
function ( i )
886+
List( mors,
887+
function ( mor )
879888
return
880889
AsList( CartesianLambdaIntroduction( cat,
881890
PreComposeList(
@@ -884,17 +893,14 @@ AddExponentialOnMorphismsWithGivenExponentials( SkeletalFinSets,
884893
CartesianLambdaElimination( cat,
885894
M,
886895
N,
887-
MapOfFinSets( cat,
888-
D,
889-
[ i ],
890-
MN ) ),
896+
mor ),
891897
beta ] ) ) )[1 + 0];
892898

893899
end ),
894900
T );
895901

896-
end, 1 + Sum( [ [ "TerminalObject", 1 ],
897-
[ "ExponentialOnObjects", 1 ],
902+
end, 1 + Sum( [ [ "ExponentialOnObjects", 1 ],
903+
[ "ExactCoverWithGlobalElements", 1 ],
898904
[ "PreComposeList", 2 ],
899905
[ "CartesianLambdaElimination", 2 ],
900906
[ "CartesianLambdaIntroduction", 2 ] ],
@@ -965,27 +971,22 @@ end );
965971
##
966972
AddMorphismsOfExternalHom( SkeletalFinSets,
967973
function ( cat, A, B )
968-
local hom_A_B, T;
974+
local hom_A_B, mors;
969975

970976
hom_A_B := ExponentialOnObjects( cat, A, B );
971977

972-
T := TerminalObject( cat );
978+
mors := ExactCoverWithGlobalElements( cat, hom_A_B );
973979

974-
return List( hom_A_B,
975-
i -> CartesianLambdaElimination( cat,
980+
return List( mors,
981+
mor -> CartesianLambdaElimination( cat,
976982
A,
977983
B,
978-
MapOfFinSets( cat, T, [ i ], hom_A_B ) ) );
984+
mor ) );
979985

980-
end );
981-
982-
##
983-
AddExactCoverWithGlobalElements( SkeletalFinSets,
984-
function ( cat, A )
985-
986-
return MorphismsOfExternalHom( cat, TerminalObject( cat ), A );
987-
988-
end );
986+
end, 1 + Sum( [ [ "ExponentialOnObjects", 1 ],
987+
[ "ExactCoverWithGlobalElements", 1 ],
988+
[ "CartesianLambdaElimination", 2 ] ],
989+
e -> e[2] * CurrentOperationWeight( SkeletalFinSets!.derivations_weight_list, e[1] ) ) );
989990

990991
end );
991992

gap/precompiled_categories/CategoryOfSkeletalFinSetsPrecompiled.gi

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,10 @@ end
285285

286286
########
287287
function ( cat_1, arg2_1 )
288-
local hoisted_2_1, deduped_3_1;
289-
deduped_3_1 := Length( arg2_1 );
290-
hoisted_2_1 := CreateCapCategoryObjectWithAttributes( cat_1, Length, BigInt( 1 ) );
291-
return List( [ 0 .. deduped_3_1 - 1 ], function ( i_2 )
292-
return CreateCapCategoryMorphismWithAttributes( cat_1, hoisted_2_1, arg2_1, AsList, [ REM_INT( i_2, deduped_3_1 ) ] );
288+
local hoisted_1_1;
289+
hoisted_1_1 := CreateCapCategoryObjectWithAttributes( cat_1, Length, BigInt( 1 ) );
290+
return List( [ 0 .. Length( arg2_1 ) - 1 ], function ( i_2 )
291+
return CreateCapCategoryMorphismWithAttributes( cat_1, hoisted_1_1, arg2_1, AsList, [ i_2 ] );
293292
end );
294293
end
295294
########
@@ -309,10 +308,10 @@ function ( cat_1, s_1, alpha_1, beta_1, r_1 )
309308
hoisted_4_1 := AsList( beta_1 );
310309
hoisted_3_1 := AsList( alpha_1 );
311310
hoisted_2_1 := [ 0 .. deduped_8_1 - 1 ];
312-
return CreateCapCategoryMorphismWithAttributes( cat_1, s_1, r_1, AsList, List( [ 0 .. deduped_7_1 ^ deduped_8_1 - 1 ], function ( i_2 )
311+
return CreateCapCategoryMorphismWithAttributes( cat_1, s_1, r_1, AsList, List( [ 0 .. deduped_7_1 ^ deduped_8_1 - 1 ], function ( logic_new_func_x_2 )
313312
local hoisted_1_2;
314313
hoisted_1_2 := List( hoisted_2_1, function ( i_3 )
315-
return REM_INT( QUO_INT( i_2, deduped_7_1 ^ i_3 ), deduped_7_1 );
314+
return REM_INT( QUO_INT( logic_new_func_x_2, deduped_7_1 ^ i_3 ), deduped_7_1 );
316315
end );
317316
return Sum( List( hoisted_6_1, function ( k_3 )
318317
return hoisted_4_1[(1 + hoisted_1_2[(1 + hoisted_3_1[(1 + CAP_JIT_INCOMPLETE_LOGIC( k_3 ))])])] * hoisted_5_1 ^ k_3;
@@ -651,15 +650,15 @@ function ( cat_1, arg2_1, arg3_1 )
651650
deduped_4_1 := Length( arg2_1 );
652651
deduped_3_1 := Length( arg3_1 );
653652
hoisted_2_1 := [ 0 .. deduped_4_1 - 1 ];
654-
return List( [ 0 .. deduped_3_1 ^ deduped_4_1 - 1 ], function ( i_2 )
653+
return List( [ 0 .. deduped_3_1 ^ deduped_4_1 - 1 ], function ( logic_new_func_x_2 )
655654
return CreateCapCategoryMorphismWithAttributes( cat_1, arg2_1, arg3_1, AsList, List( hoisted_2_1, function ( i_3 )
656-
return REM_INT( QUO_INT( i_2, deduped_3_1 ^ i_3 ), deduped_3_1 );
655+
return REM_INT( QUO_INT( logic_new_func_x_2, deduped_3_1 ^ i_3 ), deduped_3_1 );
657656
end ) );
658657
end );
659658
end
660659
########
661660

662-
, 100 );
661+
, 401 );
663662

664663
##
665664
AddObjectConstructor( cat,

0 commit comments

Comments
 (0)