Skip to content

Commit 262bce0

Browse files
authored
Merge pull request #73 from mohamed-barakat/devel
AddCartesianCoevaluationMorphismWithGivenRange( SkeletalFinSets, ... )
2 parents 7fc8930 + 21ea249 commit 262bce0

File tree

9 files changed

+101
-14
lines changed

9 files changed

+101
-14
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 := "2021.12-07",
13+
Version := "2021.12-09",
1414

1515
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1616
License := "GPL-2.0-or-later",

doc/Doc.autodoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
@Subsection Pushout
4747
@InsertChunk Pushout
4848

49-
@Subsection Cartesian lambda introduction
49+
@Subsection Cartesian Lambda Introduction
5050
@InsertChunk CartesianLambdaIntroduction
5151

5252
@Subsection Lift
@@ -112,6 +112,9 @@
112112
@Subsection Skeletal Pushout
113113
@InsertChunk SkeletalPushout
114114

115+
@Subsection Skeletal Cartesian Lambda Introduction
116+
@InsertChunk SkeletalCartesianLambdaIntroduction
117+
115118
@Subsection Skeletal Lift
116119
@InsertChunk SkeletalLift
117120

examples/CartesianLambdaIntroduction.g

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ Length( Range( lf ) );
2323
#! 8
2424
lf( T[1] ) = f;
2525
#! true
26+
elf := CartesianLambdaElimination( S, R, lf );
27+
#! <A morphism in FinSets>
28+
elf = f;
29+
#! true
2630
#! @EndExample
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#! @Chunk SkeletalCartesianLambdaIntroduction
2+
3+
LoadPackage( "FinSetsForCAP" );
4+
5+
#! @Example
6+
S := FinSet( 3 );
7+
#! <An object in SkeletalFinSets>
8+
R := FinSet( 2 );
9+
#! <An object in SkeletalFinSets>
10+
f := MapOfFinSets( S, [ 2, 2, 1 ], R );
11+
#! <A morphism in SkeletalFinSets>
12+
IsWellDefined( f );
13+
#! true
14+
T := TerminalObject( SkeletalFinSets );
15+
#! <An object in SkeletalFinSets>
16+
IsTerminal( T );
17+
#! true
18+
lf := CartesianLambdaIntroduction( f );
19+
#! <A split monomorphism in SkeletalFinSets>
20+
Source( lf ) = T;
21+
#! true
22+
Display( Range( lf ) );
23+
#! 8
24+
Display( lf );
25+
#! [ 1, [ 7 ], 8 ]
26+
elf := CartesianLambdaElimination( S, R, lf );
27+
#! <A morphism in SkeletalFinSets>
28+
elf = f;
29+
#! true
30+
#! @EndExample

examples/SkeletalTopos.g

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,20 @@ CartesianBraidingInverse( M, N );;
3131
ExponentialOnObjects( M, N );;
3232
ExponentialOnMorphisms( f, g );;
3333
CartesianEvaluationMorphism( M, N );;
34+
CartesianCoevaluationMorphism( M, N );;
35+
DirectProductToExponentialAdjunctionMap( M, N,
36+
UniversalMorphismIntoTerminalObject( DirectProduct( M, N ) )
37+
);;
38+
ExponentialToDirectProductAdjunctionMap( M, N,
39+
UniversalMorphismFromInitialObject( ExponentialOnObjects( M, N ) )
40+
);;
41+
42+
M := FinSet( 2 );;
43+
N := FinSet( 2 );;
44+
P := FinSet( 1 );;
45+
Q := FinSet( 2 );;
46+
CartesianPreComposeMorphism( M, N, P );;
47+
CartesianPostComposeMorphism( M, N, P );;
48+
DirectProductExponentialCompatibilityMorphism( [ M, N, P, Q ] );;
3449

3550
#! @EndExample

examples/Topos.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ P := FinSet( [ "*" ] );;
4545
Q := FinSet( [ "§", "&" ] );;
4646
CartesianPreComposeMorphism( M, N, P );;
4747
CartesianPostComposeMorphism( M, N, P );;
48-
DirectProductExponentialCompatibilityMorphism( [ M, N, P, Q ] );;
48+
DirectProductExponentialCompatibilityMorphism( [ M, N, P, Q ] );;
4949

5050
#! @EndExample

gap/FinSetsForCAP.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ AddCartesianLambdaIntroduction( category_of_finite_sets,
10181018
function ( category_of_finite_sets, map )
10191019
local I;
10201020

1021-
I := TerminalObject( CapCategory( map ) );
1021+
I := TerminalObject( category_of_finite_sets );
10221022

10231023
return MapOfFinSetsNC(
10241024
I,

gap/SkeletalFinSetsForCAP.gi

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,13 +804,13 @@ end );
804804
##
805805
AddCartesianBraidingInverseWithGivenDirectProducts( SkeletalFinSets,
806806
function ( cat, MN, M, N, NM )
807-
local n, mn;
807+
local m, n;
808808

809-
n := Length( N );
809+
m := Length( M );
810810

811-
mn := Length( MN );
811+
n := Length( N );
812812

813-
return MapOfFinSets( cat, MN, List( [ 0 .. mn - 1 ] , i -> 1 + ( i mod mn ) + QuoInt( i, n ) ), NM );
813+
return MapOfFinSets( cat, MN, List( [ 0 .. Length( MN ) - 1 ] , i -> 1 + ( i mod n ) * m + QuoInt( i, n ) ), NM );
814814

815815
end );
816816

@@ -858,6 +858,18 @@ AddCartesianEvaluationMorphismWithGivenSource( SkeletalFinSets,
858858

859859
end );
860860

861+
##
862+
AddCartesianCoevaluationMorphismWithGivenRange( SkeletalFinSets,
863+
function ( cat, M, N, HN_MxN )
864+
local m, n;
865+
866+
m := Length( M );
867+
n := Length( N );
868+
869+
return MapOfFinSets( cat, M, List( [ 0 .. m - 1 ], i -> 1 + Sum( [ 0 .. n - 1 ], j -> ( i * n + j ) * (m*n)^(n - j - 1) ) ), HN_MxN );
870+
871+
end );
872+
861873
##
862874
AddSubobjectClassifier( SkeletalFinSets,
863875
function ( cat )

gap/precompiled_categories/CategoryOfSkeletalFinSetsPrecompiled.gi

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,36 @@ BindGlobal( "ADD_FUNCTIONS_FOR_CategoryOfSkeletalFinSetsPrecompiled", function (
1010

1111
########
1212
function ( cat_1, s_1, a_1, b_1, r_1 )
13-
local hoisted_1_1, hoisted_2_1, deduped_3_1;
14-
deduped_3_1 := Length( s_1 );
15-
hoisted_2_1 := Length( b_1 );
16-
hoisted_1_1 := deduped_3_1;
13+
local hoisted_1_1, hoisted_2_1;
14+
hoisted_2_1 := Length( a_1 );
15+
hoisted_1_1 := Length( b_1 );
16+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
17+
), cat_1, s_1, r_1, AsList, List( [ 0 .. Length( s_1 ) - 1 ], function ( i_2 )
18+
return 1 + i_2 mod hoisted_1_1 * hoisted_2_1 + QUO_INT( i_2, hoisted_1_1 );
19+
end ) );
20+
end
21+
########
22+
23+
, 100 );
24+
25+
##
26+
AddCartesianCoevaluationMorphismWithGivenRange( cat,
27+
28+
########
29+
function ( cat_1, a_1, b_1, r_1 )
30+
local hoisted_1_1, hoisted_2_1, hoisted_3_1, deduped_4_1, deduped_5_1;
31+
deduped_5_1 := Length( b_1 );
32+
deduped_4_1 := Length( a_1 );
33+
hoisted_3_1 := [ 0 .. deduped_5_1 - 1 ];
34+
hoisted_2_1 := deduped_4_1 * deduped_5_1;
35+
hoisted_1_1 := deduped_5_1;
1736
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
18-
), cat_1, s_1, r_1, AsList, List( [ 0 .. deduped_3_1 - 1 ], function ( i_2 )
19-
return 1 + i_2 mod hoisted_1_1 + QUO_INT( i_2, hoisted_2_1 );
37+
), cat_1, a_1, r_1, AsList, List( [ 0 .. deduped_4_1 - 1 ], function ( i_2 )
38+
local hoisted_1_2;
39+
hoisted_1_2 := i_2 * hoisted_1_1;
40+
return 1 + Sum( hoisted_3_1, function ( j_3 )
41+
return (hoisted_1_2 + j_3) * hoisted_2_1 ^ (hoisted_1_1 - j_3 - 1);
42+
end );
2043
end ) );
2144
end
2245
########

0 commit comments

Comments
 (0)