Zulip Chat Archive

Stream: lean4

Topic: Trouble with "with" command


Teddy Baker (Sep 13 2023 at 04:13):

I am having issues with the "with" command in two cases. First I tried this tactic for an inequality
cases lt_or_gt_of_ne ineqj with ilj igj
The tactic is recognized with the with part, but without it gives an "unknown tactic" error.
I also am having the same issue with
induction i with j hj
which is a standard tactic that should not have an issue. I have tried restarting the lean server, closing vs code, rebuilding with lake build, using a different version of the code on a different codespace. All to no avail! Any help would be appreciated.

Marcus Rossel (Sep 13 2023 at 05:29):

Can you post a #mwe?

Eric Wieser (Sep 13 2023 at 08:28):

cases lt_or_gt_of_ne ineqj with ilj igj is not valid Lean 4 syntax

Ruben Van de Velde (Sep 13 2023 at 08:38):

You appear to be trying to use lean 3 syntax

Kyle Miller (Sep 13 2023 at 09:32):

There's a cases' tactic that's like the Lean 3 cases. I forget if this is core, std, or mathlib.

Kyle Miller (Sep 13 2023 at 09:35):

Similarly there is induction'

Scott Morrison (Sep 13 2023 at 10:03):

These backwards-compatibility tactics are from import Std.Tactic.Cases.

Kevin Buzzard (Sep 13 2023 at 10:18):

I used to always default to cases' and induction' (because it was what I knew) until it was pointed out to me that we now have tool tips code actions to help me get the syntax for cases right.

Patrick Massot (Sep 13 2023 at 12:36):

and code actions too.

Kevin Buzzard (Sep 13 2023 at 12:52):

Oh, I'm not sure I know my tool tips from my code actions; I actually mean "click on that blue lightbulb and the correctly-formatted code magically appears".

Eric Rodriguez (Sep 13 2023 at 12:54):

I think that is a code action

Teddy Baker (Sep 13 2023 at 20:57):

Thanks everyone!


Last updated: Dec 20 2023 at 11:08 UTC