Zulip Chat Archive

Stream: mathlib4

Topic: apply_with ... { instances := false }


Adam Topaz (Apr 20 2023 at 14:27):

What's the current state of the art for using apply foo while introducing goals for the missing instances?

Adam Topaz (Apr 20 2023 at 14:27):

In mathlib3, I would usually use apply_with foo { instances := false }

Eric Wieser (Apr 20 2023 at 14:27):

refine' @foo _ _ _ (_) where (_) is the instance argument

Adam Topaz (Apr 20 2023 at 14:28):

my foo has about 15 _'s

Eric Wieser (Apr 20 2023 at 14:29):

refine @foo _ _ _ ?_ might work too, I haven't tried

Eric Wieser (Apr 20 2023 at 14:29):

Sounds like you're doomed to write a lot of _s

Adam Topaz (Apr 20 2023 at 14:35):

I ended up using suffices : A ; apply ... for one instance and suffices : A x B; cases this ; apply ... ; refine' <_,_> for 2 isntances

Adam Topaz (Apr 20 2023 at 14:35):

This can't be ideal. And using refine' foo _ _ _ _ _ _ can't be ideal either.

Adam Topaz (Apr 20 2023 at 14:39):

Is there a way to get refine to work approximately as follows: refine foo ((?_ : ClassName) := _) _ _?

Eric Wieser (Apr 20 2023 at 14:40):

I requested this in another thread

Eric Wieser (Apr 20 2023 at 14:40):

There's some progress here and onwards

Adam Topaz (Apr 20 2023 at 14:41):

Great!

Eric Wieser (Apr 20 2023 at 14:41):

Eric Wieser said:

I requested this in another thread

Here

Thomas Murrills (Apr 20 2023 at 17:15):

Btw, I’m not sure how it deals with instance arguments, but note that refine' foo .. is shorthand for refine' foo _ _ _ _ _ _ (etc.)


Last updated: Dec 20 2023 at 11:08 UTC