Zulip Chat Archive

Stream: general

Topic: Right multiplication as a mul_action


Eric Wieser (May 16 2021 at 22:47):

We have docs#monoid.to_mul_action which defines ∀ x y : R, x • y = x * y. Is there (or should there be) some alias such that ∀ x y : R, foo x • y = y * x?

Adam Topaz (May 16 2021 at 22:58):

This won't satisfy the associativity condition for a mul action

Adam Topaz (May 16 2021 at 22:58):

We need a notion of an action on the right (right mul action, right modules, etc.)

Mario Carneiro (May 16 2021 at 22:58):

it will in a comm ring, but I guess there is no point in a separate definition in that case

Mario Carneiro (May 16 2021 at 22:59):

I hope we can get by with mul actions by the opposite ring instead of right modules

Eric Wieser (May 16 2021 at 23:00):

This won't satisfy the associativity condition for a mul action

Won't it?

instance monoid.opposite_to_mul_action (R : Type*) [monoid R] : mul_action (opposite R) R :=
{ smul := λ c x, x * c.unop,
  one_smul := by simp,
  mul_smul := λ r s x, by simp [mul_assoc] }

instance (R : Type*) [monoid R] : mul_action (opposite R) (fin 3  R) :=
by apply_instance

Adam Topaz (May 16 2021 at 23:00):

We have the has_pow class, why not have a pow_action?

Adam Topaz (May 16 2021 at 23:01):

Which would really just be a right action

Adam Topaz (May 16 2021 at 23:01):

(ax)y=axy(a^x)^y = a^{xy}

Mario Carneiro (May 16 2021 at 23:01):

@Eric Wieser isn't that just monoid.to_mul_action using the opposite mul?

Eric Wieser (May 16 2021 at 23:03):

I don't understand your question. It seems to satisfy my original request:

example (R : Type*) [monoid R] (x y : R) : opposite.op x  y = y * x := rfl

Eric Wieser (May 16 2021 at 23:05):

Does that instance above seem like a good idea to you?

Eric Wieser (May 16 2021 at 23:06):

(along with a similar one for semiring.to_semimodule etc)

Eric Wieser (May 16 2021 at 23:13):

The instance would be useful here: https://github.com/leanprover-community/mathlib/pull/7572/files#r633152366

Mario Carneiro (May 16 2021 at 23:15):

I'm basically wondering how this instance relates to the mul_action (opposite R) (opposite R) instance coming from monoid.to_mul_action. Is it the same?

Eric Wieser (May 16 2021 at 23:19):

Yes, they're definitionally equal but only if you abuse the type aliases a bit

Eric Wieser (May 17 2021 at 08:43):

#7630

Eric Wieser (May 26 2021 at 16:19):

Should we introduce a notation for this? notation a ` •← `:72 b:73 := op b • a is pretty bad but is a start:

import algebra.module.opposites

notation a ` •← `:72 b:73 := op b  a

-- precedence:
example {R} (a b c d e : R) [monoid R] :
  (a  b  c •← d •← e) = (((a  (b  c)) •← d) •← e) := rfl

Oliver Nash (May 26 2021 at 16:28):

Probably this is worse but we could also consider a↶b.

Eric Wieser (May 26 2021 at 16:36):

Here's a fun vscode unicode rendering bug:

-- safe: ≃, •⃖
-- fail: =, •⃖
-- safe: ≃, •⃖

The symbol at the end of each line is the same, but in my vscode and chrome they render differently

Gabriel Ebner (May 26 2021 at 16:38):

Should there be difference between the three lines? For me, only the ≃ and = differs (in both vscode and chromium).

Bryan Gin-ge Chen (May 26 2021 at 16:44):

The symbols at the end of each line all appear the same in Firefox on macOS, using DejaVu Sans Mono:
Screen-Shot-2021-05-26-at-12.43.22-PM.png

Gabriel Ebner (May 26 2021 at 16:44):

This is a weird bug seemingly connected to font fallback. I've been playing around with the Zulip CSS:

font-family: "Source Code Pro", monospace; /* default, broken */
font-family: "Source Code Pro", "DejaVu Sans Mono";
 /* works, reported fallback font is DejaVu Sans */
font-family: "Source Code Pro"; /* works as well, reported fallback font is DejaVu Sans */

Eric Wieser (May 26 2021 at 16:45):

In chrome on windows:

image.png

Eric Wieser (May 26 2021 at 16:46):

At any rate, that probably means the syntax I was trying is _not_ a good idea!

Gabriel Ebner (May 26 2021 at 16:47):

Chromium (actually electron) on linux:
weird_glyph.png


Last updated: Dec 20 2023 at 11:08 UTC