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] - chore(LinearAlgebra/Finsupp/LinearCombination) : restore order of two lemmas #22713

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ theorem linearCombination_single (c : R) (a : α) :
theorem linearCombination_zero_apply (x : α →₀ R) : (linearCombination R (0 : α → M)) x = 0 := by
simp [linearCombination_apply]

variable (α M)

@[simp]
theorem linearCombination_zero : linearCombination R (0 : α → M) = 0 :=
LinearMap.ext (linearCombination_zero_apply R)

@[simp]
theorem linearCombination_single_index (c : M) (a : α) (f : α →₀ R) [DecidableEq α] :
linearCombination R (Pi.single a c) f = f a • c := by
rw [linearCombination_apply, sum_eq_single a, Pi.single_eq_same]
· exact fun i _ hi ↦ by rw [Pi.single_eq_of_ne hi, smul_zero]
· exact fun _ ↦ by simp only [single_eq_same, zero_smul]

variable {α M}

theorem linearCombination_linear_comp (f : M →ₗ[R] M') :
linearCombination R (f ∘ v) = f ∘ₗ linearCombination R v := by
ext
Expand Down Expand Up @@ -251,21 +266,6 @@ theorem linearCombination_onFinset {s : Finset α} {f : α → R} (g : α → M)
contrapose! h
simp [h]

variable (α M)

@[simp]
theorem linearCombination_zero : linearCombination R (0 : α → M) = 0 :=
LinearMap.ext (linearCombination_zero_apply R)

@[simp]
theorem linearCombination_single_index (c : M) (a : α) (f : α →₀ R) [DecidableEq α] :
linearCombination R (Pi.single a c) f = f a • c := by
rw [linearCombination_apply, sum_eq_single a, Pi.single_eq_same]
· exact fun i _ hi ↦ by rw [Pi.single_eq_of_ne hi, smul_zero]
· exact fun _ ↦ by simp only [single_eq_same, zero_smul]

variable {α M}

variable [Module S M] [SMulCommClass R S M]

variable (S) in
Expand Down
Loading