Zulip Chat Archive

Stream: maths

Topic: Add opposite


Yury G. Kudryashov (Oct 29 2021 at 02:32):

Related to this thread, I want to have an additive version of docs#has_mul.to_has_opposite_scalar

Yury G. Kudryashov (Oct 29 2021 at 02:33):

To do this, I need to define add_opposite.

Yury G. Kudryashov (Oct 29 2021 at 02:36):

Of course, I can do it but may be it's a good reason to think about opposite API. I have a few questions:

  1. Why do we want opposite to be irreducible (unlike order_dual etc)?
  2. Should I separate opposite (category theory) from opposite (multiplicative opposite)?
  3. If we want it to stay irreducible, should I turn it into a one-field structure?

Yakov Pechersky (Oct 29 2021 at 03:39):

For 1, is it because multiplication is a binary operation that returns data while le is a binary relation that returns a Prop?

Yury G. Kudryashov (Oct 29 2021 at 03:46):

My guess is that people who wrote opposite and order_dual had different applications in mind.

Johan Commelin (Oct 29 2021 at 04:01):

Regarding 2: since preorders and categories are quite related, I guess it almost makes more sense to unify "opposite category" (currently opposite) and "opposite order" (currently order_dual), and have a different type alias for "opposite algebra" (currently opposite)

Johan Commelin (Oct 29 2021 at 04:02):

My understanding is that opposite was made irreducible because the category library got mightily confused otherwise. @Scott Morrison Can you confirm? Or was there another reason?

Yury G. Kudryashov (Oct 29 2021 at 04:03):

I don't want order_dual to be irreducible!

Yury G. Kudryashov (Oct 29 2021 at 04:04):

If we split two meanings of opposite, which one inherits the notation? What notation should we use for the other one?

Johan Commelin (Oct 29 2021 at 04:05):

Sure, I understand. So maybe Scott will save my idea by telling us that opposite doesn't need to be irreducible for categories after all...

Johan Commelin (Oct 29 2021 at 04:06):

But maybe it's as Yakov says: order_dual flips Proppy things around, whereas opposite flips data things around.

Yury G. Kudryashov (Oct 29 2021 at 04:07):

If we flip and , then we flip min and max, and this is data.

Johan Commelin (Oct 29 2021 at 04:10):

That's right, and inf and sup as well, of course.

Yury G. Kudryashov (Oct 30 2021 at 07:37):

@Scott Morrison could you please have a look at this thread?

Scott Morrison (Oct 30 2021 at 07:38):

I don't think it needs to be irreducible, but having opposite irreducible removed an easy source of confusion.

Scott Morrison (Oct 30 2021 at 07:39):

It would be equally good as a structure.

Scott Morrison (Oct 30 2021 at 07:39):

I guess I don't understand in this discussion why we might want to make to semireducible again.

Yury G. Kudryashov (Oct 30 2021 at 07:46):

To be able to use it for "dual" proofs like we do with order_dual?

Yury G. Kudryashov (Oct 30 2021 at 07:47):

And the main question is whether we should use different opposite for "multiplicative opposite" and "category theory opposite".

Yury G. Kudryashov (Oct 30 2021 at 07:48):

Since the "multiplicative opposite" is going to get an additive version.

Yury G. Kudryashov (Oct 30 2021 at 07:48):

And what should we do with notation if we split to opposites.

Scott Morrison (Oct 30 2021 at 07:51):

I don't object to splitting opposites. The category theory one is a common generalisation of the multiplicative opposite and the order dual, and I can't think of any particular reason it is "closer" to one or the other.

Yury G. Kudryashov (Oct 30 2021 at 07:54):

What do you think about notation?

Scott Morrison (Oct 30 2021 at 08:18):

If we can't use \op for both, that seems a good reason not to split them to me. :-)

Reid Barton (Oct 30 2021 at 13:57):

Scott Morrison said:

It would be equally good as a structure.

Equally good from the standpoint of avoiding confusion, but actually making it a structure would be pretty rough for the opposite category, I found.

Reid Barton (Oct 30 2021 at 13:58):

Logically, opposite corresponds to order_dual because opposite is something we apply to the objects of a category, not the morphisms. (The thing corresponding to the multiplicative opposite would be the construction that reverses the order of \otimes in a monoidal category.)

Reid Barton (Oct 30 2021 at 14:03):

However, the practical difference between opposite for categories and order_dual is that it seems like order_dual is almost exclusively used in "dual proofs", while the opposite of a category is something we're actually interested in. I'm not sure exactly why this should be (it seems like the uses of opposite categories in category theory should also correspond to uses of the opposite orders in order theory, maybe order theory is just simpler so we can just unfold the definition where it would otherwise arise, and/or we have less order theory).

Reid Barton (Oct 30 2021 at 14:05):

I would assume that is why the fact that order_dual is a plain def hasn't led to any confusion about what a <= b means yet.

Reid Barton (Oct 30 2021 at 14:08):

On the other hand, I am not sure if we have any good solution for opposite in Lean 4 yet.

Yury G. Kudryashov (Oct 30 2021 at 14:12):

Good reason to split: we want to_additive to send opposite Monoid to opposite AddMonoid, not add_opposite AddMonoid.

Yury G. Kudryashov (Oct 30 2021 at 23:25):

What about Xᵒᵖ (category theory), Xᵐᵒᵖ (multiplicative), Xᵃᵒᵖ (additive)?

Eric Wieser (Oct 30 2021 at 23:35):

Or maybe put the notation behind a locale?

Eric Wieser (Oct 30 2021 at 23:36):

And use X⁺ᵒᵖ and Xᵒᵖ for the algebra versions, and Xᵒᵖ for category theory, but in different locales

Scott Morrison (Oct 31 2021 at 00:03):

We in fact already have ᵐᵒᵖ, in src#category_theory.monoidal.opposite, although as Reid points out above this matches up well with the multiplicative opposite anyway. In any case, the monoidal opposite is sufficiently specialized that it can of course disappear into a locale if it is ever problematic.

Yury G. Kudryashov (Oct 31 2021 at 00:38):

One more possibility: Xˣᵒᵖ and X⁺ᵒᵖ for multiplicative and additive opposites.

Yury G. Kudryashov (Oct 31 2021 at 00:43):

There is also Xᕯᵒᵖ

Yury G. Kudryashov (Oct 31 2021 at 00:43):

(two stars, one symbol)

Yury G. Kudryashov (Nov 08 2021 at 15:52):

I'm trying to separate category theory opposite from multiplicative opposite. Which one should I use for docs#rack?

Yury G. Kudryashov (Nov 08 2021 at 15:52):

@Kyle Miller :up:

Kyle Miller (Nov 08 2021 at 16:34):

Let's call this a multiplicative opposite, since x ◃ y is is generalizing x * y * x⁻¹

Eric Wieser (Nov 08 2021 at 16:34):

I wonder how much overlap shelf and docs#mul_distrib_mul_action have

Kyle Miller (Nov 08 2021 at 16:46):

I'm trying to remember why I didn't use has_scalar (and introduce a has_inv_scalar) instead of using the quandle-traditional triangle. I think there might have been two reasons: (1) some quandles have a scalar structure already, like Z[t,t1]\mathbb{Z}[t,t^{-1}], and (2) it's a self-action, and homomorphisms of self-actions transform both arguments of the operation.

Eric Wieser (Nov 08 2021 at 17:52):

Regarding 2, I guess we don't have docs#mul_distrib_mul_action_hom to sit between docs#mul_action_hom and docs#mul_semiring_action_hom


Last updated: Dec 20 2023 at 11:08 UTC