New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow coercion from matrix groups to matrix rings #22091
Comments
Commit: |
Branch: u/pbruin/22091-matrix_coercion |
comment:1
The criterion used in the patch was copied from the method |
This comment has been minimized.
This comment has been minimized.
comment:3
I do think that declaring a coercion embedding would be more appropriate. |
comment:4
Does it fix #18258? |
comment:5
Replying to @videlec:
You're probably right. I changed this and am now running doctests. Replying to @videlec:
Yes, it does. Maybe we should fix the actual bug on this ticket (by adding the coercion embedding) and keep #18258 for the other fixes (upgrading |
comment:6
Replying to @pjbruin:
There was one doctest failure (in
The error also arises with |
Dependencies: #22128 |
comment:7
The above bug is now #22128. |
comment:9
A better fix long-term is to actually to |
comment:10
Replying to @tscrim:
I see your point; I do find the new solution more elegant than the old one, but this might partly be because About the possibility for the user to profit from Anyway, I only have a slight preference for the new solution. Vincent, what are your reasons for preferring this solution?
The old version is commit 231eb32. |
comment:11
Replying to @pjbruin:
I don't understand the logic. Travis, you are proposing to declare the coercion in the
+1. This has been proved to be confusing and broken (#19016, #15303, #19388).
Looks more (mathematically) natural to me. When I define a subset I also prefer having the embedding declared once for all in init. There could be an option in the constructor to have this embedding. I would follow what is done for number fields: the embedding is part of the input data to construct it. |
comment:12
Replying to @videlec:
Yes, that is where it should go by our long-standing API for the coercion framework. Using
Then we should avoid it. By also defining an embedding during construction, you've created a unique situation in Sage, which will further confuse users, and now likely experts.
This is close to a fallacy to me, as you are not construction
IMO, this is even better: it is being hard-coded into the class itself, where you do not even need to define the object. Number fields are a different scenario by their construction, but I would still even argue that we should use the standard approach. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:14
I reverted to the original approach (with extra doctests from the other version). The argument that the approach of declaring coercion embeddings is non-standard and fundamentally slightly fragile does sound convincing to me. That having been said, I would simply like to see this bug fixed, no matter how exactly. |
comment:15
Note: the dependency #22128 is marked as "closed" but does not seem to be merged in 7.6.beta0 yet. |
Reviewer: Travis Scrimshaw |
comment:16
LGTM, so I'm setting a positive review. |
Changed branch from u/pbruin/22091-matrix_coercion to |
If
A
is a ring, then the matrix groupGL(n, A)
does not have a coercion map to the ringMatrixSpace(A, n)
of which it is the unit group:All answers should be True. The fact that
m in G
returns the correct answer despite this bug is the result of a non-standard implementation of__contains__()
; see #22092 (of which this ticket is a dependency).Depends on #22128
Component: coercion
Keywords: matrix
Author: Peter Bruin
Branch/Commit:
9dec049
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/22091
The text was updated successfully, but these errors were encountered: