From 680a583d302dd09bfd7ddd9bac8938fd717ecf72 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Sat, 22 Jun 2024 22:06:06 +0200 Subject: [PATCH 1/4] whitespace --- MatricesForHomalg/gap/Tools.gi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MatricesForHomalg/gap/Tools.gi b/MatricesForHomalg/gap/Tools.gi index 4f85a3bfa..5bb3ed5d5 100644 --- a/MatricesForHomalg/gap/Tools.gi +++ b/MatricesForHomalg/gap/Tools.gi @@ -8155,14 +8155,13 @@ InstallMethod( RingMapOntoSimplifiedResidueClassRing, pi := RingMapOntoRewrittenResidueClassRing( R ); # replace pi: A -> R = A / I by pi: A -> R_1 := A_1 / I_1 while true do - + ## construct the surjective morphism psi: A_i -> A_{i+1} / I_{i+1} =: R_{i+1} psi := RingMapOntoSimplifiedOnceResidueClassRing( Range( pi ) ); if HasIsOne( psi ) and IsOne( psi ) then break; fi; - ## compose A -pi-> A_i / I_i -psi-> A_{i+1} / I_{i+1}, ## where we understand the above psi as the isomorphism psi: A_i / I_i -psi-> A_{i+1} / I_{i+1} From 9458f6bf4b95ea3b9919180796d642740beeae80 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Sun, 25 Aug 2024 14:55:15 +0200 Subject: [PATCH 2/4] renamed RingMapOntoSimplifiedResidueClassRingByLinearEquations -> RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations --- MatricesForHomalg/PackageInfo.g | 2 +- MatricesForHomalg/gap/Tools.gd | 2 +- MatricesForHomalg/gap/Tools.gi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MatricesForHomalg/PackageInfo.g b/MatricesForHomalg/PackageInfo.g index dcd2fb69f..c6d541f57 100644 --- a/MatricesForHomalg/PackageInfo.g +++ b/MatricesForHomalg/PackageInfo.g @@ -11,7 +11,7 @@ SetPackageInfo( rec( PackageName := "MatricesForHomalg", Subtitle := "Matrices for the homalg project", -Version := "2024.08-01", +Version := "2024.08-02", 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", diff --git a/MatricesForHomalg/gap/Tools.gd b/MatricesForHomalg/gap/Tools.gd index eefb53223..f56d906b5 100644 --- a/MatricesForHomalg/gap/Tools.gd +++ b/MatricesForHomalg/gap/Tools.gd @@ -235,7 +235,7 @@ DeclareOperation( "RingMapOntoSimplifiedOnceResidueClassRing", DeclareOperation( "RingMapOntoSimplifiedResidueClassRing", [ IsHomalgRing ] ); -DeclareOperation( "RingMapOntoSimplifiedResidueClassRingByLinearEquations", +DeclareOperation( "RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations", [ IsHomalgRing ] ); ## This is a dummy declaration for a function actually installed diff --git a/MatricesForHomalg/gap/Tools.gi b/MatricesForHomalg/gap/Tools.gi index 5bb3ed5d5..5404aae15 100644 --- a/MatricesForHomalg/gap/Tools.gi +++ b/MatricesForHomalg/gap/Tools.gi @@ -8174,7 +8174,7 @@ InstallMethod( RingMapOntoSimplifiedResidueClassRing, end ); ## -InstallMethod( RingMapOntoSimplifiedResidueClassRingByLinearEquations, +InstallMethod( RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations, "for a homalg ring", [ IsHomalgRing ], From 890bfcadc3fc5b5c04b2678c899084398c7349d2 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Sun, 25 Aug 2024 14:55:59 +0200 Subject: [PATCH 3/4] fixed RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations --- MatricesForHomalg/PackageInfo.g | 2 +- MatricesForHomalg/gap/Tools.gi | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/MatricesForHomalg/PackageInfo.g b/MatricesForHomalg/PackageInfo.g index c6d541f57..aefc8a4fe 100644 --- a/MatricesForHomalg/PackageInfo.g +++ b/MatricesForHomalg/PackageInfo.g @@ -11,7 +11,7 @@ SetPackageInfo( rec( PackageName := "MatricesForHomalg", Subtitle := "Matrices for the homalg project", -Version := "2024.08-02", +Version := "2024.08-03", 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", diff --git a/MatricesForHomalg/gap/Tools.gi b/MatricesForHomalg/gap/Tools.gi index 5404aae15..7bded574f 100644 --- a/MatricesForHomalg/gap/Tools.gi +++ b/MatricesForHomalg/gap/Tools.gi @@ -8185,16 +8185,14 @@ InstallMethod( RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations, if not HasAmbientRing( R ) then return id; + elif HasIsZero( R ) and IsZero( R ) then + return id; fi; ## R = A / I I := MatrixOfRelations( R ); - L := Filtered( EntriesOfHomalgMatrix( I ), e -> Degree( e ) = 1 ); - - if L = [ ] then - return id; - fi; + L := Filtered( EntriesOfHomalgMatrix( I ), e -> Degree( e ) <= 1 ); A := AmbientRing( R ); @@ -8202,13 +8200,17 @@ InstallMethod( RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations, L := BasisOfRows( L ); + if IsZero( L ) then + return id; + fi; + S := A / L; pi := RingMapOntoSimplifiedResidueClassRing( S ); P := Range( pi ); - Assert( 0, not HasAmbientRing( P ) ); + Assert( 0, ( HasIsZero( P ) and IsZero( P ) ) or not HasAmbientRing( P ) ); J := Pullback( pi, I ); From 5fe52ea28074058d785b8fb0858e55e4ee73ead6 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Sun, 25 Aug 2024 14:57:22 +0200 Subject: [PATCH 4/4] d&i RingMapOntoSimplifiedResidueClassRingUsingLinearEquations --- MatricesForHomalg/PackageInfo.g | 2 +- MatricesForHomalg/gap/Tools.gd | 3 +++ MatricesForHomalg/gap/Tools.gi | 39 +++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/MatricesForHomalg/PackageInfo.g b/MatricesForHomalg/PackageInfo.g index aefc8a4fe..c969ddd34 100644 --- a/MatricesForHomalg/PackageInfo.g +++ b/MatricesForHomalg/PackageInfo.g @@ -11,7 +11,7 @@ SetPackageInfo( rec( PackageName := "MatricesForHomalg", Subtitle := "Matrices for the homalg project", -Version := "2024.08-03", +Version := "2024.08-04", 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", diff --git a/MatricesForHomalg/gap/Tools.gd b/MatricesForHomalg/gap/Tools.gd index f56d906b5..4d763cb0a 100644 --- a/MatricesForHomalg/gap/Tools.gd +++ b/MatricesForHomalg/gap/Tools.gd @@ -238,6 +238,9 @@ DeclareOperation( "RingMapOntoSimplifiedResidueClassRing", DeclareOperation( "RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations", [ IsHomalgRing ] ); +DeclareOperation( "RingMapOntoSimplifiedResidueClassRingUsingLinearEquations", + [ IsHomalgRing ] ); + ## This is a dummy declaration for a function actually installed ## in GaussForHomalg DeclareGlobalFunction( "HOMALG_RING_OF_INTEGERS_PRIME_POWER_HELPER" ); diff --git a/MatricesForHomalg/gap/Tools.gi b/MatricesForHomalg/gap/Tools.gi index 7bded574f..08646b72a 100644 --- a/MatricesForHomalg/gap/Tools.gi +++ b/MatricesForHomalg/gap/Tools.gi @@ -8228,3 +8228,42 @@ InstallMethod( RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations, return epi; end ); + +## +InstallMethod( RingMapOntoSimplifiedResidueClassRingUsingLinearEquations, + "for a homalg ring", + [ IsHomalgRing ], + + function( R ) + local id, pi, psi; + + id := RingMap( R ); + + if not HasAmbientRing( R ) then + return id; + fi; + + # R = A / I + pi := RingMap( Indeterminates( R ), AmbientRing( R ), R ); + + SetIsMorphism( pi, true ); + SetIsEpimorphism( pi, true ); + + while true do + + ## construct the surjective morphism psi: A_i -> A_{i+1} / I_{i+1} =: R_{i+1} + psi := RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations( Range( pi ) ); + + if ( HasIsOne( psi ) and IsOne( psi ) ) or ( HasIsZero( Range( psi ) ) and IsZero( Range( psi ) ) ) then + break; + fi; + + ## compose A -pi-> A_i / I_i -psi-> A_{i+1} / I_{i+1}, + ## where we understand the above psi as the isomorphism psi: A_i / I_i -psi-> A_{i+1} / I_{i+1} + pi := PreCompose( pi, psi ); + + od; + + return pi; + +end );