L∃∀N-verified Quantum Information Theory

  • RRS to QIC891, Fall 2026

  • Lecture 3, 2026-09-22

\Gamma ⊢ t : T

Questions we've had so far

  • 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

Working through the questions

Let's do live coding

Sorts and types

  • 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.

#check Type -- where `Type ≡ Type 0`
Type : Type 1
#check (Sort 1) -- more generally, Type u ≡ Sort (u + 1)
Type : Type 1
universe u #check (Sort u)
Sort u : Type u
#check (Type u)
Type u : Type (u + 1)

Type-checking sets and types

  • 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 ℝ) #check Membership ℝ (Set ℝ)
Membership ℝ (Set ℝ) : Type
#check Set.univ ℝ
Set.univ ℝ : Prop
variable {x : ℝ} #check x ∈ (Set.univ : Set ℝ) -- lives in Mathlib.Data.Set.Defs.lean
x ∈ Set.univ : Prop