leanprover-community / mathlib

Lean 3's obsolete mathematical components library: please use mathlib4
https://leanprover-community.github.io/lean3
Apache License 2.0
1.67k stars 297 forks source link

[Merged by Bors] - chore(field_theory/splitting_field): refactor `splitting_field` #19178

Closed riccardobrasca closed 1 year ago

riccardobrasca commented 1 year ago

We refactor the definition of splitting_field. The main motivation is to backport !4#4891 since the is seems very problematic to port the current design.

Zulip discussion relevant to this PR: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/!4.234891.20.20FieldTheory.2ESplittingField


All the modifications not in field_theory.splitting_field.construction have been done to solve timeouts.

Open in Gitpod

eric-wieser commented 1 year ago

Just to note I back-ported a more bikesheddy side of 4891 in #19179

riccardobrasca commented 1 year ago

~The linter will complain and there is some doc to be fixed. I will fix everything tomorrow.~ Done.

mathlib-dependent-issues-bot commented 1 year ago

This PR/issue depends on:

ericrbg commented 1 year ago

Why do we have to disable the instances now? Is it just a timeout if the instance is kept in, or an actual diamond? I like the solution, though, not the most elegant but definitely a good way to essentially copy a field construction

riccardobrasca commented 1 year ago

Why do we have to disable the instances now? Is it just a timeout if the instance is kept in, or an actual diamond? I like the solution, though, not the most elegant but definitely a good way to essentially copy a field construction

It's causing a timeout, but I am not sure why. I can have a look tomorrow. splitting_field.algebra' is the instance giving the algebra structure over A, where K is an A-algebra: maybe it is a loop?

I don't think there can be a diamond with the K-algebra structure, the definition is the same:

instance algebra : algebra K (splitting_field f) :=
ideal.quotient.algebra _

instance algebra' {R : Type*} [comm_semiring R] [algebra R K] : algebra R (splitting_field f) :=
ideal.quotient.algebra _

Indeed

example : splitting_field.algebra f = @splitting_field.algebra' K _ f K _ (algebra.id K) := rfl

works. Maybe there another instance algebra (znmod p) (znmod p)?

jcommelin commented 1 year ago

Thanks :tada:

bors merge

bors[bot] commented 1 year ago

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.