Skip to content

case name has unnecessary parts #6550

@b-mehta

Description

@b-mehta

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The case name is unnecessarily long when deconstructing many parts.

Context

Example:

example (h : ∃ a b c d e f g : ℕ, False ∨ False) : False := by
  obtain ⟨a, b, c, d, e, f, g, h | h⟩ := h
  · sorry
  · sorry

The goals are now labelled case intro.intro.intro.intro.intro.intro.intro.inl and case intro.intro.intro.intro.intro.intro.intro.inr.

This happens surprisingly often to me, particularly when I deconstruct many existentials: I just had a case where it was named intro.intro.intro.intro.mk.mk.intro.intro.inr.twice where inr.twice is the only meaningful part of the label.

Steps to Reproduce

  1. Code as above

Expected behavior:
Desirable behaviour here would be that when deconstructing an inductive which has exactly one constructor, nothing is appended to the case name. In this case, the goals would be labelled case inl and case inr.

Actual behavior:
The goals are labelled case intro.intro.intro.intro.intro.intro.intro.inl and case intro.intro.intro.intro.intro.intro.intro.inr.

Versions

Using live.lean-lang.org:
Lean 4.16.0-rc1
Target: x86_64-unknown-linux-gnu

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-mediumWe may work on this issue if we find the timebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions