Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WithGivens for monoidal and (co)cartesian derivations #1494

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CartesianCategories/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "CartesianCategories",
Subtitle := "Cartesian and cocartesian categories and various subdoctrines",
Version := "2023.11-02",
Version := "2023.11-03",
Date := ~.Version{[ 1 .. 10 ]},
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)( ),
License := "GPL-2.0-or-later",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@
AddDerivationToCAP( CartesianBraidingInverseWithGivenDirectProducts,
"CartesianBraidingInverseWithGivenDirectProducts as the inverse of the braiding",
[ [ InverseForMorphisms, 1 ],
[ CartesianBraiding, 1 ] ],
[ CartesianBraidingWithGivenDirectProducts, 1 ] ],

function( cat, object_2_x_object_1, object_1, object_2, object_1_x_object_2 )
##TODO: Use CartesianBraidingWithGiven
return InverseForMorphisms( cat, CartesianBraiding( cat, object_1, object_2 ) );

return InverseForMorphisms( cat, CartesianBraidingWithGivenDirectProducts( cat, object_1_x_object_2, object_1, object_2, object_2_x_object_1 ) );

Check warning on line 18 in CartesianCategories/gap/BraidedCartesianCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/BraidedCartesianCategoriesDerivedMethods.gi#L18

Added line #L18 was not covered by tests

end : CategoryFilter := IsCartesianCategory );

##
AddDerivationToCAP( CartesianBraidingWithGivenDirectProducts,
"CartesianBraidingWithGivenDirectProducts as the inverse of CartesianBraidingInverse",
[ [ InverseForMorphisms, 1 ],
[ CartesianBraidingInverse, 1 ] ],
[ CartesianBraidingInverseWithGivenDirectProducts, 1 ] ],

function( cat, object_1_x_object_2, object_1, object_2, object_2_x_object_1 )
##TODO: Use CartesianBraidingInverseWithGiven
return InverseForMorphisms( cat, CartesianBraidingInverse( cat, object_1, object_2 ) );

return InverseForMorphisms( cat, CartesianBraidingInverseWithGivenDirectProducts( cat, object_2_x_object_1, object_1, object_2, object_1_x_object_2 ) );

Check warning on line 30 in CartesianCategories/gap/BraidedCartesianCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/BraidedCartesianCategoriesDerivedMethods.gi#L30

Added line #L30 was not covered by tests

end : CategoryFilter := IsCartesianCategory );

Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@
AddDerivationToCAP( CocartesianBraidingInverseWithGivenCoproducts,
"CocartesianBraidingInverseWithGivenCoproducts as the inverse of the braiding",
[ [ InverseForMorphisms, 1 ],
[ CocartesianBraiding, 1 ] ],
[ CocartesianBraidingWithGivenCoproducts, 1 ] ],

function( cat, object_2_u_object_1, object_1, object_2, object_1_u_object_2 )
##TODO: Use CocartesianBraidingWithGiven
return InverseForMorphisms( cat, CocartesianBraiding( cat, object_1, object_2 ) );

return InverseForMorphisms( cat, CocartesianBraidingWithGivenCoproducts( cat, object_1_u_object_2, object_1, object_2, object_2_u_object_1 ) );

Check warning on line 18 in CartesianCategories/gap/BraidedCocartesianCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/BraidedCocartesianCategoriesDerivedMethods.gi#L18

Added line #L18 was not covered by tests

end : CategoryFilter := IsCocartesianCategory );

##
AddDerivationToCAP( CocartesianBraidingWithGivenCoproducts,
"CocartesianBraidingWithGivenCoproducts as the inverse of CocartesianBraidingInverse",
[ [ InverseForMorphisms, 1 ],
[ CocartesianBraidingInverse, 1 ] ],
[ CocartesianBraidingInverseWithGivenCoproducts, 1 ] ],

function( cat, object_1_u_object_2, object_1, object_2, object_2_u_object_1 )
##TODO: Use CocartesianBraidingInverseWithGiven
return InverseForMorphisms( cat, CocartesianBraidingInverse( cat, object_1, object_2 ) );

return InverseForMorphisms( cat, CocartesianBraidingInverseWithGivenCoproducts( cat, object_2_u_object_1, object_1, object_2, object_1_u_object_2 ) );

Check warning on line 30 in CartesianCategories/gap/BraidedCocartesianCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/BraidedCocartesianCategoriesDerivedMethods.gi#L30

Added line #L30 was not covered by tests

end : CategoryFilter := IsCocartesianCategory );

Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
##
AddDerivationToCAP( CartesianEvaluationForCartesianDualWithGivenDirectProduct,
"CartesianEvaluationForCartesianDualWithGivenDirectProduct using the direct product-exponential adjunction and IsomorphismFromCartesianDualObjectToExponentialIntoTerminalObject",
[ [ ExponentialToDirectProductAdjunctionMap, 1 ],
[ [ ExponentialToDirectProductAdjunctionMapWithGivenDirectProduct, 1 ],
[ IsomorphismFromCartesianDualObjectToExponentialIntoTerminalObject, 1 ] ],

function( cat, s, a, r )
Expand All @@ -300,8 +300,11 @@
#
# Adjoint( a^v → Exp(a,1) ) = ( a^v × a → 1 )

return ExponentialToDirectProductAdjunctionMap( cat, a, r,
IsomorphismFromCartesianDualObjectToExponentialIntoTerminalObject( cat, a ) );
return ExponentialToDirectProductAdjunctionMapWithGivenDirectProduct( cat,
a,
r,
IsomorphismFromCartesianDualObjectToExponentialIntoTerminalObject( cat, a ),
s );

end : CategoryFilter := IsCartesianClosedCategory );

Expand Down Expand Up @@ -531,14 +534,16 @@
AddDerivationToCAP( IsomorphismFromObjectToExponentialWithGivenExponential,
"IsomorphismFromObjectToExponentialWithGivenExponential using the coevaluation morphism",
[ [ TerminalObject, 1 ],
[ DirectProduct, 1 ],
[ ExponentialOnObjects, 1 ],
[ PreCompose, 1 ],
[ CartesianCoevaluationMorphism, 1 ],
[ ExponentialOnMorphisms, 1 ],
[ CartesianCoevaluationMorphismWithGivenRange, 1 ],
[ ExponentialOnMorphismsWithGivenExponentials, 1 ],
[ IdentityMorphism, 1 ],
[ CartesianRightUnitor, 1 ] ],
[ CartesianRightUnitorWithGivenDirectProduct, 1 ] ],

function( cat, a, internal_hom )
local unit;
local unit, a_x_1, exp_1_ax1;

# a
# |
Expand All @@ -551,20 +556,24 @@
# Exp(1, a)

unit := TerminalObject( cat );
a_x_1 := BinaryDirectProduct( cat, a, unit );
exp_1_ax1:= ExponentialOnObjects( cat, unit, a_x_1 );

return PreCompose( cat,
CartesianCoevaluationMorphism( cat, a, unit ),
ExponentialOnMorphisms( cat,
IdentityMorphism( cat, unit ),
CartesianRightUnitor( cat, a ) ) );
CartesianCoevaluationMorphismWithGivenRange( cat, a, unit, exp_1_ax1 ),
ExponentialOnMorphismsWithGivenExponentials( cat,
exp_1_ax1,
IdentityMorphism( cat, unit ),
CartesianRightUnitorWithGivenDirectProduct( cat, a, a_x_1 ),
internal_hom ) );

end : CategoryFilter := IsCartesianClosedCategory );

##
AddDerivationToCAP( IsomorphismFromObjectToExponentialWithGivenExponential,
"IsomorphismFromObjectToExponentialWithGivenExponential as the adjoint of the right unitor",
[ [ TerminalObject, 1 ],
[ DirectProductToExponentialAdjunctionMap, 1 ],
[ DirectProductToExponentialAdjunctionMapWithGivenExponential, 1 ],
[ CartesianRightUnitor, 1 ] ],

function( cat, a, internal_hom )
Expand All @@ -573,10 +582,11 @@
#
# Adjoint( ρ_a ) = ( a → Exp(1,a) )

return DirectProductToExponentialAdjunctionMap( cat,
return DirectProductToExponentialAdjunctionMapWithGivenExponential( cat,

Check warning on line 585 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L585

Added line #L585 was not covered by tests
a,
TerminalObject( cat ),
CartesianRightUnitor( cat, a ) );
CartesianRightUnitor( cat, a ),
internal_hom );

Check warning on line 589 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L588-L589

Added lines #L588 - L589 were not covered by tests

end : CategoryFilter := IsCartesianClosedCategory );

Expand All @@ -598,10 +608,13 @@
"IsomorphismFromExponentialToObjectWithGivenExponential using the evaluation morphism",
[ [ TerminalObject, 1 ],
[ PreCompose, 1 ],
[ CartesianRightUnitorInverse, 1 ],
[ CartesianEvaluationMorphism, 1 ] ],
[ DirectProduct, 1 ],
[ ExponentialOnObjects, 1 ],
[ CartesianRightUnitorInverseWithGivenDirectProduct, 1 ],
[ CartesianEvaluationMorphismWithGivenSource, 1 ] ],

function( cat, a, internal_hom )
local unit, exp_1a, exp_1a_x_1;

# Exp(1,a)
# |
Expand All @@ -613,9 +626,13 @@
# v
# a

unit := TerminalObject( cat );
exp_1a := ExponentialOnObjects( cat, unit, a );
exp_1a_x_1 := BinaryDirectProduct( cat, exp_1a, unit );

return PreCompose( cat,
CartesianRightUnitorInverse( cat, internal_hom ),
CartesianEvaluationMorphism( cat, TerminalObject( cat ), a ) );
CartesianRightUnitorInverseWithGivenDirectProduct( cat, internal_hom, exp_1a_x_1 ),
CartesianEvaluationMorphismWithGivenSource( cat, unit, a, exp_1a_x_1 ) );

end : CategoryFilter := IsCartesianClosedCategory );

Expand Down Expand Up @@ -682,34 +699,38 @@
##
AddDerivationToCAP( CartesianEvaluationMorphismWithGivenSource,
"CartesianEvaluationMorphismWithGivenSource using the direct product-exponential adjunction on the identity",
[ [ ExponentialToDirectProductAdjunctionMap, 1 ],
[ [ ExponentialToDirectProductAdjunctionMapWithGivenDirectProduct, 1 ],
[ IdentityMorphism, 1 ],
[ ExponentialOnObjects, 1 ] ],

function( cat, a, b, direct_product_object )

# Adjoint( id_Exp(a,b): Exp(a,b) → Exp(a,b) ) = ( Exp(a,b) × a → b )

return ExponentialToDirectProductAdjunctionMap( cat,
a, b,
IdentityMorphism( cat, ExponentialOnObjects( cat, a, b ) ) );
return ExponentialToDirectProductAdjunctionMapWithGivenDirectProduct( cat,

Check warning on line 710 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L710

Added line #L710 was not covered by tests
a,
b,
IdentityMorphism( cat, ExponentialOnObjects( cat, a, b ) ),
direct_product_object );

Check warning on line 714 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L713-L714

Added lines #L713 - L714 were not covered by tests

end : CategoryFilter := IsCartesianClosedCategory );

##
AddDerivationToCAP( CartesianCoevaluationMorphismWithGivenRange,
"CartesianCoevaluationMorphismWithGivenRange using the direct product-exponential adjunction on the identity",
[ [ DirectProductToExponentialAdjunctionMap, 1 ],
[ [ DirectProductToExponentialAdjunctionMapWithGivenExponential, 1 ],
[ IdentityMorphism, 1 ],
[ DirectProduct, 1 ] ],

function( cat, a, b, internal_hom )

# Adjoint( id_(a × b): a × b → a × b ) = ( a → Exp(b, a × b) )

return DirectProductToExponentialAdjunctionMap( cat,
a, b,
IdentityMorphism( cat, BinaryDirectProduct( cat, a, b ) ) );
return DirectProductToExponentialAdjunctionMapWithGivenExponential( cat,

Check warning on line 729 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L729

Added line #L729 was not covered by tests
a,
b,
IdentityMorphism( cat, BinaryDirectProduct( cat, a, b ) ),
internal_hom );

Check warning on line 733 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L732-L733

Added lines #L732 - L733 were not covered by tests

end : CategoryFilter := IsCartesianClosedCategory );

Expand Down Expand Up @@ -852,13 +873,14 @@
##
AddDerivationToCAP( CartesianPostComposeMorphismWithGivenObjects,
"CartesianPostComposeMorphismWithGivenObjects using CartesianPreComposeMorphism and braiding",
[ [ CartesianBraiding, 1 ],
[ [ CartesianBraidingWithGivenDirectProducts, 1 ],
[ ExponentialOnObjects, 2 ],
[ PreCompose, 1 ],
[ CartesianPreComposeMorphism, 1 ] ],
[ DirectProduct, 1],
[ CartesianPreComposeMorphismWithGivenObjects, 1 ] ],

function( cat, source, a, b, c, range )
local braiding;
local exp_ab, exp_bc, exp_ab_x_exp_bc, braiding;

# Exp(b,c) × Exp(a,b)
# |
Expand All @@ -870,22 +892,27 @@
# v
# Exp(a,c)

braiding := CartesianBraiding( cat, ExponentialOnObjects( cat, b, c ), ExponentialOnObjects( cat, a, b ) );
exp_ab := ExponentialOnObjects( cat, a, b );
exp_bc := ExponentialOnObjects( cat, b, c );
exp_ab_x_exp_bc := BinaryDirectProduct( cat, exp_ab, exp_bc );

Check warning on line 897 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L895-L897

Added lines #L895 - L897 were not covered by tests

braiding := CartesianBraidingWithGivenDirectProducts( cat, source, exp_bc, exp_ab, exp_ab_x_exp_bc );

Check warning on line 899 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L899

Added line #L899 was not covered by tests

return PreCompose( cat, braiding, CartesianPreComposeMorphism( cat, a, b, c ) );
return PreCompose( cat, braiding, CartesianPreComposeMorphismWithGivenObjects( cat, exp_ab_x_exp_bc, a, b, c, range ) );

Check warning on line 901 in CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi

View check run for this annotation

Codecov / codecov/patch

CartesianCategories/gap/SymmetricCartesianClosedCategoriesDerivedMethods.gi#L901

Added line #L901 was not covered by tests

end : CategoryFilter := IsCartesianClosedCategory );

##
AddDerivationToCAP( CartesianPreComposeMorphismWithGivenObjects,
"CartesianPreComposeMorphismWithGivenObjects using CartesianPostComposeMorphism and braiding",
[ [ CartesianBraiding, 1 ],
[ [ CartesianBraidingWithGivenDirectProducts, 1 ],
[ ExponentialOnObjects, 2 ],
[ PreCompose, 1 ],
[ CartesianPostComposeMorphism, 1 ] ],
[ DirectProduct, 1],
[ CartesianPostComposeMorphismWithGivenObjects, 1 ] ],

function( cat, source, a, b, c, range )
local braiding;
local exp_ab, exp_bc, exp_bc_x_exp_ab, braiding;

# Exp(a,b) × Exp(b,c)
# |
Expand All @@ -897,9 +924,13 @@
# v
# Exp(a,c)

braiding := CartesianBraiding( cat, ExponentialOnObjects( cat, a, b ), ExponentialOnObjects( cat, b, c ) );
exp_ab := ExponentialOnObjects( cat, a, b );
exp_bc := ExponentialOnObjects( cat, b, c );
exp_bc_x_exp_ab := BinaryDirectProduct( cat, exp_bc, exp_ab );

braiding := CartesianBraidingWithGivenDirectProducts( cat, source, exp_bc, exp_ab, exp_bc_x_exp_ab );

return PreCompose( cat, braiding, CartesianPostComposeMorphism( cat, a, b, c ) );
return PreCompose( cat, braiding, CartesianPostComposeMorphismWithGivenObjects( cat, exp_bc_x_exp_ab, a, b, c, range ) );

end : CategoryFilter := IsCartesianClosedCategory );

Expand Down
Loading