leanprover-community / leanprover-community/mathlib4

`interval_cases using ..` appears to only support names of hypotheses, not terms

Open
#18,690 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

t-meta
Dominant language
Lean
Stars
4.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

e.g.

import Mathlib.Tactic

example {a : ℕ} (h₁ : a ≠ 0) (h₂ : a ≠ 1) : 2 ≤ a := by
  by_contra hu
  interval_cases using (Nat.zero_le a), hu <;> contradiction

which yields

    interval_cases failed: provided bound '0 ≤ a' cannot be evaluated

This works:

import Mathlib.Tactic

example {a : ℕ} (h₁ : a ≠ 0) (h₂ : a ≠ 1) : 2 ≤ a := by
  by_contra hu
  let this := (Nat.zero_le a)
  interval_cases using this, hu <;> contradiction

Semi-relatedly, it seems like using also doesn't support passing just one bound; one imagines that non-negativity of Nats or hypotheses in the context could be used along with a single explicit bound.

as reported on 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 with import Mathlib.Tactic, comparing interval_cases using (Nat.zero_le a), hu with the version that binds the term to this. Start at the interval_cases tactic entry point and determine how using arguments are evaluated; done means term bounds and the reported single-bound case behave as intended, with regression coverage.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.