- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 684
Fix bug with creation of extensions of function fields #41096
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
Conversation
| Documentation preview for this PR (built with commit 74deb42; changes) is ready! 🎉 | 
| EXAMPLES:: | ||
| sage: K.<x> = FunctionField(QQ); R.<y> = K[] | ||
| sage: K.extension(y^5 - x^3 - 3*x + x*y) # needs sage.rings.function_field | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, we can not use K.extension like this? I think it is better to preserve these tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand, isn't it exactly line 456 in function_field.py? I feel like these tests were run twice, but maybe there is something silly I am missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand, isn't it exactly line 456 in
function_field.py? I feel like these tests were run twice, but maybe there is something silly I am missing?
The base field is QQ, a rational number field. But in line 456 examples, its base field is GF(2). This examples is used to detect the extension method on the function field based on a rational number field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand, isn't it exactly line 456 in
function_field.py? I feel like these tests were run twice, but maybe there is something silly I am missing?
I think you can add this into the line456 test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I need another cup of black tea, I agree that the tests I added (starting line 475) are on GF(2), but it seems to me that the tests between line 456 and 469 are precisely the ones I deleted, with QQ. I just ran diff on these lines and the only difference is lines 463/464 vs 454/455. Maybe we can keep the small difference? But I don't see the GF(2) thing?
| OK. Thank you. | 
sagemathgh-41096: Fix bug with creation of extensions of function fields When creating a function field extension, it is never checked that the polynomial defining the extension is defined over that function field. Hence, when calling `base_ring` one gets a bug because the base ring of the polynomial ring is returned, and not the function field which we used to create the extension. Fixes sagemath#41095. When working on this, I remarked that the `extension` method of `RationalFunctionField` was just a copy paste (even for doctests) of the one of `FunctionField`, which is its parent. So I also removed it. But I can put it back if someone explains me why this can sometimes be useful to do so. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. URL: sagemath#41096 Reported by: Rubén Muñoz--Bertrand Reviewer(s): Chenxin Zhong, Rubén Muñoz--Bertrand
When creating a function field extension, it is never checked that the polynomial defining the extension is defined over that function field. Hence, when calling
base_ringone gets a bug because the base ring of the polynomial ring is returned, and not the function field which we used to create the extension.Fixes #41095.
When working on this, I remarked that the
extensionmethod ofRationalFunctionFieldwas just a copy paste (even for doctests) of the one ofFunctionField, which is its parent. So I also removed it. But I can put it back if someone explains me why this can sometimes be useful to do so.📝 Checklist