leanprover / leanprover/lean4

Suggestion on Document: Explicit Declaration for Multiple Universe Level Variable

Open
#4,122 3 comments 1 reaction 1 assignee View on GitHub

@david-christiansen is already working on this.

Since May 10, 2024.

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

Description

Hello Lean Developer,

I was writing universe-lifting function due to lack of cumulative universe

inductive  liftU.{u v}  (X: Type u) : Type (max v (u + 1)) := 
  | inh : X → liftU X

It doesn't work, and I was stuck on the document for a while, not sure if explicit universe-level variable declaration can be done.

Then my friend told me I have to add a comma between u and v for multiple variables. Problem solved.

I think document it would be of great help.


When I was trying all sorts of syntax, I bump into the following seemingly working.

inductive LiftU {u : Type x} {v : Type y} (X : Type u) : Type (max v (u + 1)) :=
  | inh : X → LiftU X

I wonder if this is an intended behaviour (i.e. universe level type is some Type _). Also wonder if the above level x y for the level u v would impact anything.

I believe documenting these would be of great help for the Lean beginner, great 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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.