Skip to content
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

[Merged by Bors] - feat(linear_algebra/finite_dimensional): bases given by finsets #3041

Closed
wants to merge 6 commits into from
27 changes: 26 additions & 1 deletion src/linear_algebra/finite_dimensional.lean
@@ -1,7 +1,7 @@
/-
Copyright (c) 2019 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes
Authors: Chris Hughes, Yakov Pechersky
-/
import linear_algebra.dimension
import ring_theory.principal_ideal_domain
Expand Down Expand Up @@ -111,6 +111,19 @@ begin
cases exists_is_basis K V with s hs,
exact ⟨s, hs, finite_of_linear_independent hs.1⟩
end

/-- In a finite dimensional space, there exists a finite basis. Provides the basis as a finset.
This is in contrast to `exists_is_basis_finite`, which provides a set and a `set.finite`.
-/
lemma finite_dimensional.exists_is_basis_finset [finite_dimensional K V] :
pechersky marked this conversation as resolved.
Show resolved Hide resolved
∃ b : finset V, is_basis K (subtype.val : (↑b : set V) → V) :=
begin
obtain ⟨s, s_basis, s_finite⟩ := finite_dimensional.exists_is_basis_finite K V,
refine ⟨s_finite.to_finset, _⟩,
rw set.finite.coe_to_finset,
exact s_basis,
end

variables {K V}

/-- A vector space is finite-dimensional if and only if it is finitely generated. As the
Expand All @@ -133,6 +146,11 @@ lemma of_finite_basis {ι : Type w} [fintype ι] {b : ι → V} (h : is_basis K
finite_dimensional K V :=
iff_fg.2 $ ⟨finset.univ.image b, by {convert h.2, simp} ⟩

/-- If a vector space has a finite basis, then it is finite-dimensional, finset style. -/
lemma of_finite_basis' {b : finset V} (h : is_basis K (subtype.val : (↑b : set V) -> V)) :
pechersky marked this conversation as resolved.
Show resolved Hide resolved
finite_dimensional K V :=
iff_fg.2 $ ⟨b, by {convert h.2, simp} ⟩

/-- A subspace of a finite-dimensional space is also finite-dimensional. -/
instance finite_dimensional_submodule [finite_dimensional K V] (S : submodule K V) :
finite_dimensional K S :=
Expand Down Expand Up @@ -196,6 +214,13 @@ begin
exact (lift_inj.mp this).symm
end

/-- If a vector space is finite-dimensional, then the cardinality of any basis is equal to its
`findim`. This lemma uses finsets instead of indexed types. -/
lemma finite_dimensional.findim_eq_card_basis'' [finite_dimensional K V] {b : finset V}
(h : is_basis K (subtype.val : (↑b : set V) -> V)) :
bryangingechen marked this conversation as resolved.
Show resolved Hide resolved
findim K V = finset.card b :=
by { rw [finite_dimensional.findim_eq_card_basis h, fintype.subtype_card], intros x, refl }

/-- If a submodule has maximal dimension in a finite dimensional space, then it is equal to the
whole space. -/
lemma eq_top_of_findim_eq [finite_dimensional K V] {S : submodule K V}
Expand Down