Zulip Chat Archive

Stream: general

Topic: instantiating existentials


Hunter Freyer (Sep 29 2020 at 13:55):

If I have a hypothesis h : \exists (a : A) (b : B), (P a b), how do I get a b and P a b into the context? cases h works kinda, but it plucks off the arguments one at a time and loses their parameter names.

Heather Macbeth (Sep 29 2020 at 13:56):

obtain ⟨a, b, hP⟩ := h

Hunter Freyer (Sep 29 2020 at 13:59):

phew, alright! Thanks! How does one find out about these tactics without harassing you helpful people??

Sebastien Gouezel (Sep 29 2020 at 14:01):

https://leanprover-community.github.io/mathlib_docs/tactics.html#obtain

Patrick Massot (Sep 29 2020 at 14:05):

Hunter, did you explore this webpage?

Hunter Freyer (Sep 29 2020 at 14:11):

Some of it, yes, but it's a bit of a "kitchen sink" of docs so it's hard to know how deep to dig into each doc...

Hunter Freyer (Sep 29 2020 at 14:11):

I hadn't seen the mathlib tactics docs, that should be helpful.

Patrick Massot (Sep 29 2020 at 14:12):

The answer to your question is in the tutorial project for instance.

Hunter Freyer (Sep 29 2020 at 14:14):

aha, I'd sort of glossed over that because it takes a very number-theory/equality-based style, when I'm doing more of a dependent-types/inductive-data style, so last time I looked it wasn't so useful. But I should remember to consult that again in the future

Patrick Massot (Sep 29 2020 at 14:23):

Number theory? @Kevin Buzzard did you read that?

Patrick Massot (Sep 29 2020 at 14:24):

Anyway, you seem to be a computer scientist, so the good resource for your is probably https://github.com/blanchette/logical_verification_2020/raw/master/hitchhikers_guide.pdf

Kevin Buzzard (Sep 29 2020 at 14:26):

all that topological ring theory must have converted you


Last updated: Dec 20 2023 at 11:08 UTC