leanprover / leanprover/lean4

Ability to suppress unused universe parameter error

Open
#2,116 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P-low
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites
  • [X ] Put an X between the brackets on this line if you have done all of the following:
    • Checked that your issue isn't already filed.
    • Reduced the issue to a self-contained, reproducible test case.
Description

In Lean 4 unused universe parameters are now a hard error.

There are situations where it is desirable to suppress this error, e.g. the existing implementation of lifting universes for categories in Mathlib (see link below).

Currently, we have a hacky fix to sidestep this error. This is not a good permanent state.

Steps to Reproduce
def ULiftHom.{w,u} (C : Type u) : Type u := C 

Expected behavior: A linter warning which can be turned off.

Actual behavior: There is no way to toggle the error off.

Reproduces how often: 100%

Thanks.

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 unused-universe-parameter error with the ULiftHom example, then inspect the referenced Mathlib/CategoryTheory/Category/ULift.lean workaround and the linked Lean change. Done means unused universe parameters can be treated as a configurable warning rather than an unavoidable error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.