feat: aesop_contractive tactic to solve Contractive/NonExpansive goals#422
feat: aesop_contractive tactic to solve Contractive/NonExpansive goals#422arthur-adjedj wants to merge 11 commits into
aesop_contractive tactic to solve Contractive/NonExpansive goals#422Conversation
This is done by 1. weakening `introsTransparency?` to `none` and 2. erasing `Aesop.BuiltinRules.rfl` at call-site in the tactic-macro
|
Agreed with adding an |
|
Very cool! |
TODO: make it smarter on `NonExpansive` theorems
That is now implemented. I do not know if it would be useful for the tag to generate such auxiliary declarations for cases other than |
|
I played around with the PR and tweaked the annotations such that aesop_contractive can fully solve the goals. However, it seems like |
Using This seems to indicate that more than half of the time is spent running |
|
Turning off |
|
This is a good point, thanks for looking into this! This looks better, but not yet really great. If I have some time, I will look into implementing a specialized tactic for this such that we can compare performance. |
Description
This is a proof of concept that is not meant to be merged as is. This draft implements an
aesop_contractivetactic which is meant to help solveContractiveandNonExpansivegoals, similar in use to Rocq'sf_contractivetactic. This tactic works by building up a customaesopruleset, similarly to Mathlib'saesop_cat's. There is a drawback to the tactic:Many useful
Contractivetheorems are hidden behind afoo : NonExpansiveinstance, which means one needs to write a projectionfoo.neto access this theorem. However,aesopexpects declarations, not arbitrary terms, for its aesop rules, and in particular, one cannot tag such a projection termfoo.neas an aesop rule. To solve this, the PR adds a new a new@[aesop_contractive <rule-type>], generally equivalent to@[aesop safe <rule-type> (rule_sets := [aesop_contractive])], except when tagging aNonExpansive/NonExpansive₂instance. In that case, it generates the relevant auxiliary theorem and tags that instead.