Skip to content

[Merged by Bors] - feat(LinearAlgebra): unimodular elements and completion to a basis - #42466

Closed
xroblot wants to merge 9 commits into
leanprover-community:masterfrom
xroblot:unimodular
Closed

xroblot wants to merge 9 commits into
leanprover-community:masterfrom
xroblot:unimodular

Conversation

@xroblot

@xroblot xroblot commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator

Add a new file Mathlib/LinearAlgebra/Unimodular.lean about unimodular elements of a module (those on which some linear functional takes the value 1).

Main results:

  • Module.Basis.span_repr_eq_top_iff: v is unimodular iff its coordinates in a basis generate the unit ideal;
  • Module.Free.exists_basis_apply_zero_eq: a unimodular vector of a rank-two free module completes to a basis;
  • Module.Basis.span_repr_one_eq_top / Module.Free.exists_linearMap_apply_one_eq_one: 1 is unimodular in a nonzero free algebra.

Some of the mathematics and proofs in this file were developed with the help of Claude 🤖.

@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

PR summary 2fdb9d1cd3

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.LinearAlgebra.Unimodular (new file) 1776

Declarations diff (regex)

+ IsUnimodular
+ Module.Basis.span_repr_one_eq_top
+ _root_.Module.Free.isUnimodular_one
+ exists_basis_zero_eq
+ isUnimodular_iff
+ isUnimodular_iff_span_repr_eq_top
+ isUnimodular_of_apply_eq_one
+ span_repr_eq_range_applyₗ

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 2fdb9d1).

  • +9 new declarations
  • −0 removed declarations
+Matrix.toLinearEquiv.congr_simp
+Module.Basis.isUnimodular_iff_span_repr_eq_top
+Module.Basis.span_repr_eq_range_applyₗ
+Module.Basis.span_repr_one_eq_top
+Module.Free.isUnimodular_one
+Module.IsUnimodular
+Module.IsUnimodular.exists_basis_zero_eq
+Module.isUnimodular_iff
+Module.isUnimodular_of_apply_eq_one

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

Current commit 2fdb9d1cd3
Reference commit 205d80eafc

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-algebra Algebra (groups, rings, fields, etc) label Aug 5, 2026
Comment thread Mathlib/LinearAlgebra/Unimodular.lean Resolved
Comment thread Mathlib/LinearAlgebra/Unimodular.lean Resolved
@themathqueen themathqueen added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 5, 2026
@xroblot xroblot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 5, 2026
Comment thread Mathlib/LinearAlgebra/Unimodular.lean Resolved
Comment thread Mathlib/LinearAlgebra/Unimodular.lean Resolved
@jcommelin jcommelin added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 8, 2026
@xroblot xroblot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 8, 2026
Comment thread Mathlib/LinearAlgebra/Unimodular.lean Resolved
Comment thread Mathlib/LinearAlgebra/Unimodular.lean Outdated

/-- In a nonzero algebra that is free as a module, the coordinates of `1` in any basis generate
the unit ideal. Equivalently, `1` is unimodular: see `Module.Free.isUnimodular_one`. -/
theorem span_repr_one_eq_top (e : Basis ι R A) :

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.

Is this the right file? It seems like it belongs in a more elementary file. Maybe the same is true for span_repr_eq_range_applyₗ

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.

About the two lemmas, I moved span_repr_one_eq_top to RingTheory.Flat.FaithfullyFlat.Basic. For span_repr_eq_range_applyₗ, find_home gives 26 files, all unrelated, and there seems to be nothing really adequate so I would keep it here. But, if you have a file in mind, I will move it.

Comment thread Mathlib/LinearAlgebra/Unimodular.lean Resolved
@jcommelin jcommelin added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 8, 2026
@xroblot xroblot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 9, 2026

@jcommelin jcommelin 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 merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Sep 11, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
…42466)

Add a new file `Mathlib/LinearAlgebra/Unimodular.lean` about unimodular elements of a module (those on which some linear functional takes the value `1`).

Main results:

* `Module.Basis.span_repr_eq_top_iff`: `v` is unimodular iff its coordinates in a basis generate the unit ideal;
* `Module.Free.exists_basis_apply_zero_eq`: a unimodular vector of a rank-two free module completes to a basis;
* `Module.Basis.span_repr_one_eq_top` / `Module.Free.exists_linearMap_apply_one_eq_one`: `1` is unimodular in a nonzero free algebra.

Some of the mathematics and proofs in this file were developed with the help of Claude 🤖.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 11, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(LinearAlgebra): unimodular elements and completion to a basis [Merged by Bors] - feat(LinearAlgebra): unimodular elements and completion to a basis Sep 11, 2026
@mathlib-bors mathlib-bors Bot closed this Sep 11, 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.

3 participants