Zulip Chat Archive
Stream: lean4
Topic: Simp/Rewrite type of constructor
Joey Eremondi (Apr 16 2024 at 06:22):
I'm trying to automate a long but tedious proof, and most cases are straightforward constructor applications, but there are some cases where it's only apparent that a constructor can be applied after some simp rules have been applied.
I'm wondering, is there either
- A version of
constructor
that rewrites the type of the constructor according to e.g. some simp lemmas, or - A version of
constructor
that applies a constructor, then produces as goals the equalities that must be satisfied for the constructor application to be type-correct
Henrik Böving (Apr 16 2024 at 06:25):
Sounds to me like Aesop is the type of tactic that you want.
Kyle Miller (Apr 16 2024 at 06:31):
It could be helpful having some examples. Is it that indices aren't defeq?
Joey Eremondi (Apr 16 2024 at 06:42):
Kyle Miller said:
It could be helpful having some examples. Is it that indices aren't defeq?
Yes exactly, the indices are propositionally equal but not definitionallly.
Kyle Miller (Apr 16 2024 at 18:04):
This tactic doesn't exist, but I've been thinking about what it would take to make it.
One issue that comes to mind is that, if you're able to create equalities, then usually every constructor is applicable (barring universe constraints). If you can name which constructor you want to apply, then I think it shouldn't be too much work to make a tactic that lets you apply it and create side goals for equalities.
Kyle Miller (Apr 16 2024 at 18:05):
It could be that you have to specify a discharger tactic (with perhaps simp
as the default discharger), and it takes the first constructor such that the discharger is able to prove all the generated equalities.
Last updated: May 02 2025 at 03:31 UTC