Skip to content

Commit

Permalink
Merge pull request #613 from mohamed-barakat/RingMapOntoSimplifiedRes…
Browse files Browse the repository at this point in the history
…idueClassRing

fixed RingMapOnto* methods
  • Loading branch information
mohamed-barakat authored Aug 25, 2024
2 parents 3c67d56 + 35d2300 commit b6a3230
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion MatricesForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SetPackageInfo( rec(

PackageName := "MatricesForHomalg",
Subtitle := "Matrices for the homalg project",
Version := "2024.08-04",
Version := "2024.08-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",

Expand Down
36 changes: 26 additions & 10 deletions MatricesForHomalg/gap/Tools.gi
Original file line number Diff line number Diff line change
Expand Up @@ -8015,7 +8015,7 @@ InstallMethod( RingMapOntoRewrittenResidueClassRing,
fi;

## R = A / I
I := MatrixOfRelations( R );
I := BasisOfRows( MatrixOfRelations( R ) );

A := AmbientRing( R );

Expand Down Expand Up @@ -8047,7 +8047,9 @@ InstallMethod( RingMapOntoRewrittenResidueClassRing,
zero_rows := ZeroRows( matrix - images );

## create the standard subring S of A, i.e., the subring generated by the standard indeterminates
if Length( indets ) = Length( zero_rows ) and
if IsZero( DecideZeroRows( HomalgIdentityMatrix( 1, A ), I ) ) then
S := k / One( k );
elif Length( indets ) = Length( zero_rows ) and
IsIdenticalObj( k, CoefficientsRing( A ) ) then
S := A;
else
Expand Down Expand Up @@ -8091,8 +8093,22 @@ InstallMethod( RingMapOntoSimplifiedOnceResidueClassRing,
fi;

## R = A / I
A := AmbientRing( R );

I := MatrixOfRelations( R );

## [ y_1, ..., y_{i-1}, y_i, y_{i+1}, ..., y_s ]
indets := ShallowCopy( Indeterminates( A ) );

if IsEmpty( indets ) and IsZero( DecideZeroRows( HomalgIdentityMatrix( 1, A ), I ) ) then
S := CoefficientsRing( A ) / 1;
SetIsZero( S, true );
epi := RingMap( ListWithIdenticalEntries( Length( indets ), Zero( S ) ), A, S );
SetIsMorphism( epi, true );
SetIsEpimorphism( epi, true );
return epi;
fi;

for i in [ 1 .. NumberRows( I ) ] do
## [ j, f/u ] where (u y_j - f) ∈ GB(I)
img := IsolateIndeterminate( I[ i, 1 ] );
Expand All @@ -8102,14 +8118,12 @@ InstallMethod( RingMapOntoSimplifiedOnceResidueClassRing,
od;

if img = fail then
return id;
epi := RingMap( List( indets, a -> a / R ), A, R );
SetIsMorphism( epi, true );
SetIsEpimorphism( epi, true );
return epi;
fi;

A := AmbientRing( R );

## [ y_1, ..., y_{i-1}, y_i, y_{i+1}, ..., y_s ]
indets := ShallowCopy( Indeterminates( A ) );

new_indets := List( indets, String );

## [ y_1, ..., y_{i-1}, y_{i+1}, ..., y_s ]
Expand Down Expand Up @@ -8159,7 +8173,8 @@ InstallMethod( RingMapOntoSimplifiedResidueClassRing,
## 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
if ( HasIsZero( Range( psi ) ) and IsZero( Range( psi ) ) ) or
Length( Indeterminates( Source( psi ) ) ) = Length( Indeterminates( Range( psi ) ) ) then
break;
fi;

Expand Down Expand Up @@ -8254,7 +8269,8 @@ InstallMethod( RingMapOntoSimplifiedResidueClassRingUsingLinearEquations,
## 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
if ( HasIsZero( Range( psi ) ) and IsZero( Range( psi ) ) ) or
Length( Indeterminates( Source( psi ) ) ) = Length( Indeterminates( Range( psi ) ) ) then
break;
fi;

Expand Down

0 comments on commit b6a3230

Please sign in to comment.