Skip to content

more improvements found by tryAtEachStep#2

Merged
augustepoiroux merged 1 commit intomath-inc:gaussfrom
dwrensha:pr341-tryAtEachStep-2
Feb 24, 2026
Merged

more improvements found by tryAtEachStep#2
augustepoiroux merged 1 commit intomath-inc:gaussfrom
dwrensha:pr341-tryAtEachStep-2

Conversation

@dwrensha
Copy link

No description provided.

@augustepoiroux
Copy link

That's great, thanks! I am currently trying tryAtEachStep with rfl.
What do you think about using it with grind??

@augustepoiroux augustepoiroux merged commit 797bf3c into math-inc:gauss Feb 24, 2026
@augustepoiroux
Copy link

augustepoiroux commented Feb 24, 2026

Here is the result with rfl: #3
@dwrensha would be happy to have your opinion on it

@dwrensha
Copy link
Author

I would caution against applying rfl and grind suggestions indiscriminately.

With grind there is significant danger that you will make proofs take longer to execute. Unfortunately, tryAtEachStep does not yet measure performance.

With rfl there is danger that you will add defeq abuse.

@dwrensha dwrensha deleted the pr341-tryAtEachStep-2 branch February 24, 2026 14:44
@augustepoiroux
Copy link

I see, thanks. Indeed, having a way to automatically compare heartbeats before and after would be a really nice feature

@dwrensha
Copy link
Author

Mathlib's "tactic analysis framework" has done some work in this direction: https://github.com/leanprover-community/mathlib4/blob/master/Mathlib/Tactic/TacticAnalysis/Declarations.lean

@augustepoiroux
Copy link

@dwrensha More improvements there: #6
I created a tool based on tryAtEachStep automatically trying different tactics and applying the ones decreasing both the number of lines and the number of heartbeats. In the PR above >95% of the golfs are generated by this tool with the following criteria: reducing the number of lines by at least 2, and strictly decreasing the number of heartbeats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants