Zulip Chat Archive

Stream: new members

Topic: Question about type parameters to `Exists`


Rajiv (Dec 12 2020 at 14:46):

I am trying to understand how Exists works in Lean.

In logic.lean Exists is defined as follows.

inductive Exists {α : Sort u} (p : α  Prop) : Prop
| intro (w : α) (h : p w) : Exists

Now in this example,

variable U : Type

variable A : U  U  Prop

variable a :  (x : U) (y : U), A x y

#check a

What values would α and p take in the type constructor for Exists?

Kenny Lau (Dec 12 2020 at 14:47):

This is syntactic sugar for nested exists

Kenny Lau (Dec 12 2020 at 14:47):

you can put set_option pp.all true on the line before #check a

Rajiv (Dec 12 2020 at 14:52):

Thanks Kenny. I am really looking forward to going back to Haskell, after I understand lean type system! :-)


Last updated: Dec 20 2023 at 11:08 UTC