Skip to content

[Merged by Bors] - refactor(QuadraticForm/Complex): generalize to algebraically closed field#34158

Closed
wwylele wants to merge 7 commits intoleanprover-community:masterfrom
wwylele:quadform-alg-closed
Closed

[Merged by Bors] - refactor(QuadraticForm/Complex): generalize to algebraically closed field#34158
wwylele wants to merge 7 commits intoleanprover-community:masterfrom
wwylele:quadform-alg-closed

Conversation

@wwylele
Copy link
Copy Markdown
Collaborator

@wwylele wwylele commented Jan 20, 2026

A free generalization since the only place the property of C is used is to get a square root. This can still be further generalized to quadratically closed field, but we don't have that definition yet.

Also did small clean up and removed a erw.


Open in Gitpod

@github-actions github-actions Bot added large-import Automatically added label for PRs with a significant increase in transitive imports t-algebra Algebra (groups, rings, fields, etc) labels Jan 20, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 20, 2026

PR summary 57d8fb21eb

Import changes exceeding 2%

% File
+32.43% Mathlib.LinearAlgebra.QuadraticForm.Complex

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.LinearAlgebra.QuadraticForm.Complex 1949 2581 +632 (+32.43%)
Import changes for all files
Files Import difference
Mathlib.LinearAlgebra.QuadraticForm.Complex 632
Mathlib.LinearAlgebra.QuadraticForm.AlgClosed (new file) 1706

Declarations diff

+ equivalent_of_isAlgClosed
+ equivalent_weightedSumSquares_of_isAlgClosed
+ isometryEquivWeightedSumSquaresWeightedSumSquares
+ weightedSumSquaresCongr

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

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

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


Decrease in tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type
629 -1 erw

Current commit 5cc6bee749
Reference commit 57d8fb21eb

You can run this locally as

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

/-- The isometry between a weighted sum of squares on an algebraically closed field and the
sum of squares, i.e. `weightedSumSquares` with weights 1 or 0. -/
noncomputable def isometryEquivSumSquares [DecidableEq K] (w' : ι → K) :
IsometryEquiv (weightedSumSquares K w')
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 think you should generalize this to "weightedSumSquares w equiv weightedSumSquares w'" if w/w' is a square of a unit.

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.

Thanks for the suggestion! I have implemented this as isometryEquivWeightedSumSquares₂. Do you know if we already have the bundled version of the LinearEquiv part of this def? I have found LinearEquiv.smulOfUnit and DistribMulAction.toLinearEquiv but I couldn't make them type check

@wwylele wwylele force-pushed the quadform-alg-closed branch from 739ec12 to 223d502 Compare January 22, 2026 04:30
…ield

A free generalization since the only place the property of C is used is
to get a square root. This can still be further generalized to
quadratically closed field, but we don't have that definition yet.

Also did small clean up and removed a erw.
@wwylele wwylele force-pushed the quadform-alg-closed branch from 223d502 to 9a584f4 Compare January 22, 2026 05:06
Comment thread Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean Outdated
Comment thread Mathlib/LinearAlgebra/QuadraticForm/AlgClosed.lean Outdated
@ocfnash
Copy link
Copy Markdown
Contributor

ocfnash commented Feb 6, 2026

Unassigning myself as I am travelling without laptop for the next 9 days.

Comment thread Mathlib/LinearAlgebra/QuadraticForm/AlgClosed.lean Outdated
Comment thread Mathlib/LinearAlgebra/QuadraticForm/AlgClosed.lean Outdated
Comment thread Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean Outdated
Comment thread Mathlib/LinearAlgebra/QuadraticForm/AlgClosed.lean Outdated
@chrisflav chrisflav added the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 16, 2026
Comment thread Mathlib/LinearAlgebra/QuadraticForm/AlgClosed.lean Outdated
@wwylele wwylele removed the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 19, 2026
Comment thread Mathlib/LinearAlgebra/QuadraticForm/AlgClosed.lean Outdated
Comment thread Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean Outdated
Comment thread Mathlib/LinearAlgebra/QuadraticForm/IsometryEquiv.lean Outdated
@chrisflav chrisflav added the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 19, 2026
wwylele and others added 3 commits February 19, 2026 10:08
Co-authored-by: Christian Merten <christian@merten.dev>
Co-authored-by: Christian Merten <christian@merten.dev>
Co-authored-by: Christian Merten <christian@merten.dev>
@wwylele wwylele removed the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 19, 2026
@wwylele wwylele requested a review from chrisflav February 20, 2026 19:11
Copy link
Copy Markdown
Member

@chrisflav chrisflav left a comment

Choose a reason for hiding this comment

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

Thanks!
maintainer merge

@github-actions
Copy link
Copy Markdown

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

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Feb 20, 2026
@riccardobrasca
Copy link
Copy Markdown
Member

Thanks!

bors merge

@mathlib-triage mathlib-triage Bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Feb 21, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Feb 21, 2026
…ield (#34158)

A free generalization since the only place the property of C is used is to get a square root. This can still be further generalized to quadratically closed field, but we don't have that definition yet.

Also did small clean up and removed a erw.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented Feb 21, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title refactor(QuadraticForm/Complex): generalize to algebraically closed field [Merged by Bors] - refactor(QuadraticForm/Complex): generalize to algebraically closed field Feb 21, 2026
@mathlib-bors mathlib-bors Bot closed this Feb 21, 2026
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
…ield (leanprover-community#34158)

A free generalization since the only place the property of C is used is to get a square root. This can still be further generalized to quadratically closed field, but we don't have that definition yet.

Also did small clean up and removed a erw.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-import Automatically added label for PRs with a significant increase in transitive imports 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.

6 participants