Skip to content

[Merged by Bors] - feat(Algebra/QuadraticAlgebra): quadratic orders over ℤ and their fraction ring - #42711

Closed
xroblot wants to merge 29 commits into
leanprover-community:masterfrom
xroblot:quadratic-algebra-fraction-ring
Closed

xroblot wants to merge 29 commits into
leanprover-community:masterfrom
xroblot:quadratic-algebra-fraction-ring

Conversation

@xroblot

@xroblot xroblot commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Give QuadraticAlgebra ℤ a b the algebra structure over QuadraticAlgebra ℚ a b coming from the base change along ℤ → ℚ, and prove that QuadraticAlgebra ℚ a b is the localization of QuadraticAlgebra ℤ a b at the nonzero integers, hence its fraction ring.

Also prove that QuadraticAlgebra ℤ a b is a domain exactly when discr a b is not a square.

Prepared with Claude Code 🤖


Open in Gitpod

@github-actions

github-actions Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

PR summary c7718de3d2

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Algebra.QuadraticAlgebra.Int (new file) 1732

Declarations diff (regex)

+ discr_intCast
+ exists_nat_smul_mem
+ im_algebraMap
+ instance :
+ instance : Algebra (QuadraticAlgebra ℤ a b) (QuadraticAlgebra ℚ a b)
+ instance : FaithfulSMul (QuadraticAlgebra ℤ a b) (QuadraticAlgebra ℚ a b)
+ instance : IsFractionRing (QuadraticAlgebra ℤ a b) (QuadraticAlgebra ℚ a b) := by
+ instance : IsScalarTower ℤ (QuadraticAlgebra ℤ a b) (QuadraticAlgebra ℚ a b)
+ instance [Fact (¬ IsSquare (discr a b))] : IsDomain (QuadraticAlgebra ℤ a b)
+ isDomain_iff
+ isDomain_iff_isField
+ norm_algebraMap_eq
+ re_algebraMap
+ trace_algebraMap_eq

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

  • +14 new declarations
  • −0 removed declarations
+IsFractionRing.isDomain_iff_isField
+QuadraticAlgebra.Int.exists_nat_smul_mem
+QuadraticAlgebra.Int.im_algebraMap
+QuadraticAlgebra.Int.instAlgebraIntRatCast
+QuadraticAlgebra.Int.instFaithfulSMulIntRatCast
+QuadraticAlgebra.Int.instIsDomainIntOfFactNotIsSquareDiscr
+QuadraticAlgebra.Int.instIsFractionRingIntRatCast
+QuadraticAlgebra.Int.instIsLocalizationIntAlgebraMapSubmonoidNonZeroDivisorsRatCast
+QuadraticAlgebra.Int.instIsScalarTowerIntRatCast
+QuadraticAlgebra.Int.isDomain_iff
+QuadraticAlgebra.Int.norm_algebraMap_eq
+QuadraticAlgebra.Int.re_algebraMap
+QuadraticAlgebra.Int.trace_algebraMap_eq
+QuadraticAlgebra.discr_intCast

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

Current commit c7718de3d2
Reference commit 300d0e5357

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 Aug 13, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Aug 13, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Aug 13, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Aug 13, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

@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 Aug 14, 2026
…tic-algebra-fraction-ring

# Conflicts:
#	Mathlib.lean
#	Mathlib/Algebra/QuadraticAlgebra/Discr.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 Aug 15, 2026
xroblot added a commit to xroblot/mathlib4 that referenced this pull request Aug 16, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Aug 17, 2026
@xroblot xroblot added the WIP Work in progress label Aug 17, 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 Aug 17, 2026
…nto quadratic-algebra-fraction-ring

# Conflicts:
#	Mathlib.lean
#	Mathlib/Algebra/QuadraticAlgebra/Basic.lean
#	Mathlib/Algebra/QuadraticAlgebra/Discr.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 Sep 3, 2026
@xroblot xroblot removed the WIP Work in progress label Sep 3, 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 Sep 15, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

…-fraction-ring

# Conflicts:
#	Mathlib.lean
#	Mathlib/Algebra/QuadraticAlgebra/Discriminant.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 Sep 23, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Oct 2, 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 Oct 2, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

…-fraction-ring

# Conflicts:
#	Mathlib/Algebra/QuadraticAlgebra/Basic.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 Oct 3, 2026
@xroblot
xroblot requested a review from riccardobrasca October 6, 2026 15:47

@riccardobrasca riccardobrasca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

bors d+

@mathlib-bors mathlib-bors Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Oct 10, 2026
@mathlib-bors

mathlib-bors Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

✌️ xroblot can now approve this pull request until 2026-10-24 11:01 UTC (in 2 weeks). To approve and merge, reply with bors r+. More detailed instructions are available here.

⚠️ This delegation only covers changes within Archive/**, Counterexamples/**, docs/**, DownstreamTest/**, Mathlib/**, MathlibTest/**, Wanted/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.lean, Wanted.lean; an author commit touching anything else will revoke it. Bors also revokes it if a later push changes too many files for it to check the full list — even if it stays within scope.

@xroblot

xroblot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

bors r+

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Oct 10, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Oct 10, 2026
…ction ring (#42711)

Give `QuadraticAlgebra ℤ a b` the algebra structure over `QuadraticAlgebra ℚ a b` coming from the base change along `ℤ → ℚ`, and prove that `QuadraticAlgebra ℚ a b` is the localization of `QuadraticAlgebra ℤ a b` at the nonzero integers, hence its fraction ring.

Also prove that `QuadraticAlgebra ℤ a b` is a domain exactly when `discr a b` is not a square.

Prepared with Claude Code 🤖
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Oct 10, 2026
@mathlib-bors

mathlib-bors Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Algebra/QuadraticAlgebra): quadratic orders over ℤ and their fraction ring [Merged by Bors] - feat(Algebra/QuadraticAlgebra): quadratic orders over ℤ and their fraction ring Oct 10, 2026
@mathlib-bors mathlib-bors Bot closed this Oct 10, 2026
@mathlib-bors mathlib-bors Bot removed the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Oct 10, 2026
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.

2 participants