Skip to content

Fix InjectionZeroMagma claiming to be bijective - #6767

Open
fingolfin wants to merge 1 commit into
masterfrom
mh-claude/injectionzeromagma
Open

fingolfin wants to merge 1 commit into
masterfrom
mh-claude/injectionzeromagma

Conversation

@fingolfin

@fingolfin fingolfin commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

The embedding of a magma into the magma with zero adjoined was built with the four-argument MappingByFunction, which marks the map bijective. The zero is not in its image, so IsBijective returned true and PreImage( map, zero ) returned fail instead of raising an error. Build it with the false, prefun form and mark it injective and not surjective.

The internal _InjectionPrincipalFactor had the same flaw for Rees 0-matrix semigroups; IsomorphismReesZeroMatrixSemigroup now uses PreImagesRepresentativeNC instead of the inverse mapping.

Assisted-by: Generative AI


This leads to a test failure in the Semigroups package (as it relied on this bug, accidentally); fix for that is being prepared now at semigroups/Semigroups#1238.

The embedding of a magma into the magma with zero adjoined was built
with the four-argument `MappingByFunction`, which marks the map
bijective. The zero is not in its image, so `IsBijective` returned
true and `PreImage( map, zero )` returned `fail` instead of raising an
error. Build it with the `false, prefun` form and mark it injective and
not surjective.

The internal `_InjectionPrincipalFactor` had the same flaw for Rees
0-matrix semigroups; `IsomorphismReesZeroMatrixSemigroup` now uses
`PreImagesRepresentativeNC` instead of the inverse mapping.

Assisted-by: Generative AI
@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them topic: library release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Oct 18, 2026
@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.67%. Comparing base (3f74e5d) to head (0463fae).

Files with missing lines Patch % Lines
lib/reesmat.gi 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6767      +/-   ##
==========================================
- Coverage   79.67%   79.67%   -0.01%     
==========================================
  Files         684      684              
  Lines      295465   295470       +5     
  Branches     8656     8656              
==========================================
- Hits       235424   235418       -6     
- Misses      58217    58223       +6     
- Partials     1824     1829       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fingolfin added a commit to fingolfin/Semigroups that referenced this pull request Oct 18, 2026
`UnderlyingInjectionZeroMagma` is injective but not surjective: the
adjoined zero is not in its image. GAP currently marks it bijective by
mistake, which makes `x ^ InverseGeneralMapping( inj )` work. Once GAP
fixes that (gap-system/gap#6767), the inverse is no longer total and
`^` raises an error, breaking `IsomorphismPartialPermSemigroup` for
zero groups.

Use `PreImagesRepresentative` instead, which works with both old and
fixed GAP versions.

Assisted-by: Generative AI

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant