Skip to content

feat(InnerProductSpace/PiL2): det of a linear isometry has unit norm#39192

Open
jayscambler wants to merge 4 commits into
leanprover-community:masterfrom
greyhaven-ai:feat/linearIsometryEquiv-abs-det
Open

feat(InnerProductSpace/PiL2): det of a linear isometry has unit norm#39192
jayscambler wants to merge 4 commits into
leanprover-community:masterfrom
greyhaven-ai:feat/linearIsometryEquiv-abs-det

Conversation

@jayscambler
Copy link
Copy Markdown

@jayscambler jayscambler commented May 11, 2026

Adds LinearIsometryEquiv.norm_det and the real corollary LinearIsometryEquiv.abs_det. The proof uses the unitary matrix of a linear isometry in orthonormal bases, via LinearIsometryEquiv.toMatrix_mem_unitaryGroup and Matrix.det_of_mem_unitary. The supporting matrix lemma is moved from Adjoint.lean to PiL2.lean, where it no longer depends on adjoints.

For a linear isometry equivalence `R : E ≃ₗᵢ[𝕜] E` of a
finite-dimensional inner-product space, the determinant of the
underlying linear map has unit norm.

This is the natural endomorphism counterpart to
`OrthonormalBasis.det_to_matrix_orthonormalBasis : ‖a.toBasis.det b‖ = 1`
(already in mathlib). The proof routes through that lemma by
expressing `R` as the change-of-basis matrix between `b` and `b.map R`
in any orthonormal basis.

New lemmas:

- `LinearIsometryEquiv.norm_det` (`@[simp]`): the RCLike-generic form.
- `LinearIsometryEquiv.abs_det` (`@[simp]`): the real-specific corollary
  via `Real.norm_eq_abs`.

Use case: combined with `Measure.addHaar_preimage_continuousLinearEquiv`,
this gives `volume (R⁻¹' T) = volume T` for any set `T` (no measurability
needed) on `EuclideanSpace ℝ (Fin n)`.
@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label May 11, 2026
@github-actions
Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

PR summary f40a8e8c6e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ abs_det
+ norm_det

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.


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

@github-actions github-actions Bot added the t-analysis Analysis (normed *, calculus) label May 11, 2026
Copy link
Copy Markdown
Collaborator

@wwylele wwylele left a comment

Choose a reason for hiding this comment

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

According to the guideline, could you disclose your usage of AI, if any?

The PR description is suspiciously verbose and it looks like AI-written, which would be prohibited by the guideline. Or perhaps you unfortunately copied the format from other AI-generated PR. In any case, could you make it concise?

Comment on lines +1082 to +1083
theorem norm_det (R : E ≃ₗᵢ[𝕜] E) :
‖LinearMap.det (R : E →ₗ[𝕜] E)‖ = 1 := by
Copy link
Copy Markdown
Collaborator

@wwylele wwylele May 11, 2026

Choose a reason for hiding this comment

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

Here is a shorter proof

theorem norm_det (R : E ≃ₗᵢ[𝕜] E) : ‖R.toLinearMap.det‖ = 1 := by
  rw [← R.toLinearMap.det_toMatrix (stdOrthonormalBasis 𝕜 E).toBasis]
  apply CStarRing.norm_of_mem_unitary
  exact Matrix.det_of_mem_unitary <| R.toMatrix_mem_unitaryGroup _ _ 

Comment on lines +1105 to +1106
have h : ‖LinearMap.det (R : F' →ₗ[ℝ] F')‖ = 1 := norm_det (𝕜 := ℝ) (E := F') R
rwa [Real.norm_eq_abs] at 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.

does this work?

Suggested change
have h : ‖LinearMap.det (R : F' →ₗ[ℝ] F')‖ = 1 := norm_det (𝕜 := ℝ) (E := F') R
rwa [Real.norm_eq_abs] at h
simpa using R.norm_det

@jayscambler jayscambler force-pushed the feat/linearIsometryEquiv-abs-det branch from ad19edb to 263f08b Compare May 11, 2026 17:04
@jayscambler
Copy link
Copy Markdown
Author

Thanks. To disclose: an initial proof and the original PR draft were produced in collaboration with Claude Opus 4.7 (Anthropic) while testing Grey Haven's autocontext tool on a longer-running Lean formalization (Putnam 2013 A5). I read every line, ran lake build against master locally before submitting, and am opening this PR myself. Given the experimental nature of the workflow, I'd particularly welcome review feedback on any aspect of the proof or naming.

On the shorter proof: going to try the refactor (moving LinearIsometryEquiv.toMatrix_mem_unitaryGroup so it's available from PiL2.lean) and will report back. Also rewriting the PR description more concisely.

Move `LinearIsometryEquiv.toMatrix_mem_unitaryGroup` from `Adjoint.lean`
up to `PiL2.lean` so it is in scope where `norm_det` is stated. The new
proof in `PiL2.lean` does not go through `adjoint`; instead it reduces
to `OrthonormalBasis.toMatrix_orthonormalBasis_mem_unitary` via
`b.map f`. With the lemma available, `norm_det` becomes the three-line
form @wwylele suggested.
@jayscambler

This comment was marked as low quality.

The previous refactor commit deleted the final theorem in the file but
left a trailing blank line, which the `end-of-file-fixer` pre-commit
hook flagged in CI.
Use `simpa only [Real.norm_eq_abs] using R.norm_det` instead of the
two-line have/rwa version. Suggested by reviewer.
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented May 11, 2026

Moderation note: per mathlib's contribution guidelines, LLM-written comments on github are not allowed. Your comment looks very LLM-generated. Please write comments by hand in the future.

Consider this as official warning.

@grunweg grunweg added the LLM-generated PRs with substantial input from LLMs - review accordingly label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM-generated PRs with substantial input from LLMs - review accordingly new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants