Zulip Chat Archive

Stream: lean4

Topic: Add terms to `try?`


Moritz R (Jan 28 2026 at 15:51):

First of all, a huge thank you to all the people developing on grind and the try? tactic.
It's proven (ha!) to be extremely useful to me. <3

I have a suggestion:
Sometimes i know that a specific proof term i can build (typically using 1-3 local arguments) will be really useful for discharging the goal, but grind [myterm] can't quite do it, since it's missing one or two lemmas from the library that i typically don't know by name.

How about having something to the likes of try? [myterm1, myterm2], to add these terms to the lemma filter/local assumptions?

vibecodermcswaggins (Jan 28 2026 at 15:58):

(deleted)

Moritz R (Jan 28 2026 at 15:59):

please open a different topic

Jovan Gerbscheid (Jan 28 2026 at 16:35):

Presumably, have := myterm1; have := myterm2; try? would do this?

Moritz R (Jan 28 2026 at 16:38):

good idea

Moritz R (Jan 28 2026 at 16:39):

would be a bit nicer though, if the wished-for try? [...] would also directly inline the term when it finds a proof

Kim Morrison (Jan 29 2026 at 02:39):

I'm not really sure where we would start here. try? dispatches to many different subsidiary tactics (and indeed is user extensible). I can't imagine any way of systematically passing these additional terms to the tactics, beyond just calling have first.

Jakub Nowak (Jan 29 2026 at 10:20):

Maybe we could add editor code action for inlining have/let, so at least you could do that manually after the fact?


Last updated: Feb 28 2026 at 14:05 UTC