Zulip Chat Archive

Stream: mathlib4

Topic: unused universe parameter


Yury G. Kudryashov (Feb 16 2023 at 06:54):

In !4#2312, I get an "unused universe parameter 'w'" error. Is it a linter that can be disabled?

Yury G. Kudryashov (Feb 16 2023 at 06:54):

The unused param is here on purpose: it says where to ULift the morphisms in a category.

Kevin Buzzard (Feb 16 2023 at 07:01):

Can you use it? I mean, add a .{w} or something?

Yury G. Kudryashov (Feb 16 2023 at 07:02):

Lean fails to compile the definition.

Matthew Ballard (Feb 18 2023 at 20:36):

I pushed a hacky "fix". (Sadly, I don't have a gif of me doing air quotes to go with this message.)

Matthew Ballard (Feb 18 2023 at 20:37):

Ability to toggle this error would be nice

Yury G. Kudryashov (Feb 18 2023 at 20:52):

Do you want to take over this PR? It has 1 "unused argument" linter error left.

Matthew Ballard (Feb 18 2023 at 20:57):

I can look at it again this evening. But I should get some official sanction for the “fix”

Yury G. Kudryashov (Feb 18 2023 at 22:03):

This will be given by a reviewer.

Reid Barton (Feb 18 2023 at 22:08):

It should have a porting note

Matthew Ballard (Feb 18 2023 at 22:43):

It is ready for review.

Adam Topaz (Feb 19 2023 at 04:00):

This is quite a hack...

def UliftHom.{w} (C : Type u) : Type u :=
  let _ := ULift.{w} C
  C

Is there really no way around this?

Adam Topaz (Feb 19 2023 at 04:05):

Do we not have some way to turn off the unused universe parameter linter?

Matthew Ballard (Feb 19 2023 at 04:06):

No it is in core

Matthew Ballard (Feb 19 2023 at 04:06):

But others will know better than me

Adam Topaz (Feb 19 2023 at 04:06):

sigh

Adam Topaz (Feb 19 2023 at 04:13):

I might be misunderstanding, but it seems that this is hardcoded and not a linter? Here is where this check is coming from:
https://github.com/leanprover/lean4/blob/cce2d3500e64ea0bfd56c46688e7aaeb1c4cb548/src/Lean/Elab/DeclUtil.lean#L77

Matthew Ballard (Feb 19 2023 at 04:13):

That is my understanding also

Eric Wieser (Feb 19 2023 at 13:10):

Is this worth opening a lean 4 issue about?

Eric Wieser (Feb 19 2023 at 13:11):

Then we have something to reference in a comment next to the hack

Matthew Ballard (Feb 21 2023 at 17:14):

Issue #2116


Last updated: Dec 20 2023 at 11:08 UTC