HOME

TheInfoList



OR:

In
mathematical logic Mathematical logic is the study of Logic#Formal logic, formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory (also known as computability theory). Research in mathematical logic com ...
and
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, the calculus of constructions (CoC) is a
type theory In mathematics and theoretical computer science, a type theory is the formal presentation of a specific type system. Type theory is the academic study of type systems. Some type theories serve as alternatives to set theory as a foundation of ...
created by Thierry Coquand. It can serve as both a typed
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
and as constructive foundation for mathematics. For this second reason, the CoC and its variants have been the basis for Coq and other
proof assistant In computer science and mathematical logic, a proof assistant or interactive theorem prover is a software tool to assist with the development of formal proofs by human–machine collaboration. This involves some sort of interactive proof edi ...
s. Some of its variants include the calculus of inductive constructions (which adds inductive types), the calculus of (co)inductive constructions (which adds coinduction), and the predicative calculus of inductive constructions (which removes some
impredicativity In mathematics, logic and philosophy of mathematics, something that is impredicative is a self-referencing definition. Roughly speaking, a definition is impredicative if it invokes (mentions or quantifies over) the set being defined, or (more com ...
).


General traits

The CoC is a higher-order typed lambda calculus, initially developed by Thierry Coquand. It is well known for being at the top of Barendregt's lambda cube. It is possible within CoC to define functions from terms to terms, as well as terms to types, types to types, and types to terms. The CoC is strongly normalizing, and hence
consistent In deductive logic, a consistent theory is one that does not lead to a logical contradiction. A theory T is consistent if there is no formula \varphi such that both \varphi and its negation \lnot\varphi are elements of the set of consequences ...
.


Usage

The CoC has been developed alongside the Coq
proof assistant In computer science and mathematical logic, a proof assistant or interactive theorem prover is a software tool to assist with the development of formal proofs by human–machine collaboration. This involves some sort of interactive proof edi ...
. As features were added (or possible liabilities removed) to the theory, they became available in Coq. Variants of the CoC are used in other proof assistants, such as Matita and Lean.


The basics of the calculus of constructions

The calculus of constructions can be considered an extension of the Curry–Howard isomorphism. The Curry–Howard isomorphism associates a term in the
simply typed lambda calculus The simply typed lambda calculus (), a form of type theory, is a typed interpretation of the lambda calculus with only one type constructor () that builds function types. It is the canonical and simplest example of a typed lambda calculus. The ...
with each natural-deduction proof in intuitionistic propositional logic. The calculus of constructions extends this isomorphism to proofs in the full intuitionistic
predicate calculus Predicate or predication may refer to: * Predicate (grammar), in linguistics * Predication (philosophy) * several closely related uses in mathematics and formal logic: **Predicate (mathematical logic) ** Propositional function **Finitary relation, ...
, which includes proofs of quantified statements (which we will also call "propositions").


Terms

A ''term'' in the calculus of constructions is constructed using the following rules: * \mathbf is a term (also called ''type''); * \mathbf is a term (also called ''prop'', the type of all propositions); * Variables (x, y, \ldots) are terms; * If A and B are terms, then so is (A B); * If A and B are terms and x is a variable, then the following are also terms: ** (\lambda x:A. B), ** (\forall x:A. B). In other words, the term syntax, in
Backus–Naur form In computer science, Backus–Naur form (BNF, pronounced ), also known as Backus normal form, is a notation system for defining the Syntax (programming languages), syntax of Programming language, programming languages and other Formal language, for ...
, is then: :e ::= \mathbf \mid \mathbf \mid x \mid e \, e \mid \lambda x\mathbine.e\mid \forall x\mathbine.e The calculus of constructions has five kinds of objects: # ''proofs'', which are terms whose types are ''propositions''; # ''propositions'', which are also known as ''small types''; # ''predicates'', which are functions that return propositions; # ''large types'', which are the types of predicates (\mathbf is an example of a large type); # \mathbf itself, which is the type of large types.


β-equivalence

As with the untyped lambda calculus, the calculus of constructions uses a basic notion of equivalence of terms, known as \beta-equivalence. This captures the meaning of \lambda-abstraction: * (\lambda x:A . B) N =_\beta B(x := N) \beta-equivalence is a congruence relation for the calculus of constructions, in the sense that * If A =_\beta B and M =_\beta N, then A M =_\beta B N.


Judgments

The calculus of constructions allows proving typing judgments: : x_1:A_1, x_2:A_2, \ldots \vdash t:B, which can be read as the implication : If variables x_1, x_2, \ldots have, respectively, types A_1, A_2, \ldots, then term t has type B. The valid judgments for the calculus of constructions are derivable from a set of inference rules. In the following, we use \Gamma to mean a sequence of type assignments x_1:A_1, x_2:A_2, \ldots ; A, B, C, D to mean terms; and K, L to mean either \mathbf or \mathbf. We shall write B :=N/math> to mean the result of substituting the term N for the
free variable In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a variable may be said to be either free or bound. Some older books use the terms real variable and apparent variable for f ...
x in the term B. An inference rule is written in the form :\frac, which means : if \Gamma \vdash A:B is a valid judgment, then so is \Gamma' \vdash C:D .


Inference rules for the calculus of constructions

1. 2. 3. 4. 5. 6.


Defining logical operators

The calculus of constructions has very few basic operators: the only logical operator for forming propositions is \forall. However, this one operator is sufficient to define all the other logical operators: : \begin A \Rightarrow B & \equiv & \forall x:A . B & (x \notin B) \\ A \wedge B & \equiv & \forall C:\mathbf . (A \Rightarrow B \Rightarrow C) \Rightarrow C & \\ A \vee B & \equiv & \forall C:\mathbf . (A \Rightarrow C) \Rightarrow (B \Rightarrow C) \Rightarrow C & \\ \neg A & \equiv & \forall C:\mathbf . (A \Rightarrow C) & \\ \exists x:A.B & \equiv & \forall C:\mathbf . (\forall x:A.(B \Rightarrow C)) \Rightarrow C & \end


Defining data types

The basic data types used in computer science can be defined within the calculus of constructions: ; Booleans : \forall A: \mathbf . A \Rightarrow A \Rightarrow A ; Naturals : \forall A: \mathbf . (A \Rightarrow A) \Rightarrow A \Rightarrow A ; Product A \times B : A \wedge B ; Disjoint union A + B : A \vee B Note that Booleans and Naturals are defined in the same way as in
Church encoding In mathematics, Church encoding is a means of representing data and operators in the lambda calculus. The Church numerals are a representation of the natural numbers using lambda notation. The method is named for Alonzo Church, who first encoded d ...
. However, additional problems arise from propositional extensionality and proof irrelevance.


See also

*
Pure type system In the branches of mathematical logic known as proof theory and type theory, a pure type system (PTS), previously known as a generalized type system (GTS), is a form of typed lambda calculus that allows an arbitrary number of Structure (mathematic ...
* Lambda cube *
System F System F (also polymorphic lambda calculus or second-order lambda calculus) is a typed lambda calculus that introduces, to simply typed lambda calculus, a mechanism of universal quantification over types. System F formalizes parametric polymorph ...
* Dependent type *
Intuitionistic type theory Intuitionistic type theory (also known as constructive type theory, or Martin-Löf type theory (MLTT)) is a type theory and an alternative foundation of mathematics. Intuitionistic type theory was created by Per Martin-Löf, a Swedish mathematicia ...
* Homotopy type theory


References


Sources

* ** Also available freely accessible online:
Note terminology is rather different. For instance, (\forall x:A . B) is written 'x'' : ''A''''B''. * * * — An application of the CoC {{refend Dependently typed programming Lambda calculus Type theory