leanprover-community / leanprover-community/mathlib4

Explode is incorrectly spaced when namespaces are open-ed

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

In a context where a namespace has been open-ed, it appears the column width for the theorem row is based on a fully qualified name for the theorem (even though such name is not displayed), which throws off the spacing for the whole table. See below.

Minimal example:

import Mathlib.Tactic.Explode

namespace LongNamedNamespace
axiom TheTheorem (x: Type): x = x
end LongNamedNamespace

section
open LongNamedNamespace
theorem Theorem2 (x: Type) : x = x := by
  apply TheTheorem;
/-
Theorem2 : ∀ (x : Type), x = x

0│   │ x                             ├ Type
1│   │ TheTheorem │ x = x
2│0,1│ ∀I                            │ ∀ (x : Type), x = x


-/
#explode Theorem2
end


/-
Theorem2 : ∀ (x : Type), x = x

0│   │ x                             ├ Type
1│   │ LongNamedNamespace.TheTheorem │ x = x
2│0,1│ ∀I                            │ ∀ (x : Type), x = x


-/
#explode Theorem2


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

Start by running the minimal example using Mathlib.Tactic.Explode and compare the two #explode outputs with and without open LongNamedNamespace. Trace how the theorem row width is chosen; done means the open-namespace output uses the displayed theorem name and no longer adds spacing for the qualified name.

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.