Zulip Chat Archive

Stream: general

Topic: arguments-are-not-implicit


Matei Adriel (Mar 17 2022 at 18:49):

I am following along https://leanprover.github.io/theorem_proving_in_lean4/dependent_type_theory.html

I tried pasting the following example in neovim: image.png

For some reason, all the arguments have to be explicitly passed for me. Am I doing something wrong?

Arthur Paulino (Mar 17 2022 at 18:57):

(The #new members stream is better focused on helping with such questions)

What do you mean? What were you expecting to see?

Matei Adriel (Mar 17 2022 at 19:03):

Arthur Paulino said:

(The #new members stream is better focused on helping with such questions)

What do you mean? What were you expecting to see?

The book says lean should be able to infer what arguments need to be implicit

Arthur Paulino (Mar 17 2022 at 19:11):

It's easier to see it happening here:

def id' (a : α) := a
#print id'
-- def id'.{u_1} : {α : Sort u_1} → α → α :=
-- fun {α} a => a

Notice how Lean added α as an implicit parameter of id'

In the example that you posted, everything has already been declared to be explicit. Like this:

variable (α : Sort u_1)

def id' (a : α) := a
#print id'
-- def id'.{u_1} : (α : Sort u_1) → α → α :=
-- fun α a => a

Last updated: Dec 20 2023 at 11:08 UTC