You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defOrderDual (α : Type u) : Type u := α
variable (α : Type u) [instLE : LE α] {a b : α}
instance : LE (OrderDual α) := ⟨fun x y : α => y ≤ x⟩
theoremfoo : a ≤ b := sorryexample : a ≤ b := foo (OrderDual α) -- fails-- synthesized type class instance is not definitionally equal to expression inferred by typing rules, synthesized-- instLEOrderDual-- inferred-- instLEexample : a ≤ b := @foo (OrderDual α) _ b a -- worksexample : a ≤ b := (foo (OrderDual α) :) -- works
Here we have a goal @LE.le.{u} α instLE a b which we want to match against @LE.le.{u} (OrderDual.{u} α) (@instLEOrderDual.{u} α instLE) ?a ?b, which is possible by unfolding instLEOrderDual and then assigning ?a := b, ?b := a. However lean seems to latch on the solution ?a := a, ?b := b and then complains that the instance argument does not match.
I don't think this has anything to do with unfolding (except for the superficial sense in that we have definitional reductions in Lean..). This seems to be a side effect of the new expected-type propagation procedure. In particular, we don't synthesize type class instances before propagating the expected type, allowing the unifier to assign them.
Activity
gebner commentedon Nov 28, 2022
I don't think this has anything to do with unfolding (except for the superficial sense in that we have definitional reductions in Lean..). This seems to be a side effect of the new expected-type propagation procedure. In particular, we don't synthesize type class instances before propagating the expected type, allowing the unifier to assign them.
Let me see if that's the issue here.