Zulip Chat Archive

Stream: mathlib4

Topic: Failure to synthesize instance


Chris Hughes (Dec 01 2022 at 13:19):

This instance failure came up when porting Order.Hom.Basic . PR It seems pretty difficult to fix and in earlier versions of Lean4 (2022-20-10), the class OrderIsoClass gives an error to do with LE \a depending on an outParam but not being an outParam. This seems to not have a solution within my Lean4 expertise.

class EquivLike (E : Sort _) (α β : outParam (Sort _)) where
/-- `OrderIsoClass F α β` states that `F` is a type of order isomorphisms.


You should extend this class when you extend `OrderIso`. -/
class OrderIsoClass (F : Type _) (α β : outParam (Type _)) [LE α] [LE β] extends
  EquivLike F α β where


example (F α β : Type _) [LE α] [LE β] [OrderIsoClass F α β] : EquivLike F α β := by infer_instance

Sebastien Gouezel (Dec 01 2022 at 13:52):

Is this the same issue as https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/instance.20loop.3F/near/313151621?

Scott Morrison (Dec 01 2022 at 14:49):

We should probably just wait on porting any files involving EquivLike for now.

Scott Morrison (Dec 01 2022 at 14:50):

Until https://github.com/leanprover/lean4/issues/1901 is fixed, EquivLike is going to cause lots of problems.

Scott Morrison (Dec 01 2022 at 14:51):

Sorry, even FunLike.

Chris Hughes (Dec 01 2022 at 14:52):

There are not very many files that don't depend on these things.

Scott Morrison (Dec 01 2022 at 14:55):

Yes, it's a difficult situation. Hopefully we have a fix soon.

Scott Morrison (Dec 01 2022 at 14:55):

If someone reviews/merges my category theory PR, most of category theory is independent of FunLike.

Scott Morrison (Dec 01 2022 at 14:56):

And if someone finishes my Heyting PR, getting up to Data.Set.Basic should be open.

Chris Hughes (Dec 01 2022 at 15:04):

I'm working on your Heyting PR right now. There's a difficult Type Class issue there as well. It's hard to minimize

Chris Hughes (Dec 01 2022 at 17:54):

Chris Hughes said:

I'm working on your Heyting PR right now. There's a difficult Type Class issue there as well. It's hard to minimize

Type class problem fixed and this PR should be Ready To Merge


Last updated: Dec 20 2023 at 11:08 UTC