Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for include suggest that it might affect def #5184

Closed
david-christiansen opened this issue Aug 27, 2024 · 2 comments · Fixed by #5206
Closed

Docs for include suggest that it might affect def #5184

david-christiansen opened this issue Aug 27, 2024 · 2 comments · Fixed by #5206
Labels
bug Something isn't working documentation Documentation improvement

Comments

@david-christiansen
Copy link
Contributor

david-christiansen commented Aug 27, 2024

Description

Based on the documentation comment for include:

include eeny meeny instructs Lean to include the section variables eeny and meeny in all declarations in the remainder of the current section, differing from the default behavior of conditionally including variables based on use in the declaration header. include is usually followed by the in combinator to limit the inclusion to the subsequent declaration.

I would expect that it affected def and inductive. We should probably fix this by updating these docs.

Steps to Reproduce

Write the following code:

variable
  {α : Type u} {β : Type v}
  (f : α → β) (g : β → α)

include g

def optMap (o : Option α) : Option β :=
  match o with
  | none => none
  | some x => some (f x)

#check optMap

Expected behavior:

I would expect this signature:

optMap.{u, v} {α : Type u} {β : Type v} (f : α → β) (g : β → α) (o : Option α) : Option β

Actual behavior:
This signature:

optMap.{u, v} {α : Type u} {β : Type v} (f : α → β) (o : Option α) : Option β

Versions

"4.11.0-rc2"

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@david-christiansen david-christiansen added bug Something isn't working documentation Documentation improvement labels Aug 27, 2024
@digama0
Copy link
Collaborator

digama0 commented Aug 27, 2024

I would expect that it affected def and inductive. We should probably fix this by updating these docs.

I would also expect that, and think we should fix it by making it actually do that. Having variables have slightly different behavior depending on which command is being used (keeping in mind that there is a relatively large and open ended list of command keywords) seems like a difficult thing to get in users' heads.

@Kha
Copy link
Member

Kha commented Aug 29, 2024

Let's first fix the status quo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Documentation improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants