nLab record type

Redirected from "infinitary record types".

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

Contents

Definition

In dependent type theory, a record type is a type which consists of variadic tuples called records, whose individual elements in the tuples are called fields.

Finitary record types can be defined in terms of the unit type and iterated dependent sum types. Examples of finitary record types include unit types, negative copies, product types, dependent sum types, etc…

Infinitary record types have an infinite number of fields and require something like two-level type theory to be implemented. An example of an infinitary record type is any semi-simplicial type.

Implementations

Most type-theory based proof assistants include primitive record types, with dependent sum types defined as a particular case of these, rather than requiring general record types to be defined using dependent sum types. This includes:

Record types with type fields

It is also possible to have “record types” whose fields themselves are types. These are typically types of types with additional structure.

Let AA be a type and let x:AB(x)x:A \vdash B(x) be a type family.

Traditionally a record type with type fields is a dependent sum types involving a type universe field: suppose we have a Russell universe UU or a Tarski universe (U,T)(U, T) and a function P:(AU)UP:(A \to U) \to U representing the non-type fields of the record type. Then the type of record types with type fields is given by the dependent sum type

A:U B:AUP(A,B) A:U B:T(A)UT(P(A,B)\sum_{A:U} \sum_{B:A \to U} P(A, B) \qquad \sum_{A:U} \sum_{B:T(A) \to U} T(P(A, B)

for Russell universes and Tarski universes respectively, where AA is the index type of the family BB of type fields.

But in a dependent type theory with a separate type judgment, types are not elements of universes. Instead of the above notion of “record type with UU-small types fields”, we have the notion of “record types with type fields”. Type families (B(x)) x:A(B(x))_{x:A}, previously functions B:AUB:A \to U, are now judged to be types in context x:AB(x)typex:A \vdash B(x) \; \mathrm{type}. The function P:(AU)UP:(A \to U) \to U which takes types to propostions is now an operator on types and type families, which is defined using inference rules:

ΓAtypeΓ,x:AB(x)ΓP(̲x.B(x))type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x)}{\Gamma \vdash P(\underline{ }x.B(x)) \; \mathrm{type}}

Examples of such PP definable from the existing type formers in dependent type theory, include

The resulting record type with type fields (B(x)) x:A(B(x))_{x:A} and non-type fields PP is denoted in this section by Type P\mathrm{Type}_P.

Care must be taken for which PP one could use to define the record type with type fields. For example, given unit type 𝟙\mathbb{1} and the type family (B(x)) x:𝟙(B(x))_{x:\mathbb{1}}, for P(̲x.B(x))B(pt)𝟙P(\underline{ }x.B(x)) \equiv B(\mathrm{pt}) \to \mathbb{1} and P(̲x.B(x))isSet(B(pt))P(\underline{ }x.B(x)) \equiv \mathrm{isSet}(B(\mathrm{pt})), the resulting Type P\mathrm{Type}_P always contains itself or its set truncation in addition to the empty type, resulting in Girard's paradox; thus, one cannot form such record types with type fields in the type theory.

References

Last revised on May 15, 2025 at 15:48:22. See the history of this page for a list of all contributions to it.