Zulip Chat Archive

Stream: Is there code for X?

Topic: hom.op_inv


Damiano Testa (Mar 29 2022 at 12:35):

Dear All,

is a definition similar to the one below available already?

Thanks!

import algebra.group.opposite

open mul_opposite

@[to_additive]
def hom.op_inv {α : Type*} [group α] : α →* αᵐᵒᵖ :=
λ x, op x⁻¹, by simp, by simp

Yaël Dillies (Mar 29 2022 at 12:39):

cc @Mantas Baksys

Yaël Dillies (Mar 29 2022 at 12:41):

You probably want to name it monoid_hom.op_inv and have all other options, like mul_hom.op_inv, monoid_with_zero_hom.op_inv, the additive versions...

Damiano Testa (Mar 29 2022 at 12:43):

Ok, thanks! At least, it was not simply a matter of adding docs# in front of my name and finding it!

Damiano Testa (Mar 29 2022 at 12:43):

I think that I would even prefer to have

@[to_additive]
def mul_opposite.op_inv_equiv {α : Type*} [group α] : α ≃* αᵐᵒᵖ :=
{ to_fun    := λ x : α, op x⁻¹,
  inv_fun   := λ x : αᵐᵒᵖ, unop x⁻¹,
  left_inv  := λ x, by simp,
  right_inv := λ x, by simp,
  map_mul'  := λ x y, by simp }

Mantas Baksys (Mar 29 2022 at 12:46):

I've added some new instances to op in my PR #12931 but your definition was out of scope, so I didn't touch it :smile:

Mantas Baksys (Mar 29 2022 at 12:47):

Damiano Testa said:

I think that I would even prefer to have

@[to_additive]
def equiv.op_inv {α : Type*} [group α] : α ≃* αᵐᵒᵖ :=
{ to_fun    := λ x : α, op x⁻¹,
  inv_fun   := λ x : αᵐᵒᵖ, unop x⁻¹,
  left_inv  := λ x, by simp,
  right_inv := λ x, by simp,
  map_mul'  := λ x y, by simp }

How about mul_opposite.op_inv_equiv for the name?

Damiano Testa (Mar 29 2022 at 12:49):

Mantas, thanks for the input! I updated the name!

Damiano Testa (Mar 29 2022 at 13:07):

While we are at it, where should this definition go?

Damiano Testa (Mar 29 2022 at 13:09):

(Note: I would like to keep the PR small, simply containing this definition and maybe a couple of simp/rfl lemmas that go with it! I would rather not also do climb the has_mul/mul_one_class/.../field class-ladder!)

Yaël Dillies (Mar 29 2022 at 13:46):

I would do αᵐᵒᵖ ≃* α to have the more complicated stuff on the LHS.

Damiano Testa (Mar 29 2022 at 13:59):

Found it! I think that it is docs#mul_equiv.inv'. The direction is the opposite to the one that Yaël suggests.

Yaël Dillies (Mar 29 2022 at 14:03):

Can you unify docs#mul_equiv.inv and docs#mul_equiv.inv' by working over a div_inv_monoid?

Eric Wieser (Mar 29 2022 at 15:43):

Probably not, because a div_inv_monoid tells you nothing about how inv behaves

Eric Wieser (Mar 29 2022 at 15:44):

Yaël Dillies said:

Can you unify docs#mul_equiv.inv and docs#mul_equiv.inv' by working over a div_inv_monoid?

I think you're muddling things, one of these is for group and the other for comm_group. Did you mean docs#mul_equiv.inv₀?

Eric Wieser (Mar 29 2022 at 15:45):

We seem not to have mul_equiv.inv₀' for group_with_zero

Yaël Dillies (Mar 29 2022 at 15:46):

Ah it's still the same problem that we have no typeclass stronger than has_involutive_inv and monoid and weaker than group and group_with_zero.

Damiano Testa (Mar 29 2022 at 19:28):

What would be this intermediate typeclass? Something where the inverse of a product is the (reversed) product of the inverses?

Yaël Dillies (Mar 29 2022 at 19:47):

Is that enough for inv to be involutive? In any case, it should be stronger than div_inv_monoid.

Yaël Dillies (Mar 29 2022 at 19:48):

For the record, such a typeclass would allow us to deduplicate docs#set.div_inv_monoid and docs#set.div_inv_monoid'


Last updated: Dec 20 2023 at 11:08 UTC