-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - refactor(LinearIndependent): refactor to use LinearIndepOn #21886
Conversation
PR summary e9c9122503Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @apnelson1 ! I think this is quite nice. I really appreciate the work you did here and in the creation of LinearIndepOn
. I'm going to leave it just a bit longer in case anyone else has something to say, but if, after addressing these minor issues below, it's not merged in a few days, I'll come back to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some nice work, I'm happy to redo my split of LinearIndependent.lean
so that this can be merged first in peace. :)
Thanks for the review and the patience! |
Thanks! bors merge |
Currently, if `s` is a set of vectors in a module `W`, the way to state that the vectors in `s` are linearly independent is `LinearIndependent R (Subtype.val : ↥s → W)` (or similar), and if `v : ι -> W` and `s : Set ι` is a set of indices, the way to state that `s` indexes a linearly independent subcollection is `LinearIndependent R (fun x : ↥s ↦ (f x : W))` or similar. #21799 introduced a definition `LinearIndepOn`, which gives an alternative spelling `LinearIndepOn R f s` instead of `LinearIndependent R (fun x : ↥s ↦ (f x : W))` for the indexed version, and (therefore) `LinearIndepOn R id s` for the set version. This PR updates spellings throughout mathlib, changing terms of type `LinearIndependent R (Subtype.val : ↥s → W)` to `LinearIndepOn R id s` and `LinearIndependent R (fun x : ↥s ↦ (f x : W))` to `LinearIndepOn R f s`. The API using the old spellings has been deprecated, and replaced with new one - the diff is designed to be as small as possible subject to deprecating the old spellings. In some cases, where no extra work was needed, we generalized lemmas that previously apply to `LinearIndepOn R id s` to `LinearIndepOn R v s` for arbitrary `v`. But there is room to do this further in other places, some of which have been marked TODO. Most changes happen in `LinearAlgebra/LinearIndependent.lean`, but only about 100 lines have been added to the length, many of which are deprecated alias lines. Nearly all other changes are knock-on effects, where statements, proofs and (in two cases) definitions that use the old spellings are updated. 22 files are affected, but the majority only in the form of slight modifications of proofs to avoid deprecated lemmas. The two files other than `LinearIndependent.lean` with changed definitions are: - `Mathlib/LinearAlgebra/Dimension/Basic.lean` (definition of Module.rank) - `Mathlib/LinearAlgebra/Dimension/RankNullity.lean` (changed structure field of `HasRankNullity`) The files with changed theorem statements are: - `Mathlib/FieldTheory/Fixed.lean` - `Mathlib/LinearAlgebra/Basis/VectorSpace.lean` - `Mathlib/LinearAlgebra/Dimension/Constructions.lean` - `Mathlib/LinearAlgebra/Dimension/Finite.lean` - `Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean` - `Mathlib/LinearAlgebra/Dimension/LinearMap.lean` - `Mathlib/LinearAlgebra/Dimension/Localization.lean` - `Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean` [Zulip discussion](https://leanprover.zulipchat.com/#narrow/channel/144837-PR-reviews/topic/.2321886.20LinearIndepOn.20refactor/near/500527995)
Pull request successfully merged into master. Build succeeded: |
* origin/master: (823 commits) chore(Computability): fix naming of lemmas about Sum.inl, Sum.inr, Sum.casesOn (#22156) feat: `Fintype Ordering` (#22154) chore: more renamings to fit the naming convention (#22148) feat(CategoryTheory): any monomorphism in a Grothendieck abelian category is a transfinite composition of pushouts of monomorphisms in a small family (#22157) chore: rename `{Continuous., continuous_}sum_map` to `sumMap` (#22155) chore: remove initial space followed by `-/` (#22158) chore: make arg in HeightOneSpectrum.valuation explicit (#22139) feat(Data/List): `List.maximum` is monotone (#22091) chore(Combinatorics/SimpleGraph): extract WalkDecomp from Walk (#21981) feat: if a monoid M acts, then so does (s : S) with [SubmonoidClass S M] (#21123) chore: backport changes to `getElem` lemmas (#22146) feat(CategoryTheory): generating monomorphisms in Grothendieck abelian categories (#22150) feat: rename variables to fit doc (#22143) feat(CategoryTheory): IsDetecting.isIso_iff_of_mono (#22135) feat(CategoryTheory): truncations of transfinite compositions (#22149) chore: simplify a proof (#22134) feat(CategoryTheory): monomorphisms are stable under coproducts in Grothendieck abelian categories (#22133) feat(Order): Set.Ici.isSuccLimit_coe (#22103) chore(Analysis/Convex/Normed): split into smaller files (#22015) feat(Algebra/Algebra/Lie): max nilpotent ideal <= radical (#22140) refactor(LinearIndependent): refactor to use LinearIndepOn (#21886) chore: rename some more `Foo.sum_elim` -> `sumElim` (#22130) chore: rename Injective.sum_elim and friends (#22129) chore: fix naming oversight from #22070 (#22128) chore: fix spelling mistakes (#22136) feat(RingTheory/Ideal/Quotient): define transtition map between ring or module quotient by powers of ideal (#21900) fix: initialize_simps_projections print warning when projection data already exists (#20339) chore: rename ContMDiff.sum_{elim,map} (#22131) feat(CategoryTheory): characterization of injective objects in terms of lifting properties (#22104) chore(Lean,Tactic): un-indent some doc-strings (#22118) feat(Algebra/MvPolynomial): add `comp` versions of rename lemmas (#21259) chose: add deprecation (#22124) feat(CategoryTheory/Abelian/GrothendieckCategory): computing colimits in Subobject (#22123) feat(CategoryTheory/Subobject): hasCardinalLT_of_mono (#22122) feat: add `DenseRange.piMap` (#22114) feat(Algebra/Algebra/Lie): define the maximal nilpotent ideal of Lie algebras (#22061) chore(Data/Finset): don't import algebra when defining `Finset.card` (#21866) feat: a function on a discrete space is smooth (#22113) feat: commutative group objects in additive categories (#21521) style(Geometry/Manifold): remove superfluous indentation in doc-strings (#22117) chore: rename PushNeg.lean to Push.lean (#22108) feat: add Is{Open,Closed}Embedding.sum_elim (#22070) feat(RingTheory/Perfectoid): define the untilt map and generalize pretilt (#21563) feature(Topology/Algebra/Module/WeakBilin): Linear map from F into the topological dual of E with the weak topology (#21078) feat(CategoryTheory/Abelian): the exact sequence attached to a pushout square (#22110) chore(ChartedSpace.lean): group constructions together (#22107) feat(CategoryTheory/MorphismProperty): more basic API (#22099) chore(Data/Fintype): split `Fintype/Card.lean` (#21840) chore(SetTheory/Cardinal/Cofinality): make `IsStrongLimit` into a structure (#21971) feat(Combinatorics/SimpleGraph): Add a theorem about cliques in induced subgraphs (#20705) ...
Currently, if
s
is a set of vectors in a moduleW
, the way to state that the vectors ins
are linearly independent isLinearIndependent R (Subtype.val : ↥s → W)
(or similar), and ifv : ι -> W
ands : Set ι
is a set of indices, the way to state thats
indexes a linearly independent subcollection isLinearIndependent R (fun x : ↥s ↦ (f x : W))
or similar.#21799 introduced a definition
LinearIndepOn
, which gives an alternative spellingLinearIndepOn R f s
instead ofLinearIndependent R (fun x : ↥s ↦ (f x : W))
for the indexed version, and (therefore)LinearIndepOn R id s
for the set version.This PR updates spellings throughout mathlib, changing terms of type
LinearIndependent R (Subtype.val : ↥s → W)
toLinearIndepOn R id s
andLinearIndependent R (fun x : ↥s ↦ (f x : W))
toLinearIndepOn R f s
.The API using the old spellings has been deprecated, and replaced with new one - the diff is designed to be as small as possible subject to deprecating the old spellings. In some cases, where no extra work was needed, we generalized lemmas that previously apply to
LinearIndepOn R id s
toLinearIndepOn R v s
for arbitraryv
. But there is room to do this further in other places, some of which have been marked TODO.Most changes happen in
LinearAlgebra/LinearIndependent.lean
, but only about 100 lines have been added to the length, many of which are deprecated alias lines. Nearly all other changes are knock-on effects, where statements, proofs and (in two cases) definitions that use the old spellings are updated. 22 files are affected, but the majority only in the form of slight modifications of proofs to avoid deprecated lemmas.The two files other than
LinearIndependent.lean
with changed definitions are:Mathlib/LinearAlgebra/Dimension/Basic.lean
(definition of Module.rank)Mathlib/LinearAlgebra/Dimension/RankNullity.lean
(changed structure field ofHasRankNullity
)The files with changed theorem statements are:
Mathlib/FieldTheory/Fixed.lean
Mathlib/LinearAlgebra/Basis/VectorSpace.lean
Mathlib/LinearAlgebra/Dimension/Constructions.lean
Mathlib/LinearAlgebra/Dimension/Finite.lean
Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
Mathlib/LinearAlgebra/Dimension/Localization.lean
Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean
Zulip discussion