Contractive Functions on Infinite Data Structures

with Venanzio Capretta and Graham Hutton. IFL 2016.PDF

Abstract

Coinductive data structures, such as streams or infinite lists, have many applications in functional programming and type theory, and are naturally defined using recursive equations. But how do we ensure that such equations make sense, i.e. that they actually generate a productive infinite object? A standard means to achieve productivity is to use Banach’s fixed-point theorem, which guarantees the unique existence of solutions to recursive equations on metric spaces under certain conditions. Functions satisfying these conditions are called contractions. In this article, we give a new characterization of contractions on streams in the form of a sound and complete representation theorem, and generalize this result to a wide class of non-well-founded structures, first to infinite binary trees, then to final coalgebras of container functors. These results have important potential applications in functional programming, where coinduction and corecursion are successfully deployed to model continuous reactive systems, dynamic interactivity, signal processing, and other tasks that require flexible non-well-founded data. Our representation theorems provide a definition paradigm to compactly compute with such data and easily reason about them.

BibTeX

```
@inproceedings{Contractions_IFL2016,
author = {Capretta, Venanzio and Hutton, Graham and Jaskelioff, Mauro},
title = {Contractive Functions on Infinite Data Structures},
booktitle = {Proceedings of the 28th Symposium on the Implementation and Application of Functional Programming Languages},
series = {IFL 2016},
year = {2016},
isbn = {978-1-4503-4767-9},
location = {Leuven, Belgium},
pages = {5:1--5:13},
articleno = {5},
numpages = {13},
url = {http://doi.acm.org/10.1145/3064899.3064900},
doi = {10.1145/3064899.3064900},
publisher = {ACM},
address = {New York, NY, USA},
}
```