Zulip Chat Archive
Stream: new members
Topic: Checking my understanding of Lean's type theory
Noah Stebbins (Jun 22 2024 at 20:49):
Hi guys :wave:
I'm new to Lean and wanted to check my understanding of a few concepts I read in Theorem Proving in Lean & played around with in VSCode.
Here's my understanding of #check Listbeing Type u → Type u
Listtakes in a parameter that specifies what the type of its members will be, e.g. ℕ, and returns a term of typeList ℕ. In the ℕ case, we could think ofListasType 0 → Type 0- Furthermore, we want this hold for any type universe (e.g. Type 1, Type 2) not just Type 0. But we want to ensure that both the input and the output aren't within different universes but rather the same universe u, hence
Type u → Type u. For the life of me I can't think of a case in which the type of the list would be in any universe other than 0. :thinking:
Yaël Dillies (Jun 22 2024 at 20:53):
- Correct
- That's not quite it. The underlying type theory forces
List αto live in a universe at least as big as the one ofα(think of it in terms of size.List αis at least as big asαsincea ↦ [a]is an injection), and we make it live in the same universe out of simplicity. In fact,List : Type u → Type (max u v)would be perfectly allowed. A list ofTypewould have to live inType 1becauseType : Type 1.
Last updated: May 02 2025 at 03:31 UTC