Given some term
A : Sort u
in Lean, is there a way to artificially increase the universe level and promote A to a term
A : Sort (u + 1)
in a higher universe?
Context: I have written down the definition of a large category in Lean.
structure Cat : Type 2 :=
(ob : Type 1)
(mor : Π p : ob × ob, Type 1)
(id : Π x : ob, mor(x,x))
(comp {x y z : ob} : Π g : mor(y,z), Π f : mor(x,y), mor(x,z))
(assoc {x y z w : ob} : ∀f : mor(x,y), ∀g : mor(y,z), ∀h : mor(z,w),
comp h (comp g f) = comp (comp h g) f)
(leftn {x y : ob} : ∀f : mor(x,y), comp (id y) f = f)
(rightn {x y : ob} : ∀f : mor(x,y), comp f (id x) = f)
Next I want to define a category SET of sets and a category PROP of propositions. The morphism types in the category of sets should be the standard function types, and the morphism types in the category of propositions should be implications.
Type : Type 1
is of the right universe level, but I have problems with the morphism types in SET and with both function and morphism types for PROP.
Prop : Type 0
φ : Prop, ψ : Prop ⊢ φ → ψ : Sort 0
The universe level is too low for my definition of a category. Is there a way to fix this without introducing different versions of Cat for different universe level combinations?
ULift
can raise universe levels, but I'd say this is usually not the best approach $\endgroup$Sort u
instead ofType u
. Also I’d look at the existing category theory library starting with the definition of category to see how it compares to yours. $\endgroup$