Skip to content

Commit dbcdd9f

Browse files
artie2000plp127
andcommitted
feat(Mathlib/LinearAlgebra): embeddings of free modules (#37919)
* A free module embeds linearly into any module of strictly greater rank * A free module embeds linearly into another free module iff the other one has greater rank The proofs have been generalised as much as possible. Co-authored-by: Aaron Liu <aaronliu2008@outlook.com>
1 parent 9519868 commit dbcdd9f

File tree

4 files changed

+84
-8
lines changed

4 files changed

+84
-8
lines changed

Mathlib/LinearAlgebra/Basis/Basic.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ protected lemma linearIndepOn (s : Set ι) : LinearIndepOn R b s :=
9393
protected theorem ne_zero [Nontrivial R] (i) : b i ≠ 0 :=
9494
b.linearIndependent.ne_zero i
9595

96+
theorem injective_constr_of_linearIndependent
97+
[Semiring R₂] [Module R₂ M'] [SMulCommClass R R₂ M'] {v : ι → M'}
98+
(hv : LinearIndependent R v) : Injective (b.constr R₂ v) :=
99+
fun _ _ hab ↦ b.repr.injective <| hv.finsuppLinearCombination_injective <| by
100+
simpa [constr_def] using hab
101+
96102
end Properties
97103

98104
variable {v : ι → M} {x y : M}

Mathlib/LinearAlgebra/Dimension/Basic.lean

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,23 @@ end LinearIndependent
108108

109109
namespace Module
110110

111-
variable [Semiring R] [AddCommMonoid M] [Module R M] [Nontrivial R]
111+
variable [Semiring R] [AddCommMonoid M] [Module R M]
112+
113+
theorem exists_set_linearIndependent_of_lt_lift_rank {c : Cardinal.{w}}
114+
(h : Cardinal.lift.{v} c < Cardinal.lift.{w} (Module.rank R M)) :
115+
∃ s : Set M, Cardinal.lift.{w} #s = Cardinal.lift.{v} c ∧ LinearIndepOn R id s := by
116+
rcases Cardinal.lt_lift_iff.mp h with ⟨c', hc', hcc'⟩
117+
rcases exists_lt_of_lt_ciSup (by simpa [← hcc', Module.rank_def] using h) with ⟨⟨s, hs⟩, h⟩
118+
rcases Cardinal.le_mk_iff_exists_subset.mp h.le with ⟨t, hst, ht⟩
119+
exact ⟨t, by simp [ht, hcc'], hs.mono hst⟩
120+
121+
theorem exists_set_linearIndependent_of_lt_rank {c : Cardinal.{v}} (h : c < Module.rank R M) :
122+
∃ s : Set M, #s = c ∧ LinearIndepOn R id s := by
123+
simpa using exists_set_linearIndependent_of_lt_lift_rank (Cardinal.lift_lt.mpr h)
124+
125+
variable [Nontrivial R]
112126

127+
-- TODO: the forward directions of the next few theorems don't need [Nontrivial R]
113128
/-- Note: if the rank of a module is infinite, it may not contain a linear independent subset
114129
with cardinality equal to the rank, see
115130
https://mathoverflow.net/questions/263020/maximum-cardinal-of-a-set-of-linearly-independent-vectors-in-a-module. -/

Mathlib/LinearAlgebra/Dimension/Finite.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,6 @@ theorem setFinite [Module.Finite R M] {b : Set M}
187187

188188
end LinearIndependent
189189

190-
lemma exists_set_linearIndependent_of_lt_rank {n : Cardinal} (hn : n < Module.rank R M) :
191-
∃ s : Set M, #s = n ∧ LinearIndepOn R id s := by
192-
obtain ⟨⟨s, hs⟩, hs'⟩ := exists_lt_of_lt_ciSup' (hn.trans_eq (Module.rank_def R M))
193-
obtain ⟨t, ht, ht'⟩ := le_mk_iff_exists_subset.mp hs'.le
194-
exact ⟨t, ht', hs.mono ht⟩
195-
196190
lemma exists_finset_linearIndependent_of_le_rank {n : ℕ} (hn : n ≤ Module.rank R M) :
197191
∃ s : Finset M, s.card = n ∧ LinearIndepOn R id (s : Set M) := by
198192
rcases hn.eq_or_lt with h | h
@@ -206,6 +200,9 @@ lemma exists_finset_linearIndependent_of_le_rank {n : ℕ} (hn : n ≤ Module.ra
206200
cases nonempty_fintype s
207201
exact ⟨s.toFinset, by simpa using hs, by simpa⟩
208202

203+
@[deprecated (since := "2026-04-13")]
204+
alias exists_set_linearIndependent_of_lt_rank := Module.exists_set_linearIndependent_of_lt_rank
205+
209206
lemma exists_linearIndependent_of_le_rank {n : ℕ} (hn : n ≤ Module.rank R M) :
210207
∃ f : Fin n → M, LinearIndependent R f :=
211208
have ⟨_, hs, hs'⟩ := exists_finset_linearIndependent_of_le_rank hn

Mathlib/LinearAlgebra/Dimension/Free.lean

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,52 @@ theorem Module.finrank_mul_finrank : finrank F K * finrank K A = finrank F A :=
7070
end Tower
7171

7272
variable {R : Type u} {S : Type*} {M M₁ : Type v} {M' : Type v'}
73-
variable [Semiring R] [StrongRankCondition R]
73+
variable [Semiring R]
7474
variable [AddCommMonoid M] [Module R M] [Module.Free R M]
7575
variable [AddCommMonoid M'] [Module R M'] [Module.Free R M']
7676
variable [AddCommMonoid M₁] [Module R M₁] [Module.Free R M₁]
7777

7878
namespace Module.Free
7979

80+
variable {N : Type v} [AddCommMonoid N] [Module R N]
81+
variable {N' : Type v'} [AddCommMonoid N'] [Module R N']
82+
83+
theorem exists_linearMap_injective_of_linearIndependent_of_lift_rank_le
84+
{ι : Type w} {v : ι → N'} (hv : LinearIndependent R v)
85+
(cnd : Cardinal.lift.{w} (Module.rank R M) ≤ Cardinal.lift.{v} #ι) :
86+
∃ f : M →ₗ[R] N', Function.Injective f := by
87+
nontriviality M
88+
have := Module.nontrivial R M
89+
rcases Module.Free.exists_set R M with ⟨_, ⟨B⟩⟩
90+
replace cnd := (Cardinal.lift_le.2 B.linearIndependent.cardinal_le_rank).trans cnd
91+
rw [Cardinal.lift_mk_le'] at cnd
92+
rcases cnd with ⟨i, hi⟩
93+
refine ⟨B.constr ℕ (v ∘ i), B.injective_constr_of_linearIndependent (hv.comp _ hi)⟩
94+
95+
theorem exists_linearMap_injective_of_linearIndependent_of_rank_le
96+
{ι : Type v} {v : ι → N} (hv : LinearIndependent R v) (cnd : Module.rank R M ≤ #ι) :
97+
∃ f : M →ₗ[R] N, Function.Injective f :=
98+
exists_linearMap_injective_of_linearIndependent_of_lift_rank_le hv (by simpa using cnd)
99+
100+
theorem exists_linearMap_injective_of_lift_rank_lt
101+
(cnd : Cardinal.lift.{v'} (Module.rank R M) < Cardinal.lift.{v} (Module.rank R N')) :
102+
∃ f : M →ₗ[R] N', Function.Injective f := by
103+
rcases exists_set_linearIndependent_of_lt_lift_rank cnd with ⟨s, hs, hs₂⟩
104+
exact exists_linearMap_injective_of_linearIndependent_of_lift_rank_le
105+
hs₂.linearIndependent hs.symm.le
106+
107+
theorem exists_linearMap_injective_of_rank_lt (cnd : Module.rank R M < Module.rank R N) :
108+
∃ f : M →ₗ[R] N, Function.Injective f :=
109+
exists_linearMap_injective_of_lift_rank_lt (by simpa using cnd)
110+
111+
end Module.Free
112+
113+
section StrongRankCondition
114+
115+
variable [StrongRankCondition R]
116+
117+
namespace Module.Free
118+
80119
variable (R M)
81120

82121
/-- The rank of a free module `M` over `R` is the cardinality of `ChooseBasisIndex R M`. -/
@@ -105,6 +144,23 @@ open Module.Free
105144

106145
open Cardinal
107146

147+
theorem lift_rank_le_iff_exists_linearMap :
148+
Cardinal.lift.{v'} (Module.rank R M) ≤ Cardinal.lift.{v} (Module.rank R M') ↔
149+
∃ f : M →ₗ[R] M', Function.Injective f where
150+
mp h := by
151+
rcases Module.Free.exists_set R M' with ⟨_, ⟨B⟩⟩
152+
exact exists_linearMap_injective_of_linearIndependent_of_lift_rank_le B.linearIndependent
153+
(B.mk_eq_rank''.symm ▸ h)
154+
mpr := fun ⟨f, hf⟩ ↦ LinearMap.lift_rank_le_of_injective f hf
155+
156+
theorem rank_le_iff_exists_linearMap :
157+
Module.rank R M ≤ Module.rank R M₁ ↔ ∃ f : M →ₗ[R] M₁, Function.Injective f := by
158+
simp [← lift_rank_le_iff_exists_linearMap]
159+
160+
theorem finrank_le_iff_exists_linearMap [Module.Finite R M] [Module.Finite R M'] :
161+
finrank R M ≤ finrank R M' ↔ ∃ f : M →ₗ[R] M', Function.Injective f := by
162+
simp [← lift_rank_le_iff_exists_linearMap, ← finrank_eq_rank]
163+
108164
/-- Two vector spaces are isomorphic if they have the same dimension. -/
109165
theorem nonempty_linearEquiv_of_lift_rank_eq
110166
(cnd : Cardinal.lift.{v'} (Module.rank R M) = Cardinal.lift.{v} (Module.rank R M')) :
@@ -306,6 +362,8 @@ noncomputable def _root_.LinearEquiv.smul_id_of_finrank_eq_one (d1 : Module.finr
306362

307363
end Module
308364

365+
end StrongRankCondition
366+
309367
namespace Algebra
310368

311369
instance (R S : Type*) [CommSemiring R] [StrongRankCondition R] [Semiring S] [Algebra R S]

0 commit comments

Comments
 (0)