Type theory MOC

Type of booleans

The type of booleans 𝟚 has two canonical terms: 0 and 1, often called false and true. In (non-dependent) programming and classical mathematics, predicates are usually thought of as having values in 𝟚.

0 == 1 # False
1 == 1 # True

This is justified by the fact that, in the category Category of sets of classical mathematics,1 the corresponding set 𝟚 is a subobject classifier. In constructive contexts where the Law of excluded middle is not assumed, however, this is not the case (we instead need a Universe of propositions Ω), so the role played by 𝟚 is quite different.

Standard presentation

The type of booleans is usually defined in a type theory as a positive inductive type. The standard presentation is as follows: ind

  1. Formation rule
⊒𝟚
  1. Introduction rules
⊒0:𝟚⊒1:𝟚
  1. Induction rule
Ξ“,π‘₯:𝟚⊒𝐢(π‘₯)Ξ“,𝑐0:𝐢(0),𝑐1:𝐢(1),𝑝:𝟚⊒ind𝟚⁑(𝑐0,𝑐1,𝑝):𝐢(𝑝)
  1. Judgemental computation rules
Ξ“,π‘₯:𝟚⊒𝐢(π‘₯)Ξ“,𝑐0:𝐢(0),𝑐1:𝐢(1)⊒ind𝟚⁑(𝑐0,𝑐1,0)=𝑐0:𝐢(0)Ξ“,π‘₯:𝟚⊒𝐢(π‘₯)Ξ“,𝑐0:𝐢(0),𝑐1:𝐢(1)⊒ind𝟚⁑(𝑐0,𝑐1,1)=𝑐1:𝐢(1)


develop | en | SemBr

Footnotes

  1. See ETCS. ↩