Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit dae87bc

Browse files
committed
chore(data/finsupp/basic): Remove finsupp.leval which duplicates finsupp.lapply (#4876)
1 parent 5334f48 commit dae87bc

File tree

5 files changed

+15
-28
lines changed

5 files changed

+15
-28
lines changed

src/algebra/big_operators/finsupp.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ variables {α : Type u} {ι : Type v} {β : Type w} [add_comm_monoid β]
2121
variables {s : finset α} {f : α → (ι →₀ β)} (i : ι)
2222

2323
theorem finset.sum_apply' : (∑ k in s, f k) i = ∑ k in s, f k i :=
24-
(s.sum_hom $ finsupp.eval_add_hom i).symm
24+
(s.sum_hom $ finsupp.apply_add_hom i).symm
2525

2626
variables {γ : Type u₁} {δ : Type v₁} [add_comm_monoid δ]
2727
variables (g : ι →₀ β) (k : ι → β → γ → δ) (x : γ)

src/data/finsupp/basic.lean

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Johannes Hölzl, Scott Morrison
55
-/
66
import algebra.group.pi
77
import algebra.big_operators.order
8-
import algebra.module.linear_map
8+
import algebra.module.basic
99
import data.fintype.card
1010
import data.finset.preimage
1111
import data.multiset.antidiagonal
@@ -638,14 +638,18 @@ instance : add_monoid (α →₀ M) :=
638638
zero_add := assume ⟨s, f, hf⟩, ext $ assume a, zero_add _,
639639
add_zero := assume ⟨s, f, hf⟩, ext $ assume a, add_zero _ }
640640

641-
/-- `finsupp.single` as an `add_monoid_hom`. -/
641+
/-- `finsupp.single` as an `add_monoid_hom`.
642+
643+
See `finsupp.lsingle` for the stronger version as a linear map.
644+
-/
642645
@[simps] def single_add_hom (a : α) : M →+ α →₀ M :=
643646
⟨single a, single_zero, λ _ _, single_add⟩
644647

645-
/-- Evaluation of a function `f : α →₀ M` at a point as an additive monoid homomorphism. -/
646-
def eval_add_hom (a : α) : (α →₀ M) →+ M := ⟨λ g, g a, zero_apply, λ _ _, add_apply⟩
648+
/-- Evaluation of a function `f : α →₀ M` at a point as an additive monoid homomorphism.
647649
648-
@[simp] lemma eval_add_hom_apply (a : α) (g : α →₀ M) : eval_add_hom a g = g a := rfl
650+
See `finsupp.lapply` for the stronger version as a linear map. -/
651+
@[simps apply]
652+
def apply_add_hom (a : α) : (α →₀ M) →+ M := ⟨λ g, g a, zero_apply, λ _ _, add_apply⟩
649653

650654
lemma single_add_erase (a : α) (f : α →₀ M) : single a (f a) + f.erase a = f :=
651655
ext $ λ a',
@@ -834,7 +838,7 @@ finset.subset.antisymm
834838
@[simp] lemma sum_apply [has_zero M] [add_comm_monoid N]
835839
{f : α →₀ M} {g : α → M → β →₀ N} {a₂ : β} :
836840
(f.sum g) a₂ = f.sum (λa₁ b, g a₁ b a₂) :=
837-
(eval_add_hom a₂ : (β →₀ N) →+ _).map_sum _ _
841+
(apply_add_hom a₂ : (β →₀ N) →+ _).map_sum _ _
838842

839843
lemma support_sum [has_zero M] [add_comm_monoid N]
840844
{f : α →₀ M} {g : α → M → (β →₀ N)} :
@@ -1608,24 +1612,7 @@ instance [semiring R] [add_comm_monoid M] [semimodule R M] : semimodule R (α
16081612
zero_smul := λ x, ext $ λ _, zero_smul _ _,
16091613
smul_zero := λ x, ext $ λ _, smul_zero _ }
16101614

1611-
variables {α M} (R)
1612-
1613-
/-- Evaluation at point as a linear map. This version assumes that the codomain is a semimodule
1614-
over some semiring. See also `leval`. -/
1615-
def leval' [semiring R] [add_comm_monoid M] [semimodule R M] (a : α) :
1616-
(α →₀ M) →ₗ[R] M :=
1617-
⟨λ g, g a, λ _ _, add_apply, λ _ _, rfl⟩
1618-
1619-
@[simp] lemma coe_leval' [semiring R] [add_comm_monoid M] [semimodule R M] (a : α) (g : α →₀ M) :
1620-
leval' R a g = g a :=
1621-
rfl
1622-
1623-
variable {R}
1624-
1625-
/-- Evaluation at point as a linear map. This version assumes that the codomain is a semiring. -/
1626-
def leval [semiring R] (a : α) : (α →₀ R) →ₗ[R] R := leval' R a
1627-
1628-
@[simp] lemma coe_leval [semiring R] (a : α) (g : α →₀ R) : leval a g = g a := rfl
1615+
variables {α M} {R}
16291616

16301617
lemma support_smul {_ : semiring R} [add_comm_monoid M] [semimodule R M] {b : R} {g : α →₀ M} :
16311618
(b • g).support ⊆ g.support :=

src/data/polynomial/coeff.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ by { rw [mem_support_to_fun, not_not], refl, }
4848
variable (R)
4949
/-- The nth coefficient, as a linear map. -/
5050
def lcoeff (n : ℕ) : polynomial R →ₗ[R] R :=
51-
finsupp.leval n
51+
finsupp.lapply n
5252
variable {R}
5353

5454
@[simp] lemma lcoeff_apply (n : ℕ) (f : polynomial R) : lcoeff R n f = coeff f n := rfl

src/linear_algebra/basis.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ begin
149149
{ to_fun := λ x, f x i,
150150
map_add' := λ _ _, by rw [hadd, pi.add_apply],
151151
map_smul' := λ _ _, by rw [hsmul, pi.smul_apply] },
152-
show (finsupp.leval i).comp hv.repr x = f_i x,
152+
show (finsupp.lapply i).comp hv.repr x = f_i x,
153153
congr' 1,
154154
refine hv.ext (λ j, _),
155155
show hv.repr (v j) i = f (v j) i,

src/linear_algebra/finsupp.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ lhom_ext $ λ a, linear_map.congr_fun (h a)
8181

8282
/-- Interpret `λ (f : α →₀ M), f a` as a linear map. -/
8383
def lapply (a : α) : (α →₀ M) →ₗ[R] M :=
84-
{ map_smul' := assume a b, rfl, ..finsupp.eval_add_hom a }
84+
{ map_smul' := assume a b, rfl, ..finsupp.apply_add_hom a }
8585

8686
section lsubtype_domain
8787
variables (s : set α)

0 commit comments

Comments
 (0)