leanprover-community / leanprover-community/lean

local notation can change explicitness of arguments

Open
#772 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
434
Forks
79
PR merge metrics
No merged PRs in 30d

Description

(reporting this so that it can be linked to, not really requesting that this should be fixed)

The following code shows some weird interaction between local notation involving variables and the explicitness of said variables in declarations:

variables {G : Type*} {L : G → G}

local prefix ` ◾ `:67 := L

variables (L)

local prefix ` † `:67 := L

lemma explicit (p : G) : L p = p :=
sorry -- works as intended

lemma implicit (p : G) : ◾p = p :=
sorry -- the variable `L` is an implicit argument to this lemma, but should be explicit

variables {L}

lemma explicit2 (p : G) : †p = p :=
sorry -- the variable `L` is an explicit argument to this lemma, but should be implicit

#check @explicit
#check @explicit2
#check @implicit

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied Lean snippet and compare the argument explicitness reported by #check @explicit, @explicit2, and @implicit. Investigate the interaction between local notation and variable declarations; done would mean determining whether the behavior is an accepted limitation or defining a precise correction.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.