Skip to content

Conversation

tb65536
Copy link
Collaborator

@tb65536 tb65536 commented Oct 4, 2025

This PR introduces a predicate Polynomial.Factors that generalizes Polynomial.Splits beyond fields. This PR contains the definition of Polynomial.Factors along with most of API for Polynomial.Splits. The end goal is to either redefine Polynomial.Splits in terms of Polynomial.Factors or deprecate Polynomial.Splits entirely.

Zulip discussion: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Generalizing.20.60Polynomial.2ESplits.60.20to.20rings


Open in Gitpod

@tb65536 tb65536 added awaiting-CI This PR doesn't pass CI yet. This label is automatically removed once it does. t-algebra Algebra (groups, rings, fields, etc) labels Oct 4, 2025
Copy link

github-actions bot commented Oct 4, 2025

PR summary 0607ff2a96

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Algebra.Polynomial.Factors (new file) 1246

Declarations diff

+ Factors
+ Factors.C
+ Factors.C_mul
+ Factors.C_mul_X_pow
+ Factors.X
+ Factors.X_add_C
+ Factors.X_pow
+ Factors.X_sub_C
+ Factors.eq_prod_roots
+ Factors.exists_eval_eq_zero
+ Factors.listProd
+ Factors.map
+ Factors.monomial
+ Factors.mul
+ Factors.multisetProd
+ Factors.natDegree_eq_card_roots
+ Factors.natDegree_le_one_of_irreducible
+ Factors.neg
+ Factors.of_degree_eq_one
+ Factors.of_degree_le_one
+ Factors.of_dvd
+ Factors.of_natDegree_eq_one
+ Factors.of_natDegree_le_one
+ Factors.one
+ Factors.pow
+ Factors.prod
+ Factors.roots_ne_zero
+ Factors.splits
+ Factors.zero
+ _root_.Polynomial.not_isUnit_X_add_C
+ factors_X_sub_C_mul_iff
+ factors_iff_exists_multiset
+ factors_iff_exists_multiset'
+ factors_iff_splits
+ factors_mul_iff
+ factors_neg_iff
+ factors_of_natDegree_eq_zero

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@tb65536 tb65536 added the t-ring-theory Ring theory label Oct 4, 2025
@kckennylau
Copy link
Collaborator

The end goal is to either redefine Polynomial.Splits in terms of Polynomial.Factors or deprecate Polynomial.Splits entirely.

(my personal opinion) I think this should be reflected in the docstring of both Polynomial.Splits and Polynomial.Factors.

@kckennylau
Copy link
Collaborator

I think all of these theorems could be tagged @[aesop] so it can do its magic automatically for a given goal like Factors (3 * (X - 1) * (X - 4))...

@tb65536
Copy link
Collaborator Author

tb65536 commented Oct 4, 2025

I think all of these theorems could be tagged @[aesop] so it can do its magic automatically for a given goal like Factors (3 * (X - 1) * (X - 4))...

I've taken a stab at this, but let me know if anything looks off (I'm not so familiar with aesop).

@kckennylau
Copy link
Collaborator

Unfortunately I'm also not very familiar with aesop...

@github-actions github-actions bot removed the awaiting-CI This PR doesn't pass CI yet. This label is automatically removed once it does. label Oct 4, 2025
Copy link
Member

@erdOne erdOne left a comment

Choose a reason for hiding this comment

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

Also it's a personal preference but maybe you would want to move some {f : R[X]} to variable?

@erdOne
Copy link
Member

erdOne commented Oct 20, 2025

I just now realized that you are intentionally mimicking the Splits API. If any of the suggestions above will make your life harder when doing the refactor then feel free to ignore them. But perhaps leave the comment unresolved so that we can come back to this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-algebra Algebra (groups, rings, fields, etc) t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants