Skip to content
The Lumenary

Each worksheet prints cleanly on A4 or Letter. Answer keys are on a separate page.

The Lumenary · First-year graduate

Categorical logic

Name: ______________________

Date: ______________________

You will learn to

  • Interpret the simply typed λ-calculus with products in a cartesian closed category, prove that βη-equal terms have equal interpretations, and show that Set\mathbf{Set} is cartesian closed while Grp\mathbf{Grp} is not
  • Express ∃\exists and ∀\forall as the left and right adjoints of substitution (pulling back predicates), and derive quantifier laws from the fact that adjoints preserve limits or colimits
  • Define Heyting algebras and prove that intuitionistic propositional logic is sound and complete for them
  • Use the open sets of R\R to show that P∨¬PP \lor \neg P is not intuitionistically derivable, while ¬¬(P∨¬P)\neg\neg(P \lor \neg P) is
  • State the Curry–Howard–Lambek correspondence and place it in the wider landscape (hyperdoctrines, dependent types, toposes)
  1. 1.

    In the Heyting algebra O(R)\mathcal{O}(\R) of open subsets of R\R, let W=R∖{0}W = \R \setminus \{0\}. What are ¬W\neg W and ¬¬W\neg\neg W?

    • A.¬W=∅\neg W = \varnothing and ¬¬W=R\neg\neg W = \R
    • B.¬W={0}\neg W = \{0\} and ¬¬W=W\neg\neg W = W
    • C.¬W=∅\neg W = \varnothing and ¬¬W=W\neg\neg W = W
    • D.¬W\neg W is undefined because WW is not closed
  2. 2.

    Which of these categories are cartesian closed? (Choose all that apply.)

    • A.Set\mathbf{Set}
    • B.The chain 0<12<10 \lt \tfrac12 \lt 1 as a poset category
    • C.Grp\mathbf{Grp}
    • D.(N,≤)(\N, \le) as a poset category
    • E.FinSet\mathbf{FinSet}
  3. 3.

    In the three-element Heyting algebra 0<12<10 \lt \tfrac12 \lt 1, for how many elements aa does a∨¬a=1a \vee \neg a = 1 hold?

  4. 4.

    Since f∗⊣∀ff^* \dashv \forall_f, the universal quantifier is a right adjoint, and right adjoints preserve limits (in a poset: meets). Which logical law is an instance of exactly this fact?

    • A.∀y (φ∧ψ)  ⟺  ∀y φ∧∀y ψ\forall y\,(\varphi \wedge \psi) \iff \forall y\,\varphi \wedge \forall y\,\psi
    • B.∃y (φ∨ψ)  ⟺  ∃y φ∨∃y ψ\exists y\,(\varphi \vee \psi) \iff \exists y\,\varphi \vee \exists y\,\psi
    • C.∀y (φ∨ψ)  ⟺  ∀y φ∨∀y ψ\forall y\,(\varphi \vee \psi) \iff \forall y\,\varphi \vee \forall y\,\psi
    • D.∃y (φ∧ψ)  ⟺  ∃y φ∧∃y ψ\exists y\,(\varphi \wedge \psi) \iff \exists y\,\varphi \wedge \exists y\,\psi
  5. 5.

    In the proof that intuitionistic logic is sound for Heyting algebras, one rule needs the distributive law c∧(a∨b)=(c∧a)∨(c∧b)c \wedge (a \vee b) = (c \wedge a) \vee (c \wedge b). Which rule, and why does the distributive law hold in every Heyting algebra?

    • A.∨\vee-elimination; because c∧−c \wedge - is a left adjoint (of c⇒−c \Rightarrow -) and so preserves joins
    • B.→\to-introduction; because every lattice is distributive
    • C.∨\vee-introduction; because joins are least upper bounds
    • D.→\to-elimination; because (a⇒b)∧a≤b(a \Rightarrow b) \wedge a \le b
  6. 6.

    With forallAlong f S = {y | ∀ x, f x = y → x ∈ S}, which Lean statement says that ∀ is right adjoint to pulling back along f : X → Y (for S : Set X, T : Set Y)?

    • A.f ⁻¹' T ⊆ S ↔ T ⊆ forallAlong f S
    • B.f '' S ⊆ T ↔ S ⊆ f ⁻¹' T
    • C.forallAlong f S ⊆ T ↔ S ⊆ f ⁻¹' T
    • D.T ⊆ forallAlong f S ↔ f '' S ⊆ T
  7. 7.

    How many closed βη-normal terms of type A×A→A×AA \times A \to A \times A are there, for a base type AA?

  8. 8.

    A student claims: "Intuitionistic logic proves ¬(P∨¬P)\neg(P \vee \neg P); that is what rejecting excluded middle means." Which response is correct?

    • A.The claim is false. In the two-element Boolean algebra ¬(p∨¬p)\neg(p \vee \neg p) evaluates to ⊥\bot, so by soundness it is not derivable. In fact ¬¬(p∨¬p)\neg\neg(p \vee \neg p) is derivable.
    • B.The claim is true, because p∨¬pp \vee \neg p is not derivable
    • C.The claim is true in O(R)\mathcal{O}(\R), since there U∨¬U≠RU \vee \neg U \ne \R for U=(0,∞)U = (0, \infty)
    • D.The question is meaningless, because intuitionistic logic has no negation
  9. 9.

    A finite topology is given as a set opens of frozensets. Write neg(opens, u), returning the pseudo-complement of the open set u (the union of all open sets disjoint from u), and is_boolean(opens, space), returning True exactly when u | neg(opens, u) == space for every open u.

    Computational — Practice

Code: Apache-2.0 · Content: CC BY-SA 4.0