Skip to content

feat(Algebra/Polynomial): lemmas about polynomial degree#37956

Open
artie2000 wants to merge 3 commits intoleanprover-community:masterfrom
artie2000:poly-degree
Open

feat(Algebra/Polynomial): lemmas about polynomial degree#37956
artie2000 wants to merge 3 commits intoleanprover-community:masterfrom
artie2000:poly-degree

Conversation

@artie2000
Copy link
Copy Markdown
Collaborator

  • Add various small lemmas about polynomial degree

Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 12, 2026

PR summary 6b3e5a3312

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ degree_eq_iff_natDegree_eq_of_atLeastTwo
+ degree_eq_one_iff_natDegree_eq_one
+ degree_sub_lt_right
+ natDegree_add_one
+ natDegree_le_of_dvd
+ natDegree_normalize
+ natDegree_one_add

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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).

@github-actions github-actions bot added the t-algebra Algebra (groups, rings, fields, etc) label Apr 12, 2026
mt natDegree_eq_of_degree_eq_some

theorem degree_eq_one_iff_natDegree_eq_one :
p.degree = 1 ↔ p.natDegree = 1 :=
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this should be the other way around? I find degree to be better behaved than natDegree. Maybe worth getting a second opinion.

p.degree = 1 ↔ p.natDegree = 1 :=
degree_eq_iff_natDegree_eq_of_pos (Nat.zero_lt_one)

theorem degree_eq_iff_natDegree_eq_of_atLeastTwo {n : ℕ} [Nat.AtLeastTwo n] :
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should either take an n ≠ 0 argument, or if you really want to use typeclasses for whatever reason, this should take NeZero n.

(degree_neg (erase (natDegree q) q) ▸ degree_add_le _ _)
_ < degree p := max_lt_iff.2 ⟨hd' ▸ degree_erase_lt hp0, hd.symm ▸ degree_erase_lt hq0⟩

theorem degree_sub_lt_right (hd : degree p = degree q) (hq0 : q ≠ 0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps the other theorem should be renamed degree_sub_lt_left.

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants