nLab axiom K (type theory)

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

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
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

Foundational axiom

Disambiguation: For axiom K as a principle of modal logic, see axiom K (modal logic)

Contents

Idea

In dependent type theory, axiom K refers to a couple of different axioms and rules applicable to individual types to turn them into h-sets, type families to turn them into families of sets (and in particular, universes to turn them into internal types of sets), as well as the type theory as a whole to turn it into an actual set-level type theory, where all types are h-sets. Under certain conditions, axiom K for universes is incompatible with the univalence axiom, and axiom K for the whole type theory is incompatible with the existence of a univalent universe.

Heuristically, the axiom asserts that for each element a:Aa:A, every identification of the identity type Id A(a,a)\mathrm{Id}_A(a, a) is typally equal to the canonical reflexivity identification refl A(a):Id A(a,a)refl_A(a):\mathrm{Id}_A(a, a). This is equivalent to saying that for every element a:Aa:A, reflexivity refl A(a)\mathrm{refl}_A(a) is the center of contraction of the loop space type of aa.

Statement

There are multiple notions of axiom K: for individual types, for type families and Tarski universes, and for the type theory itself.

For individual types

The following definition is adapted from theorem 7.2.1 of the HoTT book. Given a type AA, axiom K is the axiom that for all elements a:Aa:A and identifications p:Id A(a,a)p:\mathrm{Id}_A(a, a), there is an identification K(a,p):Id Id A(a,a)(p,refl A(a))K(a, p):\mathrm{Id}_{\mathrm{Id}_A(a, a)}(p, refl_A(a)). This is the same as stating that there is a dependent function

K A: a:A p:Id A(a,a)Id Id A(a,a)(p,refl A(a))K_A: \prod_{a:A} \prod_{p:\mathrm{Id}_A(a, a)} \mathrm{Id}_{\mathrm{Id}_A(a, a)}(p, refl_A(a))

Axiom K implies that AA is an h-set, and can be used in the definition of an h-set.

For type families and universes

Axiom K for type families (A,B)(A, B) says that given a type AA with a type family B(a)B(a) indexed by elements a:Aa:A, the typal axiom K holds for the dependent type B(a)B(a) of every element of the index type a:Aa:A. This is the same as stating that there is a dependent function

K A,B: a:A b:B(a) pId B(a)(b,b)Id Id B(a)(b,b)(p,refl B(a)(b))K_{A, B}: \prod_{a:A} \prod_{b:B(a)} \prod_{p\mathrm{Id}_{B(a)}(b, b)} \mathrm{Id}_{\mathrm{Id}_{B(a)}(b, b)}(p, \mathrm{refl}_{B(a)}(b))

This definition of axiom K could be used in the definition of family of sets. Since this definition applies to type families, this should probably be called the familial axiom K to distinguish it from the axiom K above.

Since every Tarski universe consists of a type UU of encodings and a type family TT representing the actual small types indexed by the type UU, with addition structure representing the closure of UU under all type formers, the familial axiom K definition works for Tarski universes as well, and this could equivalently be called the Tarski universe axiom K.

As a rule in the type theory

In the same manner that uniqueness of identity proofs could be expressed as a rule instead of an axiom, Axiom K could also be rewritten as a rule instead of an axiom, by making the hypotheses of the axioms into premises of the rule. This makes axiom K applicable not only to universes, but to the entire type theory. In addition, one could use, in addition to typal equality, either judgmental equality or propositional equality, resulting in judgmental axiom K and propositional axiom K, with the original axiom K called typal axiom K

In this manner, axiom K then becomes the rules:

  • Judgmental axiom K
ΓAtypeΓa:AΓp:Id A(a,a)Γprefl A(a):Id A(a,a)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma\vdash a:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, a)}{\Gamma\vdash p \equiv refl_A(a):\mathrm{Id}_A(a, a)}
  • Propositional axiom K
ΓAtypeΓa:AΓp:Id A(a,a)Γp= Id A(a,a)refl A(a)true\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma\vdash a:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, a)}{\Gamma\vdash p =_{\mathrm{Id}_A(a, a)} refl_A(a) \; \mathrm{true}}
  • Typal axiom K
ΓAtypeΓa:AΓp:Id A(a,a)ΓK A(a,p):Id Id A(a,a)(p,refl A(a))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma\vdash a:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, a)}{\Gamma\vdash K_A(a, p):\mathrm{Id}_{\mathrm{Id}_A(a, a)}(p, refl_A(a))}

Axiom K is a axiom of set truncation, and turns the type theory into a set-level type theory. Judgmental axiom K holds in XTT, where it follows from the judgmental UIP rule, which in turn follows from boundary separation.

This should probably be called the K rule rather than axiom K, since it is no longer an axiom.

Axiom K for heterogeneous identity types

There is also a notion of axiom K for heterogeneous identity types, which is given by the following rule:

  • Judgmental axiom K for heterogeneous identity types:

    ΓAtypeΓBtype Γf:ABΓa:AΓb:AΓp:Id A(a,b) Γq:hId B(a,b,p,f(a),f(b))Γqap B(f,a,b,p):hId B(a,b,p,f(a),f(b))\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash f:A \to B \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, b) \\ \Gamma \vdash q:\mathrm{hId}_{B}(a, b, p, f(a), f(b)) \end{array} }{\Gamma \vdash q \equiv \mathrm{ap}_{B}(f, a, b, p):\mathrm{hId}_{B}(a, b, p, f(a), f(b))}
  • Propositional axiom K for heterogeneous identity types:

    ΓAtypeΓBtype Γf:ABΓa:AΓb:AΓp:Id A(a,b) Γq:hId B(a,b,p,f(a),f(b))Γq= hId B(a,b,p,f(a),f(b))ap B(f,a,b,p)true\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash f:A \to B \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, b) \\ \Gamma \vdash q:\mathrm{hId}_{B}(a, b, p, f(a), f(b)) \end{array} }{\Gamma \vdash q =_{\mathrm{hId}_{B}(a, b, p, f(a), f(b))} \mathrm{ap}_{B}(f, a, b, p) \; \mathrm{true}}
  • Typal axiom K for heterogeneous identity types:

    ΓAtypeΓBtype Γf:ABΓa:AΓb:AΓp:Id A(a,b) Γq:hId B(a,b,p,f(a),f(b))ΓK B(f,a,b,p,q):Id hId B(a,b,p,f(a),f(b))(q,ap B(f,a,b,p))\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash f:A \to B \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, b) \\ \Gamma \vdash q:\mathrm{hId}_{B}(a, b, p, f(a), f(b)) \end{array} }{\Gamma \vdash K_{B}(f, a, b, p, q):\mathrm{Id}_{\mathrm{hId}_{B}(a, b, p, f(a), f(b))}(q, \mathrm{ap}_{B}(f, a, b, p))}

and likewise for dependent heterogeneous identity types:

  • Judgmental axiom K for dependent heterogeneous identity types:

    ΓAtypeΓ,x:AB(x)type Γf: x:AB(x)Γa:AΓb:AΓp:Id A(a,b) Γq:hId x:A.B(x)(a,b,p,f(a),f(b))Γqapd x:A.B(x)(f,a,b,p):hId x:A.B(x)(a,b,p,f(a),f(b))\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \\ \Gamma \vdash f:\prod_{x:A} B(x) \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, b) \\ \Gamma \vdash q:\mathrm{hId}_{x:A.B(x)}(a, b, p, f(a), f(b)) \end{array} }{\Gamma \vdash q \equiv \mathrm{apd}_{x:A.B(x)}(f, a, b, p):\mathrm{hId}_{x:A.B(x)}(a, b, p, f(a), f(b))}
  • Propositional axiom K for dependent heterogeneous identity types:

    ΓAtypeΓ,x:AB(x)type Γf: x:AB(x)Γa:AΓb:AΓp:Id A(a,b) Γq:hId x:A.B(x)(a,b,p,f(a),f(b))Γq= hId x:A.B(x)(a,b,p,f(a),f(b))apd x:A.B(x)(f,a,b,p)true\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \\ \Gamma \vdash f:\prod_{x:A} B(x) \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, b) \\ \Gamma \vdash q:\mathrm{hId}_{x:A.B(x)}(a, b, p, f(a), f(b)) \end{array} }{\Gamma \vdash q =_{\mathrm{hId}_{x:A.B(x)}(a, b, p, f(a), f(b))} \mathrm{apd}_{x:A.B(x)}(f, a, b, p) \; \mathrm{true}}
  • Typal axiom K for dependent heterogeneous identity types:

    ΓAtypeΓ,x:AB(x)type Γf: x:AB(x)Γa:AΓb:AΓp:Id A(a,b) Γq:hId x:A.B(x)(a,b,p,f(a),f(b))ΓK x:A.B(x)(f,a,b,p,q):Id hId x:A.B(x)(a,b,p,f(a),f(b))(q,apd x:A.B(x)(f,a,b,p))\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \\ \Gamma \vdash f:\prod_{x:A} B(x) \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:\mathrm{Id}_A(a, b) \\ \Gamma \vdash q:\mathrm{hId}_{x:A.B(x)}(a, b, p, f(a), f(b)) \end{array} }{\Gamma \vdash K_{x:A.B(x)}(f, a, b, p, q):\mathrm{Id}_{\mathrm{hId}_{x:A.B(x)}(a, b, p, f(a), f(b))}(q, \mathrm{apd}_{x:A.B(x)}(f, a, b, p))}

Properties

Axiom K and univalence

In this section we assume that the universe is a Tarski universe. The K rule is inconsistent with having a univalent type with a type family (A,B)(A, B) with at least one term a:Aa:A where the dependent type B(a)B(a) is provably not a proposition

( p:B(a) q:B(a)Id B(a)(p,q))\left(\prod_{p:B(a)} \prod_{q:B(a)} \mathrm{Id}_{B(a)}(p, q)\right) \to \emptyset

because by univalence, AA is then provably not a set, which contradicts the K rule. In particular, having a univalent universe (U,T)(U, T) in the type theory is inconsistent with the K rule.

The familial axiom K applied to Tarski universes implies that for all A:UA:U the type T(A)T(A) is a set. This means the type reflection of the internal equivalences T(A UB)T(A \simeq_U B) is an h-set, and the univalence axiom then implies that UU is an h-groupoid. If UU has h-sets which can be proven not to be an h-proposition, such as the booleans type, then UU is provably not an h-set.

However, unlike the case for the K rule, the familial axiom K and the univalence axiom for universes are inconsistent with each other only if the Tarski universe UU has objects which can be proven not to be an h-set, such as internal univalent Tarski universes V:UV:U where the type T(V)T(V) has terms A:T(V)A:T(V) such that T V(A)T_V(A) is an h-set which is not an h-proposition, such as the booleans type. As a result, T(V)T(V) can be proven to not be a set, causing axiom K for UU to be inconsistent with the existence of V:UV:U and univalence.

Computational behavior

Unlike its logical equivalent axiom UIP, axiom K can be endowed with computational behavior: K(A,x,P,d,refl Ax)K(A,x,P,d,refl_A x) computes to dd. This gives a way to specify a computational set-level type theory.

This sort of computational axiom K can also be implemented with, and is sufficient to imply, a general scheme of function definition by pattern-matching. This is implemented in the proof assistant Agda. (The flag --without-K alters Agda’s pattern-matching scheme to a weaker version appropriate for intensional type theory, including homotopy type theory.)

References

The axiom K was introduced in

  • Thomas Streicher, Investigations into intensional type theory Habilitation thesis (1993) (pdf)

For a review and discussion of the implementation in Coq, see

  • Pierre Corbineau, The K axiom in Coq (almost) for free (pdf)

Discussion in the context of homotopy type theory is in

around theorem 7.2.1

Last revised on January 25, 2023 at 18:19:26. See the history of this page for a list of all contributions to it.