RRS to QIC891, Fall 2026
Lecture 3, 2026-09-22
\Gamma ⊢ t : T
Define: Hierarchy of sorts or types, and propositions
We write and understand x \in \mathbb{R}
But x ∈ ℝ doesn't type-check. Why?
Does #check have a type?
What is “equality of propositions”?
E.g. propext : (P ↔ Q) → P = Q
Define: Hierarchy of sorts or types, and propositions
Sorts and types are different names for the same thing
Type means Type 0, which is Sort 1.
#checkType : Type 1 Type
-- where `Type ≡ Type 0`
Type : Type 1#checkType : Type 1 (Sort 1)
-- more generally, Type u ≡ Sort (u + 1)
Type : Type 1universe u
#checkSort u : Type u (Sort u)
Sort u : Type u#checkType u : Type (u + 1) (Type u)
Type u : Type (u + 1)
Let's say x \in \mathbb{R} “type-checks”. Does x ∈ ℝ type-check?
x ∈ ℝ does not type-check.
ℝ is not a set, and the membership symbol establishes a proposition
between terms of a type and a set of that type.
-- The following will not compile
-- #check `x ∈ ℝ`
-- #check `x ∈ ℝ` failed to synthesize instance of type
-- class `Membership ℝ Type`
-- Hint: Type class instance resolution failures can be
-- inspected with the `set_option trace.Meta.synthInstance
-- true` command. #check Membership x (Set ℝ)
#checkMembership ℝ (Set ℝ) : Type Membership ℝ (Set ℝ)
Membership ℝ (Set ℝ) : Type#checkSet.univ ℝ : Prop Set.univ ℝ
Set.univ ℝ : Propvariable {x : ℝ}
#checkx ∈ Set.univ : Prop x ∈ (Set.univ : Set ℝ)
-- lives in Mathlib.Data.Set.Defs.lean
x ∈ Set.univ : Prop