diff --git a/FreydCategoriesForCAP/PackageInfo.g b/FreydCategoriesForCAP/PackageInfo.g index 34c79c2e31..386a4abcd0 100644 --- a/FreydCategoriesForCAP/PackageInfo.g +++ b/FreydCategoriesForCAP/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "FreydCategoriesForCAP", Subtitle := "Freyd categories - Formal (co)kernels for additive categories", -Version := "2022.12-03", +Version := "2022.12-04", Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ), License := "GPL-2.0-or-later", @@ -94,7 +94,6 @@ Dependencies := rec( [ "GeneralizedMorphismsForCAP", ">= 2018.06.15" ] ], SuggestedOtherPackages := [ - [ "QPA", ">= 2.0" ], [ "FinSetsForCAP", ">= 2022.05-01" ] ], ExternalConditions := [ ], diff --git a/FreydCategoriesForCAP/examples/5Lemma.g b/FreydCategoriesForCAP/examples/5Lemma.g deleted file mode 100644 index 3d150e8734..0000000000 --- a/FreydCategoriesForCAP/examples/5Lemma.g +++ /dev/null @@ -1,51 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Adelman 5 lemma - -LoadPackage( "FreydCategoriesForCAP" );; -LoadPackage( "GeneralizedMorphisms");; - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -quiver := RightQuiver( "Q(8)[a:1->2,b:2->3,c:3->4,d:3->5,e:4->6,f:5->6,g:6->7,h:7->8]" );; -QQ := HomalgFieldOfRationals();; -A := PathAlgebra( QQ, quiver );; -B := QuotientOfPathAlgebra( A, -[ - A.ce - A.df, - A.abd, - A.egh, - A.bc, - A.fg, - A.ab #since d is supposed to be a mono -] );; -QRowsB := QuiverRowsDescentToZDefinedByBasisPaths( B );; -Adel := AdelmanCategory( QRowsB );; -a := B.a/QRowsB/Adel;; -b := B.b/QRowsB/Adel;; -c := B.c/QRowsB/Adel;; -d := B.d/QRowsB/Adel;; -e := B.e/QRowsB/Adel;; -f := B.f/QRowsB/Adel;; -g := B.g/QRowsB/Adel;; -h := B.h/QRowsB/Adel;; -l := CokernelProjection( a );; -k := CokernelColift( a, PreCompose( b, d ) );; -i := KernelEmbedding( h );; -j := KernelLift( h, PreCompose( e, g ) );; -Kd := KernelObject( d );; -Hbc := HomologyObject( b, c );; -Hcj := HomologyObject( c, j );; -Hkf := HomologyObject( k, f );; -Hfg := HomologyObject( f, g );; -L := [ Kd, Hbc, Hcj, Hkf, Hfg ];; -K := KernelObject( e );; -test_func := MembershipFunctionSerreSubcategoryGeneratedByObjects( L, Adel );; -#! Warning: the provided function returns either true or fail! -C := FullSubcategoryByMembershipFunction( Adel, test_func );; -Serre := Adel/C;; -K := K/Serre;; -IsZero( K ); -#! true -#! #@fi -# @EndExample diff --git a/FreydCategoriesForCAP/examples/AdelmanCategoryBasics.g b/FreydCategoriesForCAP/examples/AdelmanCategoryBasics.g index 6f452d9734..b3f517c3ec 100644 --- a/FreydCategoriesForCAP/examples/AdelmanCategoryBasics.g +++ b/FreydCategoriesForCAP/examples/AdelmanCategoryBasics.g @@ -59,67 +59,6 @@ IsCongruentForMorphisms( KernelLift( m, KernelEmbedding( m ) ), IdentityMorphism #! true #! @EndExample -#! @Section Adelman category basics for for additive closure of algebroids - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -LoadPackage( "Algebroids", false ); -#! true -quiver := RightQuiver( "Q(9)[a:1->2,b:2->3,c:1->4,d:2->5,e:3->6,f:4->5,g:5->6,h:4->7,i:5->8,j:6->9,k:7->8,l:8->9,m:2->7,n:3->8]" );; -kQ := PathAlgebra( HomalgFieldOfRationals(), quiver );; -Aoid := Algebroid( kQ, [ kQ.ad - kQ.cf, - kQ.dg - kQ.be, - kQ.("fi") - kQ.hk, - kQ.gj - kQ.il, - kQ.mk + kQ.bn - kQ.di ] );; -mm := SetOfGeneratingMorphisms( Aoid );; -CapCategorySwitchLogicOff( Aoid );; -Acat := AdditiveClosure( Aoid );; -a := AsAdditiveClosureMorphism( mm[1] );; -b := AsAdditiveClosureMorphism( mm[2] );; -c := AsAdditiveClosureMorphism( mm[3] );; -d := AsAdditiveClosureMorphism( mm[4] );; -e := AsAdditiveClosureMorphism( mm[5] );; -f := AsAdditiveClosureMorphism( mm[6] );; -g := AsAdditiveClosureMorphism( mm[7] );; -h := AsAdditiveClosureMorphism( mm[8] );; -i := AsAdditiveClosureMorphism( mm[9] );; -j := AsAdditiveClosureMorphism( mm[10] );; -k := AsAdditiveClosureMorphism( mm[11] );; -l := AsAdditiveClosureMorphism( mm[12] );; -m := AsAdditiveClosureMorphism( mm[13] );; -n := AsAdditiveClosureMorphism( mm[14] );; -Adel := AdelmanCategory( Acat );; -A := AdelmanCategoryObject( a, b );; -B := AdelmanCategoryObject( f, g );; -alpha := AdelmanCategoryMorphism( A, d, B );; -IsWellDefined( alpha ); -#! true -IsWellDefined( KernelEmbedding( alpha ) ); -#! true -IsWellDefined( CokernelProjection( alpha ) ); -#! true -T := AdelmanCategoryObject( k, l );; -tau := AdelmanCategoryMorphism( B, i, T );; -IsZeroForMorphisms( PreCompose( alpha, tau ) ); -#! true -colift := CokernelColift( alpha, tau );; -IsWellDefined( colift ); -#! true -IsCongruentForMorphisms( PreCompose( CokernelProjection( alpha ), colift ), tau ); -#! true -lift := KernelLift( tau, alpha );; -IsWellDefined( lift ); -#! true -IsCongruentForMorphisms( PreCompose( lift, KernelEmbedding( tau ) ), alpha ); -#! true -IsCongruentForMorphisms( ColiftAlongEpimorphism( CokernelProjection( alpha ), tau ), colift ); -#! true -IsCongruentForMorphisms( LiftAlongMonomorphism( KernelEmbedding( tau ), alpha ), lift ); -#! true -#! #@fi -#! @EndExample - #! @Section Adelman category basics for category of columns #! @Example diff --git a/FreydCategoriesForCAP/examples/AdelmanHom.g b/FreydCategoriesForCAP/examples/AdelmanHom.g deleted file mode 100644 index c68f25fc22..0000000000 --- a/FreydCategoriesForCAP/examples/AdelmanHom.g +++ /dev/null @@ -1,34 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Adelman category basics - -LoadPackage( "FreydCategoriesForCAP" );; - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -LoadPackage( "Algebroids", false ); -#! true -quiver := RightQuiver( "Q(3)[a:1->2,b:1->2,c:2->3]" );; -kQ := PathAlgebra( HomalgFieldOfRationals(), quiver );; -Aoid := Algebroid( kQ );; -SetIsProjective( DistinguishedObjectOfHomomorphismStructure( Aoid ), true );; -mm := SetOfGeneratingMorphisms( Aoid );; -CapCategorySwitchLogicOff( Aoid );; -Acat := AdditiveClosure( Aoid );; -a := AsAdditiveClosureMorphism( mm[1] );; -b := AsAdditiveClosureMorphism( mm[2] );; -c := AsAdditiveClosureMorphism( mm[3] );; -a := AsAdelmanCategoryMorphism( a );; -b := AsAdelmanCategoryMorphism( b );; -c := AsAdelmanCategoryMorphism( c );; -A := Source( a );; -B := Range( a );; -C := Range( c );; -HomomorphismStructureOnObjects( A, C );; -HomomorphismStructureOnMorphisms( IdentityMorphism( A ), c );; -mor := InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( a );; -int := InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( A, B, mor );; -IsCongruentForMorphisms( int, a ); -#! true -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/examples/AdelmanSnakeLemma.g b/FreydCategoriesForCAP/examples/AdelmanSnakeLemma.g deleted file mode 100644 index f7a5fa6de6..0000000000 --- a/FreydCategoriesForCAP/examples/AdelmanSnakeLemma.g +++ /dev/null @@ -1,51 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Adelman snake lemma - -LoadPackage( "FreydCategoriesForCAP" );; -LoadPackage( "GeneralizedMorphismsForCAP" );; - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -LoadPackage( "Algebroids", false ); -#! true -DeactivateDefaultCaching(); -SwitchGeneralizedMorphismStandard( "span" );; -snake_quiver := RightQuiver( "Q(6)[a:1->2,b:2->3,c:3->4]" );; -kQ := PathAlgebra( HomalgFieldOfRationals(), snake_quiver );; -Aoid := Algebroid( kQ, [ kQ.abc ] );; -CapCategorySwitchLogicOff( Aoid );; -m := SetOfGeneratingMorphisms( Aoid );; -a := m[1];; -b := m[2];; -c := m[3];; -add := AdditiveClosure( Aoid );; -DisableInputSanityChecks( add );; -adelman := AdelmanCategory( add );; -a := AsAdditiveClosureMorphism( a );; -b := AsAdditiveClosureMorphism( b );; -c := AsAdditiveClosureMorphism( c );; -aa := AsAdelmanCategoryMorphism( a );; -bb := AsAdelmanCategoryMorphism( b );; -cc := AsAdelmanCategoryMorphism( c );; -dd := CokernelProjection( aa );; -ee := CokernelColift( aa, PreCompose( bb, cc ) );; -ff := KernelEmbedding( ee );; -gg := KernelEmbedding( cc );; -hh := KernelLift( cc, PreCompose( aa, bb ) );; -ii := CokernelProjection( hh );; -fff := AsGeneralizedMorphism( ff );; -ddd := AsGeneralizedMorphism( dd );; -bbb := AsGeneralizedMorphism( bb );; -ggg := AsGeneralizedMorphism( gg );; -iii := AsGeneralizedMorphism( ii );; -p := PreCompose( [ fff, PseudoInverse( ddd ), bbb, PseudoInverse( ggg ), iii ] );; -IsHonest( p ); -#! true -jj := KernelObjectFunctorial( bb, dd, ee );; -pp := HonestRepresentative( p );; -comp := PreCompose( jj, pp );; -IsZero( comp ); -#! true -#! #@fi -# @EndExample diff --git a/FreydCategoriesForCAP/examples/Basics.gi b/FreydCategoriesForCAP/examples/Basics.gi index e2d3c929b5..39aa2a7839 100644 --- a/FreydCategoriesForCAP/examples/Basics.gi +++ b/FreydCategoriesForCAP/examples/Basics.gi @@ -196,63 +196,6 @@ InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( Sourc #! true #! @EndExample - -#! @Section Basics of additive closure - -#! @Example -## Algebroid -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -LoadPackage( "Algebroids", false ); -#! true -snake_quiver := RightQuiver( "Q(6)[a:1->2,b:2->3,c:1->4,d:2->5,e:3->6,f:4->5,g:5->6]" );; -kQ := PathAlgebra( HomalgFieldOfRationalsInSingular(), snake_quiver );; -A := kQ / [ kQ.ad - kQ.cf, kQ.dg - kQ.be, kQ.ab, kQ.fg ];; -Aoid := Algebroid( kQ, [ kQ.ad - kQ.cf, kQ.dg - kQ.be, kQ.ab, kQ.fg ] );; -s := SetOfObjects( Aoid );; -m := SetOfGeneratingMorphisms( Aoid );; -interpretation := InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( -m[3] );; -InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( Source( m[3] ), Range( m[3] ), interpretation );; - -## additive closure -add := AdditiveClosure( Aoid );; -obj1 := AdditiveClosureObject( [ s[1], s[2] ], add );; -mor := AdditiveClosureMorphism( obj1, [ [ IdentityMorphism( s[1] ), ZeroMorphism( s[1], s[2] ) ], [ ZeroMorphism( s[2], s[1] ), -IdentityMorphism( s[2] ) ] ], obj1 );; -IsWellDefined( mor );; -IsCongruentForMorphisms( PreCompose( mor, mor ), IdentityMorphism( obj1 ) );; -obj2 := AdditiveClosureObject( [ s[3], s[3] ], add );; -id := IdentityMorphism( obj2 );; -objs1:= AdditiveClosureObject( [ s[1] ], add );; -objs2:= AdditiveClosureObject( [ s[2] ], add );; -ids1 := IdentityMorphism( objs1 );; -ids2 := IdentityMorphism( objs2 );; -HomomorphismStructureOnMorphisms( DirectSumFunctorial( [ ids1, ids2 ] ), ids1 );; - -interpretation := InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( mor );; -IsCongruentForMorphisms( - InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( Source( mor ), Range( mor ), interpretation ), - mor );; - -a := AsAdditiveClosureMorphism( m[1] );; -b := AsAdditiveClosureMorphism( m[2] );; -c := AsAdditiveClosureMorphism( m[3] );; -d := AsAdditiveClosureMorphism( m[4] );; -e := AsAdditiveClosureMorphism( m[5] );; -f := AsAdditiveClosureMorphism( m[6] );; -g := AsAdditiveClosureMorphism( m[7] );; - -l := Lift( PreCompose( a, d ), f );; -IsCongruentForMorphisms( PreCompose( l, f ), PreCompose( a, d ) ); -#! true -l := Colift( c, PreCompose( a, d ) );; -IsCongruentForMorphisms( PreCompose( c, l ), PreCompose( a, d ) ); -#! true -#! #@fi -#! @EndExample - - - - - #! @Section Basics based on category of columns #! @Example diff --git a/FreydCategoriesForCAP/examples/ExactnessConditions.g b/FreydCategoriesForCAP/examples/ExactnessConditions.g deleted file mode 100644 index 482634bea9..0000000000 --- a/FreydCategoriesForCAP/examples/ExactnessConditions.g +++ /dev/null @@ -1,39 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Exactness conditions - -LoadPackage( "FreydCategoriesForCAP" );; - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -ReadPackage( "FreydCategoriesForCAP", "examples/SubobjectLatticeFunctions.g" );; -quiver := RightQuiver( "Q(4)[a:1->2,b:2->3,c:3->4]" );; -QQ := HomalgFieldOfRationals();; -A := PathAlgebra( QQ, quiver );; -B := QuotientOfPathAlgebra( A, [ A.ab, A.bc ] );; -RowsB := QuiverRowsDescentToZDefinedByBasisPaths( B : overhead := false );; -Adel := AdelmanCategory( RowsB : overhead := false );; -a := B.a/RowsB/Adel;; -c := B.c/RowsB/Adel;; -F := CokernelObject( a );; -G := KernelObject( c );; -eta := AdelmanCategoryMorphism( F, B.b/RowsB, G );; -C := CokernelObject( eta );; -I := ImageObject( eta );; -K := KernelObject( eta );; -IsImagePreserving( I ); -#! true -IsLeftExact( I ); -#! false -IsRightExact( I ); -#! false -IsMonoPreserving( K ); -#! false -IsEpiPreserving( K ); -#! false -IsMonoPreserving( C ); -#! false -IsEpiPreserving( C ); -#! false -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/examples/QuiverRowsBasics.g b/FreydCategoriesForCAP/examples/QuiverRowsBasics.g deleted file mode 100644 index d5afdd5f67..0000000000 --- a/FreydCategoriesForCAP/examples/QuiverRowsBasics.g +++ /dev/null @@ -1,100 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Quiver rows bascis - -LoadPackage( "FreydCategoriesForCAP" );; -LoadPackage( "RingsForHomalg" ); - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -## quiver without relations -QQ := HomalgFieldOfRationals();; -quiver := RightQuiver( "Q(3)[a:1->2,b:1->2,c:2->3]" );; -Av := Vertices( quiver );; -A := PathAlgebra( QQ, quiver );; -a := BasisPaths( CanonicalBasis( A ) );; -a := List( a, p -> PathAsAlgebraElement( A, p ) );; -zA := Zero( A );; -QRowsA := QuiverRows( A );; -mat := [ [ a[1], zA ], [ zA, a[6] ], [ a[1], zA ] ];; -obj1 := QuiverRowsObject( [ [ Av[1], 1 ], [ Av[2], 1 ], [ Av[1], 1 ] ], QRowsA );; -obj2 := QuiverRowsObject( [ [ Av[1], 1 ], [ Av[3], 1 ] ], QRowsA );; -alpha := QuiverRowsMorphism( obj1, mat, obj2 );; -obj3 := QuiverRowsObject( [ [ Av[2], 1 ] ], QRowsA );; -mat := [ [ a[4] ], [ zA ] ];; -beta := QuiverRowsMorphism( obj2, mat, obj3 );; -pre := PreCompose( alpha, beta );; -IsWellDefined( PreCompose( alpha, beta ) ); -#! true -IsZeroForMorphisms( pre ); -#! false -ze := ZeroMorphism( Source( pre ), Range( pre ) );; -IsCongruentForMorphisms( pre + ze, pre ); -#! true -IsCongruentForMorphisms( pre + pre, pre ); -#! false -IsZeroForMorphisms( pre - pre ); -#! true -IsCongruentForMorphisms( - PreCompose( - UniversalMorphismFromZeroObject( obj1 ), - UniversalMorphismIntoZeroObject( obj1 ) - ), - IdentityMorphism( ZeroObject( QRowsA ) ) -); -#! true -NrSummands( DirectSum( List( [ 1 .. 1000 ], i -> obj1 ) ) ) = 1000 * NrSummands( obj1 ); -#! true -L := [ obj1, obj2, obj3 ];; -pi := List( [ 1,2,3 ], i -> ProjectionInFactorOfDirectSum( L, i ) );; -iota := List( [ 1,2,3 ], i -> InjectionOfCofactorOfDirectSum( L, i ) );; -ForAll( [1,2,3], i -> - IsCongruentForMorphisms( - PreCompose( iota[i], pi[i] ), - IdentityMorphism( L[i] ) - ) -); -#! true -IsZeroForMorphisms( PreCompose( iota[2], pi[1] ) ); -#! true -IsCongruentForMorphisms( - UniversalMorphismIntoDirectSum( L, pi ), - IdentityMorphism( DirectSum( L ) ) -); -#! true -IsCongruentForMorphisms( - UniversalMorphismFromDirectSum( L, iota ), - IdentityMorphism( DirectSum( L ) ) -); -#! true -IsCongruentForMorphisms( - InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( obj1, obj2, - InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( alpha ) - ), - alpha -); -#! true - -## quiver with relations -quiver := RightQuiver( -"Q(8)[a:1->5,b:2->6,c:3->7,d:4->8,e:1->2,f:2->3,g:3->4,h:5->6,i:6->7,j:7->8]" -);; -Bv := Vertices( quiver );; -QQ := HomalgFieldOfRationals();; -kQ := PathAlgebra( QQ, quiver );; -B := QuotientOfPathAlgebra( kQ, -[ - kQ.e * kQ.f, kQ.f * kQ.g, - kQ.h * kQ.i, kQ.i * kQ.j, - kQ.e * kQ.b - kQ.a * kQ.h, - kQ.f * kQ.c - kQ.b * kQ.i, - kQ.g * kQ.d - kQ.c * kQ.j ] -);; -b := BasisPaths( CanonicalBasis( B ) );; -QRowsB := QuiverRows( B );; -obj := QuiverRowsObject( [ [ Bv[1], 2 ], [ Bv[1], 4 ], [ Bv[1], 4 ], [ Bv[1], 6 ] ], QRowsB );; -IsWellDefined( obj ); -#! true -IdentityMorphism( obj );; -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/examples/QuiverRowsOverZ.g b/FreydCategoriesForCAP/examples/QuiverRowsOverZ.g deleted file mode 100644 index 816138c664..0000000000 --- a/FreydCategoriesForCAP/examples/QuiverRowsOverZ.g +++ /dev/null @@ -1,94 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Quiver rows over the integers -LoadPackage( "FreydCategoriesForCAP" );; - -#! Well-defined morphisms - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -QQ := HomalgFieldOfRationals();; -snake_quiver := RightQuiver( "Q(4)[a:1->2,b:2->3,c:3->4]" );; -vertices := Vertices( snake_quiver );; -A := PathAlgebra( QQ, snake_quiver );; -A := QuotientOfPathAlgebra( A, [ A.abc ] );; -QRowsA := QuiverRowsDescentToZDefinedByBasisPaths( A );; -v1 := AsQuiverRowsObject( vertices[1], QRowsA );; -v2 := AsQuiverRowsObject( vertices[2], QRowsA );; -mat := [ [ 1/2*A.a ] ];; -x := QuiverRowsMorphism( v1, mat, v2 );; -IsWellDefined( x ); -#! false -mat := [ [ 2*A.a ] ];; -x := QuiverRowsMorphism( v1, mat, v2 );; -IsWellDefined( x ); -#! true -#! #@fi -#! @EndExample - -#! Snake lemma over the integers - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -a := AsQuiverRowsMorphism( A.a, QRowsA );; -b := AsQuiverRowsMorphism( A.b, QRowsA );; -c := AsQuiverRowsMorphism( A.c, QRowsA );; -aa := AsAdelmanCategoryMorphism( a );; -bb := AsAdelmanCategoryMorphism( b );; -cc := AsAdelmanCategoryMorphism( c );; -dd := CokernelProjection( aa );; -ee := CokernelColift( aa, PreCompose( bb, cc ) );; -ff := KernelEmbedding( ee );; -gg := KernelEmbedding( cc );; -hh := KernelLift( cc, PreCompose( aa, bb ) );; -ii := CokernelProjection( hh );; -fff := AsGeneralizedMorphism( ff );; -ddd := AsGeneralizedMorphism( dd );; -bbb := AsGeneralizedMorphism( bb );; -ggg := AsGeneralizedMorphism( gg );; -iii := AsGeneralizedMorphism( ii );; -p := PreCompose( [ fff, PseudoInverse( ddd ), bbb, PseudoInverse( ggg ), iii ] );; -IsHonest( p ); -#! true -jj := KernelObjectFunctorial( bb, dd, ee );; -kk := CokernelObjectFunctorial( hh, gg, bb );; -pp := HonestRepresentative( p );; -comp := PreCompose( jj, pp );; -IsZero( comp ); -#! true -comp := PreCompose( pp, kk );; -IsZero( comp ); -#! true -homology := function( alpha, beta ) return CokernelObject( LiftAlongMonomorphism( KernelEmbedding( beta ), ImageEmbedding( alpha ) ) ); end;; -IsZero( homology( jj, pp ) ); -#! true -IsZero( homology( pp, kk ) ); -#! true -#! #@fi -# @EndExample - -#! Phenomena over the integers - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -quiver := RightQuiver( "Q(2)[a:1->2]" );; -vertices := Vertices( quiver );; -B := PathAlgebra( QQ, quiver );; -QRowsB := QuiverRows( B );; -QRowsB_overZ := QuiverRowsDescentToZDefinedByBasisPaths( B );; -a := AsQuiverRowsMorphism( B.a, QRowsB );; -a_Z := AsQuiverRowsMorphism( B.a, QRowsB_overZ );; -aa := AsAdelmanCategoryMorphism( a );; -aa_Z := AsAdelmanCategoryMorphism( a_Z );; -bb := aa + aa;; -bb_Z := aa_Z + aa_Z;; -K1 := KernelEmbedding( bb );; -K2 := KernelEmbedding( aa );; -IsEqualAsSubobjects( K1, K2 ); -#! true -K1_Z := KernelEmbedding( bb_Z );; -K2_Z := KernelEmbedding( aa_Z );; -IsEqualAsSubobjects( K1_Z, K2_Z ); -#! false -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/examples/QuiverRowsSnakeLemma.g b/FreydCategoriesForCAP/examples/QuiverRowsSnakeLemma.g deleted file mode 100644 index ec4c6a4415..0000000000 --- a/FreydCategoriesForCAP/examples/QuiverRowsSnakeLemma.g +++ /dev/null @@ -1,54 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Adelman snake lemma - -LoadPackage( "FreydCategoriesForCAP" );; -LoadPackage( "GeneralizedMorphismsForCAP" );; - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -SwitchGeneralizedMorphismStandard( "cospan" );; -snake_quiver := RightQuiver( "Q(6)[a:1->2,b:2->3,c:3->4]" );; -QQ := HomalgFieldOfRationals();; -A := PathAlgebra( QQ, snake_quiver );; -A := QuotientOfPathAlgebra( A, [ A.abc ] );; -QRowsA := QuiverRows( A );; -SetIsProjective( DistinguishedObjectOfHomomorphismStructure( QRowsA ), true );; - -a := AsQuiverRowsMorphism( A.a, QRowsA );; -b := AsQuiverRowsMorphism( A.b, QRowsA );; -c := AsQuiverRowsMorphism( A.c, QRowsA );; -aa := AsAdelmanCategoryMorphism( a );; -bb := AsAdelmanCategoryMorphism( b );; -cc := AsAdelmanCategoryMorphism( c );; -dd := CokernelProjection( aa );; -ee := CokernelColift( aa, PreCompose( bb, cc ) );; -ff := KernelEmbedding( ee );; -gg := KernelEmbedding( cc );; -hh := KernelLift( cc, PreCompose( aa, bb ) );; -ii := CokernelProjection( hh );; -fff := AsGeneralizedMorphism( ff );; -ddd := AsGeneralizedMorphism( dd );; -bbb := AsGeneralizedMorphism( bb );; -ggg := AsGeneralizedMorphism( gg );; -iii := AsGeneralizedMorphism( ii );; -p := PreCompose( [ fff, PseudoInverse( ddd ), bbb, PseudoInverse( ggg ), iii ] );; -IsHonest( p ); -#! true -jj := KernelObjectFunctorial( bb, dd, ee );; -kk := CokernelObjectFunctorial( hh, gg, bb );; -pp := HonestRepresentative( p );; - -comp := PreCompose( jj, pp );; -IsZero( comp ); -#! true -comp := PreCompose( pp, kk );; -IsZero( comp ); -#! true -homology := function( alpha, beta ) return CokernelObject( LiftAlongMonomorphism( KernelEmbedding( beta ), ImageEmbedding( alpha ) ) ); end;; -IsZero( homology( jj, pp ) ); -#! true -IsZero( homology( pp, kk ) ); -#! true -#! #@fi -# @EndExample diff --git a/FreydCategoriesForCAP/examples/SnakeLemmaProof.g b/FreydCategoriesForCAP/examples/SnakeLemmaProof.g deleted file mode 100644 index 4acaa4f2ce..0000000000 --- a/FreydCategoriesForCAP/examples/SnakeLemmaProof.g +++ /dev/null @@ -1,82 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Snake lemma first proof - -LoadPackage( "FreydCategoriesForCAP" );; -LoadPackage( "GeneralizedMorphismsForCAP" );; - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -LoadPackage( "Algebroids", false ); -#! true -DeactivateDefaultCaching(); -SwitchGeneralizedMorphismStandard( "cospan" );; -snake_quiver := RightQuiver( "Q(6)[a:1->2,b:2->3,c:1->4,d:2->5,e:3->6,f:4->5,g:5->6]" );; -kQ := PathAlgebra( HomalgFieldOfRationals(), snake_quiver );; -Aoid := Algebroid( kQ, [ kQ.ad - kQ.cf, kQ.dg - kQ.be, kQ.ab, kQ.fg ] );; -m := SetOfGeneratingMorphisms( Aoid );; - -a := m[1];; -b := m[2];; -c := m[3];; -d := m[4];; -e := m[5];; -f := m[6];; -g := m[7];; - - -cat := Aoid;; -CapCategorySwitchLogicOff( cat );; -DisableInputSanityChecks( cat );; -cat := AdditiveClosure( cat );; -DisableInputSanityChecks( cat );; -cat := Opposite( cat );; -DisableInputSanityChecks( cat );; -CapCategorySwitchLogicOff( cat );; -CapCategorySwitchLogicOff( Opposite( cat ) );; -cat := FreydCategory( cat );; -CapCategorySwitchLogicOff( cat );; -cat := Opposite( cat );; -CapCategorySwitchLogicOff( cat );; - -af := AsMorphismInFreeAbelianCategory( m[1] );; -bf := AsMorphismInFreeAbelianCategory( m[2] );; -cf := AsMorphismInFreeAbelianCategory( m[3] );; -df := AsMorphismInFreeAbelianCategory( m[4] );; -ef := AsMorphismInFreeAbelianCategory( m[5] );; -ff := AsMorphismInFreeAbelianCategory( m[6] );; -gf := AsMorphismInFreeAbelianCategory( m[7] );; - -bn := CokernelProjection( af );; -en := CokernelColift( af, PreCompose( df, gf ) );; -fn := KernelEmbedding( gf );; -cn := KernelLift( gf, PreCompose( af, df ) );; - -ke := KernelEmbedding( en );; -co := CokernelProjection( cn );; - -gk := AsGeneralizedMorphism( ke );; -gb := AsGeneralizedMorphism( bn );; -gd := AsGeneralizedMorphism( df );; -gf := AsGeneralizedMorphism( fn );; -gc := AsGeneralizedMorphism( co );; - -DirectSumFunctorial( [ af, af ] );; -IsZero( PreCompose( ke, en ));; -timestart := Runtimes().user_time;; -p := PreCompose( [ gk, PseudoInverse( gb ) ] );; -p2 := PreCompose( p, gd );; -p3:= PreCompose( p2, PseudoInverse( gf ) );; -p4:= PreCompose( p3, gc );; -IsHonest( p ); -#! false -IsHonest( p2 ); -#! false -IsHonest( p3 ); -#! false -IsHonest( p4 ); -#! true -timeend := Runtimes().user_time - timestart;; -h := HonestRepresentative( p4 );; -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/examples/SnakeLemmaProof2.g b/FreydCategoriesForCAP/examples/SnakeLemmaProof2.g deleted file mode 100644 index 4959376c34..0000000000 --- a/FreydCategoriesForCAP/examples/SnakeLemmaProof2.g +++ /dev/null @@ -1,58 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Snake lemma second proof - -LoadPackage( "FreydCategoriesForCAP" );; -LoadPackage( "GeneralizedMorphismsForCAP" );; - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -LoadPackage( "Algebroids", false ); -#! true -DeactivateDefaultCaching(); -SwitchGeneralizedMorphismStandard( "cospan" );; -snake_quiver := RightQuiver( "Q(6)[a:1->2,b:2->3,c:3->4]" );; -kQ := PathAlgebra( HomalgFieldOfRationals(), snake_quiver );; -Aoid := Algebroid( kQ, [ kQ.abc ] );; -m := SetOfGeneratingMorphisms( Aoid );; - -a := m[1];; -b := m[2];; -c := m[3];; - -cat := Aoid;; -CapCategorySwitchLogicOff( cat );; -DisableInputSanityChecks( cat );; -cat := AdditiveClosure( cat );; -DisableInputSanityChecks( cat );; -cat := Opposite( cat );; -DisableInputSanityChecks( cat );; -CapCategorySwitchLogicOff( cat );; -CapCategorySwitchLogicOff( Opposite( cat ) );; -cat := FreydCategory( cat );; -CapCategorySwitchLogicOff( cat );; -cat := Opposite( cat );; -CapCategorySwitchLogicOff( cat );; - -a := AsMorphismInFreeAbelianCategory( a );; -b := AsMorphismInFreeAbelianCategory( b );; -c := AsMorphismInFreeAbelianCategory( c );; - -coker_a := CokernelProjection( a );; -colift := CokernelColift( a, PreCompose( b, c ) );; - -ker_c := KernelEmbedding( c );; -lift := KernelLift( c, PreCompose( a, b ) );; - -p := PreCompose( [ - AsGeneralizedMorphism( KernelEmbedding( colift ) ), - GeneralizedInverse( coker_a ), - AsGeneralizedMorphism( b ), - GeneralizedInverse( ker_c ), - AsGeneralizedMorphism( CokernelProjection( lift ) ) -] );; - -IsHonest( p ); -#! true -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/examples/SubobjectLattice.g b/FreydCategoriesForCAP/examples/SubobjectLattice.g deleted file mode 100644 index d67e06ad23..0000000000 --- a/FreydCategoriesForCAP/examples/SubobjectLattice.g +++ /dev/null @@ -1,28 +0,0 @@ -#! @Chapter Examples and Tests - -#! @Section Subobject lattice - -LoadPackage( "FreydCategoriesForCAP" );; - -#! We compute the number of the generic subobject lattice generated by 2 independent subobjects y,z -#! and one subobject x of y. - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -ReadPackage( "FreydCategoriesForCAP", "examples/SubobjectLatticeFunctions.g" );; -quiver := RightQuiver( "Q(4)[a:1->2,b:2->3,c:1->4]" );; -QQ := HomalgFieldOfRationals();; -B := PathAlgebra( QQ, quiver );; -RowsB := QuiverRowsDescentToZDefinedByBasisPaths( B : overhead := false );; -Adel := AdelmanCategory( RowsB : overhead := false );; -a := B.a/RowsB/Adel;; -b := B.b/RowsB/Adel;; -c := B.c/RowsB/Adel;; -x := KernelEmbedding( a );; -y := KernelEmbedding( PreCompose( a, b ) );; -z := KernelEmbedding( c );; -gens := [ x, y, z ];; -Size( GenerateSubobjects( gens ) ); -#! 8 -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/examples/SubobjectLatticeFunctions.g b/FreydCategoriesForCAP/examples/SubobjectLatticeFunctions.g deleted file mode 100644 index b41668a686..0000000000 --- a/FreydCategoriesForCAP/examples/SubobjectLatticeFunctions.g +++ /dev/null @@ -1,147 +0,0 @@ -## Helper functions for computing with lattices of subobjects - -## Intput: two subobjects -## Output: their intersection -IntS := function( sub1, sub2 ) - local intersection; - - intersection := MorphismFromFiberProductToSink( [ sub1, sub2 ] ); - - SetIsMonomorphism( intersection, true ); - - return intersection; - -end; - -## Intput: two subobjects -## Output: their sum -SumS := function( sub1, sub2 ) - local subobject_sum; - - subobject_sum := ImageEmbedding( UniversalMorphismFromDirectSum( [ sub1, sub2 ] ) ); - - SetIsMonomorphism( subobject_sum, true ); - - return subobject_sum; - -end; - -## Intput: a list of subobjects -## Output: all subobjects in the subobject lattice generated by the input (if it is finite) -GenerateSubobjects := function( input ) - local debug_output, print_func, all, new_objs, test, test_func, x, y, t, counter, s_counter, size, word_list, int, sum, elem; - - if IsEmpty( input ) then - - return input; - - fi; - - debug_output := CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT( "debug_output", false ); - - print_func := function( str ) - - if debug_output then - - Print( str ); - - fi; - - end; - - counter := 0; - - for elem in input do - - counter := counter + 1; - - elem!.id := counter; - - SetIsMonomorphism( elem, true ); - - od; - - all := ShallowCopy( input );; - - new_objs := ShallowCopy( input ); - - test_func := function( t, all ) - local r; - - r := ForAny( all, z -> IsEqualAsSubobjects( t, z ) ); - - return r; - - end; - - word_list := []; - - while true do - - test := []; - - # join and meet of all with new_objs - - size := Size( all ) * Size( new_objs ); - s_counter := 0; - - for x in all do - for y in new_objs do - - if x!.id <> y!.id then - - if not Set( [ x!.id, y!.id ] ) in word_list then - - Add( word_list, Set( [ x!.id, y!.id ] ) ); - - int := IntS( x, y ); - - Add( test, int ); - - sum := SumS( x, y ); - - Add( test, sum ); - - s_counter := s_counter + 1; - - print_func( Concatenation( "\r", String( s_counter ), "/", String( size ), "\c" ) ); - - fi; - - fi; - - od; - od; - - new_objs := []; - - print_func( "\n\c" ); - - print_func( String( Size( test ) ) ); - - - for t in test do - - if not test_func( t, all ) then - counter := counter + 1; - print_func( Concatenation( "(N=", String( counter ),")\c" ) ); - t!.id := counter; - Add( all, t ); - Add( new_objs, t ); - else - print_func( "-\c" ); - fi; - - od; - - if IsEmpty( new_objs ) then - break; - else - print_func( "S\n\c" ); - fi; - - od; - - return all; - -end; diff --git a/FreydCategoriesForCAP/examples/TheoremAdelman.g b/FreydCategoriesForCAP/examples/TheoremAdelman.g deleted file mode 100644 index c0abfc8785..0000000000 --- a/FreydCategoriesForCAP/examples/TheoremAdelman.g +++ /dev/null @@ -1,28 +0,0 @@ -#! @Chapter Examples and Tests - -LoadPackage( "FreydCategoriesForCAP" );; -LoadPackage( "RingsForHomalg" ); - -#! @Section Adelman category theorem - -#! @Example -#! #@if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) -LoadPackage( "Algebroids", false ); -#! true -quiver := RightQuiver( "Q(9)[a:1->2,b:3->2]" );; -kQ := PathAlgebra( HomalgFieldOfRationals(), quiver );; -Aoid := Algebroid( kQ );; -mm := SetOfGeneratingMorphisms( Aoid );; -CapCategorySwitchLogicOff( Aoid );; -Acat := AdditiveClosure( Aoid );; -a := AsAdditiveClosureMorphism( mm[1] );; -b := AsAdditiveClosureMorphism( mm[2] );; -a := AsAdelmanCategoryMorphism( a );; -b := AsAdelmanCategoryMorphism( b );; -pi1 := ProjectionInFactorOfFiberProduct( [ a, b ], 1 );; -pi2 := ProjectionInFactorOfFiberProduct( [ a, b ], 1 );; -c := CokernelColift( pi1, PreCompose( a, CokernelProjection( b ) ) );; -IsMonomorphism( c ); -#! true -#! #@fi -#! @EndExample diff --git a/FreydCategoriesForCAP/gap/QuiverRows.gd b/FreydCategoriesForCAP/gap/QuiverRows.gd deleted file mode 100644 index 18d555983e..0000000000 --- a/FreydCategoriesForCAP/gap/QuiverRows.gd +++ /dev/null @@ -1,120 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# FreydCategoriesForCAP: Freyd categories - Formal (co)kernels for additive categories -# -# Declarations -# -#! @Chapter Quiver rows - -#################################### -## -#! @Section GAP Categories -## -#################################### - -DeclareCategory( "IsQuiverRowsObject", - IsCapCategoryObject ); - -DeclareCategory( "IsQuiverRowsMorphism", - IsCapCategoryMorphism ); - -DeclareGlobalFunction( "INSTALL_FUNCTIONS_FOR_QUIVER_ROWS" ); - -DeclareCategory( "IsQuiverRowsCategory", - IsCapCategory ); - -#################################### -## -#! @Section Constructors -## -#################################### - -DeclareAttribute( "QuiverRows", - IsQuiverAlgebra ); - -DeclareAttribute( "QuiverRowsDescentToZDefinedByBasisPaths", - IsQuiverAlgebra ); - -DeclareAttribute( "QuiverRowsDescentToZDefinedByBasisPaths", - IsQuiverRowsCategory ); - -DeclareOperation( "QuiverRows", - [ IsQuiverAlgebra, IsBool ] ); - -DeclareOperation( "QuiverRowsObject", - [ IsList, IsQuiverRowsCategory ] ); - -DeclareOperation( "AsQuiverRowsObject", - [ IsQuiverVertex, IsQuiverRowsCategory ] ); - -DeclareOperation( "QuiverRowsMorphism", - [ IsQuiverRowsObject, IsList, IsQuiverRowsObject ] ); - -DeclareOperation( "AsQuiverRowsMorphism", - [ IsQuiverAlgebraElement, IsQuiverRowsCategory ] ); - -DeclareOperation( "\/", - [ IsQuiverAlgebraElement, IsQuiverRowsCategory ] ); - -DeclareOperation( "\/", - [ IsPath, IsQuiverRowsCategory ] ); - -#################################### -## -#! @Section Attributes -## -#################################### - -DeclareAttribute( "UnderlyingQuiverAlgebra", - IsQuiverRowsCategory ); - -DeclareAttribute( "UnderlyingQuiver", - IsQuiverRowsCategory ); - -DeclareAttribute( "ListOfQuiverVertices", - IsQuiverRowsObject ); - -DeclareAttribute( "NrSummands", - IsQuiverRowsObject ); - -DeclareAttribute( "MorphismMatrix", - IsQuiverRowsMorphism ); - -DeclareAttribute( "NrRows", - IsQuiverRowsMorphism ); - -DeclareAttribute( "NrCols", - IsQuiverRowsMorphism ); - -DeclareAttribute( "AsListListOfMatrices", - IsQuiverRowsMorphism ); - -DeclareAttribute( "SortedRepresentative", - IsQuiverRowsObject ); - -DeclareAttribute( "IsomorphismToSortedRepresentative", - IsQuiverRowsObject ); - -DeclareAttribute( "IsomorphismFromSortedRepresentative", - IsQuiverRowsObject ); - -DeclareAttribute( "PermutationToSortedRepresentative", - IsQuiverRowsObject ); - -#################################### -## -#! @Section Operators -## -#################################### - -DeclareOperation( "\[\]", - [ IsQuiverRowsMorphism, IsInt ] ); - -DeclareOperation( "\[\]", - [ IsQuiverRowsObject, IsInt ] ); - -DeclareOperation( "\*", - [ IsQuiverRowsMorphism, IsQuiverRowsMorphism ] ); - -DeclareGlobalFunction( "CAP_INTERNAL_MORPHISM_BETWEEN_DIRECT_SUMS_LIST_LIST" ); - -DeclareGlobalFunction( "CAP_INTERNAL_QUIVER_ROWS_MORPHISM_AS_LIST_LIST" ); diff --git a/FreydCategoriesForCAP/gap/QuiverRows.gi b/FreydCategoriesForCAP/gap/QuiverRows.gi deleted file mode 100644 index 2451a9213f..0000000000 --- a/FreydCategoriesForCAP/gap/QuiverRows.gi +++ /dev/null @@ -1,1655 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# FreydCategoriesForCAP: Freyd categories - Formal (co)kernels for additive categories -# -# Implementations -# - -#################################### -## -## Constructors -## -#################################### - -## -InstallMethod( QuiverRows, - [ IsQuiverAlgebra ], - - function( underlying_quiver_algebra ) - - return QuiverRows( underlying_quiver_algebra, false ); - -end ); - -## -InstallMethod( QuiverRowsDescentToZDefinedByBasisPaths, - [ IsQuiverAlgebra ], - - function( underlying_quiver_algebra ) - - return QuiverRows( underlying_quiver_algebra, true ); - -end ); - -## -InstallMethod( QuiverRowsDescentToZDefinedByBasisPaths, - [ IsQuiverRowsCategory ], - - function( quiver_rows ) - local underlying_quiver_algebra; - - underlying_quiver_algebra := UnderlyingQuiverAlgebra( quiver_rows ); - - return QuiverRows( underlying_quiver_algebra, true ); - -end ); - -## -InstallMethod( QuiverRows, - [ IsQuiverAlgebra, IsBool ], - - function( underlying_quiver_algebra, over_Z ) - local underlying_quiver, category, ring, paths, p, q, category_name; - - if not IsFiniteDimensional( underlying_quiver_algebra ) then - - Error( "the given quiver has to be finite dimensional\n" ); - - fi; - - ring := LeftActingDomain( underlying_quiver_algebra ); - - if over_Z then - - if IsIdenticalObj( ring, Rationals ) - or - ( HasIsRationalsForHomalg( ring ) and IsRationalsForHomalg( ring ) - and not IsHomalgExternalRingRep( ring ) ) - then - - ## Test if the multiplication table which is induced by the basis of the quiver algebra - ## (computed by the Groebner basis) only has integral coefficients. - paths := BasisPaths( CanonicalBasis( underlying_quiver_algebra ) ); - - for p in paths do - - for q in paths do - - if not ForAll( Coefficients( PathAsAlgebraElement( underlying_quiver_algebra, p ) * PathAsAlgebraElement( underlying_quiver_algebra, q ) ), IsInt ) then - - Error( "the basis of the given quiver algebra does give rise to a well-defined algebroid over Z\n"); - - fi; - - od; - - od; - - else - - Error( "the left acting domain of the given quiver algebra is not supported for constructing an algebroid of the integers\n"); - - fi; - - ring := HomalgRingOfIntegers(); - - category_name := Concatenation( "QuiverRows( ", String( underlying_quiver_algebra )," ) descended to Z" ); - - else - - category_name := Concatenation( "QuiverRows( ", String( underlying_quiver_algebra )," )" ); - - fi; - - underlying_quiver := QuiverOfAlgebra( underlying_quiver_algebra ); - - category := CreateCapCategory( category_name ); - - DeactivateCachingOfCategory( category ); - - CapCategorySwitchLogicOff( category ); - - SetFilterObj( category, IsQuiverRowsCategory ); - - SetIsAdditiveCategory( category, true ); - - SetIsLinearCategoryOverCommutativeRing( category, true ); - - SetCommutativeRingOfLinearCategory( category, ring ); - - SetUnderlyingQuiverAlgebra( category, underlying_quiver_algebra ); - - SetUnderlyingQuiver( category, underlying_quiver ); - - AddObjectRepresentation( category, IsQuiverRowsObject ); - - AddMorphismRepresentation( category, IsQuiverRowsMorphism and HasMorphismMatrix ); - - INSTALL_FUNCTIONS_FOR_QUIVER_ROWS( category, over_Z ); - - Finalize( category ); - - return category; - -end ); - -## -InstallMethod( QuiverRowsObject, - [ IsList, IsQuiverRowsCategory ], - - function( list_of_vertices, category ) - local quiver_rows_object, s, L, v, vertex, current; - - ## create normal form of list_of_vertices - ## every object will be constructed via this constructor, thus, - ## every object can be assumed to be in normal form - ## [ [ vertex, multiplicity ], ... ] - ## multiplicites > 0 - - ## get rid of zeros (and negative integers) - list_of_vertices := Filtered( list_of_vertices, l -> IsPosInt( l[2] ) ); - - ## collect consecutive vertices - s := Size( list_of_vertices ); - - if s > 1 then - - L := []; - - current := ShallowCopy( list_of_vertices[1] ); - - for v in [ 2 .. s ] do - - vertex := list_of_vertices[v]; - - if vertex[1] = current[1] then - - current[2] := current[2] + vertex[2]; - - else - - Add( L, current ); - - current := ShallowCopy( vertex ); - - fi; - - od; - - Add( L, current ); - - else - - L := list_of_vertices; - - fi; - - quiver_rows_object := ObjectifyObjectForCAPWithAttributes( - rec( ), category, - ListOfQuiverVertices, L - ); - - Add( category, quiver_rows_object ); - - return quiver_rows_object; - -end ); - -## -InstallMethod( QuiverRowsMorphism, - [ IsQuiverRowsObject, IsList, IsQuiverRowsObject ], - - function( source, matrix, range ) - local quiver_rows_morphism, category; - - category := CapCategory( source ); - - quiver_rows_morphism := ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( - rec( ), category, - source, - range, - MorphismMatrix, matrix - ); - - Add( category, quiver_rows_morphism ); - - return quiver_rows_morphism; - -end ); - -## -InstallMethod( AsQuiverRowsObject, - [ IsQuiverVertex, IsQuiverRowsCategory ], - - function( v, category ) - - return QuiverRowsObject( [ [ v, 1 ] ], category ); - -end ); - -## -InstallMethod( AsQuiverRowsMorphism, - [ IsQuiverAlgebraElement, IsQuiverRowsCategory ], - - function( m, category ) - local v, w, m_rep; - - if IsZero( m ) then - - Error( "cannot create a morphism form 0 since the information about source and range is not deducable\n" ); - - fi; - - if not IsUniform( m ) then - - Error( "the given element is not uniform\n" ); - - fi; - - if IsQuotientOfPathAlgebraElement( m ) then - - m_rep := Representative( m ); - - else - - m_rep := m; - - fi; - - v := Source( LeadingPath( m_rep ) ); - - w := Target( LeadingPath( m_rep ) ); - - return QuiverRowsMorphism( AsQuiverRowsObject( v, category ), [ [ m ] ], AsQuiverRowsObject( w, category ) ); - -end ); - -## -InstallMethod( NrRows, - [ IsQuiverRowsMorphism ], - - function( morphism ) - - return NrSummands( Source( morphism ) ); - -end ); - -## -InstallMethod( NrCols, - [ IsQuiverRowsMorphism ], - - function( morphism ) - - return NrSummands( Range( morphism ) ); - -end ); - -## -InstallMethod( \[\], - [ IsQuiverRowsMorphism, IsInt ], - - function( morphism, i ) - local nr_cols, mat, zero; - - if not ( i >= 1 ) and ( i <= NrRows( morphism ) ) then - - Error( "bad index" ); - - fi; - - nr_cols := NrCols( morphism ); - - if nr_cols = 0 then - - return [ ]; - - fi; - - mat := MorphismMatrix( morphism ); - - zero := Zero( UnderlyingQuiverAlgebra( CapCategory( morphism ) ) ); - - if IsEmpty( mat ) then - - return List( [ 1 .. nr_cols ], i -> zero ); - - fi; - - return mat[i]; - -end ); - -## -InstallMethod( NrSummands, - [ IsQuiverRowsObject ], - - function( object ) - - return Sum( List( ListOfQuiverVertices( object ), l -> l[2] ) ); - -end ); - -## -InstallMethod( \[\], - [ IsQuiverRowsObject, IsInt ], - - function( object, i ) - local list, current, l; - - if not ( ( i >= 1 ) and ( i <= NrSummands( object ) ) ) then - - Error( "bad index" ); - - fi; - - list := ListOfQuiverVertices( object ); - - current := 0; - - for l in list do - - current := current + l[2]; - - if current >= i then - - return l[1]; - - fi; - - od; - - Error( "Bug in []-Operator for IsQuiverRowsObject" ); - -end ); - -## -InstallMethod( AsListListOfMatrices, - [ IsQuiverRowsMorphism ], - function( alpha ) - local list_source, list_range, row_intervals, boundary, i, col_intervals, listlist, intr, intc, mat, row; - - list_source := ListOfQuiverVertices( Source( alpha ) ); - - if IsEmpty( list_source ) then - - return []; - - fi; - - list_range := ListOfQuiverVertices( Range( alpha ) ); - - if IsEmpty( list_range ) then - - return []; - - fi; - - row_intervals := []; - - boundary := 1; - - for i in [ 1 .. Size( list_source ) ] do - - row_intervals[i] := [ boundary .. boundary + (list_source[i][2] - 1) ]; - - boundary := boundary + list_source[i][2]; - - od; - - col_intervals := []; - - boundary := 1; - - for i in [ 1 .. Size( list_range ) ] do - - col_intervals[i] := [ boundary .. boundary + (list_range[i][2] - 1) ]; - - boundary := boundary + list_range[i][2]; - - od; - - mat := MorphismMatrix( alpha ); - - listlist := []; - - for intr in row_intervals do - - row := []; - - for intc in col_intervals do - - Add( row, List( mat{intr}, r -> r{intc} ) ); - - od; - - Add( listlist, row ); - - od; - - return listlist; - -end ); - -## -InstallMethod( PermutationToSortedRepresentative, - [ IsQuiverRowsObject ], - - function( object ) - local list; - - list := ListOfQuiverVertices( object ); - - return SortingPerm( List( list, l -> l[1] ) ); - -end ); - -## -InstallMethod( SortedRepresentative, - [ IsQuiverRowsObject ], - - function( object ) - local perm, list; - - perm := PermutationToSortedRepresentative( object ); - - list := ListOfQuiverVertices( object ); - - return QuiverRowsObject( Permuted( list, perm ), CapCategory( object ) ); - -end ); - -#################################### -## -## Basic operations -## -#################################### - - -InstallGlobalFunction( INSTALL_FUNCTIONS_FOR_QUIVER_ROWS, - - function( category, over_Z ) - local algebra, quiver, zero, IDENTITY_MATRIX_QUIVER_ROWS, ZERO_MATRIX_QUIVER_ROWS, - vertices, basis, basis_paths_by_vertex_index, path, MATRIX_FOR_ALGEBROID_HOMSTRUCTURE, hom_structure_algebroid, - ring, default_range_of_HomStructure, hom_structure_range_category, hom_structure_on_morphisms_for_pure_components, - representative_func; - - algebra := UnderlyingQuiverAlgebra( category ); - - ring := CommutativeRingOfLinearCategory( category ); - - quiver := UnderlyingQuiver( category ); - - zero := Zero( algebra ); - - ## prepare the homomorphism structure - - ## storing the basis paths - ## basis_paths_by_vertex_index[ v_index ][ w_index ] = [ p_1:v -> w, p_2:v -> w, ... ] - vertices := Vertices( quiver ); - - basis := BasisPaths( CanonicalBasis( algebra ) ); - - basis_paths_by_vertex_index := List( vertices, i -> List( vertices, i -> [ ] ) ); - - for path in basis do - - Add( basis_paths_by_vertex_index[ VertexIndex( Source( path ) ) ][ VertexIndex( Target( path ) ) ], path ); - - od; - - ## precomputing matrices for the hom structure of the algebroid - ## hom_structure_algebroid[ v_index ][ w_index ][ v'_index ][ w'_index ][ path_1_index ][ path_2_index ] = [ Hom(v,w) -> Hom(v',w'): x -> path_1 * x * path_2 ] - ## in particular: (path_1: v' -> v), (path_2: w -> w') - - MATRIX_FOR_ALGEBROID_HOMSTRUCTURE := function( v, w, vp, wp, path_1, path_2 ) - local mat, hom_v_w, hom_vp_wp, alpha, beta, path; - - mat := []; - - hom_v_w := basis_paths_by_vertex_index[ VertexIndex( v ) ][ VertexIndex( w ) ]; - - if IsEmpty( hom_v_w ) then - - return mat; - - fi; - - hom_vp_wp := basis_paths_by_vertex_index[ VertexIndex( vp ) ][ VertexIndex( wp ) ]; - - if IsEmpty( hom_vp_wp ) then - - return mat; - - fi; - - alpha := PathAsAlgebraElement( algebra, path_1 ); - - beta := PathAsAlgebraElement( algebra, path_2 ); - - if IsQuotientOfPathAlgebra( algebra ) then - - for path in hom_v_w do - - Add( mat, - CoefficientsOfPaths( hom_vp_wp, Representative( alpha * PathAsAlgebraElement( algebra, path ) * beta ) ) - ); - - od; - - else - - for path in hom_v_w do - - Add( mat, - CoefficientsOfPaths( hom_vp_wp, ( alpha * PathAsAlgebraElement( algebra, path ) * beta ) ) - ); - - od; - - fi; - - return mat; - - end; - - hom_structure_algebroid := - List( vertices, v -> - List( vertices, w -> - List( vertices, vp -> - List( vertices, wp -> - List( basis_paths_by_vertex_index[ VertexIndex( vp ) ][ VertexIndex( v ) ], path_1 -> - List( basis_paths_by_vertex_index[ VertexIndex( w ) ][ VertexIndex( wp ) ], path_2 -> - MATRIX_FOR_ALGEBROID_HOMSTRUCTURE( v, w, vp, wp, path_1, path_2 ) - ) - ) - ) - ) - ) - ); - - default_range_of_HomStructure := CategoryOfRows( ring ); - - hom_structure_range_category := CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT( "range_of_HomStructure", default_range_of_HomStructure ); - - if not (IsCategoryOfRows( hom_structure_range_category ) or (IsBoundGlobal( "IsMatrixCategory" ) and ValueGlobal( "IsMatrixCategory" )( hom_structure_range_category ))) then - - Error( "range_of_HomStructure must be a category of rows or a matrix category" ); - - fi; - - SetRangeCategoryOfHomomorphismStructure( category, hom_structure_range_category ); - - ## - if IsQuotientOfPathAlgebra( algebra ) then - - representative_func := Representative; - - else - - representative_func := IdFunc; - - fi; - - ## - ZERO_MATRIX_QUIVER_ROWS := function( nr_rows, nr_cols ) - - if nr_rows = 0 or nr_cols = 0 then - - return []; - - fi; - - return NullMat( nr_rows, nr_cols, algebra ); - - end; - - ## - IDENTITY_MATRIX_QUIVER_ROWS := function( object ) - local size, list, l, mat, row, counter, v, id, j; - - size := NrSummands( object ); - - if size = 0 then - - return []; - - fi; - - list := ListOfQuiverVertices( object ); - - mat := []; - - counter := 1; - - for l in list do - - v := l[1]; - - id := PathAsAlgebraElement( algebra, v ); - - for j in [ counter .. counter + (l[2] - 1) ] do - - row := List( [ 1 .. size ], i -> zero ); - - row[j] := id; - - Add( mat, row ); - - od; - - counter := counter + l[2]; - - od; - - return mat; - - end; - - ## - AddIsEqualForCacheForObjects( category, - IsIdenticalObj ); - - ## - AddIsEqualForCacheForMorphisms( category, - IsIdenticalObj ); - - ## Well-defined for objects and morphisms - ## - AddIsWellDefinedForObjects( category, - function( object ) - local list; - - list := ListOfQuiverVertices( object ); - - if IsEmpty( list ) then - - return true; - - fi; - - if not ForAll( list, l -> IsList( l ) and Size( l ) = 2 ) then - - return false; - - fi; - - if not ForAll( list, l -> IsQuiverVertex( l[1] ) and IsPosInt( l[2] ) ) then - - return false; - - fi; - - if not ForAll( list, l -> l[1] in quiver ) then - - return false; - - fi; - - # all tests passed, so it is well-defined - return true; - - end ); - - ## - AddIsWellDefinedForMorphisms( category, - function( morphism ) - local matrix, nr_rows, nr_cols, source, range, i, j, m, v, w; - - matrix := MorphismMatrix( morphism ); - - nr_rows := NrRows( morphism ); - - nr_cols := NrCols( morphism ); - - if nr_rows = 0 or nr_cols = 0 then - - return IsEmpty( matrix ); - - fi; - - if not Size( matrix ) = nr_rows then - - return false; - - fi; - - if not ForAll( matrix, row -> Size( row ) = nr_cols ) then - - return false; - - fi; - - source := Source( morphism ); - - range := Range( morphism ); - - for i in [ 1 .. nr_rows ] do - - for j in [ 1 .. nr_cols ] do - - m := matrix[i][j]; - - ##TODO: in operator does not distinguish between quotient and non-quotient algebra - if not (m in algebra) then - Print( "1"); - return false; - - fi; - - if not IsZero( m ) then - - if not IsUniform( m ) then - - return false; - - fi; - - if IsQuotientOfPathAlgebraElement( m ) then - - m := Representative( m ); - - fi; - - v := Source( LeadingPath( m ) ); - - if not ( source[i] = v ) then - - return false; - - fi; - - w := Target( LeadingPath( m ) ); - - if not ( range[j] = w ) then - - return false; - - fi; - - if over_Z and not ForAll( Coefficients( m ), IsInt ) then - - return false; - - fi; - fi; - - od; - - od; - - # all tests passed, so it is well-defined - return true; - - end ); - - ## Equality Basic Operations for Objects and Morphisms - ## - AddIsEqualForObjects( category, - function( A, B ) - - return ListOfQuiverVertices( A ) = ListOfQuiverVertices( B ); - - end ); - - ## - AddIsCongruentForMorphisms( category, - function( alpha, beta ) - - return MorphismMatrix( alpha ) = MorphismMatrix( beta ); - - end ); - - ## - AddAdditiveGenerators( category, - function( cat ) - - return List( Vertices( UnderlyingQuiver( cat ) ), v -> AsQuiverRowsObject( v, cat ) ); - - end ); - - ## Basic Operations for a Category - - ## - AddIdentityMorphism( category, - - function( object ) - - return QuiverRowsMorphism( object, IDENTITY_MATRIX_QUIVER_ROWS( object ), object ); - - end ); - - ## - AddZeroMorphism( category, - function( source, range ) - - return QuiverRowsMorphism( source, ZERO_MATRIX_QUIVER_ROWS( NrSummands( source ), NrSummands( range ) ), range ); - - end ); - - ## - AddPreCompose( category, - function( alpha, beta ) - local A, B, C, mat; - - A := Source( alpha ); - - B := Range( alpha ); - - C := Range( beta ); - - if NrSummands( A ) = 0 or NrSummands( B ) = 0 or NrSummands( C ) = 0 then - - return ZeroMorphism( A, C ); - - fi; - - mat := MorphismMatrix( alpha ) * MorphismMatrix( beta ); - - return QuiverRowsMorphism( A, mat, C ); - - end ); - - # - AddMultiplyWithElementOfCommutativeRingForMorphisms( category, - function( r, morphism ) - - return QuiverRowsMorphism( Source( morphism ), r * MorphismMatrix( morphism ), Range( morphism ) ); - - end ); - - ## Basic Operations for an Additive Category - ## - AddIsZeroForMorphisms( category, - function( alpha ) - local matrix, r, c; - - matrix := MorphismMatrix( alpha ); - - if IsEmpty( matrix ) then - - return true; - - fi; - - for r in matrix do - - for c in r do - - if not IsZero( c ) then - - return false; - - fi; - - od; - - od; - - return true; - - end ); - - ## - AddAdditionForMorphisms( category, - function( alpha, beta ) - - return QuiverRowsMorphism( Source( alpha ), - MorphismMatrix( alpha ) + MorphismMatrix( beta ), - Range( beta ) ); - - end ); - - ## - AddAdditiveInverseForMorphisms( category, - function( alpha ) - - return QuiverRowsMorphism( Source( alpha ), - -MorphismMatrix( alpha ), - Range( alpha ) ); - - end ); - - ## - AddZeroObject( category, - function( ) - - return QuiverRowsObject( [ ], category ); - - end ); - - ## - AddUniversalMorphismIntoZeroObjectWithGivenZeroObject( category, - function( sink, zero_object ) - - return QuiverRowsMorphism( sink, [ ], zero_object ); - - end ); - - ## - AddUniversalMorphismFromZeroObjectWithGivenZeroObject( category, - function( source, zero_object ) - - return QuiverRowsMorphism( zero_object, [ ], source ); - - end ); - - ## - AddDirectSum( category, - function( list ) - - return QuiverRowsObject( Concatenation( List( list, ListOfQuiverVertices ) ), category ); - - end ); - - ## - AddProjectionInFactorOfDirectSumWithGivenDirectSum( category, - function( list, projection_number, direct_sum_object ) - local range, nr_cols, pre_matrix, id_matrix, post_matrix; - - range := list[projection_number]; - - nr_cols := NrSummands( range ); - - if NrSummands( direct_sum_object ) = 0 or nr_cols = 0 then - - return QuiverRowsMorphism( direct_sum_object, [], range ); - - fi; - - pre_matrix := - ZERO_MATRIX_QUIVER_ROWS( - Sum( list{ [ 1 .. projection_number - 1 ] }, i -> NrSummands( i ) ), - nr_cols - ); - - id_matrix := IDENTITY_MATRIX_QUIVER_ROWS( range ); - - post_matrix := - ZERO_MATRIX_QUIVER_ROWS( - Sum( list{ [projection_number + 1 .. Size( list ) ] }, i -> NrSummands( i ) ), - nr_cols - ); - - return QuiverRowsMorphism( direct_sum_object, - Concatenation( pre_matrix, id_matrix, post_matrix ), - range ); - - end ); - - ## - AddInjectionOfCofactorOfDirectSumWithGivenDirectSum( category, - function( list, injection_number, direct_sum_object ) - local source, nr_cols, pre_matrix, id_matrix, post_matrix; - - source := list[injection_number]; - - nr_cols := NrSummands( source ); - - if NrSummands( direct_sum_object ) = 0 or nr_cols = 0 then - - return QuiverRowsMorphism( source, [], direct_sum_object ); - - fi; - - pre_matrix := - ZERO_MATRIX_QUIVER_ROWS( - Sum( list{ [ 1 .. injection_number - 1 ] }, i -> NrSummands( i ) ), - nr_cols - ); - - id_matrix := IDENTITY_MATRIX_QUIVER_ROWS( source ); - - post_matrix := - ZERO_MATRIX_QUIVER_ROWS( - Sum( list{ [injection_number + 1 .. Size( list ) ] }, i -> NrSummands( i ) ), - nr_cols - ); - - return QuiverRowsMorphism( source, - Transpose( Concatenation( pre_matrix, id_matrix, post_matrix ) ), - direct_sum_object ); - - end ); - - # ## - AddUniversalMorphismIntoDirectSumWithGivenDirectSum( category, - function( diagram, test_object, source, direct_sum ) - local mat, nr_rows; - - nr_rows := NrSummands( test_object ); - - if NrSummands( direct_sum ) = 0 or nr_rows = 0 then - - return QuiverRowsMorphism( test_object, [], direct_sum ); - - fi; - - mat := List( [ 1 .. nr_rows ], i -> Concatenation( List( source, tau -> tau[i] ) ) ); - - return QuiverRowsMorphism( test_object, mat, direct_sum ); - - end ); - - ## - AddUniversalMorphismFromDirectSumWithGivenDirectSum( category, - function( diagram, test_object, sink, direct_sum ) - local mat; - - if NrSummands( direct_sum ) = 0 or NrSummands( test_object ) = 0 then - - return QuiverRowsMorphism( direct_sum, [], test_object ); - - fi; - - mat := Concatenation( List( sink, MorphismMatrix ) ); - - return QuiverRowsMorphism( direct_sum, mat, test_object ); - - end ); - - ## - AddHomomorphismStructureOnObjects( category, - function( A, B ) - local listA, listB, rank, a, b; - - listA := ListOfQuiverVertices( A ); - - listB := ListOfQuiverVertices( B ); - - rank := 0; - - for a in listA do - - for b in listB do - - rank := rank + Size( basis_paths_by_vertex_index[ VertexIndex( a[1] ) ][ VertexIndex( b[1] ) ] ) * a[2] * b[2] ; - - od; - - od; - - return ObjectConstructor( hom_structure_range_category, rank ); - - end ); - - ## expects only non-zero cases - hom_structure_on_morphisms_for_pure_components := function( alpha, beta, listi, listj, listk, listl ) - local j, k, i, l, a, b, c, d, alpha_ij, beta_kl, row, entry, row_counts, col_counts, - basis_vp_v, basis_w_wp, basis_v_w, m, basis_vp_wp, n, mat, vp, v, w, wp, coeffs_alpha, coeffs_beta, p, q; - - a := listj[2]; - - b := listk[2]; - - c := listi[2]; - - d := listl[2]; - - vp := listi[1]; - - v := listj[1]; - - w := listk[1]; - - wp := listl[1]; - - basis_vp_v := basis_paths_by_vertex_index[ VertexIndex(vp) ][ VertexIndex( v )]; - - basis_w_wp := basis_paths_by_vertex_index[ VertexIndex(w) ][ VertexIndex( wp )]; - - basis_v_w := basis_paths_by_vertex_index[ VertexIndex(v) ][ VertexIndex( w )]; - - m := Size( basis_v_w ); - - basis_vp_wp := basis_paths_by_vertex_index[ VertexIndex(vp) ][ VertexIndex( wp )]; - - n := Size( basis_vp_wp ); - - mat := []; - - for j in [ 1 .. a ] do - - for k in [ 1 .. b ] do - - row := []; - - for i in [ 1 .. c ] do - - for l in [ 1 .. d ] do - - ## create dummy zero mat - entry := NullMat( m, n ); - - alpha_ij := alpha[i][j]; - - if not IsZero( alpha_ij ) then - - beta_kl := beta[k][l]; - - if not IsZero( beta_kl ) then - - coeffs_alpha := CoefficientsOfPaths( basis_vp_v, alpha_ij ); - - coeffs_beta := CoefficientsOfPaths( basis_w_wp, beta_kl ); - - for p in [ 1 .. Size( basis_vp_v ) ] do - - for q in [ 1 .. Size( basis_w_wp ) ] do - - entry := entry + - coeffs_alpha[p] * coeffs_beta[q] * - hom_structure_algebroid[ VertexIndex(v) ][ VertexIndex(w) ][ VertexIndex(vp) ][ VertexIndex(wp) ][ p ][ q ]; - - od; - - od; - - fi; - - fi; - - Add( row, entry ); - - od; - - od; - - Add( mat, row ); - - od; - - od; - - row_counts := List( mat, r -> Size( r[1] ) ); - - col_counts := List( mat[1], m -> Size( m[1] ) ); - - return CAP_INTERNAL_MORPHISM_BETWEEN_DIRECT_SUMS_LIST_LIST( row_counts, mat, col_counts ); - - end; - - ## - AddHomomorphismStructureOnMorphismsWithGivenObjects( category, - function( hom_source, alpha, beta, hom_range ) - local listj, listk, listi, listl, listjk, listil, mat, j, k, row, i, l, row_counts, col_counts, alpham, betam, entry; - - listi := ListOfQuiverVertices( Source( alpha ) ); - - listj := ListOfQuiverVertices( Range( alpha ) ); - - listk := ListOfQuiverVertices( Source( beta ) ); - - listl := ListOfQuiverVertices( Range( beta ) ); - - ## - row_counts := []; - - for j in [ 1 .. Size( listj ) ] do - - for k in [ 1 .. Size( listk ) ] do - - Add( row_counts, listj[j][2] * listk[k][2] * Size( basis_paths_by_vertex_index[ VertexIndex( listj[j][1] ) ][ VertexIndex( listk[k][1] ) ] ) ); - - od; - - od; - - col_counts := []; - - for i in [ 1 .. Size( listi ) ] do - - for l in [ 1 .. Size( listl ) ] do - - Add( col_counts, listi[i][2] * listl[l][2] * Size( basis_paths_by_vertex_index[ VertexIndex( listi[i][1] ) ][ VertexIndex( listl[l][1] ) ] ) ); - - od; - - od; - - ## - alpham := AsListListOfMatrices( alpha ); - - betam := AsListListOfMatrices( beta ); - - mat := []; - - for j in [ 1 .. Size( listj ) ] do - - for k in [ 1 .. Size( listk ) ] do - - row := []; - - if row_counts[(j-1)*Size( listk ) + k] > 0 then - - for i in [ 1 .. Size( listi ) ] do - - for l in [ 1 .. Size( listl ) ] do - - entry := []; - - if col_counts[(i-1)*Size( listl ) + l] > 0 then - - entry := hom_structure_on_morphisms_for_pure_components( - alpham[i][j], betam[k][l], listi[i], listj[j], listk[k], listl[l] - ); - - fi; - - Add( row, entry ); - - od; - - od; - - fi; - - Add( mat, row ); - - od; - - od; - - mat := CAP_INTERNAL_MORPHISM_BETWEEN_DIRECT_SUMS_LIST_LIST( - row_counts, mat, col_counts - ); - - if IsEmpty( mat ) then - - return ZeroMorphism( hom_structure_range_category, hom_source, hom_range ); - - else - - return MorphismConstructor( hom_structure_range_category, hom_source, HomalgMatrix( mat, ObjectDatum( hom_structure_range_category, hom_source ), ObjectDatum( hom_structure_range_category, hom_range ), ring ), hom_range ); - - fi; - - end ); - - ## - AddDistinguishedObjectOfHomomorphismStructure( category, - function( ) - - return ObjectConstructor( hom_structure_range_category, 1 ); - - end ); - - ## - AddInterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects( category, - function( source, alpha, range ) - local listlist, lists, listr, row, i, j, submat, basis, c, a; - - listlist := AsListListOfMatrices( alpha ); - - lists := ListOfQuiverVertices( Source( alpha ) ); - - listr := ListOfQuiverVertices( Range( alpha ) ); - - row := []; - - for i in [ 1 .. Size( lists ) ] do - - for j in [ 1 .. Size( listr ) ] do - - submat := listlist[i][j]; - - basis := basis_paths_by_vertex_index[ VertexIndex( lists[i][1] ) ][ VertexIndex( listr[j][1] ) ]; - - for c in [ 1 .. lists[i][2] ] do - - for a in [ 1 .. listr[j][2] ] do - - Append( row, CoefficientsOfPaths( basis, representative_func( submat[c][a] ) ) ); - - od; - - od; - - od; - - od; - - if IsEmpty( row ) then - - return ZeroMorphism( hom_structure_range_category, source, range ); - - else - - return MorphismConstructor( hom_structure_range_category, source, HomalgMatrix( row, 1, Size( row ), ring ), range ); - - fi; - - end ); - - ## - AddInterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( category, - function( A, B, morphism ) - local coeffs, lists, listr, mat, pos, i, row, j, submat, basis, c, submatrow, a, - entry, row_counts, col_counts; - - ## this works for range categories with attribute UnderlyingMatrix - coeffs := EntriesOfHomalgMatrix( UnderlyingMatrix( morphism ) ); - - lists := ListOfQuiverVertices( A ); - - listr := ListOfQuiverVertices( B ); - - mat := []; - - pos := 1; - - for i in [ 1 .. Size( lists ) ] do - - row := []; - - for j in [ 1 .. Size( listr ) ] do - - submat := []; - - basis := basis_paths_by_vertex_index[ VertexIndex( lists[i][1] ) ][ VertexIndex( listr[j][1] ) ]; - - for c in [ 1 .. lists[i][2] ] do - - submatrow := []; - - for a in [ 1 .. listr[j][2] ] do - - entry := coeffs{ [ pos .. pos + ( Size( basis ) - 1 ) ] }; - - entry := QuiverAlgebraElement( algebra, entry, basis ); - - Add( submatrow, entry ); - - pos := pos + Size( basis ); - - od; - - Add( submat, submatrow ); - - od; - - Add( row, submat ); - - od; - - Add( mat, row ); - - od; - - row_counts := List( lists, i -> i[2] ); - - col_counts := List( listr, i -> i[2] ); - - mat := CAP_INTERNAL_MORPHISM_BETWEEN_DIRECT_SUMS_LIST_LIST( - row_counts, mat, col_counts - ); - - return QuiverRowsMorphism( A, mat, B ); - - end ); - -end ); - - -#################################### -## -## Helper -## -#################################### - -InstallGlobalFunction( CAP_INTERNAL_MORPHISM_BETWEEN_DIRECT_SUMS_LIST_LIST, - function( row_counts, matrix, col_counts ) - local nr_rows, nr_cols, row_count_indices, col_count_indices, result_mat, r; - - nr_rows := Size( row_counts ); - - nr_cols := Size( col_counts ); - - row_count_indices := Filtered( [ 1 .. nr_rows ], i -> row_counts[i] > 0 ); - - if IsEmpty( row_count_indices ) then - - return []; - - fi; - - col_count_indices := Filtered( [ 1 .. nr_cols ], i -> col_counts[i] > 0 ); - - if IsEmpty( col_count_indices ) then - - return []; - - fi; - - matrix := matrix{row_count_indices}; - - matrix := List( matrix, r -> r{col_count_indices} ); - - nr_rows := Size( row_count_indices ); - - nr_cols := Size( col_count_indices ); - - result_mat := []; - - for r in [ 1 .. nr_rows ] do - - Append( result_mat, - List( [ 1 .. row_counts[row_count_indices[r]] ], - i -> Concatenation( List( matrix[r], mat -> mat[i] ) ) ) - ); - - od; - - return result_mat; - -end ); - -#################################### -## -## View -## -#################################### - -## -InstallMethod( ViewObj, - [ IsQuiverRowsMorphism ], - function( morphism ) - - Print( "" - ); -end ); - -## -InstallMethod( ViewObj, - [ IsQuiverRowsObject ], - function( object ) - Print( "" - ); -end ); - -## -InstallMethod( Display, - [ IsQuiverRowsObject ], - - function( object ) - - Display( ListOfQuiverVertices( object ) ); - -end ); - -## -InstallMethod( Display, - [ IsQuiverRowsMorphism ], - - function( morphism ) - - Print( "Source: "); - Display( Source( morphism ) ); - Print( " |\n"); - Print( " |\n"); - Print( "Matrix: "); - Display( MorphismMatrix( morphism ) ); - Print( " |\n"); - Print( " v\n"); - Print( "Range : "); - Display( Range( morphism ) ); - -end ); - - -## -InstallMethod( LaTeXOutput, - [ IsQuiverRowsObject ], - - function( obj ) - local l, exp_func; - - l := ListOfQuiverVertices( obj ); - - if IsEmpty( l ) then - - return "0"; - - fi; - - exp_func := function( i ) - if i = 1 then - return ""; - else - return Concatenation( "\\oplus", String( i ) ); - fi; - end; - - l := List( l, pair -> Concatenation( "V_{", LabelAsString( pair[1] ), "}^{", exp_func( pair[2] ), "}" ) ); - - return JoinStringsWithSeparator( l, " \\oplus " ); - -end ); - -## -InstallMethod( LaTeXOutput, - [ IsQuiverRowsMorphism ], - - function( morphism ) - local matrix, source, range; - - matrix := MorphismMatrix( morphism ); - - if IsEmpty( matrix ) then - matrix := "0"; - else - - matrix := JoinStringsWithSeparator( - List( matrix, row -> JoinStringsWithSeparator( List( row, el -> Concatenation( "CAPINTMARKER", String( el ) ) ), "\&" ) ), - """\\""" - ); - - matrix := ReplacedString( matrix, "{ 1*", "{" ); - - matrix := ReplacedString( matrix, "{ -1*", "{-" ); - - matrix := ReplacedString( matrix, " + 1*", " + " ); - - matrix := ReplacedString( matrix, " - 1*", " - " ); - - matrix := ReplacedString( matrix, "CAPINTMARKER1*", "" ); - - matrix := ReplacedString( matrix, "CAPINTMARKER-1*", "-" ); - - matrix := ReplacedString( matrix, "CAPINTMARKER", "" ); - - matrix := ReplacedString( matrix, "*", "" ); - - matrix := Concatenation( "\\begin{pmatrix}", matrix, "\\end{pmatrix}" ); - - fi; - - if ValueOption( "OnlyDatum" ) = true then - - return matrix; - - fi; - - source := LaTeXOutput( Source( morphism ) ); - - range := LaTeXOutput( Range( morphism ) ); - - return Concatenation( source, "\\xrightarrow{", matrix, "}", range ); - -end ); - - -#################################### -## -## Convenience -## -#################################### - -## -InstallMethod( \., - [ IsQuiverRowsCategory, IsPosInt ], - function( QRows, string_as_int ) - local name, A, q, a; - - name := NameRNam( string_as_int ); - - A := UnderlyingQuiverAlgebra( QRows ); - - q := QuiverOfAlgebra( A ); - - a := q.( name ); - - if IsQuiverVertex( a ) then - - return AsQuiverRowsObject( a, QRows ); - - elif IsArrow( a ) then - - return AsQuiverRowsMorphism( A.( name ), QRows ); - - else - - Error( "the given component ", name, " is neither a vertex nor an arrow of the quiver q = ", q, "\n" ); - - fi; - -end ); - -## -InstallOtherMethod( \/, - [ IsQuiverVertex, IsQuiverRowsCategory ], - AsQuiverRowsObject -); - -## -InstallOtherMethod( \/, - [ IsQuiverAlgebraElement, IsQuiverRowsCategory ], - AsQuiverRowsMorphism ); - -## -InstallOtherMethod( \/, - [ IsPath, IsQuiverRowsCategory ], - {p, QRows} -> PathAsAlgebraElement( UnderlyingQuiverAlgebra( QRows ), p )/QRows -); - -## -InstallMethod( \*, - [ IsQuiverRowsMorphism, IsQuiverRowsMorphism ], - PreCompose -); - -#################################### -## -## Down -## -#################################### - -## -InstallMethod( Down, - [ IsQuiverRowsObject ], - ListOfQuiverVertices ); - -## -InstallMethod( DownOnlyMorphismData, - [ IsQuiverRowsMorphism ], - MorphismMatrix ); diff --git a/FreydCategoriesForCAP/init.g b/FreydCategoriesForCAP/init.g index d5957ffd83..393e3fa78e 100644 --- a/FreydCategoriesForCAP/init.g +++ b/FreydCategoriesForCAP/init.g @@ -29,10 +29,6 @@ ReadPackage( "FreydCategoriesForCAP", "gap/CokernelImageClosure.gd" ); ReadPackage( "FreydCategoriesForCAP", "gap/AdelmanCategory.gd" ); -if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) then - ReadPackage( "FreydCategoriesForCAP", "gap/QuiverRows.gd" ); -fi; - ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreyd.gd" ); if IsPackageMarkedForLoading( "FinSetsForCAP", ">= 2019.09.20" ) then diff --git a/FreydCategoriesForCAP/read.g b/FreydCategoriesForCAP/read.g index 804cf28c86..fd5185fe92 100644 --- a/FreydCategoriesForCAP/read.g +++ b/FreydCategoriesForCAP/read.g @@ -30,10 +30,6 @@ ReadPackage( "FreydCategoriesForCAP", "gap/CokernelImageClosure.gi" ); ReadPackage( "FreydCategoriesForCAP", "gap/AdelmanCategory.gi" ); -if IsPackageMarkedForLoading( "QPA", ">= 2.0" ) then - ReadPackage( "FreydCategoriesForCAP", "gap/QuiverRows.gi" ); -fi; - ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreyd.gi" ); if IsPackageMarkedForLoading( "FinSetsForCAP", ">= 2019.09.20" ) then