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): tiny missing pieces #4089

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/linear_algebra/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ rfl
theorem comp_smul (g : M₂ →ₗ[R] M₃) (a : R) : g.comp (a • f) = a • (g.comp f) :=
ext $ assume b, by rw [comp_apply, smul_apply, g.map_smul]; refl

/-- Applying a linear map at `v : M`, seen as a linear map from `M →ₗ[R] M₂` to `M₂`. -/
def applyₗ (v : M) : (M →ₗ[R] M₂) →ₗ[R] M₂ :=
{ to_fun := λ f, f v,
map_add' := λ f g, f.add_apply g v,
map_smul' := λ x f, f.smul_apply x v }

end comm_semiring

section ring
Expand Down
17 changes: 17 additions & 0 deletions src/linear_algebra/finite_dimensional.lean
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ lemma findim_eq_card_finset_basis {b : finset V}
findim K V = finset.card b :=
by { rw [findim_eq_card_basis h, fintype.subtype_card], intros x, refl }

lemma equiv_fin {ι : Type*} [finite_dimensional K V] {v : ι → V} (hv : is_basis K v) :
∃ g : fin (findim K V) ≃ ι, is_basis K (v ∘ g) :=
begin
have : (cardinal.mk (fin $ findim K V)).lift = (cardinal.mk ι).lift,
by simp [cardinal.mk_fin (findim K V), ← findim_eq_card_basis' hv],
PatrickMassot marked this conversation as resolved.
Show resolved Hide resolved
rcases cardinal.lift_mk_eq.mp this with ⟨g⟩,
exact ⟨g, hv.comp _ g.bijective⟩
end

variables (K V)

lemma fin_basis [finite_dimensional K V] : ∃ v : fin (findim K V) → V, is_basis K v :=
let ⟨B, hB, B_fin⟩ := exists_is_basis_finite K V, ⟨g, hg⟩ := finite_dimensional.equiv_fin hB in
⟨coe ∘ g, hg⟩

variables {K V}

lemma cardinal_mk_le_findim_of_linear_independent
[finite_dimensional K V] {ι : Type w} {b : ι → V} (h : linear_independent K b) :
cardinal.mk ι ≤ findim K V :=
Expand Down