Zulip Chat Archive

Stream: Is there code for X?

Topic: MulOpposites and [instances]


Damiano Testa (Aug 23 2023 at 07:04):

Dear All,

in mathlib4, the implementation of Mul/AddOpposites changed wrt mathlib3 and I am not yet famliar with the setup.

Is the instance below available? Usable? Desirable? Of course, there are plenty more, in case this one is missing!

import Mathlib.Algebra.Opposites
import Mathlib.Algebra.Group.Defs
import Mathlib.Tactic.ApplyFun

open MulOpposite
instance {A : Type*} [inst : Mul A] [inst_1 : IsLeftCancelMul A] : IsRightCancelMul Aᵐᵒᵖ :=
fun a b c bc => by
  apply_fun unop at bc  using unop_injective (α := A)
  exact mul_left_cancel bc

Eric Wieser (Aug 23 2023 at 07:45):

I think it's just missing

Eric Wieser (Aug 23 2023 at 07:45):

I think the stronger CancelMonoid-like classes are there

Damiano Testa (Aug 23 2023 at 07:48):

I'll PR it soon, then!

Unless @Junyan Xu wants to beat me to it! (This is for the PR on NoZeroDivisors.)

Damiano Testa (Aug 23 2023 at 07:57):

For reference, docs#MulOpposite.addSemigroup and around there is what Eric was saying, I believe.

Damiano Testa (Aug 23 2023 at 07:59):

Even though, Mul...add is a little strange. Seems like to_additive is missing a trick!

Damiano Testa (Aug 23 2023 at 11:23):

#6752


Last updated: Dec 20 2023 at 11:08 UTC