Skip to content

[Merged by Bors] - feat(RingTheory/Polynomial/Cyclotomic/Eval): when is ζ - 1 a unit - #45220

Closed
xroblot wants to merge 11 commits into
leanprover-community:masterfrom
xroblot:cyclotomic-isunit-sub-one
Closed

xroblot wants to merge 11 commits into
leanprover-community:masterfrom
xroblot:cyclotomic-isunit-sub-one

Conversation

@xroblot

@xroblot xroblot commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

For a primitive n-th root of unity ζ in a domain, ζ - 1 is a unit precisely when the n-th cyclotomic polynomial takes a unit value at 1. Consequently ζ - 1 is a unit when n > 1 is not a prime power, and, when algebraMap ℤ R is a local homomorphism (e.g. for rings of integers), only then. We also add eval_one_cyclotomic_of_not_isPrimePow, stated with IsPrimePow, and deprecate eval_one_cyclotomic_not_prime_pow in its favour. The hypothesis of IsPrimitiveRoot.norm_toInteger_sub_one_eq_one is restated with IsPrimePow.

🤖 Claude extracted this PR from my SKW project.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

PR summary 63a20d81f3

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.RingTheory.Polynomial.Cyclotomic.Eval 2843 2844 +1 (+0.04%)
Mathlib.NumberTheory.NumberField.Cyclotomic.Basic 3599 3600 +1 (+0.03%)
Import changes for all files
Files Import difference
31 files Mathlib.Analysis.Fourier.ZMod Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar Mathlib.NumberTheory.AddCharacter.Trace Mathlib.NumberTheory.Cyclotomic.Discriminant Mathlib.NumberTheory.Cyclotomic.Gal Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots Mathlib.NumberTheory.DirichletCharacter.GaussSum Mathlib.NumberTheory.Fermat Mathlib.NumberTheory.GaussSum Mathlib.NumberTheory.JacobiSum.Basic Mathlib.NumberTheory.LSeries.DirichletContinuation Mathlib.NumberTheory.LSeries.Nonvanishing Mathlib.NumberTheory.LSeries.PrimesInAP Mathlib.NumberTheory.LSeries.WeakPNT Mathlib.NumberTheory.LSeries.ZMod Mathlib.NumberTheory.LSeries.ZetaZeros Mathlib.NumberTheory.LegendreSymbol.AddCharacter Mathlib.NumberTheory.LegendreSymbol.Complex Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity Mathlib.NumberTheory.LucasLehmer Mathlib.NumberTheory.NumberField.CMField Mathlib.NumberTheory.NumberField.Cyclotomic.Basic Mathlib.NumberTheory.NumberField.Cyclotomic.Embeddings Mathlib.NumberTheory.NumberField.Cyclotomic.Three Mathlib.NumberTheory.PrimesCongruentOne Mathlib.RingTheory.LittleWedderburn Mathlib.RingTheory.Polynomial.Cyclotomic.Eval Mathlib.Tactic.NormNum.LegendreSymbol Mathlib.Tactic
1

Declarations diff (regex)

+ eval_one_cyclotomic_of_not_isPrimePow
+ isUnit_natCast_iff_eq_one
+ isUnit_sub_one_iff
+ isUnit_sub_one_iff_isUnit_eval_one_cyclotomic
+ isUnit_sub_one_iff_of_prime_pow
+ isUnit_sub_one_of_not_isPrimePow

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

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

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 63a20d8).

  • +6 new declarations
  • −0 removed declarations
+IsPrimitiveRoot.isUnit_sub_one_iff
+IsPrimitiveRoot.isUnit_sub_one_iff_isUnit_eval_one_cyclotomic
+IsPrimitiveRoot.isUnit_sub_one_iff_of_prime_pow
+IsPrimitiveRoot.isUnit_sub_one_of_not_isPrimePow
+Polynomial.eval_one_cyclotomic_of_not_isPrimePow
+isUnit_natCast_iff_eq_one

No changes to strong technical debt.
No changes to weak technical debt.

Current commit 63a20d81f3
Reference commit f1070cd4d9

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py 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-ring-theory Ring theory label Oct 23, 2026
@xroblot xroblot added the WIP Work in progress label Oct 23, 2026
@xroblot xroblot removed the WIP Work in progress label Oct 26, 2026
@tb65536 tb65536 added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Oct 27, 2026
@xroblot xroblot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Oct 27, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot 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 21, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

…-sub-one

# Conflicts:
#	Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 21, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot 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 24, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

…-sub-one

# Conflicts:
#	Mathlib/RingTheory/RootsOfUnity/CyclotomicUnits.lean
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 27, 2026
@artie2000 artie2000 self-assigned this Nov 28, 2026

@artie2000 artie2000 left a comment •

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.

some local comments
I hope they are not too nitpicky!
will look globally later

@artie2000 artie2000 added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 28, 2026
@xroblot xroblot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 28, 2026

@artie2000 artie2000 left a comment

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.

Thanks!

maintainer delegate

Comment thread Mathlib/Algebra/Algebra/Basic.lean Resolved
@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by artie2000.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 28, 2026
@riccardobrasca

Copy link
Copy Markdown
Member

Thanks!

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Nov 29, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 29, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Nov 29, 2026
…45220)

For a primitive `n`-th root of unity `ζ` in a domain, `ζ - 1` is a unit precisely when the `n`-th cyclotomic polynomial takes a unit value at `1`. Consequently `ζ - 1` is a unit when `n > 1` is not a prime power, and, when `algebraMap ℤ R` is a local homomorphism (e.g. for rings of integers), only then. We also add `eval_one_cyclotomic_of_not_isPrimePow`, stated with `IsPrimePow`, and deprecate `eval_one_cyclotomic_not_prime_pow` in its favour. The hypothesis of `IsPrimitiveRoot.norm_toInteger_sub_one_eq_one` is restated with `IsPrimePow`.

:robot: Claude extracted this PR from my [SKW project](https://github.com/xroblot/SKW).
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Nov 29, 2026
@mathlib-bors

mathlib-bors Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(RingTheory/Polynomial/Cyclotomic/Eval): when is ζ - 1 a unit [Merged by Bors] - feat(RingTheory/Polynomial/Cyclotomic/Eval): when is ζ - 1 a unit Nov 29, 2026
@mathlib-bors mathlib-bors Bot closed this Nov 29, 2026
TJHeeringa pushed a commit to TJHeeringa/mathlib4 that referenced this pull request Dec 2, 2026
…eanprover-community#45220)

For a primitive `n`-th root of unity `ζ` in a domain, `ζ - 1` is a unit precisely when the `n`-th cyclotomic polynomial takes a unit value at `1`. Consequently `ζ - 1` is a unit when `n > 1` is not a prime power, and, when `algebraMap ℤ R` is a local homomorphism (e.g. for rings of integers), only then. We also add `eval_one_cyclotomic_of_not_isPrimePow`, stated with `IsPrimePow`, and deprecate `eval_one_cyclotomic_not_prime_pow` in its favour. The hypothesis of `IsPrimitiveRoot.norm_toInteger_sub_one_eq_one` is restated with `IsPrimePow`.

:robot: Claude extracted this PR from my [SKW project](https://github.com/xroblot/SKW).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors. t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants