leanprover-community / leanprover-community/mathlib4

`exact?` adds extraneous `id`

Open
#7,068 0 comments 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.