Skip to content

[Merged by Bors] - feat(Algebra/QuadraticAlgebra): add the trace - #42207

Closed
xroblot wants to merge 6 commits into
leanprover-community:masterfrom
xroblot:quadratic-algebra-trace
Closed

xroblot wants to merge 6 commits into
leanprover-community:masterfrom
xroblot:quadratic-algebra-trace

Conversation

@xroblot

@xroblot xroblot commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Add QuadraticAlgebra.trace, the trace of a quadratic algebra as an R-linear map.

(Also fixes two typos in docstrings.)


Open in Gitpod

@github-actions

github-actions Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

PR summary 85267946fc

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ algebraMap_trace_eq_add_star
+ sq_eq_trace_smul_sub_norm
+ sq_sub_trace_smul_add_norm_eq_zero
+ star_eq
+ sub_star
+ trace
+ trace_algebraMap
+ trace_def
+ trace_intCast
+ trace_natCast
+ trace_omega
+ trace_one
+ trace_star

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

  • +13 new declarations
  • −0 removed declarations
+QuadraticAlgebra.algebraMap_trace_eq_add_star
+QuadraticAlgebra.sq_eq_trace_smul_sub_norm
+QuadraticAlgebra.sq_sub_trace_smul_add_norm_eq_zero
+QuadraticAlgebra.star_eq
+QuadraticAlgebra.sub_star
+QuadraticAlgebra.trace
+QuadraticAlgebra.trace_algebraMap
+QuadraticAlgebra.trace_def
+QuadraticAlgebra.trace_intCast
+QuadraticAlgebra.trace_natCast
+QuadraticAlgebra.trace_omega
+QuadraticAlgebra.trace_one
+QuadraticAlgebra.trace_star

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 85267946fc
Reference commit 9cebae57f4

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.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 Jul 28, 2026
@tb65536 tb65536 added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 29, 2026
@xroblot xroblot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 30, 2026

@Whysoserioushah Whysoserioushah 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.

I think in general this looks good to me! Thanks!

@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+

simp [trace_def]

@[simp]
theorem trace_star (z : QuadraticAlgebra R a b) : trace (star z) = trace z := by

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.

I am surprised we don't have a typeclass for this, but I don't find it... can you also double check?

@xroblot xroblot Jul 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I could not find it either.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(There a class for functions that commute with star but not for functions that absorb star.)

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

mathlib-bors Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✌️ xroblot can now approve this pull request until 2026-08-14 07:29 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/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.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 Jul 31, 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 Jul 31, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
Add `QuadraticAlgebra.trace`, the trace of a quadratic algebra as an `R`-linear map.

(Also fixes two typos in docstrings.)
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Jul 31, 2026
@mathlib-bors

mathlib-bors Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(Algebra/QuadraticAlgebra): add the trace [Merged by Bors] - feat(Algebra/QuadraticAlgebra): add the trace Jul 31, 2026
@mathlib-bors mathlib-bors Bot closed this Jul 31, 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 Jul 31, 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-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants