nLab
two-valued type

Contents

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logiccategory theorytype theory
trueterminal object/(-2)-truncated objecth-level 0-type/unit type
falseinitial objectempty type
proposition(-1)-truncated objecth-proposition, mere proposition
proofgeneralized elementprogram
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
cut elimination for implicationcounit for hom-tensor adjunctionbeta reduction
introduction rule for implicationunit for hom-tensor adjunctioneta conversion
logical conjunctionproductproduct type
disjunctioncoproduct ((-1)-truncation of)sum type (bracket type of)
implicationinternal homfunction type
negationinternal hom into initial objectfunction type into empty type
universal quantificationdependent productdependent product type
existential quantificationdependent sum ((-1)-truncation of)dependent sum type (bracket type of)
equivalencepath space objectidentity type/path type
equivalence classquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
coinductionlimitcoinductive type
completely presented setdiscrete object/0-truncated objecth-level 2-type/preset/h-set
setinternal 0-groupoidBishop set/setoid
universeobject classifiertype of types
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Contents

Idea

The two-valued type is an axiomatization of the two-valued object in the context of homotopy type theory.

Definition

As an inductive type, the two-valued type is given by

Inductive Two : Type
  | zero : Two
  | one : Two

This says that the type is inductively constructed from two terms in the type Two, whose interpretation is as the two points of the type; hence the name two-valued type.

Boolean logic

The two-valued type is also called the type of booleans. One could recursively define the logical functions on 2\mathbf{2} as follows

  • For negation ¬\neg
    • ¬0:=1\neg 0 := 1
    • ¬1:=0\neg 1 := 0
  • For conjunction \wedge
    • 0a:=00 \wedge a := 0
    • 1a:=a1 \wedge a := a
  • For disjunction \vee
    • 0a:=a0 \vee a := a
    • 1a:=11 \vee a := 1
  • For implication \implies
    • 0a:=10 \implies a := 1
    • 1a:=a1 \implies a := a

One could prove that (2,0,1,¬,,,)(\mathbf{2}, 0, 1, \neg, \wedge, \vee, \implies) form a Boolean algebra. The poset structure is given by implication.

A boolean predicate valued in a type TT is a function P:T2P: T \rightarrow \mathbf{2}, and the type T2T \to \mathbf{2} is a boolean function algebra for finite types TT, and if path types exist, for all types TT. Thus the functor F:UBoolAlgF: U \to BoolAlg, F(T)=T2F(T) = T \to \mathbf{2} for a type universe UU is a Boolean hyperdoctrine, and one could do classical first-order logic inside UU if 2\mathbf{2} and path types exist in UU.

In fact, just with dependent sum types, dependent product types, empty type, unit type, and the two-valued type in a type universe UU, any two-valued logic could be done inside UU. Furthermore, since binary disjoint coproducts exist when 2\mathbf{2} exists, all finite types exist in UU, and any finitely-valued logic?, such as the internal logic of a finite cartesian power of Set, could be done inside UU.

For finite types, one could also inductively define specific functions

aA.()(a):(A2)2\forall a \in A.(-)(a):(A \to \mathbf{2}) \to \mathbf{2}
aA.()(a):(A2)2\exists a \in A.(-)(a):(A \to \mathbf{2}) \to \mathbf{2}

from the type of boolean predicates on AA and 2\mathbf{2} such that they behave like existential quantification and universal quantification.

Bi-pointed types

A bi-pointed type is a type AA with a function 2A\mathbf{2}\to A. Examples include the interval type and the function type of the natural numbers type.

Properties

  • A two-valued type is a suspension type of the empty type, and the suspension of an two-valued type is a circle type. Geometrically, a two-valued type is a zero-dimensional sphere.

See also

Last revised on June 9, 2021 at 11:19:42. See the history of this page for a list of all contributions to it.