I am trying to do some category theory in Lean. However, I am not yet very fluent in type theory, and the following does not really seem to work:
class pset (S: Type) :=
(point: S)
class category (: Type) :=
(test: unit)
instance pset_category : category pset :=
{
test := ()
}
I get a type mismatch at category pset
, since pset
has type Type -> Type
, whereas it is expected to have type Type
. What is going wrong?
I assume you want
pset
to be something like "pointed sets". So then its definition should beNow you will notice that
#check pset
tells you it has typeType 1
. So you still can't make it into acategory
, since you only defined "small" categories. If you changeType
toType*
in the definition ofcategory
, all should be good.