Zulip Chat Archive

Stream: mathlib4

Topic: mathlib4#2122


Thomas Browning (Feb 07 2023 at 00:49):

I just opened mathlib4#2122 porting Tactic.Group
I'm pretty new to lean4, and this is my first PR to mathlib4, so any feedback would be much appreciated.
In particular, the tactic really should really keep alternating between two auxiliary tactics (simp and ring), but I'm not sure how to do this and am currently just running simp <;> ring <;> simp which works for the test cases.

Jireh Loreaux (Feb 07 2023 at 03:04):

I haven't looked at the PR yet, but can't you do it essentially the same way as mathlib3? It used a call to repeat I think.

Thomas Murrills (Feb 07 2023 at 03:59):

Nice work! :) I pulled the branch and tried using repeat, but it makes some applications of group very slow—e.g. when the target is some equality that group simplifies but does not prove. Is there some tactic of the form fail_if_no_progress tacs (or equivalent meta code)?

Thomas Murrills (Feb 07 2023 at 04:06):

also here's a convenient example that fails without an extra ring call:

example (n m : ) (a b : G) : a^(m-n)*b^(m-n)*b^(n-m)*a^(n-m) = 1 := by group

Thomas Murrills (Feb 07 2023 at 04:35):

I wrote a quick one already that should do the trick (until/unless an existing version is found). :) @Thomas Browning is it ok if I commit on the PR?

Thomas Browning (Feb 07 2023 at 05:23):

@Thomas Murrills Yes, go for it!

Thomas Murrills (Feb 07 2023 at 08:31):

Maaaaaaybe that new tactic should have been a separate PR. :sweat_smile: But it's small and, I imagine, fairly low-use—and the port is chugging along—so maybe it's ok if we bundle it together with group.

Or I can split it out and we can make it a PR dependence; that wouldn't be a problem.

Thomas Murrills (Feb 07 2023 at 09:08):

Of course, we might still find that some tactic or functionality like fail_if_no_progress already existed and I just couldn't find it :upside_down: but it was a fun exercise in any case :)

Thomas Browning (Feb 07 2023 at 15:52):

Thanks for the help!

Thomas Murrills (Feb 07 2023 at 20:57):

No problem, happy to! And nice work porting group! :D

Jireh Loreaux (Feb 10 2023 at 19:28):

@Thomas Murrills is group with your failIfNoProgress relatively quick? If not, is it in part because we're in TacticM instead of MetaM and there's more overhead?

Jireh Loreaux (Feb 10 2023 at 19:30):

A good test case would be line 114 in the open PR !4#2143. If it works there and doesn't take forever then it's probably okay.

Jireh Loreaux (Feb 10 2023 at 19:35):

I just checked. It works.

Thomas Murrills (Feb 10 2023 at 19:38):

Good to hear! :) I’m also going to take another look at fail_if_no_progress today if I can, and maybe improve it a little further.

Thomas Murrills (Feb 10 2023 at 23:22):

I'm thinking we should:

  • merge Tactic.Group as-is, bundled with the current version of fail_if_no_progress
  • enhance fail_if_no_progress afterwards to use simpler checks

instead of perfecting fail_if_no_progress first, so that we don't slow down the port. Does that sound reasonable?

Jireh Loreaux (Feb 11 2023 at 01:59):

Agreed, but I don't have merge powers


Last updated: Dec 20 2023 at 11:08 UTC