leanprover-community / leanprover-community/mathlib4
Flexible linter false positives/negatives
Open
Nobody has claimed this yet.
bug
- Dominant language
- Lean
- Stars
- 4.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
- Doesn't trigger (false negative):
theorem foo {x₁ x₂ : Nat} {l₁ l₂ : List Nat} (h : x₁ :: l₁ = x₂ :: l₂) : l₁ = l₂ := by
simp at h
exact h.right
- Doesn't trigger (false negative):
theorem foo {x₁ x₂ : Nat} {l₁ l₂ : List Nat} (h : x₁ :: l₁ = x₂ :: l₂) : l₁ = l₂ := by
simp at h
have := h.right
sorry
- Triggers (false positive):
theorem foo {x₁ x₂ : Nat} {l₁ l₂ : List Nat} (h : x₁ :: l₁ = x₂ :: l₂) : l₁ = l₂ := by
simp at h
let h := 3
sorry
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides three Lean snippets showing the flexible linter's false negatives and false positive, but names no source file or test. Reproduce these examples first, then read the linter implementation and linked Zulip discussion; done means the first two cases trigger appropriately while the locally shadowed h in the third does not.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100