Zulip Chat Archive

Stream: new members

Topic: exists.elim in tactic mode?


Abhimanyu Pallavi Sudhir (Oct 11 2018 at 11:45):

Hi -- I've been trying to prove a certain relation is symmetric -- is there a way to use "exists.elim" in tactic mode? It always gives me errors.

Johan Commelin (Oct 11 2018 at 11:46):

Is that existsi?

Edward Ayers (Oct 11 2018 at 11:48):

cases h with x p will take an existential hypothesis and hit it with exists.elim

Johan Commelin (Oct 11 2018 at 11:49):

Aah, in that case, you might also be interested in rcases. It is cases on steroids.

Edward Ayers (Oct 11 2018 at 11:52):

example (P : α  Prop) (Q : Prop) (h₁ :  x, P(x)) (h₂ :  x, P(x)  Q) : Q :=
begin
    cases h₁ with x h₃, -- you can also omit the `with` and it will name them `h₁_w` and `h₁_h`
    apply h₂ _ h₃
end

Abhimanyu Pallavi Sudhir (Oct 11 2018 at 11:53):

Ok, that seems to work, thanks. It's quite natural to uses cases on ∃, certainly.

Abhimanyu Pallavi Sudhir (Oct 11 2018 at 12:13):

(deleted)

Abhimanyu Pallavi Sudhir (Oct 11 2018 at 12:14):

(deleted)

Abhimanyu Pallavi Sudhir (Oct 11 2018 at 12:15):

(deleted)

Bryan Gin-ge Chen (Oct 11 2018 at 14:06):

I've been writing exact exists.elim h (by { intro x hx, ... }), but maybe that's considered less elegant.

Kenny Lau (Oct 11 2018 at 14:11):

yes, that is considered less elegant

Kevin Buzzard (Oct 11 2018 at 15:27):

Elegance was never my strong point when it came to Lean code.

Kevin Buzzard (Oct 11 2018 at 15:27):

Lucky I might now have an MSc student who will elegantify my code :D


Last updated: Dec 20 2023 at 11:08 UTC