-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(meta/environment): the equations that lead to a given definition are now accessible in Lean code #393
base: master
Are you sure you want to change the base?
Conversation
are now accessible in Lean code
Written together with @DanielFabian |
e <- get_defn_spec n gives us a pre-term parsed from the equations typed in by the user. Those are distinct from the equations proved by the equation compiler as their can be fewer equations when multiple cases can be described by the same equation |
There are two issues here:
|
@gebner What we are after here are the equations you see in the pattern match. So if your pattern match contains 5 lines in the source code, we need a sorted list of 5 equations. And sorted, because at this point, the left hand sides are not yet disjoint. Rather, the equations need to be applied in order and the first match wins. The whole point of this is so that we get a target for something we would like to automatically prove. E.g.: def foo : nat -> nat :=
| 0 := 1
| n := 2 in this case, we want an easy way to get two goals, in order: You'll notice, that the second theorem is false. But it becomes true, if you modify it slightly: The idea is that you get this ever-growing list of premises as you go through the pattern match cases where at every point, the universally quantified theorem is true, but only because you also know that any of the previous patterns were already handled and therefore are now known to be impossible. If this is our goal, are the elaborated equations the ones we need? |
Yes, I'd strongly suggest that. |
Co-authored-by: Daniel Fabian daniel.fabian@integral-it.ch