-
Notifications
You must be signed in to change notification settings - Fork 974
feat(Algebra/Module/SpanRank): add comparing lemmas for span rank #33359
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
base: master
Are you sure you want to change the base?
Conversation
PR summary e78e242c45Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
✅ PR Title Formatted CorrectlyThe title of this PR has been updated to match our commit style conventions. |
erdOne
left a comment
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.
I would argue that we don't want lemmas that mention linear maps between submodules.
I think what we want is something like
lemma spanRank_map_eq {σ : R →+* S} [RingHomSurjective σ]
(f : M →ₛₗ[σ] N) (hf : Function.Injective f) (p : Submodule R M) :
(p.map f).spanRank = p.spanRank := by
refine (spanRank_map_le f p).antisymm ?_
obtain ⟨s, hs, e⟩ := (p.map f).exists_span_set_card_eq_spanRank
obtain ⟨s, rfl⟩ : ∃ y, f '' y = s := Set.subset_range_iff_exists_image_eq.mp
((subset_span.trans e.le).trans LinearMap.map_le_range)
obtain rfl : span R s = p := by simpa [(map_injective_of_injective hf).eq_iff] using e
grw [← hs, spanRank_span_le_card, Cardinal.mk_image_eq hf]
lemma spanRank_range_le {σ : R →+* S} [RingHomSurjective σ]
(f : M →ₛₗ[σ] N) : (LinearMap.range f).spanRank ≤ (⊤ : Submodule R M).spanRank := by
simpa using spanRank_map_le f ⊤
@[simp]
lemma spanRank_top_eq_spanRank (p : Submodule R M) :
(⊤ : Submodule R p).spanRank = p.spanRank := by
simpa using (spanRank_map_eq _ p.subtype_injective ⊤).symmAnd then for example if you really want spanRank_le_spanRank_of_range_eq you can get it via simpa [*] using spanRank_range_le f, which I argue you can just do inline.
Mathlib/Algebra/Module/SpanRank.lean
Outdated
| lemma spanRank_restrictScalars_eq_spanRank (M₁ : Submodule R M) : | ||
| (M₁.restrictScalars S).spanRank = M₁.spanRank := by | ||
| apply le_antisymm | ||
| · rcases exists_span_set_card_eq_spanRank M₁ with ⟨s, hscard, hsspan⟩ | ||
| rw [FG.spanRank_le_iff_exists_span_set_card_le] | ||
| use s | ||
| constructor | ||
| · rw [hscard] | ||
| · rw [← hsspan, ← span_coe_eq_restrictScalars, | ||
| coe_span_eq_span_of_surjective S R <| RingHom.surjective (algebraMap S R)] | ||
| simp | ||
| · let f : M₁.restrictScalars S →ₛₗ[algebraMap S R] M₁ := { | ||
| AddEquiv.refl M₁ with | ||
| map_smul' := by simp | ||
| } | ||
| apply spanRank_le_spanRank_of_surjective f Function.surjective_id |
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 might be a better approach:
variable {R S : Type*} {M : Type u} [CommSemiring R] [Semiring S] [AddCommMonoid M]
[Algebra R S] [Module R M] [Module S M] [IsScalarTower R S M]
lemma le_spanRank_restrictScalars
(N : Submodule S M) : N.spanRank ≤ (N.restrictScalars R).spanRank := by
obtain ⟨s, hs, e⟩ := (N.restrictScalars R).exists_span_set_card_eq_spanRank
obtain rfl : span S s = N :=
le_antisymm (span_le.mpr (span_le.mp e.le:)) (e.ge.trans (span_le_restrictScalars R S s))
grw [← hs, spanRank_span_le_card]
lemma spanRank_restrictScalars_eq (H : Function.Surjective (algebraMap R S))
(N : Submodule S M) : (N.restrictScalars R).spanRank = N.spanRank := by
refine N.le_spanRank_restrictScalars.antisymm' ?_
obtain ⟨s, hs, rfl⟩ := N.exists_span_set_card_eq_spanRank
grw [restrictScalars_span R S H s, ← hs, spanRank_span_le_card]
If so, I think I'll apply these changes, remove |
Split from PR #33247