HOME

TheInfoList



OR:

In
mathematical logic Mathematical logic is the study of 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 formal s ...
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 practical disciplines (includin ...
, 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 founda ...
created by Thierry Coquand. It can serve as both a typed programming language 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 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 an ...
), 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 ...
, initially developed by Thierry Coquand. 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 In abstract rewriting, an object is in normal form if it cannot be rewritten any further, i.e. it is irreducible. Depending on the rewriting system, an object may rewrite to several normal forms or none at all. Many properties of rewriting systems ...
, 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 ...
.


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 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 wh ...
.


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: * \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 BNF, 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.


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 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 __NOTOC__ 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 sorts and d ...
*
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 � ...
*
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 polymorphi ...
*
Dependent type In computer science and logic, a dependent type is a type whose definition depends on a value. It is an overlapping feature of type theory and type systems. In intuitionistic type theory, dependent types are used to encode logic's quantifiers lik ...
*
Intuitionistic type theory Intuitionistic type theory (also known as constructive type theory, or Martin-Löf type theory) is a type theory and an alternative foundation of mathematics. Intuitionistic type theory was created by Per Martin-Löf, a Swedish mathematician an ...
*
Homotopy type theory In mathematical logic and computer science, homotopy type theory (HoTT ) refers to various lines of development of intuitionistic type theory, based on the interpretation of types as objects to which the intuition of (abstract) homotopy theory a ...


References

* ** 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