The Algebra of Open and Interconnected Systems
Total Page:16
File Type:pdf, Size:1020Kb
The Algebra of Open and Interconnected Systems Brendan Fong Hertford College University of Oxford arXiv:1609.05382v1 [math.CT] 17 Sep 2016 A thesis submitted for the degree of Doctor of Philosophy in Computer Science Trinity 2016 For all those who have prepared food so I could eat and created homes so I could live over the past four years. You too have laboured to produce this; I hope I have done your labours justice. Abstract Herein we develop category-theoretic tools for understanding network- style diagrammatic languages. The archetypal network-style diagram- matic language is that of electric circuits; other examples include signal flow graphs, Markov processes, automata, Petri nets, chemical reaction networks, and so on. The key feature is that the language is comprised of a number of components with multiple (input/output) terminals, each possibly labelled with some type, that may then be connected together along these terminals to form a larger network. The components form hyperedges between labelled vertices, and so a diagram in this language forms a hypergraph. We formalise the compositional structure by intro- ducing the notion of a hypergraph category. Network-style diagrammatic languages and their semantics thus form hypergraph categories, and se- mantic interpretation gives a hypergraph functor. The first part of this thesis develops the theory of hypergraph categories. In particular, we introduce the tools of decorated cospans and corela- tions. Decorated cospans allow straightforward construction of hyper- graph categories from diagrammatic languages: the inputs, outputs, and their composition are modelled by the cospans, while the `decorations' specify the components themselves. Not all hypergraph categories can be constructed, however, through decorated cospans. Decorated corelations are a more powerful version that permits construction of all hypergraph categories and hypergraph functors. These are often useful for construct- ing the semantic categories of diagrammatic languages and functors from diagrams to the semantics. To illustrate these principles, the second part of this thesis details applications to linear time-invariant dynamical sys- tems and passive linear networks. Contents Prefacev I Mathematical Foundations1 1 Hypergraph categories: the algebra of interconnection2 1.1 The algebra of interconnection . .2 1.2 Symmetric monoidal categories . .5 1.2.1 Monoidal categories . .6 1.2.2 String diagrams . .7 1.2.3 Symmetry . .9 1.3 Hypergraph categories . 10 1.3.1 Frobenius monoids . 10 1.3.2 Hypergraph categories . 12 1.3.3 Hypergraph categories are self-dual compact closed . 13 1.3.4 Coherence . 15 1.4 Example: cospan categories . 17 2 Decorated cospans: from closed systems to open 22 2.1 From closed systems to open . 22 2.2 Decorated cospan categories . 25 2.2.1 Composing decorated cospans . 26 2.2.2 The hypergraph structure . 30 2.2.3 A bicategory of decorated cospans . 35 2.3 Functors between decorated cospan categories . 35 2.4 Decorations in Set are general . 40 2.5 Examples . 43 2.5.1 Labelled graphs . 43 2.5.2 Linear relations . 44 i 2.5.3 Electrical circuits . 45 3 Corelations: a tool for black boxing 48 3.1 The idea of black boxing . 48 3.2 Corelations . 52 3.2.1 Factorisation systems . 53 3.2.2 Corelations . 56 3.2.3 Categories of corelations . 58 3.3 Functors between corelation categories . 62 3.4 Examples . 66 3.4.1 Equivalence relations as corelations in Set . 67 3.4.2 Linear relations as corelations in Vect . 68 4 Decorated corelations: black-boxed open systems 71 4.1 Black-boxed open systems . 71 4.2 Decorated corelations . 74 4.2.1 Adjoining right adjoints . 75 4.2.2 Decorated corelations . 76 4.2.3 Categories of decorated corelations . 78 4.3 Functors between decorated corelation categories . 80 4.4 All hypergraph categories are decorated corelation categories . 84 4.4.1 Representing a morphism with its name . 85 4.4.2 A categorical equivalence . 89 4.4.3 Factorisations as decorations . 91 4.5 Examples . 95 4.5.1 Matrices . 95 4.5.2 Two constructions for linear relations . 97 II Applications 99 5 Signal flow diagrams 100 5.1 Behavioural control theory . 100 5.2 Linear time-invariant dynamical systems . 106 5.3 Presentation of LTI . 110 5.3.1 Syntax . 110 5.3.2 Presentations of Mat k[s; s−1] and Cospan Mat k[s; s−1].... 111 5.3.3 Corelations in Mat k[s; s−1].................... 114 ii 5.3.4 Presentation of Corel Mat k[s; s−1]................ 116 5.4 Operational semantics . 119 5.5 Controllability . 121 5.5.1 A categorical characterisation . 122 5.5.2 Control and interconnection . 124 5.5.3 Comparison to matrix methods . 125 6 Passive linear networks 128 6.1 Introduction . 129 6.2 Circuits of linear resistors . 136 6.2.1 Circuits as labelled graphs . 137 6.2.2 Ohm's law, Kirchhoff's laws, and the principle of minimum power139 6.2.3 A Dirichlet problem . 142 6.2.4 Equivalent circuits . 145 6.2.5 Dirichlet forms . 148 6.3 Inductors and capacitors . 150 6.3.1 The frequency domain and Ohm's law revisited . 151 6.3.2 The mechanical analogy . 154 6.3.3 Generalized Dirichlet forms . 155 6.3.4 A generalized minimizability result . 157 6.4 A compositional perspective . 160 6.4.1 The category of open circuits . 161 6.4.2 An obstruction to black boxing . 163 6.4.3 The category of Dirichlet cospans . 165 6.4.4 A category of behaviours . 168 6.5 Networks as Lagrangian relations . 170 6.5.1 Symplectic vector spaces . 170 6.5.2 Lagrangian subspaces from quadratic forms . 173 6.5.3 Lagrangian relations . 175 6.5.4 The symmetric monoidal category of Lagrangian relations . 177 6.6 Ideal wires and corelations . 178 6.6.1 Ideal wires as corelations . 179 6.6.2 Potentials on corelations . 180 6.6.3 Currents on corelations . 182 6.6.4 The symplectification functor . 183 6.6.5 Lagrangian relations as decorated corelations . 186 iii 6.7 The black box functor . 189 6.7.1 Definition . 189 6.7.2 Minimization via composition of relations . 191 6.7.3 Proof of functoriality . 192 7 Further directions 195 7.1 Bound colimits . 195 7.2 Open circuits and other systems . 198 Bibliography 200 iv Preface This is a thesis in the mathematical sciences, with emphasis on the mathematics. But before we get to the category theory, I want to say a few words about the scientific tradition in which this thesis is situated. Mathematics is the language of science. Twinned so intimately with physics, over the past centuries mathematics has become a superb|indeed, unreasonably effective|language for understanding planets moving in space, particles in a vacuum, the structure of spacetime, and so on. Yet, while Wigner speaks of the unreasonable effectiveness of mathematics in the natural sciences [Wig60], equally eminent mathe- maticians, not least Gelfand, speak of the unreasonable ineffectiveness of mathematics in biology [Mon07] and related fields. Why such a difference? A contrast between physics and biology is that while physical systems can often be studied in isolation|the proverbial particle in a vacuum|, biological systems are necessarily situated in their environment. A heart belongs in a body, an ant in a colony. One of the first to draw attention to this contrast was Ludwig von Bertalanffy, biologist and founder of general systems theory, who articulated the difference as one between closed and open systems: Conventional physics deals only with closed systems, i.e. systems which are considered to be isolated from their environment. However, we find systems which by their very nature and definition are not closed systems. Every living organism is essentially an open system. It maintains itself in a continuous inflow and outflow, a building up and breaking down of components, never being, so long as it is alive, in a state of chemical and thermodynamic equilibrium but maintained in a so-called steady state which is distinct from the latter [Ber68]. While the ambitious generality of general systems theory has proved difficult, von Bertalanffy’s philosophy has had great impact in his home field of biology, leading to the modern field of systems biology. Half a century later, Dennis Noble, another v great pioneer of systems biology and the originator of the first mathematical model of a working heart, describes the shift as one from reduction to integration. Systems biology. is about putting together rather than taking apart, integration rather than reduction. It requires that we develop ways of thinking about integration that are as rigorous as our reductionist pro- grammes, but different [Nob06]. In this thesis we develop rigorous ways of thinking about integration or, as we refer to it, interconnection. Interconnection and openness are tightly related. Indeed, openness implies that a system may be interconnected with its environment. But what is an environment but comprised of other systems? Thus the study of open systems becomes the study of how a system changes under interconnection with other systems. To model this, we must begin by creating language to describe the interconnection of systems. While reductionism hopes that phenomena can be explained by reducing them to \elementary units investigable independently of each other" [Ber68], this phi- losophy of integration introduces as an additional and equal priority the investigation of the way these units are interconnected. As such, this thesis is predicated on the hope that the meaning of an expression in our new language is determined by the meanings of its constituent expressions together with the syntactic rules combining them. This is known as the principle of compositionality. Also commonly known as Frege's principle, the principle of compositionality both dates back to Ancient Greek and Vedic philosophy, and is still the subject of active research today [Jan86, Sza13].