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

feat(field_theory/finite): cardinality of images of polynomials #1554

Merged
merged 5 commits into from
Oct 16, 2019

Conversation

ChrisHughes24
Copy link
Member

@ChrisHughes24 ChrisHughes24 commented Oct 15, 2019

One lemma about the cardinality of images of polynomials of roots of polynomials, and another about existence of roots of polynomials of a particular form over finite fields of odd cardinality.

These lemmas were used in a proof of the four squares theorem (every natural number is the sum of four squares, on Freek's list). They're difficult lemmas for the library, because they're not really textbook theorems, or theorems you might expect to find, but they still might be useful.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • reviewed and applied the documentation requirements
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

src/field_theory/finite.lean Show resolved Hide resolved
... = _ : by rw [sum_const, add_monoid.smul_eq_mul', nat.cast_id]

/-- If `f` and `g` are quadratic polynomials, then the `f.eval a + g.eval b = 0` has a solution. -/
lemma exists_root_sum_quadratic {f g : polynomial α} (hf2 : degree f = 2)
Copy link
Member

Choose a reason for hiding this comment

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

This seems closely related to the very useful https://en.wikipedia.org/wiki/Chevalley%E2%80%93Warning_theorem but I don't think it's a consequence. I certainly think that the lemma you formalised is useful outside of your direct application.
Would it make sense to have a version that uses the characteristic of alpha instead of its cardinality mod 2?


open finset polynomial

/-- The cardinality of a field is at most n times the cardinality of the image of a degree n
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/-- The cardinality of a field is at most n times the cardinality of the image of a degree n
/-- The cardinality of a finite integral domain is at most n times the cardinality of the image of a degree n

rcases hd with ⟨x, ⟨a, _, ha⟩, ⟨b, _, hb⟩⟩,
use [a, b],
rw [ha, ← hb, eval_neg, neg_add_self]
end
Copy link
Member

Choose a reason for hiding this comment

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

This proof is long. But if you think you can't really split of useful sublemmas then I'm fine with merging this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly I don't think there are any useful sublemmas. I shortened the proof a little.

@jcommelin jcommelin added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Oct 16, 2019
@mergify mergify bot merged commit ad8387c into master Oct 16, 2019
@mergify mergify bot deleted the finite_poly branch October 16, 2019 17:06
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…prover-community#1554)

* feat(field_theory/finite): cardinality of images of polynomials

* docstrings

* Johan's suggestions

* slightly shorten proof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants