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

Commit b39d6d8

Browse files
kckennylaujohoelzl
authored andcommitted
feat(*) refactor module
1 parent fd3e5a1 commit b39d6d8

18 files changed

+653
-621
lines changed

src/algebra/module.lean

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ universes u v w x
1313
variables {α : Type u} {β : Type v} {γ : Type w} {δ : Type x}
1414

1515
/-- Typeclass for types with a scalar multiplication operation, denoted `•` (`\bu`) -/
16-
class has_scalar (α : out_param $ Type u) (γ : Type v) := (smul : α → γ → γ)
16+
class has_scalar (α : Type u) (γ : Type v) := (smul : α → γ → γ)
1717

1818
infixr ` • `:73 := has_scalar.smul
1919

@@ -22,25 +22,26 @@ infixr ` • `:73 := has_scalar.smul
2222
connected by a "scalar multiplication" operation `r • x : β`
2323
(where `r : α` and `x : β`) with some natural associativity and
2424
distributivity axioms similar to those on a ring. -/
25-
class semimodule (α : out_param $ Type u) (β : Type v) [out_param $ semiring α]
25+
class semimodule (α : Type u) (β : Type v) [semiring α]
2626
[add_comm_monoid β] extends has_scalar α β :=
27-
(smul_add : ∀r (x y : β), r • (x + y) = r • x + r • y)
28-
(add_smul : ∀r s (x : β), (r + s) • x = r • x + s • x)
29-
(mul_smul : ∀r s (x : β), (r * s) • x = r • s • x)
27+
(smul_add : ∀(r : α) (x y : β), r • (x + y) = r • x + r • y)
28+
(add_smul : ∀(r s : α) (x : β), (r + s) • x = r • x + s • x)
29+
(mul_smul : ∀(r s : α) (x : β), (r * s) • x = r • s • x)
3030
(one_smul : ∀x : β, (1 : α) • x = x)
3131
(zero_smul : ∀x : β, (0 : α) • x = 0)
32-
(smul_zero {} : ∀r, r • (0 : β) = 0)
32+
(smul_zero {} : ∀(r : α), r • (0 : β) = 0)
3333

3434
section semimodule
35-
variables {R:semiring α} [add_comm_monoid β] [semimodule α β] (r s : α) (x y : β)
35+
variables [R:semiring α] [add_comm_monoid β] [semimodule α β] (r s : α) (x y : β)
3636
include R
3737

3838
theorem smul_add : r • (x + y) = r • x + r • y := semimodule.smul_add r x y
3939
theorem add_smul : (r + s) • x = r • x + s • x := semimodule.add_smul r s x
4040
theorem mul_smul : (r * s) • x = r • s • x := semimodule.mul_smul r s x
41-
@[simp] theorem one_smul : (1 : α) • x = x := semimodule.one_smul x
42-
@[simp] theorem zero_smul : (0 : α) • x = 0 := semimodule.zero_smul x
4341
@[simp] theorem smul_zero : r • (0 : β) = 0 := semimodule.smul_zero r
42+
variables (α)
43+
@[simp] theorem one_smul : (1 : α) • x = x := semimodule.one_smul α x
44+
@[simp] theorem zero_smul : (0 : α) • x = 0 := semimodule.zero_smul α x
4445

4546
lemma smul_smul : r • s • x = (r * s) • x := (mul_smul _ _ _).symm
4647

@@ -54,36 +55,36 @@ end semimodule
5455
connected by a "scalar multiplication" operation `r • x : β`
5556
(where `r : α` and `x : β`) with some natural associativity and
5657
distributivity axioms similar to those on a ring. -/
57-
class module (α : out_param $ Type u) (β : Type v) [out_param $ ring α]
58-
[add_comm_group β] extends semimodule α β
58+
class module (α : Type u) (β : Type v) [ring α] [add_comm_group β] extends semimodule α β
5959

6060
structure module.core (α β) [ring α] [add_comm_group β] extends has_scalar α β :=
61-
(smul_add : ∀r (x y : β), r • (x + y) = r • x + r • y)
62-
(add_smul : ∀r s (x : β), (r + s) • x = r • x + s • x)
63-
(mul_smul : ∀r s (x : β), (r * s) • x = r • s • x)
61+
(smul_add : ∀(r : α) (x y : β), r • (x + y) = r • x + r • y)
62+
(add_smul : ∀(r s : α) (x : β), (r + s) • x = r • x + s • x)
63+
(mul_smul : ∀(r s : α) (x : β), (r * s) • x = r • s • x)
6464
(one_smul : ∀x : β, (1 : α) • x = x)
6565

6666
def module.of_core {α β} [ring α] [add_comm_group β] (M : module.core α β) : module α β :=
6767
by letI := M.to_has_scalar; exact
6868
{ zero_smul := λ x,
69-
have (0 : α) • x + 0 • x = 0 • x + 0, by rw ← M.add_smul; simp,
69+
have (0 : α) • x + (0 : α) • x = (0 : α) • x + 0, by rw ← M.add_smul; simp,
7070
add_left_cancel this,
7171
smul_zero := λ r,
7272
have r • (0:β) + r • 0 = r • 0 + 0, by rw ← M.smul_add; simp,
7373
add_left_cancel this,
7474
..M }
7575

7676
section module
77-
variables {R:ring α} [add_comm_group β] [module α β] {r s : α} {x y : β}
78-
include R
77+
variables [ring α] [add_comm_group β] [module α β] (r s : α) (x y : β)
7978

8079
@[simp] theorem neg_smul : -r • x = - (r • x) :=
8180
eq_neg_of_add_eq_zero (by rw [← add_smul, add_left_neg, zero_smul])
8281

82+
variables (α)
8383
theorem neg_one_smul (x : β) : (-1 : α) • x = -x := by simp
84+
variables {α}
8485

8586
@[simp] theorem smul_neg : r • (-x) = -(r • x) :=
86-
by rw [← neg_one_smul x, ← mul_smul, mul_neg_one, neg_smul]
87+
by rw [← neg_one_smul α, ← mul_smul, mul_neg_one, neg_smul]
8788

8889
theorem smul_sub (r : α) (x y : β) : r • (x - y) = r • x - r • y :=
8990
by simp [smul_add]; rw smul_neg
@@ -107,48 +108,49 @@ instance semiring.to_semimodule [r : semiring α] : semimodule α α :=
107108
instance ring.to_module [r : ring α] : module α α :=
108109
{ ..semiring.to_semimodule }
109110

110-
class is_linear_map {α : Type u} {β : Type v} {γ : Type w}
111+
class is_linear_map (α : Type u) {β : Type v} {γ : Type w}
111112
[ring α] [add_comm_group β] [add_comm_group γ] [module α β] [module α γ]
112113
(f : β → γ) : Prop :=
113114
(add : ∀x y, f (x + y) = f x + f y)
114-
(smul : ∀c x, f (c • x) = c • f x)
115+
(smul : ∀(c : α) x, f (c • x) = c • f x)
115116

116-
structure linear_map {α : Type u} (β : Type v) (γ : Type w)
117+
structure linear_map (α : Type u) (β : Type v) (γ : Type w)
117118
[ring α] [add_comm_group β] [add_comm_group γ] [module α β] [module α γ] :=
118119
(to_fun : β → γ)
119120
(add : ∀x y, to_fun (x + y) = to_fun x + to_fun y)
120-
(smul : ∀c x, to_fun (c • x) = c • to_fun x)
121+
(smul : ∀(c : α) x, to_fun (c • x) = c • to_fun x)
121122

122-
infixr ` →ₗ `:25 := linear_map
123+
infixr ` →ₗ `:25 := linear_map _
124+
notation β ` →ₗ[`:25 α `] ` γ := linear_map α β γ
123125

124126
namespace linear_map
125127

126128
variables [ring α] [add_comm_group β] [add_comm_group γ] [add_comm_group δ]
127129
variables [module α β] [module α γ] [module α δ]
128-
variables (f g : β →ₗ γ)
130+
variables (f g : β →ₗ[α] γ)
129131
include α
130132

131-
instance : has_coe_to_fun (β →ₗ γ) := ⟨_, to_fun⟩
133+
instance : has_coe_to_fun (β →ₗ[α] γ) := ⟨_, to_fun⟩
132134

133-
theorem is_linear : is_linear_map f := {..f}
135+
theorem is_linear : is_linear_map α f := {..f}
134136

135-
@[extensionality] theorem ext {f g : β →ₗ γ} (H : ∀ x, f x = g x) : f = g :=
137+
@[extensionality] theorem ext {f g : β →ₗ[α] γ} (H : ∀ x, f x = g x) : f = g :=
136138
by cases f; cases g; congr'; exact funext H
137139

138-
theorem ext_iff {f g : β →ₗ γ} : f = g ↔ ∀ x, f x = g x :=
140+
theorem ext_iff {f g : β →ₗ[α] γ} : f = g ↔ ∀ x, f x = g x :=
139141
by rintro rfl; simp, ext⟩
140142

141143
@[simp] lemma map_add (x y : β) : f (x + y) = f x + f y := f.add x y
142144

143145
@[simp] lemma map_smul (c : α) (x : β) : f (c • x) = c • f x := f.smul c x
144146

145147
@[simp] lemma map_zero : f 0 = 0 :=
146-
by rw [← zero_smul, map_smul f 0 0, zero_smul]
148+
by rw [← zero_smul α, map_smul f 0 0, zero_smul]
147149

148150
instance : is_add_group_hom f := ⟨map_add f⟩
149151

150152
@[simp] lemma map_neg (x : β) : f (- x) = - f x :=
151-
by rw [← neg_one_smul, map_smul, neg_one_smul]
153+
by rw [← neg_one_smul α, map_smul, neg_one_smul]
152154

153155
@[simp] lemma map_sub (x y : β) : f (x - y) = f x - f y :=
154156
by simp [map_neg, map_add]
@@ -157,11 +159,11 @@ by simp [map_neg, map_add]
157159
f (t.sum g) = t.sum (λi, f (g i)) :=
158160
(finset.sum_hom f).symm
159161

160-
def comp (f : γ →ₗ δ) (g : β →ₗ γ) : β →ₗ δ := ⟨f ∘ g, by simp, by simp⟩
162+
def comp (f : γ →ₗ[α] δ) (g : β →ₗ[α] γ) : β →ₗ[α] δ := ⟨f ∘ g, by simp, by simp⟩
161163

162-
@[simp] lemma comp_apply (f : γ →ₗ δ) (g : β →ₗ γ) (x : β) : f.comp g x = f (g x) := rfl
164+
@[simp] lemma comp_apply (f : γ →ₗ[α] δ) (g : β →ₗ[α] γ) (x : β) : f.comp g x = f (g x) := rfl
163165

164-
def id : linear_map β β := ⟨id, by simp, by simp⟩
166+
def id : β →ₗ[α] β := ⟨id, by simp, by simp⟩
165167

166168
@[simp] lemma id_apply (x : β) : @id α β _ _ _ x = x := rfl
167169

@@ -172,29 +174,28 @@ variables [ring α] [add_comm_group β] [add_comm_group γ]
172174
variables [module α β] [module α γ]
173175
include α
174176

175-
def mk' (f : β → γ) (H : is_linear_map f) : β →ₗ γ := {to_fun := f, ..H}
177+
def mk' (f : β → γ) (H : is_linear_map α f) : β →ₗ γ := {to_fun := f, ..H}
176178

177-
@[simp] theorem mk'_apply {f : β → γ} (H : is_linear_map f) (x : β) :
179+
@[simp] theorem mk'_apply {f : β → γ} (H : is_linear_map α f) (x : β) :
178180
mk' f H x = f x := rfl
179181

180182
end is_linear_map
181183

182184
/-- A submodule of a module is one which is closed under vector operations.
183185
This is a sufficient condition for the subset of vectors in the submodule
184186
to themselves form a module. -/
185-
structure submodule (α : Type u) (β : Type v) {R:ring α}
187+
structure submodule (α : Type u) (β : Type v) [ring α]
186188
[add_comm_group β] [module α β] : Type v :=
187189
(carrier : set β)
188190
(zero : (0:β) ∈ carrier)
189191
(add : ∀ {x y}, x ∈ carrier → y ∈ carrier → x + y ∈ carrier)
190-
(smul : ∀ c {x}, x ∈ carrier → c • x ∈ carrier)
192+
(smul : ∀ (c:α) {x}, x ∈ carrier → c • x ∈ carrier)
191193

192194
namespace submodule
193-
variables {R:ring α} [add_comm_group β] [add_comm_group γ]
195+
variables [ring α] [add_comm_group β] [add_comm_group γ]
194196
variables [module α β] [module α γ]
195197
variables (p p' : submodule α β)
196198
variables {r : α} {x y : β}
197-
include R
198199

199200
instance : has_coe (submodule α β) (set β) := ⟨submodule.carrier⟩
200201
instance : has_mem β (submodule α β) := ⟨λ x p, x ∈ (p : set β)⟩
@@ -215,7 +216,7 @@ lemma add_mem (h₁ : x ∈ p) (h₂ : y ∈ p) : x + y ∈ p := p.add h₁ h₂
215216

216217
lemma smul_mem (r : α) (h : x ∈ p) : r • x ∈ p := p.smul r h
217218

218-
lemma neg_mem (hx : x ∈ p) : -x ∈ p := by rw ← neg_one_smul x; exact p.smul_mem _ hx
219+
lemma neg_mem (hx : x ∈ p) : -x ∈ p := by rw ← neg_one_smul α; exact p.smul_mem _ hx
219220

220221
lemma sub_mem (hx : x ∈ p) (hy : y ∈ p) : x - y ∈ p := p.add_mem hx (p.neg_mem hy)
221222

@@ -252,7 +253,7 @@ instance : module α p :=
252253
by refine {smul := (•), ..};
253254
{ intros, apply set_coe.ext, simp [smul_add, add_smul, mul_smul] }
254255

255-
protected def subtype : p →ₗ β :=
256+
protected def subtype : p →ₗ[α] β :=
256257
by refine {to_fun := coe, ..}; simp [coe_smul]
257258

258259
@[simp] theorem subtype_apply (x : p) : p.subtype x = x := rfl
@@ -287,8 +288,7 @@ end ideal
287288
This is the traditional generalization of spaces like `ℝ^n`, which have a natural
288289
addition operation and a way to multiply them by real numbers, but no multiplication
289290
operation between vectors. -/
290-
class vector_space (α : out_param $ Type u) (β : Type v)
291-
[out_param $ discrete_field α] [add_comm_group β] extends module α β
291+
class vector_space (α : Type u) (β : Type v) [discrete_field α] [add_comm_group β] extends module α β
292292

293293
/-- Subspace of a vector space. Defined to equal `submodule`. -/
294294
@[reducible] def subspace (α : Type u) (β : Type v)

src/algebra/pi_instances.lean

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ instance add_comm_group [∀ i, add_comm_group $ f i] : add_comm_group
6161
instance ring [∀ i, ring $ f i] : ring (Π i : I, f i) := by pi_instance
6262
instance comm_ring [∀ i, comm_ring $ f i] : comm_ring (Π i : I, f i) := by pi_instance
6363

64-
instance semimodule (α) {r : semiring α} [∀ i, add_comm_monoid $ f i] [∀ i, semimodule α $ f i] : semimodule α (Π i : I, f i) := by pi_instance
64+
instance semimodule (α) {r : semiring α} [∀ i, add_comm_monoid $ f i] [∀ i, semimodule α $ f i] : semimodule α (Π i : I, f i) :=
65+
{ smul := λ c f i, c • f i,
66+
smul_add := λ c f g, funext $ λ i, smul_add _ _ _,
67+
add_smul := λ c f g, funext $ λ i, add_smul _ _ _,
68+
mul_smul := λ r s f, funext $ λ i, mul_smul _ _ _,
69+
one_smul := λ f, funext $ λ i, one_smul α _,
70+
zero_smul := λ f, funext $ λ i, zero_smul α _,
71+
smul_zero := λ c, funext $ λ i, smul_zero _ }
6572
instance module (α) {r : ring α} [∀ i, add_comm_group $ f i] [∀ i, module α $ f i] : module α (Π i : I, f i) := {..pi.semimodule α}
6673
instance vector_space (α) {r : discrete_field α} [∀ i, add_comm_group $ f i] [∀ i, vector_space α $ f i] : vector_space α (Π i : I, f i) := {..pi.module α}
6774

@@ -311,8 +318,8 @@ instance {r : semiring α} [add_comm_monoid β] [add_comm_monoid γ]
311318
{ smul_add := assume a p₁ p₂, mk.inj_iff.mpr ⟨smul_add _ _ _, smul_add _ _ _⟩,
312319
add_smul := assume a p₁ p₂, mk.inj_iff.mpr ⟨add_smul _ _ _, add_smul _ _ _⟩,
313320
mul_smul := assume a₁ a₂ p, mk.inj_iff.mpr ⟨mul_smul _ _ _, mul_smul _ _ _⟩,
314-
one_smul := assume ⟨b, c⟩, mk.inj_iff.mpr ⟨one_smul _, one_smul _⟩,
315-
zero_smul := assume ⟨b, c⟩, mk.inj_iff.mpr ⟨zero_smul _, zero_smul _⟩,
321+
one_smul := assume ⟨b, c⟩, mk.inj_iff.mpr ⟨one_smul _ _, one_smul _ _⟩,
322+
zero_smul := assume ⟨b, c⟩, mk.inj_iff.mpr ⟨zero_smul _ _, zero_smul _ _⟩,
316323
smul_zero := assume a, mk.inj_iff.mpr ⟨smul_zero _, smul_zero _⟩,
317324
.. prod.has_scalar }
318325

src/analysis/normed_space/basic.lean

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ section normed_space
302302

303303
class normed_space (α : out_param $ Type*) (β : Type*) [out_param $ normed_field α]
304304
extends normed_group β, vector_space α β :=
305-
(norm_smul : ∀ a b, norm (a • b) = has_norm.norm a * norm b)
305+
(norm_smul : ∀ (a:α) b, norm (a • b) = has_norm.norm a * norm b)
306306

307307
variables [normed_field α]
308308

@@ -355,17 +355,12 @@ instance : normed_space α (E × F) :=
355355
begin
356356
intros s x,
357357
cases x with x₁ x₂,
358-
exact calc
359-
∥s • (x₁, x₂)∥ = ∥ (s • x₁, s• x₂)∥ : rfl
360-
... = max (∥s • x₁∥) (∥ s• x₂∥) : rfl
361-
... = max (∥s∥ * ∥x₁∥) (∥s∥ * ∥x₂∥) : by simp [norm_smul s x₁, norm_smul s x₂]
362-
... = ∥s∥ * max (∥x₁∥) (∥x₂∥) : by simp [mul_max_of_nonneg]
358+
change max (∥s • x₁∥) (∥s • x₂∥) = ∥s∥ * max (∥x₁∥) (∥x₂∥),
359+
rw [norm_smul, norm_smul, ← mul_max_of_nonneg _ _ (norm_nonneg _)]
363360
end,
364361

365-
add_smul := by simp[add_smul],
366-
-- I have no idea why by simp[smul_add] is not enough for the next goal
367-
smul_add := assume r x y, show (r•(x+y).fst, r•(x+y).snd) = (r•x.fst+r•y.fst, r•x.snd+r•y.snd),
368-
by simp[smul_add],
362+
add_smul := λ r x y, prod.ext (add_smul _ _ _) (add_smul _ _ _),
363+
smul_add := λ r x y, prod.ext (smul_add _ _ _) (smul_add _ _ _),
369364
..prod.normed_group,
370365
..prod.vector_space }
371366

src/analysis/normed_space/bounded_linear_maps.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ variables {G : Type*} [normed_space k G]
2929

3030
structure is_bounded_linear_map {k : Type*}
3131
[normed_field k] {E : Type*} [normed_space k E] {F : Type*} [normed_space k F] (L : E → F)
32-
extends is_linear_map L : Prop :=
32+
extends is_linear_map k L : Prop :=
3333
(bound : ∃ M, M > 0 ∧ ∀ x : E, ∥ L x ∥ ≤ M * ∥ x ∥)
3434

3535
include k
3636

3737
lemma is_linear_map.with_bound
38-
{L : E → F} (hf : is_linear_map L) (M : ℝ) (h : ∀ x : E, ∥ L x ∥ ≤ M * ∥ x ∥) :
38+
{L : E → F} (hf : is_linear_map k L) (M : ℝ) (h : ∀ x : E, ∥ L x ∥ ≤ M * ∥ x ∥) :
3939
is_bounded_linear_map L :=
4040
⟨ hf, classical.by_cases
4141
(assume : M ≤ 0, ⟨1, zero_lt_one, assume x,
@@ -58,7 +58,7 @@ lemma smul {f : E → F} (c : k) : is_bounded_linear_map f → is_bounded_linear
5858

5959
lemma neg {f : E → F} (hf : is_bounded_linear_map f) : is_bounded_linear_map (λ e, -f e) :=
6060
begin
61-
rw show (λ e, -f e) = (λ e, (-1) • f e), { funext, simp },
61+
rw show (λ e, -f e) = (λ e, (-1 : k) • f e), { funext, simp },
6262
exact smul (-1) hf
6363
end
6464

@@ -98,7 +98,7 @@ end is_bounded_linear_map
9898
-- Next lemma is stated for real normed space but it would work as soon as the base field is an extension of ℝ
9999
lemma bounded_continuous_linear_map
100100
{E : Type*} [normed_space ℝ E] {F : Type*} [normed_space ℝ F] {L : E → F}
101-
(lin : is_linear_map L) (cont : continuous L) : is_bounded_linear_map L :=
101+
(lin : is_linear_map L) (cont : continuous L) : is_bounded_linear_map L :=
102102
let ⟨δ, δ_pos, hδ⟩ := exists_delta_of_continuous cont zero_lt_one 0 in
103103
have HL0 : L 0 = 0, from (lin.mk' _).map_zero,
104104
have H : ∀{a}, ∥a∥ ≤ δ → ∥L a∥ < 1, by simpa only [HL0, dist_zero_right] using hδ,

src/data/dfinsupp.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ instance [Π i, add_group (β i)] {s : finset ι} : is_add_group_hom (@mk ι β
387387

388388
section
389389
local attribute [instance] to_module
390-
variables {γ : Type w} [ring γ] [Π i, add_comm_group (β i)] [Π i, module γ (β i)]
390+
variables (γ : Type w) [ring γ] [Π i, add_comm_group (β i)] [Π i, module γ (β i)]
391391
include γ
392-
@[simp] lemma mk_smul {s : finset ι} {c : γ} {x : Π i : (↑s : set ι), β i.1} :
392+
@[simp] lemma mk_smul {s : finset ι} {c : γ} (x : Π i : (↑s : set ι), β i.1) :
393393
mk s (c • x) = c • mk s x :=
394394
ext $ λ i, by simp only [smul_apply, mk_apply]; split_ifs; [refl, rw smul_zero]
395395

@@ -398,16 +398,16 @@ ext $ λ i, by simp only [smul_apply, mk_apply]; split_ifs; [refl, rw smul_zero]
398398
ext $ λ i, by simp only [smul_apply, single_apply]; split_ifs; [cases h, rw smul_zero]; refl
399399

400400
variable β
401-
def lmk (s : finset ι) : (Π i : (↑s : set ι), β i.1) →ₗ Π₀ i, β i :=
402-
⟨mk s, λ _ _, mk_add, λ _ _, mk_smul⟩
401+
def lmk (s : finset ι) : (Π i : (↑s : set ι), β i.1) →ₗ[γ] Π₀ i, β i :=
402+
⟨mk s, λ _ _, mk_add, λ c x, by rw [mk_smul γ x]
403403

404-
def lsingle (i) : β i →ₗ Π₀ i, β i :=
405-
⟨single i, λ _ _, single_add, λ _ _, single_smul⟩
404+
def lsingle (i) : β i →ₗ[γ] Π₀ i, β i :=
405+
⟨single i, λ _ _, single_add, λ _ _, single_smul _
406406
variable {β}
407407

408-
@[simp] lemma lmk_apply {s : finset ι} {x} : lmk β s x = mk s x := rfl
408+
@[simp] lemma lmk_apply {s : finset ι} {x} : lmk β γ s x = mk s x := rfl
409409

410-
@[simp] lemma lsingle_apply {i : ι} {x : β i} : lsingle β i x = single i x := rfl
410+
@[simp] lemma lsingle_apply {i : ι} {x : β i} : lsingle β γ i x = single i x := rfl
411411
end
412412

413413
section support_basic
@@ -754,4 +754,4 @@ subtype_domain_sum
754754

755755
end prod_and_sum
756756

757-
end dfinsupp
757+
end dfinsupp

src/data/finsupp.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ finset.induction_on s rfl $ λ a s has ih, by rw [prod_insert has, ih,
889889
section
890890
variables (α β)
891891

892-
def to_has_scalar' {R:semiring γ} [add_comm_monoid β] [semimodule γ β] : has_scalar γ (α →₀ β) := ⟨λa v, v.map_range ((•) a) (smul_zero _)⟩
892+
def to_has_scalar' [R:semiring γ] [add_comm_monoid β] [semimodule γ β] : has_scalar γ (α →₀ β) := ⟨λa v, v.map_range ((•) a) (smul_zero _)⟩
893893
local attribute [instance] to_has_scalar'
894894

895895
@[simp] lemma smul_apply' {R:semiring γ} [add_comm_monoid β] [semimodule γ β] {a : α} {b : γ} {v : α →₀ β} :
@@ -899,9 +899,9 @@ def to_semimodule {R:semiring γ} [add_comm_monoid β] [semimodule γ β] : semi
899899
{ smul := (•),
900900
smul_add := λ a x y, finsupp.ext $ λ _, smul_add _ _ _,
901901
add_smul := λ a x y, finsupp.ext $ λ _, add_smul _ _ _,
902-
one_smul := λ x, finsupp.ext $ λ _, one_smul _,
902+
one_smul := λ x, finsupp.ext $ λ _, one_smul _ _,
903903
mul_smul := λ r s x, finsupp.ext $ λ _, mul_smul _ _ _,
904-
zero_smul := λ x, finsupp.ext $ λ _, zero_smul _,
904+
zero_smul := λ x, finsupp.ext $ λ _, zero_smul _ _,
905905
smul_zero := λ x, finsupp.ext $ λ _, smul_zero _ }
906906

907907
def to_module {R:ring γ} [add_comm_group β] [module γ β] : module γ (α →₀ β) :=

0 commit comments

Comments
 (0)