Zulip Chat Archive

Stream: mathlib4

Topic: Transfer via concrete OrderIso or class-like OrderIsoClass


Yakov Pechersky (Sep 09 2024 at 20:07):

I have two functionally equivalent PRs. I want to transfer SuccOrder across an order isomorphism.

In #15950, I do so using OrderIsoClass.

variable {X Y F : Type*} [EquivLike F X Y] [Preorder X] [Preorder Y] [OrderIsoClass F X Y]

@[reducible] protected def SuccOrder [SuccOrder X] (f : F) : SuccOrder Y where ...

In #16490, I do so using OrderIso.

@[reducible]
def SuccOrder.of_orderIso {X Y : Type*} [Preorder X] [Preorder Y] [SuccOrder X] (f : X o Y) :
    SuccOrder Y where ...

I had closed #16490 because I thought there is a preference for class based lemmas. @Yaël Dillies indicated that the class pattern might be worse. What is the more appropriate solution?

Yaël Dillies (Sep 09 2024 at 20:09):

Sorry, I think you misunderstood my comment. What I meant to say is that the following looks like a bad idea:

instance (priority := 100) OrderIsoClass.toOrderIsoClassOrderDual [LE α] [LE β]
    [EquivLike F α β] [OrderIsoClass F α β] : OrderIsoClass F αᵒᵈ βᵒᵈ where
  map_le_map_iff f := map_le_map_iff f

Yakov Pechersky (Sep 09 2024 at 20:21):

I see. Still, to transfer PredOrder, I'd like to work through a dualized setup, so something of that instance would be necessary. I could make it an explicit def, or rely on concrete OrderIsos in total.


Last updated: May 02 2025 at 03:31 UTC