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

Commit 12c4562

Browse files
committed
alternate approach
1 parent fa6e8d2 commit 12c4562

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

src/group_theory/group_action/defs.lean

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,11 @@ instance is_scalar_tower.op_right [has_scalar M α] [has_scalar M N]
222222
smul_assoc]⟩
223223

224224
namespace has_scalar
225-
variables [has_scalar M α]
226225

227226
/-- Auxiliary definition for `has_scalar.comp`, `mul_action.comp_hom`,
228227
`distrib_mul_action.comp_hom`, `module.comp_hom`, etc. -/
229228
@[simp, to_additive /-" Auxiliary definition for `has_vadd.comp`, `add_action.comp_hom`, etc. "-/]
230-
def comp.smul (g : N → M) (n : N) (a : α) : α :=
229+
def comp.smul [has_scalar M α] (g : N → M) (n : N) (a : α) : α :=
231230
g n • a
232231

233232
variables (α)
@@ -238,39 +237,31 @@ See note [reducible non-instances]. Since this is reducible, we make sure to go
238237
`has_scalar.comp.smul` to prevent typeclass inference unfolding too far. -/
239238
@[reducible, to_additive /-" An additive action of `M` on `α` and a function `N → M` induces
240239
an additive action of `N` on `α` "-/]
241-
def comp (g : N → M) : has_scalar N α :=
240+
def comp [has_scalar M α] (g : N → M) : has_scalar N α :=
242241
{ smul := has_scalar.comp.smul g }
243242

244243
variables {α}
245244

246245
/-- Given a tower of scalar actions `M → α → β`, if we use `has_scalar.comp`
247246
to pull back both of `M`'s actions by a map `g : N → M`, then we obtain a new
248247
tower of scalar actions `N → α → β`.
249-
250-
This cannot be an instance because it can cause infinite loops whenever the `has_scalar` arguments
251-
are still metavariables.
252248
-/
253249
@[priority 100]
254-
lemma comp.is_scalar_tower [has_scalar M β] [has_scalar α β] [is_scalar_tower M α β]
250+
instance comp.is_scalar_tower {_ : has_scalar M α} {_ : has_scalar M β}
251+
[has_scalar α β] [is_scalar_tower M α β]
255252
(g : N → M) :
256253
(by haveI := comp α g; haveI := comp β g; exact is_scalar_tower N α β) :=
257254
by exact {smul_assoc := λ n, @smul_assoc _ _ _ _ _ _ _ (g n) }
258255

259-
/--
260-
This cannot be an instance because it can cause infinite loops whenever the `has_scalar` arguments
261-
are still metavariables.
262-
-/
263256
@[priority 100]
264-
lemma comp.smul_comm_class [has_scalar β α] [smul_comm_class M β α] (g : N → M) :
257+
instance comp.smul_comm_class {_ : has_scalar M α} {_ : has_scalar M β}
258+
[has_scalar β α] [smul_comm_class M β α] (g : N → M) :
265259
(by haveI := comp α g; exact smul_comm_class N β α) :=
266260
by exact {smul_comm := λ n, @smul_comm _ _ _ _ _ _ (g n) }
267261

268-
/--
269-
This cannot be an instance because it can cause infinite loops whenever the `has_scalar` arguments
270-
are still metavariables.
271-
-/
272262
@[priority 100]
273-
lemma comp.smul_comm_class' [has_scalar β α] [smul_comm_class β M α] (g : N → M) :
263+
instance comp.smul_comm_class' {_ : has_scalar M α} {_ : has_scalar M β}
264+
[has_scalar β α] [smul_comm_class β M α] (g : N → M) :
274265
(by haveI := comp α g; exact smul_comm_class β N α) :=
275266
by exact {smul_comm := λ _ n, @smul_comm _ _ _ _ _ _ _ (g n) }
276267

0 commit comments

Comments
 (0)