Skip to content
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

[Merged by Bors] - chore(field_theory/minimal_polynomial): generalize irreducible #5006

Closed
wants to merge 13 commits into from

Conversation

riccardobrasca
Copy link
Member

I have removed the assumption that the base ring is a field for a minimal polynomial to be irreducible.

The proof is simple but long, it should be possible to use wlog to shorten it, but I do not understand how to do it...

@riccardobrasca riccardobrasca added the awaiting-review The author would like community review of the PR label Nov 15, 2020
@awainverse
Copy link
Collaborator

I think this can be golfed down with rcases and other tricks, but I think it's worth considering whether the approach currently taken with fields. Is it actually possible (over an integral domain at least) to have an integral element whose minimal (monic) polynomial is not the minimal-degree polynomial with that element as a root?

@riccardobrasca
Copy link
Member Author

riccardobrasca commented Nov 15, 2020

If R is not integrally closed, take any a ∈ K (K is the fraction field) that is integral over R and not in R. Then it satisfies some monic polynomial with coefficients in R, by definition, and it is a root of X - a : polynomial K.

More concretely, if you take R = ℤ[√5] = {a + b√5 s.t a b ∈ ℤ}, then a = (1 + √5)/2 is a root of X ^ 2 - X - 1, so is integral over R, but of course its minimal polynomial over K is just X - a.

I do not know the minimal assumption to have that minimal polynomials are primes (UFD? integrally closed?), but some results in the file definitely do not work over any domain.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@Vierkantor Vierkantor changed the title chore(src/data/field_theory/minimal_polynomial): generalize irreducible chore(field_theory/minimal_polynomial): generalize irreducible Nov 15, 2020
@Vierkantor Vierkantor self-requested a review November 15, 2020 15:58
@Vierkantor
Copy link
Collaborator

Thanks, this is very useful and the code looks clean! I would like to help with de-duplicating the proof when I have some time, so I have self-requested a review to remind me (you are welcome to go ahead without me of course!).

@riccardobrasca
Copy link
Member Author

The proof is very linear, it is just what I would write on paper, except that I wouldn't do it for both factors. The annoying part is that by definition the minimal polynomial has minimal degree among the monic polynomials that have x has root, and the two factors are not necessarily monic. Maybe a preliminary lemma saying that the minimal polynomial has minimal degree among the polynomials with invertible leading coefficients could short the proof a bit, but not that much I believe.

Copy link
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These would be my suggestions to generalize and deduplicate the code.

src/field_theory/minimal_polynomial.lean Outdated Show resolved Hide resolved
src/field_theory/minimal_polynomial.lean Outdated Show resolved Hide resolved
src/field_theory/minimal_polynomial.lean Outdated Show resolved Hide resolved
@riccardobrasca
Copy link
Member Author

I can also add that for GCD domains the minimal polynomial over the ring is the same as the minimal polynomial over the fraction field. It should be just a few lines.

@Vierkantor
Copy link
Collaborator

If it's not too much work for you, I would appreciate it. Otherwise I'm happy with merging it after someone else has looked at my additions. Thanks for your work!

@riccardobrasca
Copy link
Member Author

I have added gcd_domain_eq_field_fractions.

The statement is almost as long as the proof, but if I do not put @is_integral_of_is_scalar_tower α f.codomain γ _ _ _ _ _ _ _ x hx Lean is not happy, I think he tries to use β instead of f.codomain somehow (of course β = f.codomain, but there is no algebra structure of β). Also, I am not completely sure this is the best way of saying γ is a β-algebra, where β is the fraction field of α and in particular γ is a α-algebra.

@riccardobrasca
Copy link
Member Author

I have no idea why CI fails on a file that I didn't touch... I modified irreducible, but in the minimal_polynomial namespace, so it shouldn't have any impact on the irreducible where CI failed.

@riccardobrasca
Copy link
Member Author

It seems that in src/number_theory/sum_two_squares.lean Lean is trying to use irreducible_iff_prime instead of principal_ideal_ring.irreducible_iff_prime (if I open the file in my branch with VS and I click to go to definition it open nat.irreducible_iff_prime, if I do the same in a fresh mathlib folder it opens principal_ideal_ring.irreducible_iff_prime).

Copy link
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small changes and it looks good to me. Thanks 🎉

bors d+

src/number_theory/sum_two_squares.lean Outdated Show resolved Hide resolved
@@ -448,7 +448,8 @@ begin
(minimal_polynomial.dvd _ _),
{ rw ← is_scalar_tower.algebra_map_eq, exact H2 },
{ rw [← is_scalar_tower.aeval_apply, minimal_polynomial.aeval H1] } },
obtain ⟨y, hy⟩ := polynomial.exists_root_of_splits _ H6 (minimal_polynomial.degree_ne_zero H5),
obtain ⟨y, hy⟩ := polynomial.exists_root_of_splits _ H6
(ne_of_lt (minimal_polynomial.degree_pos H5)).symm,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(ne_of_lt (minimal_polynomial.degree_pos H5)).symm,
(ne_of_lt (minimal_polynomial.degree_pos H5)).symm,

src/field_theory/minimal_polynomial.lean Outdated Show resolved Hide resolved
@bors
Copy link

bors bot commented Nov 19, 2020

✌️ riccardobrasca can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

riccardobrasca and others added 2 commits November 19, 2020 11:41
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@riccardobrasca
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Nov 19, 2020
I have removed the assumption that the base ring is a field for a minimal polynomial to be irreducible.

The proof is simple but long, it should be possible to use `wlog` to shorten it, but I do not understand how to do it...
@bors
Copy link

bors bot commented Nov 19, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(field_theory/minimal_polynomial): generalize irreducible [Merged by Bors] - chore(field_theory/minimal_polynomial): generalize irreducible Nov 19, 2020
@bors bors bot closed this Nov 19, 2020
@bors bors bot deleted the min_poly branch November 19, 2020 15:34
@YaelDillies YaelDillies removed the awaiting-review The author would like community review of the PR label Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants