Skip to content

chore: tidy finite fields file#7442

Closed
ericrbg wants to merge 4 commits intomasterfrom
ericrbg/tidy_finite_fields
Closed

chore: tidy finite fields file#7442
ericrbg wants to merge 4 commits intomasterfrom
ericrbg/tidy_finite_fields

Conversation

@ericrbg
Copy link
Copy Markdown
Contributor

@ericrbg ericrbg commented Sep 29, 2023

As promised on #6500.


I have not even remotely finished this, this is mainly a reminder; if people want to help out feel free!
cc @BoltonBailey, as I was talking about on the thread.

Open in Gitpod

@ericrbg ericrbg added the WIP Work in progress label Sep 29, 2023
@BoltonBailey
Copy link
Copy Markdown
Collaborator

BoltonBailey commented Sep 30, 2023

Something I noticed after upgrading the mathlib in my own project after #6500: All the lemmas that turned out to hold for rings and not just fields are actually in the FiniteField namespace. This seems a bit not ideal. Perhaps the namespace should be changed or potentially even these lemmas should be re-homed to a new or different file?

@ericrbg
Copy link
Copy Markdown
Contributor Author

ericrbg commented Oct 3, 2023

Bolton, there's little point, I'm doing the whole file over again basically. I'll push what I have soon

@ericrbg ericrbg force-pushed the ericrbg/tidy_finite_fields branch from 3c803e9 to 07dddc2 Compare October 14, 2023 23:16
· exact ⟨.inr ⟨x, h⟩, rfl⟩

lemma sum_units_nonunits {α β : Type*} [Monoid α] [AddCommMonoid β] [Fintype α] [Fintype αˣ]
[Fintype <| nonunits α] (f : α → β) :
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[lint-style] reported by reviewdog 🐶

Suggested change
[Fintype <| nonunits α] (f : α → β) :
[Fintype <| nonunits α] (f : α → β) :

variable (R) [Nontrivial R]

theorem X_pow_card_sub_X_natDegree_eq (hp : 1 < p) :
(X ^ p - X : R[X]).natDegree = p :=
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[lint-style] reported by reviewdog 🐶

Suggested change
(X ^ p - X : R[X]).natDegree = p :=
(X ^ p - X : R[X]).natDegree = p :=

variable [NoZeroDivisors R]

theorem Fintype.card_le_deg_mul_card_image_polynomial_eval [DecidableEq R] {p : R[X]}
(hp : 0 < p.degree) : Fintype.card R ≤ natDegree p * (univ.image (p.eval ·)).card := by
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[lint-style] reported by reviewdog 🐶

Suggested change
(hp : 0 < p.degree) : Fintype.card R ≤ natDegree p * (univ.image (p.eval ·)).card := by
(hp : 0 < p.degree) : Fintype.card R ≤ natDegree p * (univ.image (p.eval ·)).card := by

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@BoltonBailey
Copy link
Copy Markdown
Collaborator

Just a thought: I saw you were making a new file - I have a few more lemmas to add along the lines of "sums of polynomials over subgroups" with the final goal of the univariate sumcheck lemma. If you are looking for a place to split out what goes in the new file, you could aim for selecting the lemmas which have the bigoperators in them.

variable (p : ℕ) [Fact p.Prime] [Algebra (ZMod p) K]
variable (p : ℕ) [Field K] [Fintype K] [Fact p.Prime] [Algebra (ZMod p) K]

theorem roots_X_pow_card_sub_X : roots (X ^ q - X : K[X]) = Finset.univ.val := by
Copy link
Copy Markdown
Collaborator

@BoltonBailey BoltonBailey Oct 19, 2023

Choose a reason for hiding this comment

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

Perhaps roots_X_pow_card_sub_X can be golfed with Lagrange.nodal_subgroup_eq_X_pow_card_sub_one

@ericrbg
Copy link
Copy Markdown
Contributor Author

ericrbg commented Oct 19, 2023

Interesting, I'll check that out. It's currently a bit stuck as I've been trying to use ID -> Field to make a bunch of lemmas more syntactically general, and run into very many Lean4 issues in this case; the _uniq issue I posted about on zulip is directly related to this.

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 14, 2023
@ericrbg
Copy link
Copy Markdown
Contributor Author

ericrbg commented Feb 8, 2024

It is really impossible to do this because of Lean not wanting me to do stuff with the "non-canonical" instances; they are impossible to make defeq due to classically making up the inv, so we are hard-stuck. This is likely of minimal use; if someone wants to salvage parts of it it's fine - I won't put any more work into it.

@ericrbg ericrbg closed this Feb 8, 2024
@YaelDillies YaelDillies deleted the ericrbg/tidy_finite_fields branch July 31, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants