Skip to content

Commit f6d9e1d

Browse files
committed
feat(Algebra/Module/SpanRank): add comparing lemmas for span rank (leanprover-community#33359)
Co-authored-by: Xingyu Zhong <sun123zxy@qq.com>
1 parent 7cecd1f commit f6d9e1d

1 file changed

Lines changed: 53 additions & 6 deletions

File tree

Mathlib/Algebra/Module/SpanRank.lean

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,21 +257,68 @@ end Submodule
257257
section map
258258

259259
universe u
260-
section Submodule
260+
namespace Submodule
261+
262+
section Semilinear
261263

262-
variable {R : Type*} {M N : Type u} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N]
263-
[Module R N] (f : M →ₗ[R] N) (p : Submodule R M)
264+
variable {R S : Type*} {M N : Type u} [Semiring R] [Semiring S] {σ : R →+* S}
265+
[AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module S N]
264266

265-
lemma Submodule.spanRank_map_le : (p.map f).spanRank ≤ p.spanRank := by
267+
lemma spanRank_map_le [RingHomSurjective σ] (f : M →ₛₗ[σ] N)
268+
(p : Submodule R M) : (p.map f).spanRank ≤ p.spanRank := by
266269
rw [← generators_card p, FG.spanRank_le_iff_exists_span_set_card_le]
267270
exact ⟨f '' p.generators, Cardinal.mk_image_le, le_antisymm (span_le.2 (fun n ⟨m, hm, h⟩ ↦
268271
⟨m, span_generators p ▸ subset_span hm, h⟩)) (by simp [span_generators])⟩
269272

270-
variable {p} in
271-
lemma Submodule.spanFinrank_map_le_of_fg (hp : p.FG) : (p.map f).spanFinrank ≤ p.spanFinrank :=
273+
lemma spanFinrank_map_le_of_fg [RingHomSurjective σ] (f : M →ₛₗ[σ] N)
274+
{p : Submodule R M} (hp : p.FG) : (p.map f).spanFinrank ≤ p.spanFinrank :=
272275
(Cardinal.toNat_le_iff_le_of_lt_aleph0 (spanRank_finite_iff_fg.mpr (FG.map f hp))
273276
(spanRank_finite_iff_fg.mpr hp)).2 (p.spanRank_map_le f)
274277

278+
lemma spanRank_map_eq_of_injective [RingHomSurjective σ] (f : M →ₛₗ[σ] N)
279+
(hf : Function.Injective f) (p : Submodule R M) : (p.map f).spanRank = p.spanRank := by
280+
refine (spanRank_map_le f p).antisymm ?_
281+
obtain ⟨s, hs, e⟩ := (p.map f).exists_span_set_card_eq_spanRank
282+
obtain ⟨s, rfl⟩ : ∃ y, f '' y = s := Set.subset_range_iff_exists_image_eq.mp
283+
((subset_span.trans e.le).trans LinearMap.map_le_range)
284+
obtain rfl : span R s = p := by simpa [(map_injective_of_injective hf).eq_iff] using e
285+
grw [← hs, spanRank_span_le_card, Cardinal.mk_image_eq hf]
286+
287+
lemma spanRank_range_le [RingHomSurjective σ] (f : M →ₛₗ[σ] N) :
288+
(LinearMap.range f).spanRank ≤ (⊤ : Submodule R M).spanRank := by
289+
simpa using spanRank_map_le f ⊤
290+
291+
@[simp]
292+
lemma spanRank_top (p : Submodule R M) : (⊤ : Submodule R p).spanRank = p.spanRank := by
293+
simpa using (spanRank_map_eq_of_injective _ p.subtype_injective ⊤).symm
294+
295+
lemma spanRank_eq_of_equiv
296+
{σ' : S →+* R} [RingHomInvPair σ σ'] [RingHomInvPair σ' σ]
297+
(e : M ≃ₛₗ[σ] N) : (⊤ : Submodule R M).spanRank = (⊤ : Submodule S N).spanRank := by
298+
rw [← spanRank_map_eq_of_injective e.toLinearMap e.injective ⊤, map_top, LinearEquiv.range]
299+
300+
end Semilinear
301+
302+
section RestrictScalars
303+
304+
variable {R S : Type*} {M : Type u} [CommSemiring R] [Semiring S] [AddCommMonoid M]
305+
[Algebra R S] [Module R M] [Module S M] [IsScalarTower R S M]
306+
307+
lemma le_spanRank_restrictScalars (N : Submodule S M) :
308+
N.spanRank ≤ (N.restrictScalars R).spanRank := by
309+
obtain ⟨s, hs, e⟩ := (N.restrictScalars R).exists_span_set_card_eq_spanRank
310+
obtain rfl : span S s = N :=
311+
le_antisymm (span_le.mpr (span_le.mp e.le:)) (e.ge.trans (span_le_restrictScalars R S s))
312+
grw [← hs, spanRank_span_le_card]
313+
314+
lemma spanRank_restrictScalars_eq (H : Function.Surjective (algebraMap R S))
315+
(N : Submodule S M) : (N.restrictScalars R).spanRank = N.spanRank := by
316+
refine N.le_spanRank_restrictScalars.antisymm' ?_
317+
obtain ⟨s, hs, rfl⟩ := N.exists_span_set_card_eq_spanRank
318+
grw [restrictScalars_span R S H s, ← hs, spanRank_span_le_card]
319+
320+
end RestrictScalars
321+
275322
end Submodule
276323

277324
section Ideal

0 commit comments

Comments
 (0)