diff --git a/MatricesForHomalg/PackageInfo.g b/MatricesForHomalg/PackageInfo.g index bc60b8234..9fe7ba03f 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.06-04", +Version := "2024.06-05", 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 d4956b6c2..1667e9700 100644 --- a/MatricesForHomalg/gap/Tools.gi +++ b/MatricesForHomalg/gap/Tools.gi @@ -8187,6 +8187,8 @@ InstallMethod( RingMapOntoSimplifiedOnceResidueClassRingUsingLinearEquations, if not HasAmbientRing( R ) then return id; + elif HasIsZero( R ) and IsZero( R ) then + return id; fi; ## R = A / I @@ -8228,3 +8230,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 ) 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 );