Lably
Skip to content

Coinduction

Proof method in mathematical logic

  • 6 min read
  • 3 chapters

Related on Lably

Through Computer science, Object (computer science) and Mathematics

Coinduction is the mathematical dual to structural induction. Coinductively defined data types are known as codata and are typically infinite data structures, such as streams.

As a definition or specification, coinduction describes how an object may be "observed", "broken down" or "destructed" into simpler objects. As a proof technique, it may be used to show that an equation is satisfied by all possible implementations of such a specification.

To generate and manipulate codata, one typically uses corecursive functions, in conjunction with lazy evaluation. Informally, rather than defining a function by pattern-matching on each of the inductive constructors, one defines each of the "destructors" or "observers" over the function result.

In programming, co-logic programming (co-LP for brevity) "is a natural generalization of logic programming and coinductive logic programming, which in turn generalizes other extensions of logic programming, such as infinite trees, lazy predicates, and concurrent communicating predicates. Co-LP has applications to rational trees, verifying infinitary properties, lazy evaluation, concurrent logic programming, model checking, bisimilarity proofs, etc." Experimental implementations of co-LP are available from the University of Texas at Dallas and in the language Logtalk (for examples see ) and SWI-Prolog.

Description

In his book Types and Programming Languages, Benjamin C. Pierce gives a concise statement of both the principle of induction and the principle of coinduction. While this article is not primarily concerned with induction, it is useful to consider their somewhat generalized forms at once. In order to state the principles, a few preliminaries are required.

Preliminaries

Let U be a set and F be a monotone function 2U→2U, that is:

X⊆Y⇒F(X)⊆F(Y)

Unless otherwise stated, F will be assumed to be monotone.

  • X is F-closed if F(X)⊆X
  • X is F-consistent if X⊆F(X)
  • X is a fixed point if X=F(X)

These terms can be intuitively understood in the following way. Suppose that X is a set of assertions, and F(X) is the operation that yields the consequences of X. Then X is F-closed when one cannot conclude any more than has already been asserted, while X is F-consistent when all of the assertions are supported by other assertions (i.e. there are no "non-F-logical assumptions").

The Knaster–Tarski theorem tells us that the least fixed-point of F (denoted μF) is given by the intersection of all F-closed sets, while the greatest fixed-point (denoted νF) is given by the union of all F-consistent sets. We can now state the principles of induction and coinduction.

Definition

  • Principle of induction: If X is F-closed, then μF⊆X
  • Principle of coinduction: If X is F-consistent, then X⊆νF

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication