leanprover-community / leanprover-community/mathlib4
`exact?` adds extraneous `id`
Open
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
import Mathlib.Data.Nat.ModEq
import Mathlib.Tactic.LibrarySearch
theorem foo (a b : ℕ) (h : a + b ≡ a [MOD 10]) : b ≡ 0 [MOD 10] := by
exact?
--Try this: exact Nat.ModEq.add_left_cancel (id (Nat.ModEq.symm h)) rfl
The id is unneeded and distracting.
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
Reproduce the example using Mathlib.Data.Nat.ModEq and Mathlib.Tactic.LibrarySearch, then inspect the exact? result for the unnecessary id around Nat.ModEq.add_left_cancel. Done means the suggested proof no longer includes the extraneous id while still proving foo.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100