-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix two bugs related to empty magmas
First, SubadditiveMagma(a,[]) computes an empty magma, but we erroneously set IsTrivial for it, which implies size 1. This was changed to IsEmpty. Secondly, there was an implication from "IsFiniteOrderElementCollection and IsMagma" to IsMagmaWithInverses. But such a collection may be empty, hence the implication is invalid as given. Fixes #2400
- Loading branch information
1 parent
289fdda
commit 2e29846
Showing
3 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# | ||
# There was a bug where we marked a sub additive magma | ||
# with empty generator list as trivial, even though it is empty. | ||
# | ||
# There was also a wrong implication, from "IsFiniteOrderElementCollection and | ||
# IsMagma" to IsMagmaWithInverses. But a collection with the former filters may | ||
# be empty, and then it isn't a IsMagmaWithInverses. | ||
# | ||
gap> amgm:=AdditiveMagma([0]); | ||
<additive magma with 1 generators> | ||
gap> Size(amgm); | ||
1 | ||
gap> IsTrivial(amgm); | ||
true | ||
gap> IsEmpty(amgm); | ||
false | ||
gap> IsMagmaWithInverses(amgm); | ||
false | ||
|
||
# | ||
gap> asub:=SubadditiveMagma(amgm, []); | ||
<additive magma with 0 generators> | ||
gap> Size(asub); | ||
0 | ||
gap> IsTrivial(asub); | ||
false | ||
gap> IsEmpty(asub); | ||
true | ||
gap> IsMagmaWithInverses(asub); | ||
false | ||
|
||
# | ||
gap> mgm:=Magma( () ); | ||
<commutative semigroup with 1 generator> | ||
gap> Size(mgm); | ||
1 | ||
gap> IsTrivial(mgm); | ||
true | ||
gap> IsEmpty(mgm); | ||
false | ||
gap> IsMagmaWithInverses(mgm); | ||
false | ||
|
||
# | ||
gap> sub:=Submagma(mgm,[]); | ||
<commutative semigroup with 0 generators> | ||
gap> Size(sub); | ||
0 | ||
gap> IsTrivial(sub); | ||
false | ||
gap> IsEmpty(sub); | ||
true | ||
gap> IsMagmaWithInverses(sub); | ||
false |