Module docstring
{"# Results relating bases and cardinality. "}
{"# Results relating bases and cardinality. "}
finite_of_span_finite_eq_top_finsupp
theorem
[Nontrivial M] {ι : Type*} {s : Set (ι →₀ M)} (hs : s.Finite) (hsspan : span R s = ⊤) : Finite ι
lemma finite_of_span_finite_eq_top_finsupp [Nontrivial M] {ι : Type*} {s : Set (ι →₀ M)}
(hs : s.Finite) (hsspan : span R s = ⊤) : Finite ι :=
suffices ⋃ i ∈ s, i.support.toSet = .univ from
.of_finite_univ (this ▸ hs.biUnion fun _ _ ↦ by simp)
have ⟨x, hx⟩ := exists_ne (0 : M)
eq_univ_of_forall fun j ↦ (top_unique (hsspan.ge.trans (span_le_supported_biUnion_support R s)) ▸
mem_top (x := single j x)) ((mem_support_single ..).mpr ⟨rfl, hx⟩)
basis_finite_of_finite_spans
theorem
[Nontrivial R] {s : Set M} (hs : s.Finite) (hsspan : span R s = ⊤) {ι : Type w} (b : Basis ι R M) : Finite ι
/--
Over any nontrivial ring, the existence of a finite spanning set implies that any basis is finite.
-/
lemma basis_finite_of_finite_spans [Nontrivial R] {s : Set M} (hs : s.Finite)
(hsspan : span R s = ⊤) {ι : Type w} (b : Basis ι R M) : Finite ι := by
have := congr(($hsspan).map b.repr)
rw [← span_image, Submodule.map_top, LinearEquivClass.range] at this
exact finite_of_span_finite_eq_top_finsupp (hs.image _) this
union_support_maximal_linearIndependent_eq_range_basis
theorem
{ι : Type w} (b : Basis ι R M) {κ : Type w'} (v : κ → M) (ind : LinearIndependent R v) (m : ind.Maximal) :
⋃ k, ((b.repr (v k)).support : Set ι) = Set.univ
/-- Over any ring `R`, if `b` is a basis for a module `M`,
and `s` is a maximal linearly independent set,
then the union of the supports of `x ∈ s` (when written out in the basis `b`) is all of `b`.
-/
theorem union_support_maximal_linearIndependent_eq_range_basis {ι : Type w} (b : Basis ι R M)
{κ : Type w'} (v : κ → M) (ind : LinearIndependent R v) (m : ind.Maximal) :
⋃ k, ((b.repr (v k)).support : Set ι) = Set.univ := by
-- If that's not the case,
by_contra h
simp only [← Ne.eq_def, ne_univ_iff_exists_not_mem, mem_iUnion, not_exists_not,
Finsupp.mem_support_iff, Finset.mem_coe] at h
-- We have some basis element `b i` which is not in the support of any of the `v k`.
obtain ⟨i, w⟩ := h
have repr_eq_zero (l) : b.repr (linearCombination R v l) i = 0 := by
simp [linearCombination_apply, Finsupp.sum, w]
-- Using this, we'll construct a linearly independent family strictly larger than `v`,
-- by also using this `b i`.
let v' (o : Option κ) : M := o.elim (b i) v
have r : rangerange v ⊆ range v' := by rintro - ⟨k, rfl⟩; exact ⟨some k, rfl⟩
have r' : b i ∉ range v := fun ⟨k, p⟩ ↦ by simpa [w] using congr(b.repr $p i)
have r'' : rangerange v ≠ range v' := (r' <| · ▸ ⟨none, rfl⟩)
-- The key step in the proof is checking that this strictly larger family is linearly independent.
have i' : LinearIndepOn R id (range v') := by
apply LinearIndependent.linearIndepOn_id
rw [linearIndependent_iffₛ]
intro l l' z
simp_rw [linearCombination_option, v', Option.elim'] at z
change _ + linearCombination R v l.some = _ + linearCombination R v l'.some at z
-- We have some equality between linear combinations of `b i` and the `v k`,
-- and want to show the coefficients are equal.
ext (_ | a)
-- We'll first show the coefficient of `b i` is zero,
-- by expressing the `v k` in the basis `b`, and using that the `v k` have no `b i` term.
· simpa [repr_eq_zero] using congr(b.repr $z i)
-- All the other coefficients are also equal, because `v` is linear independent,
-- by comparing the coefficients in the basis `b`.
have l₁ : l.some = l'.some := ind <| b.repr.injective <| ext fun j ↦ by
obtain rfl | ne := eq_or_ne i j
· simp_rw [repr_eq_zero]
classical simpa [single_apply, ne] using congr(b.repr $z j)
exact DFunLike.congr_fun l₁ a
exact r'' (m (range v') i' r)
infinite_basis_le_maximal_linearIndependent'
theorem
{ι : Type w} (b : Basis ι R M) [Infinite ι] {κ : Type w'} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) :
Cardinal.lift.{w'} #ι ≤ Cardinal.lift.{w} #κ
/-- Over any ring `R`, if `b` is an infinite basis for a module `M`,
and `s` is a maximal linearly independent set,
then the cardinality of `b` is bounded by the cardinality of `s`.
-/
theorem infinite_basis_le_maximal_linearIndependent' {ι : Type w} (b : Basis ι R M) [Infinite ι]
{κ : Type w'} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) :
Cardinal.lift.{w'} #ι ≤ Cardinal.lift.{w} #κ := by
let Φ := fun k : κ => (b.repr (v k)).support
have w₁ : #ι ≤ #(Set.range Φ) := by
apply Cardinal.le_range_of_union_finset_eq_top
exact union_support_maximal_linearIndependent_eq_range_basis b v i m
have w₂ : Cardinal.lift.{w'} #(Set.range Φ) ≤ Cardinal.lift.{w} #κ := Cardinal.mk_range_le_lift
exact (Cardinal.lift_le.mpr w₁).trans w₂
infinite_basis_le_maximal_linearIndependent
theorem
{ι : Type w} (b : Basis ι R M) [Infinite ι] {κ : Type w} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) :
#ι ≤ #κ
/-- Over any ring `R`, if `b` is an infinite basis for a module `M`,
and `s` is a maximal linearly independent set,
then the cardinality of `b` is bounded by the cardinality of `s`.
-/
theorem infinite_basis_le_maximal_linearIndependent {ι : Type w} (b : Basis ι R M) [Infinite ι]
{κ : Type w} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) : #ι ≤ #κ :=
Cardinal.lift_le.mp (infinite_basis_le_maximal_linearIndependent' b v i m)