Skip to content

Commit

Permalink
feat(linear_algebra/basis): basis.ext, basis.ext' for semilinear …
Browse files Browse the repository at this point in the history
…maps (#11317)

Extend `basis.ext` and `basis.ext'` to apply to the general
(semilinear) case of `linear_map` and `linear_equiv`.
  • Loading branch information
jsm28 committed Jan 9, 2022
1 parent a58553d commit ca5e55c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/linear_algebra/basis.lean
Expand Up @@ -197,19 +197,25 @@ end coord

section ext

variables {M₁ : Type*} [add_comm_monoid M₁] [module R M₁]
variables {R₁ : Type*} [semiring R₁] {σ : R →+* R₁} {σ' : R₁ →+* R}
variables [ring_hom_inv_pair σ σ'] [ring_hom_inv_pair σ' σ]
variables {M₁ : Type*} [add_comm_monoid M₁] [module R₁ M₁]

/-- Two linear maps are equal if they are equal on basis vectors. -/
theorem ext {f₁ f₂ : M →ₗ[R] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂ :=
theorem ext {f₁ f₂ : M →ₛₗ[σ] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂ :=
by { ext x,
rw [← b.total_repr x, finsupp.total_apply, finsupp.sum],
simp only [linear_map.map_sum, linear_map.map_smul, h] }
simp only [linear_map.map_sum, linear_map.map_smulₛₗ, h] }

include σ'

/-- Two linear equivs are equal if they are equal on basis vectors. -/
theorem ext' {f₁ f₂ : M ≃ₗ[R] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂ :=
theorem ext' {f₁ f₂ : M ≃ₛₗ[σ] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂ :=
by { ext x,
rw [← b.total_repr x, finsupp.total_apply, finsupp.sum],
simp only [linear_equiv.map_sum, linear_equiv.map_smul, h] }
simp only [linear_equiv.map_sum, linear_equiv.map_smulₛₗ, h] }

omit σ'

/-- Two elements are equal if their coordinates are equal. -/
theorem ext_elem {x y : M}
Expand Down

0 comments on commit ca5e55c

Please sign in to comment.