leanprover / leanprover/reference-manual

Inductives don't always split parameters from indices with the colon

Open
#902 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
129
Forks
67
Avg merge
1d 15h
Merged PRs (30d)
16

Description

This is mostly nit, but just in case it is unintended. (Otherwise feel free to close.)

I would naively expect the reference to follow the convention that inductive declarations use the colon to separate (uniform) parameters from indices. One place where the source code, the semantics, and the reference differ (which I find surprising because I would expect the reference to either reflect the source code or its semantics) is for HEq.

The source code says (relying on inductive.autoPromoteIndices I guess):

inductive HEq : {α : Sort u} → α → {β : Sort u} → β → Prop where
  | refl (a : α) : HEq a a

The semantics (#print HEq) says (number of parameters is 2, not 0 like above and not 1 like below):

Lean 4: inductive HEq.{u} : {α : Sort u} → α → {β : Sort u} → β → Prop
number of parameters: 2
constructors:
HEq.refl : ∀ {α : Sort u} (a : α), a ≍ a

The reference shows:
HEq.{u} {α : Sort u} : α → {β : Sort u} → β → Prop

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 comparing the reference-manual rendering of HEq with the source declaration in Init/Prelude.lean and the output of #print HEq, focusing on how the colon separates parameters from indices. Done means the reference consistently reflects the intended parameter count and declaration structure.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.