Skip to content

feat(Analysis/InnerProductSpace): generalized determinant of a rectangle matrix / linear map#37295

Open
wwylele wants to merge 4 commits intoleanprover-community:masterfrom
wwylele:norm-det
Open

feat(Analysis/InnerProductSpace): generalized determinant of a rectangle matrix / linear map#37295
wwylele wants to merge 4 commits intoleanprover-community:masterfrom
wwylele:norm-det

Conversation

@wwylele
Copy link
Copy Markdown
Collaborator

@wwylele wwylele commented Mar 28, 2026

This is the volume factor of a linear map


I have encountered the expression sqrt(det(T' * T)) a few times in various places but it doesn't look like it has a standard name and entry in mathlib, so this adds it.

Zulip thread #Is there code for X? > (norm of) "determinant" of map between inner product spaces

One motivation to define this is to state volume formula under transformations. From Measure theory and fine properties of functions:

  • Lemma 3.1: for linear map $L : \mathbb{R}^n \to \mathbb{R}^m$, we have $\mathcal{H}^n(L(A)) = [ L ] \mathcal{L}^n(A)$. This is proved in this PR at euclideanHausdorffMeasure_image_eq_normDet_mul_volume
  • Theorem 3.8, for (not necessarily linear) $f : \mathbb{R}^n \to \mathbb{R}^m$ ($n \le m$) and $\mathcal{L}^n$-measurable set $A \subset \mathbb{R}^n$, we have $\int_A J f dx = \int_{\mathbb{R}^m} \mathcal{H}^0(A \cap f^{-1}{y}) d\mathcal{H}^n(y)$, where $J f$ is the normDet of the rectangular Jacobian matrix

AI usage disclosure: AI was used in the following parts

  • searching for related literature for an appropriate name
  • generate draft proofs for some lemma to verify their correctness, though the final code has been completely rewritten by me.

Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 28, 2026

PR summary 09037d340e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.InnerProductSpace.NormDet (new file) 2664

Declarations diff

+ _root_.ContinuousLinearMap.normDet_sq
+ _root_.LinearIsometry.normDet_eq_one
+ euclideanHausdorffMeasure_image
+ euclideanHausdorffMeasure_image_eq_normDet_mul_volume
+ hausdorffMeasure_image
+ normDet
+ normDet_codRestrict
+ normDet_comp
+ normDet_comp_of_finrank_eq
+ normDet_eq_abs_det
+ normDet_eq_norm_det
+ normDet_eq_norm_det_toMatrix
+ normDet_eq_norm_det_toMatrix_rangeRestrict
+ normDet_eq_prod_singularValues
+ normDet_eq_zero_iff_ker_ne_bot
+ normDet_eq_zero_iff_rank_range_ne
+ normDet_id
+ normDet_neg
+ normDet_nonneg
+ normDet_of_subsingleton
+ normDet_smul
+ normDet_sq
+ normDet_sq_eq_det_gram
+ normDet_subtype
+ normDet_zero

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

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

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


No changes to technical debt.

You can run this locally as

./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-analysis Analysis (normed *, calculus) label Mar 28, 2026
@wwylele wwylele requested a review from Copilot March 28, 2026 00:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new mathlib API entry for the commonly used “rectangular determinant” quantity sqrt(det(Tᴴ * T)), implemented for linear maps between inner product spaces as LinearMap.normDet.

Changes:

  • Introduce LinearMap.normDet : (U →ₗ[𝕜] V) → ℝ (via a determinant of the range-restriction matrix in orthonormal bases).
  • Prove core properties: basis-independence, vanishing criterion via kernel, compatibility with LinearMap.det for endomorphisms, and the “square equals det(adjoint ∘ f)” lemma (for ContinuousLinearMap and LinearMap).
  • Add literature references and wire the new file into the main Mathlib import tree.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
docs/references.bib Adds bibliography entries cited by the new module docstring.
Mathlib/Analysis/InnerProductSpace/NormDet.lean New definition LinearMap.normDet plus lemmas relating it to determinants of adjoint ∘ f.
Mathlib.lean Imports the new NormDet module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Mathlib/Analysis/InnerProductSpace/NormDet.lean Outdated
Comment thread Mathlib/Analysis/InnerProductSpace/NormDet.lean Outdated
Comment thread Mathlib/Analysis/InnerProductSpace/NormDet.lean Outdated
Comment thread Mathlib/Analysis/InnerProductSpace/NormDet.lean
Comment thread Mathlib/Analysis/InnerProductSpace/NormDet.lean
@wwylele wwylele force-pushed the norm-det branch 2 times, most recently from 04fda4a to 9d12748 Compare March 28, 2026 02:15
@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Mar 28, 2026
@wwylele wwylele force-pushed the norm-det branch 5 times, most recently from 0cea0c9 to 81ce2de Compare March 28, 2026 15:26
@wwylele wwylele force-pushed the norm-det branch 2 times, most recently from f1b20e4 to ad68026 Compare March 31, 2026 22:44
@wwylele
Copy link
Copy Markdown
Collaborator Author

wwylele commented Mar 31, 2026

Added another result LinearMap.normDet_eq_prod_singularValues : f.normDet = ∏ i ∈ Finset.range (finrank 𝕜 U), f.singularValues i.

I collected these relations with adjoint / gram matrix / singular values hopefully to show the importance of this definition, but this also makes the file pretty long. If reviewers are convinced and then suggest breaking this into multiple pieces, I am happy to do so

@mathlib-triage mathlib-triage bot assigned j-loreaux and unassigned ADedecker Apr 9, 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 Apr 11, 2026
@wwylele wwylele force-pushed the norm-det branch 2 times, most recently from 25b1043 to f88e999 Compare April 13, 2026 01:16
mathlib-bors bot pushed a commit that referenced this pull request Apr 14, 2026
…rs are independent (#37918)

Small lemma extracted from #37295. Convenient for talking about the determinant directly without detour through Pos(Semi)def
@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 Apr 14, 2026
@mathlib-dependent-issues
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux left a comment

Choose a reason for hiding this comment

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

I'll try to come back to this soon. I need to mull it over.

Comment on lines +92 to +97
have h1 : bu.toBasis.toMatrix (stdOrthonormalBasis 𝕜 U).toBasis *
(stdOrthonormalBasis 𝕜 U).toBasis.toMatrix bu.toBasis = 1 :=
Basis.toMatrix_mul_toMatrix_flip _ _
have h2 : (stdOrthonormalBasis 𝕜 U).toBasis.toMatrix bu.toBasis *
bu.toBasis.toMatrix (stdOrthonormalBasis 𝕜 U).toBasis = 1 :=
Basis.toMatrix_mul_toMatrix_flip _ _
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems to be a missing lemma that this matrix is unitary.

Copy link
Copy Markdown
Collaborator Author

@wwylele wwylele Apr 14, 2026

Choose a reason for hiding this comment

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

The difficulty here is that these matrices are "not" square matrices: the number of the rows and columns are equal, but they are of different index types. Because of this, the statement of them being unitary is not well-typed.

Comment thread Mathlib/Analysis/InnerProductSpace/NormDet.lean Outdated
@github-actions github-actions bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants