A Mechanized Theory of Regular Trees in Dependent Type Theory
Lecture Notes in Computer Science
Proof assistants are tools developed by computer scientists in order to ease formal reasoning. In this sense, they provide a framework to express statements and properties. Then, by using the proof rules of the underlying logic, theorems are proved and mechanically checked by the machine. Dependent type theory is a formalism which can serve as an alternative to set theory as a foundation for all mathematics. Type theory provides a unified framework for defining programs along with their data
... uctures, and for expressing their properties. Concretely, this means that the same language is used to define programs, state their specifications, and express the proof of their soundness. Moreover, when the underlying logic is constructive, it is possible to extract a program from the proof term of its specification. Some type theories offer powerful reasoning principles such as induction for reasoning about finite objects, or coinduction for reasoning about infinite objects. Graphs are a ubiquitous data structure in computer science. They are used for giving semantics to various logic, for modeling computations, or for expressing relations between objects. The problem of representing graphs in dependent type theory can be quite challenging. Indeed, the main obstacle is that, in full generality, graphs can be circular structures. However, induction-the main reasoning principle in dependent type theory-fails to capture naturally such circularity. Indeed, inductive types are based around the notion of well-foundedness. Nevertheless, it is well-known that coalgebraic approaches are better-suited in order to reason about non well-founded structures, i.e., structures embedding some forms of circularity. As such, coinductive types may be used to define and reason about these infinite objects. The key idea is that circular structures can be thought of as infinite trees when cycles are unfolded infinitely. We are interested in the problem of mechanizing a theory of regular trees in dependent type theory. Informally, regular trees are characterized as the subset of infinite trees having the property that the set of their distinct subtrees is finite. As such, regular trees can be thought of as finite cyclic structures. In this thesis, we propose two formalizations of regular trees. The first one, based on coinduction, defines regular trees as a restriction of a coinductive type. The second one follows a syntactic approach, in the sense that regular trees are characterized as inductively defined cyclic terms, i.e., terms with back-pointers. We prove that these two representations are isomorphic. Then, we study the problem of defining transformations on trees that preserve the regularity property. To this end, we leverage the formalism of tree transducers as a tool to obtain a synctactic characterization of a subset of corecursive function definitions. Tree transducers are then interpreted back as tree morphisms preserving this regularity property. Finally, we study various decidability results through a mechanization of a coalgebraic µ-calculus interpreted on regular trees. In particular, we prove that the bisimilarity relation on regular trees is decidable through a reduction to a model-checking problem. v First and foremost, I wish to express my gratitude to my supervisors Jean-Paul Bodeveix and Mamoun Filali for all the support and guidance. In particular, I appreciated the constant feedback about my work and the freedom to work on a wide variety of topics.