doc-next-gen

Mathlib.LinearAlgebra.Dimension.Finite

Module docstring

{"# Conditions for rank to be finite

Also contains characterization for when rank equals zero or rank equals one.

"}

linearIndependent_bounded_of_finset_linearIndependent_bounded theorem
{n : ℕ} (H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) : ∀ s : Set M, LinearIndependent R ((↑) : s → M) → #s ≤ n
Full source
/-- If every finite set of linearly independent vectors has cardinality at most `n`,
then the same is true for arbitrary sets of linearly independent vectors.
-/
theorem linearIndependent_bounded_of_finset_linearIndependent_bounded {n : }
    (H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) :
    ∀ s : Set M, LinearIndependent R ((↑) : s → M) → #s ≤ n := by
  intro s li
  apply Cardinal.card_le_of
  intro t
  rw [← Finset.card_map (Embedding.subtype s)]
  apply H
  apply linearIndependent_finset_map_embedding_subtype _ li
Finite Linear Independence Implies General Linear Independence Bound
Informal description
Let $R$ be a ring and $M$ an $R$-module. If for every finite subset $s \subseteq M$ of linearly independent vectors the cardinality of $s$ is bounded by $n \in \mathbb{N}$, then any (possibly infinite) set of linearly independent vectors in $M$ has cardinality at most $n$.
rank_le theorem
{n : ℕ} (H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) : Module.rank R M ≤ n
Full source
theorem rank_le {n : }
    (H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) :
    Module.rank R M ≤ n := by
  rw [Module.rank_def]
  apply ciSup_le'
  rintro ⟨s, li⟩
  exact linearIndependent_bounded_of_finset_linearIndependent_bounded H _ li
Bound on Module Rank via Finite Linear Independence
Informal description
Let $R$ be a ring and $M$ an $R$-module. If for every finite subset $s \subseteq M$ of linearly independent vectors the cardinality of $s$ is bounded by $n \in \mathbb{N}$, then the rank of $M$ satisfies $\text{rank}_R M \leq n$.
rank_eq_zero_iff theorem
: Module.rank R M = 0 ↔ ∀ x : M, ∃ a : R, a ≠ 0 ∧ a • x = 0
Full source
/-- See `rank_zero_iff` for a stronger version with `NoZeroSMulDivisor R M`. -/
lemma rank_eq_zero_iff :
    Module.rankModule.rank R M = 0 ↔ ∀ x : M, ∃ a : R, a ≠ 0 ∧ a • x = 0 := by
  nontriviality R
  constructor
  · contrapose!
    rintro ⟨x, hx⟩
    rw [← Cardinal.one_le_iff_ne_zero]
    have : LinearIndependent R (fun _ : Unit ↦ x) :=
      linearIndependent_iff.mpr (fun l hl ↦ Finsupp.unique_ext <| not_not.mp fun H ↦
        hx _ H ((Finsupp.linearCombination_unique _ _ _).symm.trans hl))
    simpa using this.cardinal_lift_le_rank
  · intro h
    rw [← le_zero_iff, Module.rank_def]
    apply ciSup_le'
    intro ⟨s, hs⟩
    rw [nonpos_iff_eq_zero, Cardinal.mk_eq_zero_iff, ← not_nonempty_iff]
    rintro ⟨i : s⟩
    obtain ⟨a, ha, ha'⟩ := h i
    apply ha
    simpa using DFunLike.congr_fun (linearIndependent_iff.mp hs (Finsupp.single i a) (by simpa)) i
Characterization of Zero Rank: $\text{rank}_R M = 0 \leftrightarrow \forall x \in M, \exists a \in R \setminus \{0\}, a \cdot x = 0$
Informal description
The rank of a module $M$ over a ring $R$ is zero if and only if for every element $x \in M$, there exists a nonzero element $a \in R$ such that $a \cdot x = 0$.
rank_pos_of_free theorem
[Module.Free R M] [Nontrivial M] : 0 < Module.rank R M
Full source
theorem rank_pos_of_free [Module.Free R M] [Nontrivial M] :
    0 < Module.rank R M :=
  have := Module.nontrivial R M
  (pos_of_ne_zero <| Cardinal.mk_ne_zero _).trans_le
    (Free.chooseBasis R M).linearIndependent.cardinal_le_rank
Positivity of Rank for Nontrivial Free Modules
Informal description
If $M$ is a nontrivial free module over a ring $R$, then the rank of $M$ is strictly positive, i.e., $0 < \text{rank}_R M$.
rank_zero_iff_forall_zero theorem
: Module.rank R M = 0 ↔ ∀ x : M, x = 0
Full source
theorem rank_zero_iff_forall_zero :
    Module.rankModule.rank R M = 0 ↔ ∀ x : M, x = 0 := by
  simp_rw [rank_eq_zero_iff, smul_eq_zero, and_or_left, not_and_self_iff, false_or,
    exists_and_right, and_iff_right (exists_ne (0 : R))]
Rank Zero Characterization: $\text{rank}_R M = 0 \leftrightarrow M = \{0\}$
Informal description
The rank of a module $M$ over a ring $R$ is zero if and only if every element of $M$ is zero, i.e., $\text{rank}_R M = 0 \leftrightarrow \forall x \in M, x = 0$.
rank_zero_iff theorem
: Module.rank R M = 0 ↔ Subsingleton M
Full source
/-- See `rank_subsingleton` for the reason that `Nontrivial R` is needed.
Also see `rank_eq_zero_iff` for the version without `NoZeroSMulDivisor R M`. -/
theorem rank_zero_iff : Module.rankModule.rank R M = 0 ↔ Subsingleton M :=
  rank_zero_iff_forall_zero.trans (subsingleton_iff_forall_eq 0).symm
Rank Zero Characterization: $\text{rank}_R M = 0 \leftrightarrow M$ is a subsingleton
Informal description
The rank of a module $M$ over a ring $R$ is zero if and only if $M$ is a subsingleton (i.e., all elements of $M$ are equal).
rank_pos_iff_exists_ne_zero theorem
: 0 < Module.rank R M ↔ ∃ x : M, x ≠ 0
Full source
theorem rank_pos_iff_exists_ne_zero : 0 < Module.rank R M ↔ ∃ x : M, x ≠ 0 := by
  rw [← not_iff_not]
  simpa using rank_zero_iff_forall_zero
Positive Rank Characterization: $0 < \text{rank}_R M \leftrightarrow M \neq \{0\}$
Informal description
The rank of a module $M$ over a ring $R$ is positive if and only if there exists a nonzero element in $M$, i.e., $0 < \text{rank}_R M \leftrightarrow \exists x \in M, x \neq 0$.
rank_pos theorem
[Nontrivial M] : 0 < Module.rank R M
Full source
theorem rank_pos [Nontrivial M] : 0 < Module.rank R M :=
  rank_pos_iff_nontrivial.mpr ‹_›
Positive Rank for Nontrivial Modules
Informal description
If a module $M$ over a ring $R$ is nontrivial, then its rank is positive, i.e., $0 < \text{rank}_R M$.
rank_subsingleton' theorem
[Subsingleton M] : Module.rank R M = 0
Full source
/-- See `rank_subsingleton` that assumes `Subsingleton R` instead. -/
@[nontriviality]
theorem rank_subsingleton' [Subsingleton M] : Module.rank R M = 0 :=
  rank_eq_zero_iff.mpr fun _ ↦ ⟨1, one_ne_zero, Subsingleton.elim _ _⟩
Zero Rank for Subsingleton Modules
Informal description
If a module $M$ over a ring $R$ is a subsingleton (i.e., has at most one element), then its rank is zero, i.e., $\text{rank}_R M = 0$.
rank_punit theorem
: Module.rank R PUnit = 0
Full source
@[simp]
theorem rank_punit : Module.rank R PUnit = 0 := rank_subsingleton' _ _
Zero Rank of the Trivial Module `PUnit`
Informal description
The rank of the trivial module `PUnit` over any ring $R$ is zero, i.e., $\text{rank}_R \text{PUnit} = 0$.
rank_bot theorem
: Module.rank R (⊥ : Submodule R M) = 0
Full source
@[simp]
theorem rank_bot : Module.rank R ( : Submodule R M) = 0 := rank_subsingleton' _ _
Zero Rank of Trivial Submodule
Informal description
The rank of the trivial submodule $\bot$ of a module $M$ over a ring $R$ is zero, i.e., $\text{rank}_R (\bot) = 0$.
exists_mem_ne_zero_of_rank_pos theorem
{s : Submodule R M} (h : 0 < Module.rank R s) : ∃ b : M, b ∈ s ∧ b ≠ 0
Full source
theorem exists_mem_ne_zero_of_rank_pos {s : Submodule R M} (h : 0 < Module.rank R s) :
    ∃ b : M, b ∈ s ∧ b ≠ 0 :=
  exists_mem_ne_zero_of_ne_bot fun eq => by rw [eq, rank_bot] at h; exact lt_irrefl _ h
Existence of Nonzero Element in Submodule with Positive Rank
Informal description
For any submodule $s$ of a module $M$ over a ring $R$, if the rank of $s$ is positive, then there exists a nonzero element $b \in M$ such that $b \in s$.
Module.finite_of_rank_eq_nat theorem
[Module.Free R M] {n : ℕ} (h : Module.rank R M = n) : Module.Finite R M
Full source
theorem Module.finite_of_rank_eq_nat [Module.Free R M] {n : } (h : Module.rank R M = n) :
    Module.Finite R M := by
  nontriviality R
  obtain ⟨⟨ι, b⟩⟩ := Module.Free.exists_basis (R := R) (M := M)
  have := mk_lt_aleph0_iff.mp <|
    b.linearIndependent.cardinal_le_rank |>.trans_eq h |>.trans_lt <| nat_lt_aleph0 n
  exact Module.Finite.of_basis b
Finite Module Characterization for Finite Rank
Informal description
Let $M$ be a free module over a ring $R$. If the rank of $M$ over $R$ is equal to a natural number $n$, then $M$ is a finite module over $R$.
Module.finite_of_rank_eq_zero theorem
[NoZeroSMulDivisors R M] (h : Module.rank R M = 0) : Module.Finite R M
Full source
theorem Module.finite_of_rank_eq_zero [NoZeroSMulDivisors R M]
    (h : Module.rank R M = 0) :
    Module.Finite R M := by
  nontriviality R
  rw [rank_zero_iff] at h
  infer_instance
Finite Module Characterization for Rank Zero
Informal description
Let $M$ be a module over a ring $R$ with no zero smul divisors. If the rank of $M$ over $R$ is zero, then $M$ is a finite module over $R$.
Basis.nonempty_fintype_index_of_rank_lt_aleph0 theorem
{ι : Type*} (b : Basis ι R M) (h : Module.rank R M < ℵ₀) : Nonempty (Fintype ι)
Full source
/-- If a module has a finite dimension, all bases are indexed by a finite type. -/
theorem Basis.nonempty_fintype_index_of_rank_lt_aleph0 {ι : Type*} (b : Basis ι R M)
    (h : Module.rank R M < ℵ₀) : Nonempty (Fintype ι) := by
  rwa [← Cardinal.lift_lt, ← b.mk_eq_rank, Cardinal.lift_aleph0, Cardinal.lift_lt_aleph0,
    Cardinal.lt_aleph0_iff_fintype] at h
Existence of Finite Type Structure for Basis Index Set in Finite-Rank Modules
Informal description
Let $M$ be a module over a ring $R$ with a basis indexed by a set $\iota$. If the rank of $M$ over $R$ is finite (i.e., $\text{rank}_R(M) < \aleph_0$), then there exists a finite type structure on $\iota$.
Basis.fintypeIndexOfRankLtAleph0 definition
{ι : Type*} (b : Basis ι R M) (h : Module.rank R M < ℵ₀) : Fintype ι
Full source
/-- If a module has a finite dimension, all bases are indexed by a finite type. -/
noncomputable def Basis.fintypeIndexOfRankLtAleph0 {ι : Type*} (b : Basis ι R M)
    (h : Module.rank R M < ℵ₀) : Fintype ι :=
  Classical.choice (b.nonempty_fintype_index_of_rank_lt_aleph0 h)
Finite basis index set for finite-rank modules
Informal description
Given a module \( M \) over a ring \( R \) with a basis \( b \) indexed by a type \( \iota \), if the rank of \( M \) over \( R \) is finite (i.e., \( \text{rank}_R M < \aleph_0 \)), then there exists a finite type structure on \( \iota \). This means that the index set \( \iota \) can be equipped with a finite type structure, implying that the basis is finite.
Basis.finite_index_of_rank_lt_aleph0 theorem
{ι : Type*} {s : Set ι} (b : Basis s R M) (h : Module.rank R M < ℵ₀) : s.Finite
Full source
/-- If a module has a finite dimension, all bases are indexed by a finite set. -/
theorem Basis.finite_index_of_rank_lt_aleph0 {ι : Type*} {s : Set ι} (b : Basis s R M)
    (h : Module.rank R M < ℵ₀) : s.Finite :=
  finite_def.2 (b.nonempty_fintype_index_of_rank_lt_aleph0 h)
Finiteness of Basis Index Set in Finite-Rank Modules
Informal description
Let $M$ be a module over a ring $R$ with a basis indexed by a subset $s$ of a type $\iota$. If the rank of $M$ over $R$ is finite (i.e., $\text{rank}_R(M) < \aleph_0$), then the indexing subset $s$ is finite.
LinearIndependent.cardinalMk_le_finrank theorem
[Module.Finite R M] {ι : Type w} {b : ι → M} (h : LinearIndependent R b) : #ι ≤ finrank R M
Full source
theorem cardinalMk_le_finrank [Module.Finite R M]
    {ι : Type w} {b : ι → M} (h : LinearIndependent R b) : finrank R M := by
  rw [← lift_le.{max v w}]
  simpa only [← finrank_eq_rank, lift_natCast, lift_le_nat_iff] using h.cardinal_lift_le_rank
Cardinality Bound for Linearly Independent Families in Finite-Dimensional Modules
Informal description
Let $M$ be a finite-dimensional module over a ring $R$, and let $\{b_i\}_{i \in \iota}$ be a linearly independent family of vectors in $M$ indexed by a type $\iota$. Then the cardinality of $\iota$ is less than or equal to the finite rank of $M$ over $R$, i.e., $\#\iota \leq \text{finrank}_R M$.
LinearIndependent.fintype_card_le_finrank theorem
[Module.Finite R M] {ι : Type*} [Fintype ι] {b : ι → M} (h : LinearIndependent R b) : Fintype.card ι ≤ finrank R M
Full source
theorem fintype_card_le_finrank [Module.Finite R M]
    {ι : Type*} [Fintype ι] {b : ι → M} (h : LinearIndependent R b) :
    Fintype.card ι ≤ finrank R M := by
  simpa using h.cardinalMk_le_finrank
Cardinality Bound for Finite Linearly Independent Families in Finite-Dimensional Modules
Informal description
Let $M$ be a finite-dimensional module over a ring $R$, and let $\{b_i\}_{i \in \iota}$ be a linearly independent family of vectors in $M$ indexed by a finite type $\iota$. Then the cardinality of $\iota$ is less than or equal to the finite rank of $M$ over $R$, i.e., $|\iota| \leq \text{finrank}_R M$.
LinearIndependent.finset_card_le_finrank theorem
[Module.Finite R M] {b : Finset M} (h : LinearIndependent R (fun x => x : b → M)) : b.card ≤ finrank R M
Full source
theorem finset_card_le_finrank [Module.Finite R M]
    {b : Finset M} (h : LinearIndependent R (fun x => x : b → M)) :
    b.cardfinrank R M := by
  rw [← Fintype.card_coe]
  exact h.fintype_card_le_finrank
Cardinality Bound for Finite Linearly Independent Sets in Finite-Dimensional Modules
Informal description
Let $M$ be a finite-dimensional module over a ring $R$, and let $b$ be a finite set of vectors in $M$ that is linearly independent over $R$. Then the cardinality of $b$ is less than or equal to the finite rank of $M$ over $R$, i.e., $|b| \leq \text{finrank}_R M$.
LinearIndependent.lt_aleph0_of_finite theorem
{ι : Type w} [Module.Finite R M] {v : ι → M} (h : LinearIndependent R v) : #ι < ℵ₀
Full source
theorem lt_aleph0_of_finite {ι : Type w}
    [Module.Finite R M] {v : ι → M} (h : LinearIndependent R v) :  < ℵ₀ := by
  apply Cardinal.lift_lt.1
  apply lt_of_le_of_lt
  · apply h.cardinal_lift_le_rank
  · rw [← finrank_eq_rank, Cardinal.lift_aleph0, Cardinal.lift_natCast]
    apply Cardinal.nat_lt_aleph0
Finite cardinality of index set for linearly independent families in finite-dimensional modules
Informal description
Let $M$ be a finite-dimensional module over a ring $R$, and let $\{v_i\}_{i \in \iota}$ be a linearly independent family of vectors in $M$ indexed by a type $\iota$. Then the cardinality of $\iota$ is strictly less than $\aleph_0$ (i.e., $\iota$ is finite).
LinearIndependent.finite theorem
[Module.Finite R M] {ι : Type*} {f : ι → M} (h : LinearIndependent R f) : Finite ι
Full source
theorem finite [Module.Finite R M] {ι : Type*} {f : ι → M}
    (h : LinearIndependent R f) : Finite ι :=
  Cardinal.lt_aleph0_iff_finite.1 <| h.lt_aleph0_of_finite
Finiteness of Index Set for Linearly Independent Families in Finite-Dimensional Modules
Informal description
Let $M$ be a finite-dimensional module over a ring $R$, and let $\{f_i\}_{i \in \iota}$ be a linearly independent family of vectors in $M$ indexed by a type $\iota$. Then $\iota$ is finite.
LinearIndependent.setFinite theorem
[Module.Finite R M] {b : Set M} (h : LinearIndependent R fun x : b => (x : M)) : b.Finite
Full source
theorem setFinite [Module.Finite R M] {b : Set M}
    (h : LinearIndependent R fun x : b => (x : M)) : b.Finite :=
  Cardinal.lt_aleph0_iff_set_finite.mp h.lt_aleph0_of_finite
Finiteness of Linearly Independent Subsets in Finite-Dimensional Modules
Informal description
Let $M$ be a finite-dimensional module over a ring $R$ and let $b \subseteq M$ be a subset such that the inclusion map $b \hookrightarrow M$ is linearly independent. Then $b$ is finite.
exists_set_linearIndependent_of_lt_rank theorem
{n : Cardinal} (hn : n < Module.rank R M) : ∃ s : Set M, #s = n ∧ LinearIndepOn R id s
Full source
lemma exists_set_linearIndependent_of_lt_rank {n : Cardinal} (hn : n < Module.rank R M) :
    ∃ s : Set M, #s = n ∧ LinearIndepOn R id s := by
  obtain ⟨⟨s, hs⟩, hs'⟩ := exists_lt_of_lt_ciSup' (hn.trans_eq (Module.rank_def R M))
  obtain ⟨t, ht, ht'⟩ := le_mk_iff_exists_subset.mp hs'.le
  exact ⟨t, ht', hs.mono ht⟩
Existence of Linearly Independent Subset of Given Cardinality Below Rank
Informal description
For any cardinal number $n$ such that $n < \text{rank}_R(M)$, there exists a subset $s \subseteq M$ with cardinality $n$ that is linearly independent over $R$.
exists_finset_linearIndependent_of_le_rank theorem
{n : ℕ} (hn : n ≤ Module.rank R M) : ∃ s : Finset M, s.card = n ∧ LinearIndepOn R id (s : Set M)
Full source
lemma exists_finset_linearIndependent_of_le_rank {n : } (hn : n ≤ Module.rank R M) :
    ∃ s : Finset M, s.card = n ∧ LinearIndepOn R id (s : Set M) := by
  have := nonempty_linearIndependent_set
  rcases hn.eq_or_lt with h | h
  · obtain ⟨⟨s, hs⟩, hs'⟩ := Cardinal.exists_eq_natCast_of_iSup_eq _
      (Cardinal.bddAbove_range _) _ (h.trans (Module.rank_def R M)).symm
    have : Finite s := lt_aleph0_iff_finite.mp (hs' ▸ nat_lt_aleph0 n)
    cases nonempty_fintype s
    refine ⟨s.toFinset, by simpa using hs', by simpa⟩
  · obtain ⟨s, hs, hs'⟩ := exists_set_linearIndependent_of_lt_rank h
    have : Finite s := lt_aleph0_iff_finite.mp (hs ▸ nat_lt_aleph0 n)
    cases nonempty_fintype s
    exact ⟨s.toFinset, by simpa using hs, by simpa⟩
Existence of Finite Linearly Independent Subset of Given Size Below Rank
Informal description
For any natural number $n$ such that $n \leq \text{rank}_R(M)$, there exists a finite set $s \subseteq M$ with cardinality $n$ that is linearly independent over $R$.
exists_linearIndependent_of_le_rank theorem
{n : ℕ} (hn : n ≤ Module.rank R M) : ∃ f : Fin n → M, LinearIndependent R f
Full source
lemma exists_linearIndependent_of_le_rank {n : } (hn : n ≤ Module.rank R M) :
    ∃ f : Fin n → M, LinearIndependent R f :=
  have ⟨_, hs, hs'⟩ := exists_finset_linearIndependent_of_le_rank hn
  ⟨_, (linearIndependent_equiv (Finset.equivFinOfCardEq hs).symm).mpr hs'⟩
Existence of Linearly Independent Family of Given Size Below Rank
Informal description
For any natural number $n$ such that $n \leq \text{rank}_R(M)$, there exists a linearly independent family of vectors $f : \{1, \dots, n\} \to M$ over $R$.
natCast_le_rank_iff theorem
[Nontrivial R] {n : ℕ} : n ≤ Module.rank R M ↔ ∃ f : Fin n → M, LinearIndependent R f
Full source
lemma natCast_le_rank_iff [Nontrivial R] {n : } :
    n ≤ Module.rank R M ↔ ∃ f : Fin n → M, LinearIndependent R f :=
  ⟨exists_linearIndependent_of_le_rank,
    fun H ↦ by simpa using H.choose_spec.cardinal_lift_le_rank⟩
Characterization of Module Rank via Linear Independence of Finite Families
Informal description
For a nontrivial ring $R$ and a natural number $n$, the inequality $n \leq \text{rank}_R(M)$ holds if and only if there exists a linearly independent family of vectors $f : \{1, \dots, n\} \to M$ over $R$.
natCast_le_rank_iff_finset theorem
[Nontrivial R] {n : ℕ} : n ≤ Module.rank R M ↔ ∃ s : Finset M, s.card = n ∧ LinearIndependent R ((↑) : s → M)
Full source
lemma natCast_le_rank_iff_finset [Nontrivial R] {n : } :
    n ≤ Module.rank R M ↔ ∃ s : Finset M, s.card = n ∧ LinearIndependent R ((↑) : s → M) :=
  ⟨exists_finset_linearIndependent_of_le_rank,
    fun ⟨s, h₁, h₂⟩ ↦ by simpa [h₁] using h₂.cardinal_le_rank⟩
Finite Linear Independence Criterion for Module Rank
Informal description
For a nontrivial ring $R$ and a natural number $n$, the inequality $n \leq \text{rank}_R(M)$ holds if and only if there exists a finite subset $s \subseteq M$ with cardinality $n$ such that the inclusion map from $s$ to $M$ is linearly independent over $R$.
exists_finset_linearIndependent_of_le_finrank theorem
{n : ℕ} (hn : n ≤ finrank R M) : ∃ s : Finset M, s.card = n ∧ LinearIndependent R ((↑) : s → M)
Full source
lemma exists_finset_linearIndependent_of_le_finrank {n : } (hn : n ≤ finrank R M) :
    ∃ s : Finset M, s.card = n ∧ LinearIndependent R ((↑) : s → M) := by
  by_cases h : finrank R M = 0
  · rw [le_zero_iff.mp (hn.trans_eq h)]
    exact ⟨∅, rfl, by convert linearIndependent_empty R M using 2 <;> aesop⟩
  exact exists_finset_linearIndependent_of_le_rank
    ((Nat.cast_le.mpr hn).trans_eq (cast_toNat_of_lt_aleph0 (toNat_ne_zero.mp h).2))
Existence of Finite Linearly Independent Subset of Given Size Below Finite Rank
Informal description
For any natural number $n$ such that $n \leq \text{finrank}_R(M)$, there exists a finite subset $s \subseteq M$ with cardinality $n$ that is linearly independent over $R$.
exists_linearIndependent_of_le_finrank theorem
{n : ℕ} (hn : n ≤ finrank R M) : ∃ f : Fin n → M, LinearIndependent R f
Full source
lemma exists_linearIndependent_of_le_finrank {n : } (hn : n ≤ finrank R M) :
    ∃ f : Fin n → M, LinearIndependent R f :=
  have ⟨_, hs, hs'⟩ := exists_finset_linearIndependent_of_le_finrank hn
  ⟨_, (linearIndependent_equiv (Finset.equivFinOfCardEq hs).symm).mpr hs'⟩
Existence of Linearly Independent Family of Given Size Below Finite Rank
Informal description
For any natural number $n$ such that $n \leq \text{finrank}_R(M)$, there exists a linearly independent family of vectors $f \colon \text{Fin}(n) \to M$ over the ring $R$.
Module.Finite.not_linearIndependent_of_infinite theorem
{ι : Type*} [Infinite ι] (v : ι → M) : ¬LinearIndependent R v
Full source
theorem Module.Finite.not_linearIndependent_of_infinite {ι : Type*} [Infinite ι]
    (v : ι → M) : ¬LinearIndependent R v := mt LinearIndependent.finite <| @not_finite _ _
Infinite Families in Finite-Dimensional Modules are Linearly Dependent
Informal description
Let $M$ be a finite-dimensional module over a ring $R$, and let $\{v_i\}_{i \in \iota}$ be a family of vectors in $M$ indexed by an infinite set $\iota$. Then the family $\{v_i\}_{i \in \iota}$ is not linearly independent over $R$.
iSupIndep.subtype_ne_bot_le_rank theorem
[Nontrivial R] {V : ι → Submodule R M} (hV : iSupIndep V) : Cardinal.lift.{v} #{ i : ι // V i ≠ ⊥ } ≤ Cardinal.lift.{w} (Module.rank R M)
Full source
theorem iSupIndep.subtype_ne_bot_le_rank [Nontrivial R]
    {V : ι → Submodule R M} (hV : iSupIndep V) :
    Cardinal.lift.{v} #{ i : ι // V i ≠ ⊥ }Cardinal.lift.{w} (Module.rank R M) := by
  set I := { i : ι // V i ≠ ⊥ }
  have hI : ∀ i : I, ∃ v ∈ V i, v ≠ (0 : M) := by
    intro i
    rw [← Submodule.ne_bot_iff]
    exact i.prop
  choose v hvV hv using hI
  have : LinearIndependent R v := (hV.comp Subtype.coe_injective).linearIndependent _ hvV hv
  exact this.cardinal_lift_le_rank
Cardinality Bound for Nontrivial Submodules in Independent Family by Module Rank
Informal description
Let $R$ be a nontrivial ring and $M$ be an $R$-module. Given a family of submodules $\{V_i\}_{i \in \iota}$ of $M$ that is independent (i.e., $\text{iSupIndep} V$ holds), the cardinality of the set of indices $i$ for which $V_i$ is nontrivial is bounded above by the rank of $M$. More precisely, the lifted cardinality of $\{i \in \iota \mid V_i \neq 0\}$ is less than or equal to the lifted rank of $M$ over $R$.
iSupIndep.subtype_ne_bot_le_finrank_aux theorem
{p : ι → Submodule R M} (hp : iSupIndep p) : #{ i // p i ≠ ⊥ } ≤ (finrank R M : Cardinal.{w})
Full source
theorem iSupIndep.subtype_ne_bot_le_finrank_aux
    {p : ι → Submodule R M} (hp : iSupIndep p) :
    #{ i // p i ≠ ⊥ } ≤ (finrank R M : CardinalCardinal.{w}) := by
  suffices Cardinal.lift.{v} #{ i // p i ≠ ⊥ }Cardinal.lift.{v} (finrank R M : CardinalCardinal.{w}) by
    rwa [Cardinal.lift_le] at this
  calc
    Cardinal.lift.{v} #{ i // p i ≠ ⊥ }Cardinal.lift.{w} (Module.rank R M) :=
      hp.subtype_ne_bot_le_rank
    _ = Cardinal.lift.{w} (finrank R M : CardinalCardinal.{v}) := by rw [finrank_eq_rank]
    _ = Cardinal.lift.{v} (finrank R M : CardinalCardinal.{w}) := by simp
Cardinality Bound for Nontrivial Submodules in Independent Family by Finite Rank
Informal description
Let $R$ be a ring and $M$ be a finite-dimensional $R$-module. Given an independent family of submodules $\{p_i\}_{i \in \iota}$ of $M$ (i.e., $\text{iSupIndep} p$ holds), the cardinality of the set $\{i \in \iota \mid p_i \neq 0\}$ is bounded above by the finite rank of $M$ over $R$, i.e., $\#\{i \mid p_i \neq 0\} \leq \text{finrank}_R M$.
iSupIndep.fintypeNeBotOfFiniteDimensional definition
{p : ι → Submodule R M} (hp : iSupIndep p) : Fintype { i : ι // p i ≠ ⊥ }
Full source
/-- If `p` is an independent family of submodules of a `R`-finite module `M`, then the
number of nontrivial subspaces in the family `p` is finite. -/
noncomputable def iSupIndep.fintypeNeBotOfFiniteDimensional
    {p : ι → Submodule R M} (hp : iSupIndep p) :
    Fintype { i : ι // p i ≠ ⊥ } := by
  suffices #{ i // p i ≠ ⊥ } < (ℵ₀ : Cardinal.{w}) by
    rw [Cardinal.lt_aleph0_iff_fintype] at this
    exact this.some
  refine lt_of_le_of_lt hp.subtype_ne_bot_le_finrank_aux ?_
  simp [Cardinal.nat_lt_aleph0]
Finiteness of nontrivial submodules in an independent family
Informal description
For an independent family `p` of submodules of a finite-dimensional module `M` over a ring `R`, the set of indices `i` for which `p i` is nontrivial is finite.
iSupIndep.subtype_ne_bot_le_finrank theorem
{p : ι → Submodule R M} (hp : iSupIndep p) [Fintype { i // p i ≠ ⊥ }] : Fintype.card { i // p i ≠ ⊥ } ≤ finrank R M
Full source
/-- If `p` is an independent family of submodules of a `R`-finite module `M`, then the
number of nontrivial subspaces in the family `p` is bounded above by the dimension of `M`.

Note that the `Fintype` hypothesis required here can be provided by
`iSupIndep.fintypeNeBotOfFiniteDimensional`. -/
theorem iSupIndep.subtype_ne_bot_le_finrank
    {p : ι → Submodule R M} (hp : iSupIndep p) [Fintype { i // p i ≠ ⊥ }] :
    Fintype.card { i // p i ≠ ⊥ }finrank R M := by simpa using hp.subtype_ne_bot_le_finrank_aux
Finite Cardinality Bound for Nontrivial Submodules in Independent Family by Module Rank
Informal description
Let $R$ be a ring and $M$ be a finite-dimensional $R$-module. Given an independent family of submodules $\{p_i\}_{i \in \iota}$ of $M$ (i.e., $\text{iSupIndep} p$ holds) and assuming the set $\{i \in \iota \mid p_i \neq 0\}$ is finite, the cardinality of this set is bounded above by the finite rank of $M$ over $R$, i.e., $|\{i \mid p_i \neq 0\}| \leq \text{finrank}_R M$.
Module.exists_nontrivial_relation_of_finrank_lt_card theorem
{t : Finset M} (h : finrank R M < t.card) : ∃ f : M → R, ∑ e ∈ t, f e • e = 0 ∧ ∃ x ∈ t, f x ≠ 0
Full source
/-- If a finset has cardinality larger than the rank of a module,
then there is a nontrivial linear relation amongst its elements. -/
theorem Module.exists_nontrivial_relation_of_finrank_lt_card {t : Finset M}
    (h : finrank R M < t.card) : ∃ f : M → R, ∑ e ∈ t, f e • e = 0 ∧ ∃ x ∈ t, f x ≠ 0 := by
  obtain ⟨g, sum, z, nonzero⟩ := Fintype.not_linearIndependent_iff.mp
    (mt LinearIndependent.finset_card_le_finrank h.not_le)
  refine ⟨Subtype.val.extend g 0, ?_, z, z.2, by rwa [Subtype.val_injective.extend_apply]⟩
  rw [← Finset.sum_finset_coe]; convert sum; apply Subtype.val_injective.extend_apply
Existence of Nontrivial Linear Relation in Finite Subset When Rank is Less Than Cardinality
Informal description
Let $M$ be a module over a ring $R$ and let $t$ be a finite subset of $M$. If the finite rank of $M$ over $R$ is strictly less than the cardinality of $t$, then there exists a nontrivial linear relation among the elements of $t$. That is, there exists a function $f \colon M \to R$ such that $\sum_{e \in t} f(e) \cdot e = 0$ and $f(x) \neq 0$ for some $x \in t$.
Module.exists_nontrivial_relation_sum_zero_of_finrank_succ_lt_card theorem
{t : Finset M} (h : finrank R M + 1 < t.card) : ∃ f : M → R, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, f x ≠ 0
Full source
/-- If a finset has cardinality larger than `finrank + 1`,
then there is a nontrivial linear relation amongst its elements,
such that the coefficients of the relation sum to zero. -/
theorem Module.exists_nontrivial_relation_sum_zero_of_finrank_succ_lt_card
    {t : Finset M} (h : finrank R M + 1 < t.card) :
    ∃ f : M → R, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, f x ≠ 0 := by
  -- Pick an element x₀ ∈ t,
  obtain ⟨x₀, x₀_mem⟩ := card_pos.1 ((Nat.succ_pos _).trans h)
  -- and apply the previous lemma to the {xᵢ - x₀}
  let shift : M ↪ M := ⟨(· - x₀), sub_left_injective⟩
  classical
  let t' := (t.erase x₀).map shift
  have h' : finrank R M < t'.card := by
    rw [card_map, card_erase_of_mem x₀_mem]
    exact Nat.lt_pred_iff.mpr h
  -- to obtain a function `g`.
  obtain ⟨g, gsum, x₁, x₁_mem, nz⟩ := exists_nontrivial_relation_of_finrank_lt_card h'
  -- Then obtain `f` by translating back by `x₀`,
  -- and setting the value of `f` at `x₀` to ensure `∑ e ∈ t, f e = 0`.
  let f : M → R := fun z ↦ if z = x₀ then -∑ z ∈ t.erase x₀, g (z - x₀) else g (z - x₀)
  refine ⟨f, ?_, ?_, ?_⟩
  -- After this, it's a matter of verifying the properties,
  -- based on the corresponding properties for `g`.
  · rw [sum_map, Embedding.coeFn_mk] at gsum
    simp_rw [f, ← t.sum_erase_add _ x₀_mem, if_pos, neg_smul, sum_smul,
             ← sub_eq_add_neg, ← sum_sub_distrib, ← gsum, smul_sub]
    refine sum_congr rfl fun x x_mem ↦ ?_
    rw [if_neg (mem_erase.mp x_mem).1]
  · simp_rw [f, ← t.sum_erase_add _ x₀_mem, if_pos, add_neg_eq_zero]
    exact sum_congr rfl fun x x_mem ↦ if_neg (mem_erase.mp x_mem).1
  · obtain ⟨x₁, x₁_mem', rfl⟩ := Finset.mem_map.mp x₁_mem
    have := mem_erase.mp x₁_mem'
    exact ⟨x₁, by
      simpa only [f, Embedding.coeFn_mk, sub_add_cancel, this.2, true_and, if_neg this.1]⟩
Existence of Nontrivial Linear Relation with Zero Sum for Finite Subset When Rank Plus One is Less Than Cardinality
Informal description
Let $M$ be a module over a ring $R$ and let $t$ be a finite subset of $M$. If the finite rank of $M$ over $R$ plus one is strictly less than the cardinality of $t$, then there exists a nontrivial linear relation among the elements of $t$ with coefficients summing to zero. That is, there exists a function $f \colon M \to R$ such that: 1. $\sum_{e \in t} f(e) \cdot e = 0$, 2. $\sum_{e \in t} f(e) = 0$, 3. $f(x) \neq 0$ for some $x \in t$.
Module.finrank_zero_of_subsingleton theorem
[Subsingleton M] : finrank R M = 0
Full source
/-- A (finite dimensional) space that is a subsingleton has zero `finrank`. -/
@[nontriviality]
theorem Module.finrank_zero_of_subsingleton [Subsingleton M] :
    finrank R M = 0 := by
  rw [finrank, rank_subsingleton', map_zero]
Finite Rank Zero for Subsingleton Modules
Informal description
If a module $M$ over a ring $R$ is a subsingleton (i.e., has at most one element), then its finite rank is zero, i.e., $\text{finrank}_R M = 0$.
LinearIndependent.finrank_eq_zero_of_infinite theorem
{ι} [Infinite ι] {v : ι → M} (hv : LinearIndependent R v) : finrank R M = 0
Full source
lemma LinearIndependent.finrank_eq_zero_of_infinite {ι} [Infinite ι] {v : ι → M}
    (hv : LinearIndependent R v) : finrank R M = 0 := toNat_eq_zero.mpr <| .inr hv.aleph0_le_rank
Finite Rank Zero for Infinite Linearly Independent Families
Informal description
Let $M$ be a module over a ring $R$, and let $\{v_i\}_{i \in \iota}$ be an infinite linearly independent family of vectors in $M$ indexed by an infinite type $\iota$. Then the finite rank of $M$ is zero, i.e., $\text{finrank}_R M = 0$.
Module.nontrivial_of_finrank_pos theorem
(h : 0 < finrank R M) : Nontrivial M
Full source
/-- A finite dimensional space is nontrivial if it has positive `finrank`. -/
theorem Module.nontrivial_of_finrank_pos (h : 0 < finrank R M) : Nontrivial M :=
  rank_pos_iff_nontrivial.mp (lt_rank_of_lt_finrank h)
Nontriviality from Positive Finite Rank: $\text{finrank}_R M > 0 \Rightarrow M$ is nontrivial
Informal description
If the finite rank of a module $M$ over a ring $R$ is positive, then $M$ is nontrivial (i.e., contains at least two distinct elements).
Module.nontrivial_of_finrank_eq_succ theorem
{n : ℕ} (hn : finrank R M = n.succ) : Nontrivial M
Full source
/-- A finite dimensional space is nontrivial if it has `finrank` equal to the successor of a
natural number. -/
theorem Module.nontrivial_of_finrank_eq_succ {n : }
    (hn : finrank R M = n.succ) : Nontrivial M :=
  nontrivial_of_finrank_pos (R := R) (by rw [hn]; exact n.succ_pos)
Nontriviality from Finite Rank Equal to Successor: $\text{finrank}_R M = n + 1 \Rightarrow M$ is nontrivial
Informal description
For any natural number $n$, if the finite rank of a module $M$ over a ring $R$ is equal to $n + 1$, then $M$ is nontrivial (i.e., contains at least two distinct elements).
finrank_bot theorem
: finrank R (⊥ : Submodule R M) = 0
Full source
@[simp]
theorem finrank_bot : finrank R ( : Submodule R M) = 0 :=
  finrank_eq_of_rank_eq (rank_bot _ _)
Finite Rank of Trivial Submodule is Zero
Informal description
The finite rank of the trivial submodule $\bot$ of a module $M$ over a ring $R$ is zero, i.e., $\text{finrank}_R (\bot) = 0$.
Module.finrank_pos_iff_exists_ne_zero theorem
[NoZeroSMulDivisors R M] : 0 < finrank R M ↔ ∃ x : M, x ≠ 0
Full source
/-- A finite rank torsion-free module has positive `finrank` iff it has a nonzero element. -/
theorem Module.finrank_pos_iff_exists_ne_zero [NoZeroSMulDivisors R M] :
    0 < finrank R M ↔ ∃ x : M, x ≠ 0 := by
  rw [← @rank_pos_iff_exists_ne_zero R M, ← finrank_eq_rank]
  norm_cast
Positive Finite Rank Characterization for Torsion-Free Modules: $0 < \text{finrank}_R M \leftrightarrow M \neq \{0\}$
Informal description
For a torsion-free module $M$ over a ring $R$ (i.e., $R$ has no zero divisors acting on $M$), the finite rank of $M$ is positive if and only if there exists a nonzero element in $M$, i.e., $0 < \text{finrank}_R M \leftrightarrow \exists x \in M, x \neq 0$.
Module.finrank_pos_iff theorem
[NoZeroSMulDivisors R M] : 0 < finrank R M ↔ Nontrivial M
Full source
/-- An `R`-finite torsion-free module has positive `finrank` iff it is nontrivial. -/
theorem Module.finrank_pos_iff [NoZeroSMulDivisors R M] :
    0 < finrank R M ↔ Nontrivial M := by
  rw [← rank_pos_iff_nontrivial (R := R), ← finrank_eq_rank]
  norm_cast
Positive Finite Rank Characterization via Nontriviality: $0 < \text{finrank}_R M \leftrightarrow M$ is nontrivial
Informal description
For a module $M$ over a ring $R$ with no zero smul divisors, the finite rank of $M$ is positive if and only if $M$ is nontrivial (i.e., contains at least two distinct elements). In other words, $0 < \text{finrank}_R M \leftrightarrow M$ is nontrivial.
Module.finrank_pos theorem
[NoZeroSMulDivisors R M] [h : Nontrivial M] : 0 < finrank R M
Full source
/-- A nontrivial finite dimensional space has positive `finrank`. -/
theorem Module.finrank_pos [NoZeroSMulDivisors R M] [h : Nontrivial M] :
    0 < finrank R M :=
  finrank_pos_iff.mpr h
Positive Finite Rank for Nontrivial Modules
Informal description
For a nontrivial module $M$ over a ring $R$ with no zero smul divisors, the finite rank of $M$ is positive, i.e., $\text{finrank}_R M > 0$.
Module.finrank_eq_zero_iff theorem
: finrank R M = 0 ↔ ∀ x : M, ∃ a : R, a ≠ 0 ∧ a • x = 0
Full source
/-- See `Module.finrank_zero_iff`
  for the stronger version with `NoZeroSMulDivisors R M`. -/
theorem Module.finrank_eq_zero_iff :
    finrankfinrank R M = 0 ↔ ∀ x : M, ∃ a : R, a ≠ 0 ∧ a • x = 0 := by
  rw [← rank_eq_zero_iff (R := R), ← finrank_eq_rank]
  norm_cast
Characterization of Zero Finite Rank: $\text{finrank}_R M = 0 \leftrightarrow \forall x \in M, \exists a \neq 0, a \cdot x = 0$
Informal description
The finite rank of a module $M$ over a ring $R$ is zero if and only if for every element $x \in M$, there exists a nonzero element $a \in R$ such that $a \cdot x = 0$. In other words, $\text{finrank}_R M = 0 \leftrightarrow \forall x \in M, \exists a \in R \setminus \{0\}, a \cdot x = 0$.
Module.finrank_zero_iff theorem
[NoZeroSMulDivisors R M] : finrank R M = 0 ↔ Subsingleton M
Full source
/-- A finite dimensional space has zero `finrank` iff it is a subsingleton.
This is the `finrank` version of `rank_zero_iff`. -/
theorem Module.finrank_zero_iff [NoZeroSMulDivisors R M] :
    finrankfinrank R M = 0 ↔ Subsingleton M := by
  rw [← rank_zero_iff (R := R), ← finrank_eq_rank]
  norm_cast
Finite Rank Zero Characterization: $\text{finrank}_R M = 0 \leftrightarrow M$ is a subsingleton
Informal description
For a module $M$ over a ring $R$ with no zero smul divisors (i.e., $a \cdot x = 0$ implies $a = 0$ or $x = 0$), the finite rank of $M$ is zero if and only if $M$ is a subsingleton (i.e., all elements of $M$ are equal).
Module.finrank_quotient_add_finrank_le theorem
(N : Submodule R M) : finrank R (M ⧸ N) + finrank R N ≤ finrank R M
Full source
/-- Similar to `rank_quotient_add_rank_le` but for `finrank` and a finite `M`. -/
lemma Module.finrank_quotient_add_finrank_le (N : Submodule R M) :
    finrank R (M ⧸ N) + finrank R N ≤ finrank R M := by
  haveI := nontrivial_of_invariantBasisNumber R
  have := rank_quotient_add_rank_le N
  rw [← finrank_eq_rank R M, ← finrank_eq_rank R, ← N.finrank_eq_rank] at this
  exact mod_cast this
Subadditivity of Finite Rank for Module Quotient and Submodule: $\text{finrank}_R(M/N) + \text{finrank}_R(N) \leq \text{finrank}_R(M)$
Informal description
For a module $M$ over a ring $R$ and a submodule $N$ of $M$, the sum of the finite ranks of the quotient module $M/N$ and the submodule $N$ is less than or equal to the finite rank of $M$, i.e., \[ \text{finrank}_R(M/N) + \text{finrank}_R(N) \leq \text{finrank}_R(M). \]
Module.finrank_eq_zero_of_rank_eq_zero theorem
(h : Module.rank R M = 0) : finrank R M = 0
Full source
theorem Module.finrank_eq_zero_of_rank_eq_zero (h : Module.rank R M = 0) :
    finrank R M = 0 := by
  delta finrank
  rw [h, zero_toNat]
Finite Rank Zero Implication from Rank Zero: $\text{rank}_R M = 0 \Rightarrow \text{finrank}_R M = 0$
Informal description
For a module $M$ over a ring $R$, if the rank of $M$ is zero, then the finite rank of $M$ is also zero.
Submodule.bot_eq_top_of_rank_eq_zero theorem
[NoZeroSMulDivisors R M] (h : Module.rank R M = 0) : (⊥ : Submodule R M) = ⊤
Full source
theorem Submodule.bot_eq_top_of_rank_eq_zero [NoZeroSMulDivisors R M] (h : Module.rank R M = 0) :
    ( : Submodule R M) =  := by
  nontriviality R
  rw [rank_zero_iff] at h
  subsingleton
Zero Rank Implies Trivial Submodule Lattice: $\text{rank}_R M = 0 \Rightarrow \bot = \top$ in $\text{Submodule}_R M$
Informal description
Let $R$ be a ring and $M$ an $R$-module with no zero smul divisors. If the rank of $M$ over $R$ is zero, then the bottom submodule (the zero submodule) is equal to the top submodule (the entire module $M$).
Submodule.rank_eq_zero theorem
[Nontrivial R] [NoZeroSMulDivisors R M] {S : Submodule R M} : Module.rank R S = 0 ↔ S = ⊥
Full source
/-- See `rank_subsingleton` for the reason that `Nontrivial R` is needed. -/
@[simp]
theorem Submodule.rank_eq_zero [Nontrivial R] [NoZeroSMulDivisors R M] {S : Submodule R M} :
    Module.rankModule.rank R S = 0 ↔ S = ⊥ :=
  ⟨fun h =>
    (Submodule.eq_bot_iff _).2 fun x hx =>
      congr_arg Subtype.val <|
        ((Submodule.eq_bot_iff _).1 <| Eq.symm <| Submodule.bot_eq_top_of_rank_eq_zero h) ⟨x, hx⟩
          Submodule.mem_top,
    fun h => by rw [h, rank_bot]⟩
Zero Rank Characterization for Submodules: $\text{rank}_R S = 0 \leftrightarrow S = \bot$
Informal description
Let $R$ be a nontrivial ring and $M$ an $R$-module with no zero smul divisors. For any submodule $S$ of $M$, the rank of $S$ over $R$ is zero if and only if $S$ is the trivial submodule $\{\mathbf{0}\}$.
Submodule.finrank_eq_zero theorem
[StrongRankCondition R] [NoZeroSMulDivisors R M] {S : Submodule R M} [Module.Finite R S] : finrank R S = 0 ↔ S = ⊥
Full source
@[simp]
theorem Submodule.finrank_eq_zero [StrongRankCondition R] [NoZeroSMulDivisors R M]
    {S : Submodule R M} [Module.Finite R S] :
    finrankfinrank R S = 0 ↔ S = ⊥ := by
  rw [← Submodule.rank_eq_zero, ← finrank_eq_rank, ← @Nat.cast_zero Cardinal, Nat.cast_inj]
Finite Rank Zero Characterization for Submodules: $\text{finrank}_R S = 0 \leftrightarrow S = \bot$
Informal description
Let $R$ be a ring satisfying the strong rank condition, $M$ an $R$-module with no zero smul divisors, and $S$ a finite submodule of $M$. Then the finite rank of $S$ over $R$ is zero if and only if $S$ is the trivial submodule $\{\mathbf{0}\}$.
Submodule.one_le_finrank_iff theorem
[StrongRankCondition R] [NoZeroSMulDivisors R M] {S : Submodule R M} [Module.Finite R S] : 1 ≤ finrank R S ↔ S ≠ ⊥
Full source
@[simp]
lemma Submodule.one_le_finrank_iff [StrongRankCondition R] [NoZeroSMulDivisors R M]
    {S : Submodule R M} [Module.Finite R S] :
    1 ≤ finrank R S ↔ S ≠ ⊥ := by
  simp [← not_iff_not]
Finite rank is at least one iff submodule is nontrivial
Informal description
Let $R$ be a ring satisfying the strong rank condition, $M$ be an $R$-module with no zero smul divisors, and $S$ be a finite submodule of $M$. Then the finite rank of $S$ over $R$ is at least 1 if and only if $S$ is not the trivial submodule $\{\mathbf{0}\}$.
finrank_eq_zero_of_basis_imp_not_finite theorem
(h : ∀ s : Set M, Basis.{v} (s : Set M) R M → ¬s.Finite) : finrank R M = 0
Full source
theorem finrank_eq_zero_of_basis_imp_not_finite
    (h : ∀ s : Set M, Basis.{v} (s : Set M) R M → ¬s.Finite) : finrank R M = 0 := by
  cases subsingleton_or_nontrivial R
  · have := Module.subsingleton R M
    exact (h  ⟨LinearEquiv.ofSubsingleton _ _⟩ Set.finite_empty).elim
  obtain ⟨_, ⟨b⟩⟩ := (Module.free_iff_set R M).mp ‹_›
  have := Set.Infinite.to_subtype (h _ b)
  exact b.linearIndependent.finrank_eq_zero_of_infinite
Finite rank zero when all bases are infinite
Informal description
For any set $s$ of vectors in an $R$-module $M$, if every basis of $M$ indexed by $s$ implies that $s$ is infinite, then the finite rank of $M$ over $R$ is zero.
finrank_eq_zero_of_basis_imp_false theorem
(h : ∀ s : Finset M, Basis.{v} (s : Set M) R M → False) : finrank R M = 0
Full source
theorem finrank_eq_zero_of_basis_imp_false (h : ∀ s : Finset M, Basis.{v} (s : Set M) R M → False) :
    finrank R M = 0 :=
  finrank_eq_zero_of_basis_imp_not_finite fun s b hs =>
    h hs.toFinset
      (by
        convert b
        simp)
Finite rank zero when no finite basis exists
Informal description
For any finite set $s$ of vectors in an $R$-module $M$, if there does not exist a basis of $M$ indexed by $s$, then the finite rank of $M$ over $R$ is zero.
finrank_eq_zero_of_not_exists_basis theorem
(h : ¬∃ s : Finset M, Nonempty (Basis (s : Set M) R M)) : finrank R M = 0
Full source
theorem finrank_eq_zero_of_not_exists_basis
    (h : ¬∃ s : Finset M, Nonempty (Basis (s : Set M) R M)) : finrank R M = 0 :=
  finrank_eq_zero_of_basis_imp_false fun s b => h ⟨s, ⟨b⟩⟩
Finite Rank Zero When No Finite Basis Exists
Informal description
If there does not exist a finite set $s$ of vectors in an $R$-module $M$ such that $s$ forms a basis for $M$, then the finite rank of $M$ over $R$ is zero.
finrank_eq_zero_of_not_exists_basis_finite theorem
(h : ¬∃ (s : Set M) (_ : Basis.{v} (s : Set M) R M), s.Finite) : finrank R M = 0
Full source
theorem finrank_eq_zero_of_not_exists_basis_finite
    (h : ¬∃ (s : Set M) (_ : Basis.{v} (s : Set M) R M), s.Finite) : finrank R M = 0 :=
  finrank_eq_zero_of_basis_imp_not_finite fun s b hs => h ⟨s, b, hs⟩
Finite rank zero when no finite basis exists
Informal description
If there does not exist a finite set $s$ of vectors in an $R$-module $M$ that forms a basis for $M$, then the finite rank of $M$ over $R$ is zero.
finrank_eq_zero_of_not_exists_basis_finset theorem
(h : ¬∃ s : Finset M, Nonempty (Basis s R M)) : finrank R M = 0
Full source
theorem finrank_eq_zero_of_not_exists_basis_finset (h : ¬∃ s : Finset M, Nonempty (Basis s R M)) :
    finrank R M = 0 :=
  finrank_eq_zero_of_basis_imp_false fun s b => h ⟨s, ⟨b⟩⟩
Finite rank is zero when no finite basis exists
Informal description
If there does not exist a finite set $s$ of vectors in an $R$-module $M$ such that $s$ forms a basis for $M$, then the finite rank of $M$ over $R$ is zero.
rank_eq_one theorem
(v : M) (n : v ≠ 0) (h : ∀ w : M, ∃ c : R, c • v = w) : Module.rank R M = 1
Full source
/-- If there is a nonzero vector and every other vector is a multiple of it,
then the module has dimension one. -/
theorem rank_eq_one (v : M) (n : v ≠ 0) (h : ∀ w : M, ∃ c : R, c • v = w) :
    Module.rank R M = 1 := by
  haveI := nontrivial_of_invariantBasisNumber R
  obtain ⟨b⟩ := (Basis.basis_singleton_iff.{_, _, u} PUnit).mpr ⟨v, n, h⟩
  rw [rank_eq_card_basis b, Fintype.card_punit, Nat.cast_one]
Rank-One Characterization for Modules with a Single Generator
Informal description
Let $M$ be a module over a ring $R$. If there exists a nonzero vector $v \in M$ such that every vector $w \in M$ can be written as a scalar multiple $c \cdot v$ for some $c \in R$, then the rank of $M$ over $R$ is equal to 1, i.e., $\text{rank}_R(M) = 1$.
finrank_eq_one theorem
(v : M) (n : v ≠ 0) (h : ∀ w : M, ∃ c : R, c • v = w) : finrank R M = 1
Full source
/-- If there is a nonzero vector and every other vector is a multiple of it,
then the module has dimension one. -/
theorem finrank_eq_one (v : M) (n : v ≠ 0) (h : ∀ w : M, ∃ c : R, c • v = w) : finrank R M = 1 :=
  finrank_eq_of_rank_eq (rank_eq_one v n h)
Finite Rank-One Characterization for Cyclic Modules
Informal description
Let $M$ be a module over a ring $R$. If there exists a nonzero vector $v \in M$ such that every vector $w \in M$ can be written as a scalar multiple $c \cdot v$ for some $c \in R$, then the finite rank of $M$ over $R$ is equal to $1$, i.e., $\text{finrank}_R M = 1$.
finrank_le_one theorem
(v : M) (h : ∀ w : M, ∃ c : R, c • v = w) : finrank R M ≤ 1
Full source
/-- If every vector is a multiple of some `v : M`, then `M` has dimension at most one.
-/
theorem finrank_le_one (v : M) (h : ∀ w : M, ∃ c : R, c • v = w) : finrank R M ≤ 1 := by
  haveI := nontrivial_of_invariantBasisNumber R
  rcases eq_or_ne v 0 with (rfl | hn)
  · haveI :=
      _root_.subsingleton_of_forall_eq (0 : M) fun w => by
        obtain ⟨c, rfl⟩ := h w
        simp
    rw [finrank_zero_of_subsingleton]
    exact zero_le_one
  · exact (finrank_eq_one v hn h).le
Finite Rank Bound for Cyclic Modules: $\text{finrank}_R M \leq 1$
Informal description
Let $M$ be a module over a ring $R$. If there exists a vector $v \in M$ such that every vector $w \in M$ can be written as a scalar multiple $c \cdot v$ for some $c \in R$, then the finite rank of $M$ over $R$ is at most one, i.e., $\text{finrank}_R M \leq 1$.
Module.finite_finsupp_iff theorem
: Module.Finite R (ι →₀ M) ↔ IsEmpty ι ∨ Subsingleton M ∨ Module.Finite R M ∧ Finite ι
Full source
@[simp] lemma finite_finsupp_iff :
    Module.FiniteModule.Finite R (ι →₀ M) ↔ IsEmpty ι ∨ Subsingleton M ∨ Module.Finite R M ∧ Finite ι where
  mp := by
    simp only [or_iff_not_imp_left, not_subsingleton_iff_nontrivial, not_isEmpty_iff]
    rintro h ⟨i⟩ _
    obtain ⟨s, hs⟩ := id h
    exact ⟨.of_surjective (Finsupp.lapply (R := R) (M := M) i) (Finsupp.apply_surjective i),
       finite_of_span_finite_eq_top_finsupp s.finite_toSet hs⟩
  mpr
  | .inl _ => inferInstance
  | .inr <| .inl h => inferInstance
  | .inr <| .inr h => by cases h; infer_instance
Characterization of Finite-Dimensionality for Finitely Supported Function Modules
Informal description
The module of finitely supported functions $\iota \to_{\text{f}} M$ is finite-dimensional over $R$ if and only if one of the following holds: 1. The index type $\iota$ is empty, or 2. The module $M$ is a subsingleton (i.e., has at most one element), or 3. The module $M$ is finite-dimensional over $R$ and the index type $\iota$ is finite.
Module.finite_finsupp_self_iff theorem
: Module.Finite R (ι →₀ R) ↔ Subsingleton R ∨ Finite ι
Full source
@[simp high]
lemma finite_finsupp_self_iff : Module.FiniteModule.Finite R (ι →₀ R) ↔ Subsingleton R ∨ Finite ι := by
  simp only [finite_finsupp_iff, Finite.self, true_and, or_iff_right_iff_imp]
  exact fun _ ↦ .inr inferInstance
Finite-Dimensionality Criterion for Finitely Supported Functions Module: $\text{Module.Finite}\, R\, (\iota \to_{\text{f}} R) \leftrightarrow \text{Subsingleton}\, R \lor \text{Finite}\, \iota$
Informal description
The module of finitely supported functions from $\iota$ to $R$ is finite-dimensional if and only if either $R$ is a subsingleton (i.e., has at most one element) or $\iota$ is a finite type.