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
command to unpack an existential with classical.some
#11682
Comments
If I can extend your feature request: it would be nice if it could also deal with statements like |
Note: the implementation of |
@fpvandoorn what declarations would you expect it to make? I feel like I'm missing something fairly obvious here |
If I prove def it1 (l : _) : T := classical.some $ it_exists l
def it2 (l : _) : S := classical.some $ classical.some_spec $ it_exists l
lemma it_spec1 (l : _) : P (it1 l) (it2 l) := (classical.some_spec $ classical.some_spec $ it_exists l).1
lemma it_spec2 (l : _) : Q (it2 l) (it1 l) := (classical.some_spec $ classical.some_spec $ it_exists l).2 Here is an example where that would be useful (though in that code I also did some other things that weren't purely "use |
I have an implementation. Do I need to ask on zulip to open a PR? |
I sent you an invitation so that you can push to a branch of mathlib. Please read https://leanprover-community.github.io/contribute/index.html and open an PR. |
Adds an attribute `expand_exists`, which takes a proof that something exists with some property, and outputs a value using `classical.some`, and a proof that it has that property using `classical.some_spec`. Closes #11682
I've recently found myself repeating this pattern a bunch:
It would be relatively easy to write a metaprogram that automatically generates
it
andit_spec
fromit_exists
. This could be run with an atribute onit_exists
and/or a command afterward:Note: the type of
it_spec
is defeq, but not syntactically equal, to the type ofclassical.some_spec (it_exists a b c d)
.The text was updated successfully, but these errors were encountered: