Skip to content

feat(RingTheory/QuadraticAlgebra): the minimal polynomial of ω - #46680

Open
xroblot wants to merge 2 commits into
leanprover-community:masterfrom
xroblot:quadratic-algebra-minpoly
Open

xroblot wants to merge 2 commits into
leanprover-community:masterfrom
xroblot:quadratic-algebra-minpoly

Conversation

@xroblot

@xroblot xroblot commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

We prove that the minimal polynomial of ω in QuadraticAlgebra R a b is X ^ 2 - C b * X - C a, for any commutative ring R.

We also clean up the file a bit: the results are grouped into the namespaces QuadraticAlgebra and Algebra, and @[expose] is removed since the file has no definitions.

The mathematics and design are mine. Claude Code was used as a coding assistant and for the housekeeping around this PR. 🤖


@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

PR summary 828a97fdd0

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ aeval_omega_eq_zero
+ discr_quadraticAlgebra
+ eq_zero_of_aeval_omega_eq_zero
+ leftMulMatrix_quadraticAlgebra
+ minpoly_omega
+ norm_quadraticAlgebra_apply
+ polynomial_discr_eq_discr
+ trace_quadraticAlgebra_apply
- Algebra.discr_quadraticAlgebra
- Algebra.leftMulMatrix_quadraticAlgebra
- Algebra.norm_quadraticAlgebra_apply
- Algebra.trace_quadraticAlgebra_apply
- QuadraticAlgebra.polynomial_discr_eq_discr

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 828a97f).

  • +3 new declarations
  • −0 removed declarations
+QuadraticAlgebra.aeval_omega_eq_zero
+QuadraticAlgebra.eq_zero_of_aeval_omega_eq_zero
+QuadraticAlgebra.minpoly_omega

No changes to strong technical debt.

Decrease in weak tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (weak)
5160 -1 exposed public sections

Current commit 828a97fdd0
Reference commit 13152f691c

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).

@artie2000 artie2000 self-assigned this Dec 1, 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 - just some small comments

maintainer merge?

* `QuadraticAlgebra.polynomial_discr_eq_discr`: the discriminant of the polynomial
`X ^ 2 - C b * X - C a` equals `discr a b`.
* `QuadraticAlgebra.minpoly_omega`: the minimal polynomial of `ω` over `R` is

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 is a bit clearer given we don't mention QuadraticAlgebra.omega in the file header.

Suggested change
* `QuadraticAlgebra.minpoly_omega`: the minimal polynomial of `ω` over `R` is
* `QuadraticAlgebra.minpoly_omega`: the minimal polynomial of the root `ω` over `R` is

Also, I notice in the docstring of QuadraticAlgebra, ω is called $$i$$. Possibly something to address?

Comment on lines +62 to +63
obtain ⟨rfl, rfl⟩ : s = 0 ∧ r = 0 := by simpa [QuadraticAlgebra.ext_iff] using hq₁
rw [map_zero, zero_mul, add_zero]

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.

Suggested change
obtain ⟨rfl, rfl⟩ : s = 0 ∧ r = 0 := by simpa [QuadraticAlgebra.ext_iff] using hq₁
rw [map_zero, zero_mul, add_zero]
simp_all [QuadraticAlgebra.ext_iff]

Comment on lines +69 to +70
refine (minpoly.unique' R ω (by monicity!) (aeval_omega_eq_zero a b) fun q hq ↦ ?_).symm
refine or_not_of_imp fun h ↦ eq_zero_of_aeval_omega_eq_zero h ?_

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.

Suggested change
refine (minpoly.unique' R ω (by monicity!) (aeval_omega_eq_zero a b) fun q hq ↦ ?_).symm
refine or_not_of_imp fun h ↦ eq_zero_of_aeval_omega_eq_zero h ?_
refine Eq.symm <| minpoly.unique' R ω (by monicity!) (aeval_omega_eq_zero a b) fun q hq ↦
or_not_of_imp fun h ↦ eq_zero_of_aeval_omega_eq_zero h ?_

if you like 🙂

@github-actions

github-actions Bot commented Dec 3, 2026

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 Dec 3, 2026

This branch has not been deployed

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

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. t-ring-theory Ring theory tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants