  
  [1X2 [33X[0;0YExamples and Tests[133X[101X
  
  
  [1X2.1 [33X[0;0YTest functions[133X[101X
  
  [1X2.1-1 AdditiveMonoidalCategoriesTest[101X
  
  [33X[1;0Y[29X[2XAdditiveMonoidalCategoriesTest[102X( [3Xcat[103X, [3Xa[103X, [3XL[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are[133X
  
  [30X    [33X[0;6Ya CAP category [23Xcat[123X[133X
  
  [30X    [33X[0;6Yan object [23Xa[123X[133X
  
  [30X    [33X[0;6Ya list [23XL[123X of objects[133X
  
  [33X[0;0YThis     function     checks     for    every    operation    declared    in
  AdditiveMonoidalCategories.gd  if  it is computable in the CAP category [23Xcat[123X.
  If  yes,  then the operation is executed with the parameters given above and
  compared to the equivalent computation in the opposite category of [23Xcat[123X. Pass
  the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  [1X2.1-2 BraidedMonoidalCategoriesTest[101X
  
  [33X[1;0Y[29X[2XBraidedMonoidalCategoriesTest[102X( [3Xcat[103X, [3Xa[103X, [3Xb[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are[133X
  
  [30X    [33X[0;6Ya CAP category [23Xcat[123X[133X
  
  [30X    [33X[0;6Yobjects [23Xa, b[123X[133X
  
  [33X[0;0YThis     function     checks     for    every    operation    declared    in
  BraidedMonoidalCategories.gd if it is computable in the CAP category [23Xcat[123X. If
  yes,  then  the  operation  is  executed with the parameters given above and
  compared to the equivalent computation in the opposite category of [23Xcat[123X. Pass
  the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  [1X2.1-3 ClosedMonoidalCategoriesTest[101X
  
  [33X[1;0Y[29X[2XClosedMonoidalCategoriesTest[102X( [3Xcat[103X, [3Xa[103X, [3Xb[103X, [3Xc[103X, [3Xd[103X, [3Xalpha[103X, [3Xbeta[103X, [3Xgamma[103X, [3Xdelta[103X, [3Xepsilon[103X, [3Xzeta[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are[133X
  
  [30X    [33X[0;6Ya CAP category [23Xcat[123X[133X
  
  [30X    [33X[0;6Yobjects [23Xa, b, c, d[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\alpha: a \rightarrow b[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\beta: c \rightarrow d[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\gamma: a \otimes b \rightarrow 1[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\delta: c \otimes d \rightarrow 1[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\epsilon: 1 \rightarrow \mathrm{Hom}(a,b)[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\zeta: 1 \rightarrow \mathrm{Hom}(c,d)[123X[133X
  
  [33X[0;0YThis     function     checks     for    every    operation    declared    in
  ClosedMonoidalCategories.gd  if it is computable in the CAP category [23Xcat[123X. If
  yes,  then  the  operation  is  executed with the parameters given above and
  compared to the equivalent computation in the opposite category of [23Xcat[123X. Pass
  the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  [1X2.1-4 CoclosedMonoidalCategoriesTest[101X
  
  [33X[1;0Y[29X[2XCoclosedMonoidalCategoriesTest[102X( [3Xcat[103X, [3Xa[103X, [3Xb[103X, [3Xc[103X, [3Xd[103X, [3Xalpha[103X, [3Xbeta[103X, [3Xgamma[103X, [3Xdelta[103X, [3Xepsilon[103X, [3Xzeta[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are a CAP category [23Xcat[123X objects [23Xa, b, c, d[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\alpha: a \rightarrow b[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\beta: c \rightarrow d[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\gamma: 1 \rightarrow a \otimes b[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\delta: 1 \rightarrow c \otimes d[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\epsilon: \mathrm{coHom}(a,b) \rightarrow 1[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\zeta: \mathrm{coHom}(c,d) \rightarrow 1[123X[133X
  
  [33X[0;0YThis     function     checks     for    every    operation    declared    in
  CoclosedMonoidalCategories.gd  if  it is computable in the CAP category [23Xcat[123X.
  If  yes,  then the operation is executed with the parameters given above and
  compared to the equivalent computation in the opposite category of [23Xcat[123X. Pass
  the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  [1X2.1-5 MonoidalCategoriesTensorProductAndUnitTest[101X
  
  [33X[1;0Y[29X[2XMonoidalCategoriesTensorProductAndUnitTest[102X( [3Xcat[103X, [3Xa[103X, [3Xb[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are[133X
  
  [30X    [33X[0;6Ya CAP category [23Xcat[123X[133X
  
  [30X    [33X[0;6Yobjects [23Xa, b[123X[133X
  
  [33X[0;0YThis     function     checks     for    every    operation    declared    in
  MonoidalCategoriesTensorProductAndUnit.gd  if  it  is  computable in the CAP
  category  [23Xcat[123X.  If  yes,  then the operation is executed with the parameters
  given  above  and  compared  to  the  equivalent computation in the opposite
  category of [23Xcat[123X. Pass the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  [1X2.1-6 MonoidalCategoriesTest[101X
  
  [33X[1;0Y[29X[2XMonoidalCategoriesTest[102X( [3Xcat[103X, [3Xa[103X, [3Xb[103X, [3Xc[103X, [3Xalpha[103X, [3Xbeta[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are[133X
  
  [30X    [33X[0;6Ya CAP category [23Xcat[123X[133X
  
  [30X    [33X[0;6Yobjects [23Xa, b, c[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\alpha: a \rightarrow b[123X[133X
  
  [30X    [33X[0;6Ya morphism [23X\beta: c \rightarrow d[123X[133X
  
  [33X[0;0YThis  function  checks for every operation declared in MonoidalCategories.gd
  if  it  is computable in the CAP category [23Xcat[123X. If yes, then the operation is
  executed  with  the  parameters  given  above and compared to the equivalent
  computation in the opposite category of [23Xcat[123X. Pass the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  [1X2.1-7 RigidSymmetricClosedMonoidalCategoriesTest[101X
  
  [33X[1;0Y[29X[2XRigidSymmetricClosedMonoidalCategoriesTest[102X( [3Xcat[103X, [3Xa[103X, [3Xb[103X, [3Xc[103X, [3Xd[103X, [3Xalpha[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are[133X
  
  [30X    [33X[0;6Ya CAP category [23Xcat[123X[133X
  
  [30X    [33X[0;6Yobjects [23Xa, b, c, d[123X[133X
  
  [30X    [33X[0;6Yan endomorphism [23X\alpha: a \rightarrow a[123X[133X
  
  [33X[0;0YThis   function   checks   for   every   object  and  morphism  declared  in
  RigidSymmetricClosedMonoidalCategories.gd  if  it  is  computable in the CAP
  category  [23Xcat[123X.  If  yes,  then the operation is executed with the parameters
  given  above  and  compared  to  the  equivalent computation in the opposite
  category of [23Xcat[123X. Pass the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  [1X2.1-8 RigidSymmetricCoclosedMonoidalCategoriesTest[101X
  
  [33X[1;0Y[29X[2XRigidSymmetricCoclosedMonoidalCategoriesTest[102X( [3Xcat[103X, [3Xa[103X, [3Xb[103X, [3Xc[103X, [3Xd[103X, [3Xalpha[103X ) [32X function[133X
  
  [33X[0;0YThe arguments are[133X
  
  [30X    [33X[0;6Ya CAP category [23Xcat[123X[133X
  
  [30X    [33X[0;6Yobjects [23Xa, b, c, d[123X[133X
  
  [30X    [33X[0;6Yan endomorphism [23X\alpha: a \rightarrow a[123X[133X
  
  [33X[0;0YThis   function   checks   for   every   object  and  morphism  declared  in
  RigidSymmetricCoclosedMonoidalCategories.gd  if  it is computable in the CAP
  category  [23Xcat[123X.  If  yes,  then the operation is executed with the parameters
  given  above  and  compared  to  the  equivalent computation in the opposite
  category of [23Xcat[123X. Pass the options[133X
  
  [30X    [33X[0;6Y[10Xverbose := true[110X to output more information.[133X
  
  [30X    [33X[0;6Y[10Xonly_primitive_operations  :=  true[110X, which is passed on to Opposite(),
        to  only primitively install dual operations for primitively installed
        operations  in  [23Xcat[123X.  The advantage is, that more derivations might be
        tested.     On     the     downside,    this    might    test    fewer
        dual_pre/postprocessor_funcs.[133X
  
  
  [1X2.2 [33X[0;0YBasics[133X[101X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLoadPackage( "MonoidalCategories" );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xvecspaces := CreateCapCategory( "VectorSpaces" );[127X[104X
    [4X[28XVectorSpaces[128X[104X
    [4X[25Xgap>[125X [27XReadPackage( "MonoidalCategories",[127X[104X
    [4X[25X>[125X [27X        "examples/VectorSpacesMonoidalCategory.gi" );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xz := ZeroObject( vecspaces );[127X[104X
    [4X[28X<A rational vector space of dimension 0>[128X[104X
    [4X[25Xgap>[125X [27Xa := QVectorSpace( 1 );[127X[104X
    [4X[28X<A rational vector space of dimension 1>[128X[104X
    [4X[25Xgap>[125X [27Xb := QVectorSpace( 2 );[127X[104X
    [4X[28X<A rational vector space of dimension 2>[128X[104X
    [4X[25Xgap>[125X [27Xc := QVectorSpace( 3 );[127X[104X
    [4X[28X<A rational vector space of dimension 3>[128X[104X
    [4X[25Xgap>[125X [27Xalpha := VectorSpaceMorphism( a, [ [ 1, 0 ] ], b );[127X[104X
    [4X[28XA rational vector space homomorphism with matrix:[128X[104X
    [4X[28X[ [  1,  0 ] ][128X[104X
    [4X[25Xgap>[125X [27Xbeta := VectorSpaceMorphism( b,[127X[104X
    [4X[25X>[125X [27X                [ [ 1, 0, 0 ], [ 0, 1, 0 ] ], c );[127X[104X
    [4X[28XA rational vector space homomorphism with matrix:[128X[104X
    [4X[28X[ [  1,  0,  0 ],[128X[104X
    [4X[28X  [  0,  1,  0 ] ][128X[104X
    [4X[25Xgap>[125X [27Xgamma := VectorSpaceMorphism( c,[127X[104X
    [4X[25X>[125X [27X                 [ [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 0 ] ], c );[127X[104X
    [4X[28XA rational vector space homomorphism with matrix:[128X[104X
    [4X[28X[ [  0,  1,  1 ],[128X[104X
    [4X[28X  [  1,  0,  1 ],[128X[104X
    [4X[28X  [  1,  1,  0 ] ][128X[104X
    [4X[25Xgap>[125X [27XIsCongruentForMorphisms([127X[104X
    [4X[25X>[125X [27X        TensorProductOnMorphisms( alpha, beta ),[127X[104X
    [4X[25X>[125X [27X        TensorProductOnMorphisms( beta, alpha ) );[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsOne( AssociatorRightToLeft( a, b, c ) );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsCongruentForMorphisms([127X[104X
    [4X[25X>[125X [27X        gamma, LambdaElimination( c, c, LambdaIntroduction( gamma ) ) );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsZero( TraceMap( gamma ) );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsCongruentForMorphisms([127X[104X
    [4X[25X>[125X [27X        RankMorphism( DirectSum( a, b ) ), RankMorphism( c ) );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsOne( Braiding( b, c ) );[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsOne( PreCompose( Braiding( b, c ), Braiding( c, b ) ) );[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
