Skip to content

Commit e916ec0

Browse files
committed
feat(LinearAlgebra/FreeModule): add repr_algebraMap (#21642)
1 parent 191be47 commit e916ec0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Mathlib/LinearAlgebra/FreeModule/Basic.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,19 @@ instance tensor : Module.Free S (M ⊗[R] N) :=
207207
end CommSemiring
208208

209209
end Module.Free
210+
211+
namespace Basis
212+
213+
open Finset
214+
215+
variable {S : Type*} [CommRing R] [Ring S] [Algebra R S]
216+
217+
/-- If `B` is a basis of the `R`-algebra `S` such that `B i = 1` for some index `i`, then
218+
each `r : R` gets represented as `s • B i` as an element of `S`. -/
219+
theorem repr_algebraMap {ι : Type*} [DecidableEq ι] {B : Basis ι R S} {i : ι} (hBi : B i = 1)
220+
(r : R) : B.repr ((algebraMap R S) r) = fun j : ι ↦ if i = j then r else 0 := by
221+
ext j
222+
rw [Algebra.algebraMap_eq_smul_one, map_smul, ← hBi, Finsupp.smul_apply, B.repr_self_apply]
223+
simp
224+
225+
end Basis

Mathlib/LinearAlgebra/LinearIndependent.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,14 @@ protected theorem LinearMap.linearIndependent_iff_of_disjoint (f : M →ₗ[R] M
958958
LinearIndependent R (f ∘ v) ↔ LinearIndependent R v :=
959959
f.linearIndependent_iff_of_injOn <| LinearMap.injOn_of_disjoint_ker le_rfl hf_inj
960960

961+
open Finset in
962+
/-- If `∑ i, f i • v i = ∑ i, g i • v i`, then for all `i`, `f i = g i`. -/
963+
theorem LinearIndependent.eq_coords_of_eq [Fintype ι] {v : ι → M} (hv : LinearIndependent R v)
964+
{f : ι → R} {g : ι → R} (heq : ∑ i, f i • v i = ∑ i, g i • v i) (i : ι) : f i = g i := by
965+
rw [← sub_eq_zero, ← sum_sub_distrib] at heq
966+
simp_rw [← sub_smul] at heq
967+
exact sub_eq_zero.mp ((linearIndependent_iff'.mp hv) univ (fun i ↦ f i - g i) heq i (mem_univ i))
968+
961969
/-- If `v` is a linearly independent family of vectors and the kernel of a linear map `f` is
962970
disjoint with the submodule spanned by the vectors of `v`, then `f ∘ v` is a linearly independent
963971
family of vectors. See also `LinearIndependent.map'` for a special case assuming `ker f = ⊥`. -/

0 commit comments

Comments
 (0)