Zulip Chat Archive

Stream: lean4

Topic: Resolve instance from term


Wojciech Nawrocki (Jun 08 2023 at 20:36):

I ran into the following situation. In my goal type, I have a term @foo a [_: Instance b] where Instance a cannot be inferred by typeclass synthesis, but Instance b works because b was rewritten to a earlier and they are defeq in a way that synthesis doesn't see through. Then I want to rewrite by fooThm (x) : @foo x [_: Instance x] = bar. Unfortunately, rw [fooThm] unifies x := aand then tries to synthesize the instance, which fails. Can I make it "pick up" the instance from the term instead, i.e. unify against it?

Eric Wieser (Jun 08 2023 at 22:19):

I've had this happen when porting


Last updated: Dec 20 2023 at 11:08 UTC