Zulip Chat Archive

Stream: lean4

Topic: variable


Yury G. Kudryashov (Jan 30 2023 at 07:41):

The following doesn't work:

variable (α : Type _) [Nonempty α]

def h [Nonempty α] := α

variable {α} (x : h α)

while the following works:

variable (α : Type _) [Nonempty α]

def h [Nonempty α] := α

variable {α}
variable (x : h α)

Jakob von Raumer (Jan 30 2023 at 11:42):

Noticed this as well when porting. The issue seems to be that variable seems to either change visibility of existing variables OR introduce new one but not both?

Eric Wieser (Jan 30 2023 at 14:28):

If the behavior of performing one action or the other but not both is deliberate, should the two actions have different spellings? (eg variable vs variable update)

Kevin Buzzard (Jan 30 2023 at 15:17):

This discussion should be moved to #lean4

Notification Bot (Jan 30 2023 at 15:27):

This topic was moved here from #mathlib4 > variable by Eric Wieser.

Yury G. Kudryashov (Jan 30 2023 at 15:37):

It complains that it can't find [Nonempty α], so probably the issue is that (x : h α) is evaluated in a context that does not include previously defined (in a variable) instances.


Last updated: Dec 20 2023 at 11:08 UTC