leanprover-community / leanprover-community/mathlib4

fin_cases breaks on intervals of Fin

Open
#14,652 7 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

fin_cases fails on some intervals over the type Fin (k + 2). For example:

import Mathlib.Tactic

example (k : ℕ) (x : Fin (k + 2)) (hx : x ∈ Finset.Iic 1) : True := by
  fin_cases hx

and

import Mathlib.Tactic

example (k : ℕ) (x : Fin (k + 2)) (hx : x ∈ Finset.Icc 0 1) : True := by
  fin_cases hx

should each create two cases, (x = ⊥ and x = 1 in the first example, x = 0 and x = 1 in the second). Instead they both return the error "(kernel) declaration has metavariables '_example'". More examples of this can be found in this thread on the Lean Zulip.

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 two examples from the issue after importing Mathlib.Tactic, using fin_cases on Finset.Iic 1 and Finset.Icc 0 1 over Fin (k + 2). Read the fin_cases tactic entry point and compare the failing interval handling with the expected two cases; done means both examples elaborate without metavariable errors and produce the stated cases.

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
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.