definition in nLab
Context
Type theory
There are good reasons why the theorems should all be easy and the definitions hard. [Michael Spivak, preface to “Calculus on Manifolds”]
Contents
Idea
In type theory a definition is the construction of a type or a term of a certain type. By “construction”, we mean that the type has a formation rule and the term has an introduction rule. Then, there are in general two ways to complete the construction:
-
by adding to the type theory the elimination rules, computation rules, and uniqueness rules for types and their associated terms which characterize the universal property of the type (see natural deduction),
-
by adding to the type theory a rule stating that the type or term is equal to an existing term or type.
Many types in type theory, such as function types, product types, coproduct types, booleans type, natural numbers type, integers, et cetera, are defined in both ways, by universal properties and by equality with another type.
Rules for definitions and single assignment operators
One way that definitions of types and of terms could be formalized inside the type theory is by the use of equality with another term or type. More specifically, every definition of a symbol AA comes with a formation rule for the symbol which states that it is a type or an introduction rule for the symbol which states that it is a term of a type, and a definition rule that the term or type AA is equal to some existing term or type BB. The equality used in the definition rule is called definitional equality.
As documented in the article on equality, there are three notions of equality used in type theory: judgmental equality, propositional equality, and typal equality. All three notions of equality could be used in the definition rule. In Martin-Löf type theory and cubical type theory, symbols and abbreviations are defined using judgmental equality. In ZFC and ETCS, they are defined using propositional equality, and in objective type theories, they are defined using typal equality.
For example, suppose that the type BB is already derived in some context Γ\Gamma. Then, in order to define the symbol AA to be the type BB there are the following formation and definition rules for AA:
- Formation and judgmental definition rules for AA:
ΓctxΓ⊢AtypeΓctxΓ⊢A=Btype\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash A \; \mathrm{type}} \qquad \frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash A = B \; \mathrm{type}}
- Formation and propositional definition rules for AA:
ΓctxΓ⊢AtypeΓctxΓ⊢A=Btrue\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash A \; \mathrm{type}} \qquad \frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash A = B\; \mathrm{true}}
- Formation and typal definition rules for AA:
ΓctxΓ⊢AtypeΓctxΓ⊢δ A:A≃B\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash A \; \mathrm{type}} \qquad \frac{\Gamma \: \mathrm{ctx}}{\Gamma \vdash \delta_A:A \simeq B}
Similarly, suppose that the term b:Ab:A is already derived in some context Γ\Gamma. Then, in order to define the symbol aa to be the term b:Ab:A there are the following introduction and definition rules for aa:
- Introduction and judgmental definition rules for aa:
Γ⊢AtypeΓ⊢a:AΓ⊢AtypeΓ⊢a=b:A\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash a:A} \qquad \frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash a = b:A}
- Introduction and propositional definition rules for aa:
Γ⊢AtypeΓ⊢a:AΓ⊢AtypeΓ⊢a= Abtrue\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash a:A} \qquad \frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash a =_A b \; \mathrm{true}}
- Introduction and typal definition rules for aa:
Γ⊢AtypeΓ⊢a:AΓ⊢AtypeΓ⊢δ a:a= Ab\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash a:A} \qquad \frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \delta_a:a =_A b}
However, including separate rules for each new term or type is very cumbersome and would lead to an explosion of rules in the type theory. To handle that, one usually introduces the single assignment operator, initialization operator, initialisation operator, or definition operator ≔\coloneqq to the type theory, which is formally defined as a pair of judgments
- B≔AtypeB \coloneqq A \; \mathrm{type}, where we judge BB to be defined as the type AA, or assigned the type AA
- b≔a:Ab \coloneqq a:A, where we judge bb to be defined as the term a:Aa:A, or assigned the term a:Aa:A
in addition to the judgments for types, terms, and judgmental equality. B≔AtypeB \coloneqq A \; \mathrm{type} is called type definition, type initialization, type initialisation or type single assignment, while b≔a:Ab \coloneqq a:A is called term definition, term initialization, term initialisation, or term single assignment. Judgmental single assignment is different from judgmental equality as judgmental equality is an equivalence relation, while judgmental single assignment is not an equivalence relation, but instead has a reflection rule into equality.
Depending upon what notion of equality is used for definitional equality, the single assignment operator has the following formation and equality reflection rules for type definitions
-
Formation and judgmental equality reflection rules for type definition:
Γ⊢B≔AtypeΓ⊢BtypeΓ⊢B≔AtypeΓ⊢B≡Atype\frac{\Gamma \vdash B \coloneqq A \; \mathrm{type}}{\Gamma \vdash B \; \mathrm{type}} \qquad \frac{\Gamma \vdash B \coloneqq A \; \mathrm{type}}{\Gamma \vdash B \equiv A\; \mathrm{type}}
-
Formation and propositional equality reflection rules for type definition:
Γ⊢B≔AtypeΓ⊢BtypeΓ⊢B≔AtypeΓ⊢B≡Atrue\frac{\Gamma \vdash B \coloneqq A \; \mathrm{type}}{\Gamma \vdash B \; \mathrm{type}} \qquad \frac{\Gamma \vdash B \coloneqq A \; \mathrm{type}}{\Gamma \vdash B \equiv A\; \mathrm{true}}
-
Formation and typal equality reflection rules for type definition:
Γ⊢B≔AtypeΓ⊢BtypeΓ⊢B≔AtypeΓ⊢P:B≃A\frac{\Gamma \vdash B \coloneqq A \; \mathrm{type}}{\Gamma \vdash B \; \mathrm{type}} \qquad \frac{\Gamma \vdash B \coloneqq A \; \mathrm{type}}{\Gamma \vdash P:B \simeq A}
There are also the following introduction and equality reflection rules for term definitions:
-
Introduction and judgmental equality reflection rules for term definition:
Γ⊢b≔a:AΓ⊢b:AΓ⊢b≔a:AΓ⊢b≡a:A\frac{\Gamma \vdash b \coloneqq a:A}{\Gamma \vdash b:A} \qquad \frac{\Gamma \vdash b \coloneqq a:A}{\Gamma \vdash b \equiv a:A}
-
Introduction and propositional equality reflection rules for term definition:
Γ⊢b≔a:AΓ⊢b:AΓ⊢b≔a:AΓ⊢b≡ Aatrue\frac{\Gamma \vdash b \coloneqq a:A}{\Gamma \vdash b:A} \qquad \frac{\Gamma \vdash b \coloneqq a:A}{\Gamma \vdash b \equiv_A a \; \mathrm{true}}
-
Introduction and typal equality reflection rules for term definition:
Γ⊢b≔a:AΓ⊢b:AΓ⊢b≔a:AΓ⊢p:b= Aa\frac{\Gamma \vdash b \coloneqq a:A}{\Gamma \vdash b:A} \qquad \frac{\Gamma \vdash b \coloneqq a:A}{\Gamma \vdash p:b =_A a}
Copy definitions
Another way of typally defining a type AA to be a type BB is via copying. Copying becomes important for typally defining the type of equivalences, as the usual way of typally defining types involves the type of equivalences and thus isn’t available. One add rules saying that from the assignment judgment B≔AtypeB \coloneqq A \; \mathrm{type} one can derive that BB satisfies the universal property of a copy of AA.
mathematical statements
References
The single assignment operator is defined (not by name) in Remark 2.2.1 in:
- Egbert Rijke, Introduction to Homotopy Type Theory, Cambridge Studies in Advanced Mathematics, Cambridge University Press (pdf) (478 pages)
See also:
Last revised on March 5, 2023 at 13:31:10. See the history of this page for a list of all contributions to it.