In
mathematical logic
Mathematical logic is the study of logic, formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of for ...
and
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
, the calculus of constructions (CoC) is a
type theory
In mathematics, logic, and computer science, a type theory is the formal presentation of a specific type system, and in general type theory is the academic study of type systems. Some type theories serve as alternatives to set theory as a foundat ...
created by
Thierry Coquand
Thierry Coquand (; born 18 April 1961 in Jallieu, Isère, France) is a professor in computer science at the University of Gothenburg, known for his work in constructive mathematics, especially the calculus of constructions. He received his Ph.D. u ...
. It can serve as both a typed programming language and as
constructive
Although the general English usage of the adjective constructive is "helping to develop or improve something; helpful to someone, instead of upsetting and negative," as in the phrase "constructive criticism," in legal writing ''constructive'' has ...
foundation for mathematics. For this second reason, the CoC and its variants have been the basis for
Coq
Coq is an interactive theorem prover first released in 1989. It allows for expressing mathematical assertions, mechanically checks proofs of these assertions, helps find formal proofs, and extracts a certified program from the constructive proof ...
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 editor ...
s.
Some of its variants include the calculus of inductive constructions (which adds
inductive types), the calculus of (co)inductive constructions (which adds
coinduction
In computer science, coinduction is a technique for defining and proving properties of systems of concurrent interacting objects.
Coinduction is the mathematical dual to structural induction. Coinductively defined types are known as codata and ...
), and the predicative calculus of inductive constructions (which removes some impredicativity).
General traits
The CoC is a higher-order
typed lambda calculus
A typed lambda calculus is a typed formalism that uses the lambda-symbol (\lambda) to denote anonymous function abstraction. In this context, types are usually objects of a syntactic nature that are assigned to lambda terms; the exact nature of a ...
, initially developed by
Thierry Coquand
Thierry Coquand (; born 18 April 1961 in Jallieu, Isère, France) is a professor in computer science at the University of Gothenburg, known for his work in constructive mathematics, especially the calculus of constructions. He received his Ph.D. u ...
. It is well known for being at the top of
Barendregt's
lambda cube
In mathematical logic and type theory, the λ-cube (also written lambda cube) is a framework introduced by Henk Barendregt to investigate the different dimensions in which the calculus of constructions is a generalization of the simply typed ...
. 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 classical deductive logic, a consistent theory is one that does not lead to a logical contradiction. The lack of contradiction can be defined in either semantic or syntactic terms. The semantic definition states that a theory is consistent i ...
.
Usage
The CoC has been developed alongside the
Coq
Coq is an interactive theorem prover first released in 1989. It allows for expressing mathematical assertions, mechanically checks proofs of these assertions, helps find formal proofs, and extracts a certified program from the constructive proof ...
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 editor ...
. 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
Matita
is an experimental proof assistant under development at the Computer Science Department of the University of Bologna. It is a tool aiding the development of formal proofs by man-machine collaboration, providing a programming environment whe ...
.
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 (\lambda^\to), a form
of type theory, is a typed interpretation of the lambda calculus with only one type constructor (\to) that builds function types. It is the canonical and simplest example of a typed lambda c ...
with each natural-deduction proof in
intuitionistic propositional logic. The calculus of constructions extends this isomorphism to proofs in the full intuitionistic predicate calculus, 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:
*
is a term (also called ''type'');
*
is a term (also called ''prop'', the type of all propositions);
* Variables (
) are terms;
* If
and
are terms, then so is
;
* If
and
are terms and
is a variable, then the following are also terms:
**
,
**
.
In other words, the term syntax, in
BNF, is then:
:
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 (
is an example of a large type);
#
itself, which is the type of large types.
Judgments
The calculus of constructions allows proving typing judgments:
:
Which can be read as the implication
: If variables
have, respectively, types
, then term
has type
.
The valid judgments for the calculus of constructions are derivable from a set of inference rules. In the following, we use
to mean a sequence of type assignments
;
to mean terms; and
to mean either
or
. We shall write