Algebras of Open Dynamical Systems on the Operad of Wiring Diagrams
1. ALGEBRAS OF OPEN DYNAMICAL SYSTEMS ON THE OPERAD OF WIRING DIAGRAMS
DMITRY VAGNER, DAVID I. SPIVAK, AND EUGENE LERMAN
ABSTRACT. In this paper, we use the language of operads to study open dynamical systems. More specifically, we study the algebraic nature of assembling complex dynamical systems from an interconnection of simpler ones. The syntactic architecture of such interconnections is encoded using the visual language of wiring diagrams. We define the symmetric monoidal category , from which we may construct an operad , whose objects are black boxes with input and output ports, and whose morphisms are wiring diagrams, thus prescribing the algebraic rules for interconnection. We then define two -algebras and , which associate semantic content to the structures in . Respectively, they correspond to general and to linear systems of differential equations, in which an internal state is controlled by inputs and produces outputs. As an example, we use these algebras to formalize the classical problem of systems of tanks interconnected by pipes, and hence make explicit the algebraic relationships among systems at different levels of granularity.
1.1. 1. INTRODUCTION
It is widely believed that complex systems of interest in the sciences and engineering are both modular and hierarchical. Network theory uses the tools and visual language of graph theory to model such systems, and has proven to be both effective and flexible in describing their modular character. However, the field has put less of an emphasis on finding powerful and versatile language for describing the hierarchical aspects of complex systems. There is growing confidence that category theory can provide the necessary conceptual setting for this project. This is seen, for example, in Mikhail Gromov’s well-known claim, “the mathematical language developed by the end of the 20th century by far exceeds in its expressive power anything, even imaginable, say, before 1960. Any meaningful idea coming from science can be fully developed in this language.” [Gro13]
Joyal and Street’s work on string diagrams [JS91] for monoidal categories and (with Verity) on traced monoidal categories [JSV96] has been used for decades to visualize compositions and feedback in networked systems, for example in the theory of flow charts [AMMO10]. Precursors, such as Penrose diagrams and flow diagrams, have been used in physics and the theory of computation, respectively, since the 1970’s [Sco71, BS11].
Over the past several years, the second author and collaborators have been developing a novel approach to modular hierarchical systems based on the language of operads and symmetric monoidal categories [Spi13, SR13]. The main contribution to the theory of string diagrams of the present research program is
Spivak was supported by ONR grant N000141310260 and AFOSR grant FA9550-14-1-0031.
the inclusion of an outer box, which allows for holarchic [Koe67] combinations of these diagrams. That is, the parts can be assembled into a whole, which can itself be a part. The composition of such assemblies can now be viewed as morphism composition in an operad. In fact, there is a strong connection between traced monoidal categories and algebras on these operads, such as our operad of wiring diagrams, though it will not be explained here (see [SSR15] for details).
More broadly, category theory can organize graphical languages found in a variety of applied contexts. For example, it is demonstrated in [BS11] and [Coe13] that the theory of monoidal categories unifies the diagrams coming from diverse fields such as physics, topology, logic, computation, and linguistics. More recently, as in [BB12], there has been growing interest in viewing more traditionally applied fields, such as ecology, biology, chemistry, electrical engineering, and control theory through such a lens. Specifically, category theory has been used to draw connections among visual languages such as planar knot diagrams, Feynman diagrams, circuit diagrams, signal flow graphs, Petri nets, entity relationship diagrams, social networks, and flow charts. This research is building toward what John Baez has called “a foundation of applied mathematics” [Bae13].
The goal of the present paper is to show that open continuous time dynamical systems form an algebra over a certain (colored) operad, which we call the operad of wiring diagrams. It is a variant of the operad that appeared in [SR13]. That is, wiring diagrams provide a straightforward, diagrammatic language to understand how dynamical systems that describe processes can be built up from the systems that describe its sub-processes.
More precisely, we will define a symmetric monoidal category of black boxes and wiring diagrams. Its underlying operad is a graphical language for building larger black boxes out of an interconnected set of smaller ones. We then define two -algebras, and , which encode open dynamical systems, i.e., differential equations of the form
where represents an internal state vector, represents its time derivative, and input and output represent inputs to and outputs from the system. In , the functions and are smooth, whereas in the subalgebra , they are moreover linear. The fact that and are -algebras captures the fact that these systems are closed under wiring diagram interconnection.
Our notion of interconnection is a generalization of that in Deville and Lerman [DL10], [DL15], [DL14]. Their version of interconnection produces a closed system from open ones, and can be understood in the present context as a morphism whose codomain is the closed box (see Definition 3.8). Graph fibrations between wiring diagrams form an important part of their formalism, though we do not discuss that aspect here.
This paper is the third in a series, following [SR13] and [Spi13], on using wiring diagrams to model interactions. The algebra we present here, that of open systems, is distinct from the algebras of relations and of propagators studied in earlier works. Beyond the dichotomy of discrete vs. continuous, these algebras are markedly different in structure. For one thing, the internal wires in [SR13] themselves carry state, whereas here, a wire should be thought of as instantaneously transmitting its contents from an output site to an input site. Another difference between our algebra and those of previous works is that the algebras here involve open systems in which, as in (1), the instantaneous change of state is a function of the current state and the input, whereas the output depends only on the current state (see Definition 4.2). The differences between these algebras is also reflected in a mild difference between the operad we use here and the one used in previous work.
1.1. Motivating example. The motivating example for the algebras in this paper comes from classical differential equations pedagogy; namely, systems of tanks containing salt water concentrations, with pipes carrying fluid among them. The systems of ODEs produced by such applications constitute a subset of those our language can address; they are linear systems with a certain form (see Example 5.7). To ground the discussion, we consider a specific example.
Example 1.1. Figure 1 below reimagines a problem from Boyce and DiPrima's canonical text [BD65, Figure 7.1.6] as a dynamical system over a wiring diagram.
The diagram illustrates a dynamical system within a container labeled . Inside, there are two rectangular boxes representing tanks, and .
- Inputs to : From the left, two arrows enter . The top arrow is labeled and has the text "1 gal/min" and "3 oz/gal" next to it. The bottom arrow is labeled and has "1.5 gal/min" and "1 oz/gal" next to it. These arrows are also labeled and respectively.
- Flow from to : An arrow labeled and connects the right side of to the left side of . It is labeled "3 gal/min".
- Flow from to : An arrow labeled and connects the right side of back to the left side of . It is labeled "1.5 gal/min".
- Output from : An arrow labeled and exits the right side of . It is labeled "2.5 gal/min".
- Internal Labels: Inside , the text " oz salt" and "30 gal water" is present. Inside , the text " oz salt" and "20 gal water" is present.
FIGURE 1. A dynamical system from Boyce and DiPrima interpreted over a wiring diagram in .
In this diagram, and are boxes that represent tanks consisting of salt water solution. The functions and represent the amount of salt (in ounces) found in 30 and 20 gallons of water, respectively. These tanks are interconnected with each other by pipes embedded within a total system . The prescription for how wires are attached among the boxes is formally encoded in the wiring diagram , as we will discuss in Definition 3.1.
Both tanks are being fed salt water concentrations at constant rates from the outside world. Specifically, is fed a 1 ounce salt per gallon water solution at 1.5 gallons per minute and is fed a 3 ounce salt per gallon water solution at 1 gallon per minute. The tanks also both feed each other their solutions, with feeding at 3 gallons per minute and feeding at 1.5 gallons per minute. Finally, feeds the outside world its solution at 2.5 gallons per minute.
The dynamics of the salt water concentrations both within and leaving each tank is encoded in a linear open system , consisting of a differential equation for and a readout map for each output (see Definition 2.9). Our algebra allows one to assign a linear open system to each tank , and by functoriality the morphism produces a linear open system for the larger box . We will explore this construction in detail, in particular providing explicit formulas for it in the linear case, as well as for more general systems of ODEs.
1.2. 2. PRELIMINARY NOTIONS
Throughout this paper we use the language of monoidal categories and functors. Depending on the audience, appropriate background on basic category theory can be found in MacLane [ML98], Awodey [Awo10], or Spivak [Spi14]. Leinster [Lei04] is a good source for more specific information on monoidal categories and operads. We refer the reader to [KFA69] for an introduction to dynamical systems.
Notation. We denote the category of sets and functions by Set and the full subcategory spanned by finite sets as FinSet. We generally do not concern ourselves with cardinality issues. We follow Leinster [Lei04] and use for binary product and for arbitrary product, and dually for binary coproduct and for arbitrary coproduct in any category. By operad we always mean symmetric colored operad or, equivalently, symmetric multicategory.
2.1. Monoidal categories and operads. In Section 3, we will construct the symmetric monoidal category of boxes and wiring diagrams, which we often simply denote as W. We will sometimes consider the underlying operad , obtained by applying the fully faithful functor
to W. A brief description of this functor is given below in Definition 2.1.
Definition 2.1. Let SMC denote the category of symmetric monoidal categories and lax monoidal functors; and Opd be the category of operads and operad functors. Given a symmetric monoidal category , we define the operad as follows:
for any and objects .
Now suppose is a lax monoidal functor in SMC. By definition such a functor is equipped with a morphism
natural in the , called the coherence map. With this map in hand, we define the operad functor by stating how it acts on objects and morphisms in :
Example 2.2. Consider the symmetric monoidal category , where is the cartesian product of sets and a one element set. Define Sets := as in Definition 2.1. Explicitly, Sets is the operad in which an object is a set and a morphism is a function .
Definition 2.3. Let be a symmetric monoidal category and let be as in Example 2.2. A -algebra is a lax monoidal functor . Similarly, if is an operad, a -algebra is defined as an operad functor .
To avoid subscripts, we will generally use the formalism of SMCs in this paper. Definitions 2.1 and 2.3 can be applied throughout to recast everything we do in terms of operads. The primary reason operads may be preferable in applications is that they suggest more compelling pictures. Hence throughout this paper, depictions of wiring diagrams will often be operadic, i.e., have many input boxes wired together into one output box.
2.2. Typed sets. Each box in a wiring diagram will consist of finite sets of ports, each labelled by a type. To capture this idea precisely, we define the notion of typed finite sets. By a finite product category, we mean a category that is closed under taking finite products.
Definition 2.4. Let be a small finite product category. The category of -typed finite sets, denoted , is defined as follows. An object in is a map from a finite set to the objects of :
Intuitively, one can think of a typed finite set as a finite unordered list of -objects. For any element , we call the object its type. If the typing function is clear from context, we may denote simply by .
A morphism in consists of a function that makes the following diagram of finite sets commute:
Note that is a cocartesian monoidal category.
We refer to the morphisms of as -typed functions. If a -typed function is bijective, we call it a -typed bijection.
In other words, is the comma category for the diagram
where is the inclusion.
Definition 2.5. Let be a finite product category, and let be a -typed finite set. Its dependent product is defined as
Coordinate projections and diagonals are generalized as follows. Given a typed function in we define
to be the unique morphism for which the following diagram commutes for all :
By the universal property for products, this defines a functor,
Lemma 2.6. The dependent product functor is strong monoidal. In particular, for any finite set whose elements index typed finite sets , there is a canonical isomorphism in ,
Remark 2.7. The category of second-countable smooth manifolds and smooth maps is essentially small (by the embedding theorem) so we choose a small representative and denote it Man. Note that Man is a finite product category. Manifolds will be our default typing, in the sense that we generally take in Definition 2.4 and denote
We thus refer to the objects, morphisms, and isomorphisms in TFS simply as typed finite sets, typed functions, and typed bijections, respectively.
Remark 2.8. The ports of each box in a wiring diagram will be labeled by manifolds because they are the natural setting for geometrically interpreting differential equations (see [Spi65]). For simplicity, one may wish to restrict attention to the full subcategory Euc of Euclidean spaces for , because they are the usual domains for ODEs found in the literature; or to the (non-full) subcategory Lin of Euclidean spaces and linear maps between them, because they characterize linear systems of ODEs. We will return to TFSLin in Section 5.
2.3. Open systems. As a final preliminary, we define our notion of open dynamical system. Recall that every manifold has a tangent bundle manifold, denoted , and a smooth projection map . For any point , the preimage has the structure of a vector space, called the tangent space of at . If is a Euclidean space then also for every point . A vector field on is a smooth map such that . See [Spi65] or [War83] for more background.
For the purposes of this paper we make the following definition of open systems; this may not be completely standard.
Definition 2.9. Let be smooth manifolds and be the tangent bundle of . Let denote a pair of smooth maps
where, for all we have ; that is, the following diagram commutes:
We sometimes use to denote the whole tuple,
which we refer to as an open dynamical system (or open system for short). We call the state space, the input space, the output space, the differential equation, and the readout map of the open system.
Note that the pair is determined by a single smooth map
which, by a minor abuse of notation, we also denote by .
In the special case that are Euclidean spaces and is a linear map (or equivalently and are linear), we call a linear open system.
Remark 2.10. Let be a smooth manifold, and let be trivial. Then an open system in the sense of Definition 2.9 is a smooth map over , in other words, a vector field on . From the geometric point of view, vector fields are autonomous (i.e., closed!) dynamical systems; see [Tes12].
Remark 2.11. For an arbitrary manifold , a map can be considered as a function , where is the set of vector fields on . Hence, controls the behavior of the system in the usual sense.
Remark 2.12. Given an open system we can form a new open system by feeding the readout of into the inputs of . For example suppose the open system is of the form
where and are manifolds. Define by
Then
is a new open system obtained by plugging a readout of into the space of inputs . Compare with Figure 3.
This looks a little boring. It becomes more interesting when we start with several open systems, take their product and then plug (some of the) outputs into inputs. For example suppose we start with two open systems
and
Here, again, all capital letters denote manifolds. Take their product; we get
Now plug in the functions and into inputs. We get a new system
where
Compare with Figure 7. Making these kinds of operations on open systems precise for an arbitrary number of interacting systems is the point of our paper.
By defining the appropriate morphisms, we can consider open dynamical systems as being objects in a category. We are not aware of this notion being defined previously in the literature, but it is convenient for our purposes.
Definition 2.13. Suppose that and is an open system for . A morphism of open systems
is a triple of smooth maps , , and , such that the following diagram commutes:
This defines the category ODS of open dynamical systems. We define the subcategory ODSLin ODS by restricting our objects to linear open systems, as in Definition 2.9, and imposing that the three maps in are linear.
As in Remark 2.12, we will often want to combine two or more interconnected open systems into one larger one. As we shall see in Section 4, this will involve taking a product of the smaller open systems. Before we define this formally, we first remind the reader that the tangent space functor is strong monoidal, i.e., it canonically preserves products,
Lemma 2.14. The category ODS of open systems has all finite products. That is, if is a finite set and is an open system for each , then their product is
with the obvious projection maps.
1.3. 3. THE OPERAD OF WIRING DIAGRAMS
In this section, we define the symmetric monoidal category of wiring diagrams. We then use Definition 2.1 to define the wiring diagram operad , which situates our pictorial setting. We begin by formally defining the underlying category and continue with some concrete examples to explicate this definition.
Definition 3.1. The category has objects boxes and morphisms wiring diagrams. A box is an ordered pair of -typed finite sets (Definition 2.4),
Let and . Then we refer to elements and as input ports and output ports, respectively. We call the type of port , and similarly for .
A wiring diagram in is a triple , where is a typed bijection (see Definition 2.4)
satisfying the following condition:
no passing wires: , or equivalently .
This condition allows us to decompose into a pair :
We often identify the wiring diagram with the typed bijection , or equivalently its corresponding pair .
By a wire in , we mean a pair , where , , and . In other words a wire in is a pair of ports connected by .
The identity wiring diagram is given by the identity morphism in .
Now suppose and are wiring diagrams. We define their composition as , where is given by the pair of dashed arrows making the following diagrams commute.
Here is the codiagonal map in .
Remark 3.2. For any finite product category , we may define the category by replacing with , and with , in Definition 3.1. In particular, as in Remark 2.8, we have the symmetric monoidal category of linearly typed wiring diagrams.
What we are calling a box is nothing more than an interface; at this stage it has no semantics, e.g., in terms of differential equations. Each box can be given a pictorial representation, as in Example 3.3 below.
Example 3.3. As a convention, we depict a box with input ports connecting on the left and output ports connecting on the right, as in Figure 2 below. When types are displayed, we label ports on the exterior of their box and their types adjacently on the interior of the box with a ‘:’ symbol in between to designate typing. Reading types off of this figure, we see that the type of input port is the manifold , that of input port is the circle , and that of output port is the torus .
FIGURE 2. A box with two input ports, of types and , and one output port with type .
A morphism in is a wiring diagram , the idea being that a smaller box (the domain) is nested inside of a larger box (the codomain). The ports of and are then interconnected by wires, as specified by the typed bijection . We will now see an example of a wiring diagram, accompanied by a picture.
Example 3.4. Reading off the wiring diagram drawn below in Figure 3, we have the following data for boxes:
Table 1 makes explicit via a list of its wires, i.e., pairs .
TABLE 1
Remark 3.5. The condition that be typed, as in Definition 2.4, ensures that if two ports are connected by a wire then the associated types are the same. In particular, in Example 3.4 above, must be the same type tuple as .
Now that we have made wiring diagrams concrete and visual, we can do the same for their composition.
Example 3.6. In Figure 4, we visualize the composition of two wiring diagrams and to form . Composition is depicted by drawing the wiring diagram for and then, inside of the box, drawing in the wiring diagram for . Finally, to depict the composition as one single wiring diagram, one simply “erases” the box, leaving the and boxes interconnected among themselves. Figure 4 represents such a procedure by depicting the box with a dashed arrow.
It’s important to note that the wires also connect, e.g. if a wire in connects a port to some port, and that port attaches via a wire to some port, then these wires “link together” to a total wire in , connecting a port with an port. Table 2 below traces the wires of through the and composition diagrams in (5) on its left and right side, respectively. The left portion of the table starts with and ends at , with intermediary steps of the composition denoted with superscripts . The right portion of the table starts with then goes through the intermediary of and finally reaches . We skip lines on the right portion to match the spacing on the left.
TABLE 2
Remark 3.7. The condition that be both injective and surjective prohibits exposed ports and split ports, respectively, as depicted in Figure 5a. The no passing wires condition on prohibits wires that go straight across the box, as seen in the intermediate box of Figure 5b.
Now that we have formally defined and concretely explicated the category , we will make it into a monoidal category by defining its tensor product.
Definition 3.8. Let be boxes and and be wiring diagrams. The monoidal product is given by
The closed box is the monoidal unit.
FIGURE 4. A wiring diagram composition of and , with dashed medium box .
FIGURE 5. (a) A faux-wiring diagram violating the bijectivity condition in Definition 3.1.
(b) A composition of diagrams in which a loop emerges because the inner diagram has a (prohibited) passing wire.
Remark 3.9. Once we add semantics in Section 4, closed boxes will correspond to autonomous systems, which do not interact with any outside environment (see Remark 2.10).
We now make this monoidal product explicit with an example.
Example 3.10. Consider boxes and depicted below.
We depict their tensor by stacking boxes.
Similarly, consider the following wiring diagrams (with ports left unlabelled).
We can depict their composition via stacking.
We now prove that the above data characterizing indeed constitutes a symmetric monoidal category, at which point we can, as advertised, invoke Definition 2.1 to define the operad .
Proposition 3.11. The category in Definition 3.1 and the monoidal product with unit 0 in Definition 3.8 form a symmetric monoidal category .
Proof. We begin by establishing that is indeed a category. We first show that our class of wiring diagrams is closed under composition. Let , , and .
To show that is a typed bijection, we replace the pair of maps with a pair of bijections as follows. Let (for exports) denote the image of , and (for local ports) be its complement. Then we can identify with the following pair of typed bijections
Similarly, identify with . We can then rewrite the diagram defining in (5) as one single commutative diagram of typed finite sets.
As a composition of typed bijections, is also a typed bijection.
The following computation proves that has no passing wires:
Therefore is closed under wiring diagram composition. To show that is a category, it remains to prove that composition of wiring diagrams satisfies the unit and associativity axioms. The former is straightforward and will be omitted. We now establish the latter.
Consider the wiring diagrams , , ; and let and . We readily see that by the associativity of composition in TFS. Proving that is equivalent to establishing the commutativity of the following diagram:
(6)
This diagram commutes in any category with coproducts, as follows from the associativity and naturality of the codiagonal map. We present a formal argument of this fact below in the language of string diagrams (See [JS91]). As in [Sel11], we let squares with blackened corners denote generic morphisms. We let triangles denote codiagonal maps. See Figure 6 below.
FIGURE 6. String diagram proof of commutativity of (6)
The first step of the proof follows from the topological nature of string diagrams, which mirror the axioms of monoidal categories. The second step invokes the associativity of codiagonal maps. The third and final step follows from the naturality of codiagonal maps, i.e., the commutativity of the following diagram.
Now that we have shown that is a category, we show that is a monoidal structure on . Let be boxes. We readily observe the following canonical isomorphisms.
Hence the monoidal product is well behaved on objects. It is similarly easy, and hence will be omitted, to show that is functorial. This completes the proof that is a symmetric monoidal category.
Having established that is an SMC, we can now speak about the operad of wiring diagrams. In particular, we can draw operadic pictures, such as the one in our motivating example in Figure 1, to which we now return.
Example 3.12. Figure 7 depicts an wiring diagram , which we may formally denote by the tuple . Reading directly from Figure 7, we have the boxes:
The wiring diagram is visualized by nesting the domain boxes within the codomain box , and drawing the wires prescribed by , as recorded below in Table 3.
TABLE 3
To reconceptualize as a wiring diagram in , we simply consider the tensor , as given in Figure 8 below. This demonstrates the fact that operadic pictures are easier to read and hence are more illuminating.
FIGURE 8. A wiring diagram in corresponding to the wiring diagram of Figure 7.
The following remark explains that our pictures of wiring diagrams are not completely ad hoc—they are depictions of 1-dimensional oriented manifolds with boundary. The boxes in our diagrams simply tie together the positively and negatively oriented components of an individual oriented 0-manifold.
Remark 3.13. For any set , let denote the symmetric monoidal category of oriented 0-manifolds over and the 1-dimensional cobordisms between them. We call its objects oriented -typed 0-manifolds. Recall that is our category of Man-typed wiring diagrams; let denote the set of manifolds (see Remark 2.7). There is a faithful, essentially surjective, strong monoidal functor
sending a box to the oriented -typed 0-manifold where is oriented positively and negatively. Under this functor, a wiring diagram is sent to a 1-dimensional cobordism that has no closed loops. A connected component of such a cobordism can be identified with either its left or right endpoint, which correspond to the domain or codomain of the bijection . See [SSR15].
In fact, with the no passing wires condition on morphisms (cobordisms) (see Definition 3.1), the subcategory is the left class of an orthogonal factorization system. See [Aba15].
Let be a wiring diagram. Applying the dependent product functor (see Definition 2.5) to , we obtain a diffeomorphism of manifolds
Equivalently, if is represented by the pair , as in Definition 3.1, we can express in terms of its pair of component maps:
It will also be useful to apply the dependent product functor to the commutative diagrams in (5), which define wiring diagram composition. Note that, by the contravariance of the dependent product, the codiagonal gets sent to the diagonal map . Thus we have the following commutative diagrams:
1.4. 4. THE ALGEBRA OF OPEN SYSTEMS
In this section we define an algebra (see Definition 2.3) of general open dynamical systems. A -algebra can be thought of as a choice of semantics for the syntax of , i.e., a set of possible meanings for boxes and wiring diagrams. As in Definition 2.1, we may use this to construct the corresponding operad algebra . Before we define , we revisit Example 1.1 for inspiration.
Example 4.1. As the textbook exercise [BD65, Problem 7.21] prompts, let's begin by writing down the system of equations that governs the amount of salt within the tanks . This can be done by using dimensional analysis for each port of to find the rate of salt being carried in ounces per minute, and then equating the rate to the sum across these rates for ports minus ports.
Dropping the physical units, we are left with the following system of ODEs:
The derivations for the equations in (9) involved a hidden step in which the connection pattern in Figure 1, or equivalently Figure 7, was used. Our wiring diagram approach explains this step and makes it explicit. Each box in a wiring diagram should only “know” about its own inputs and outputs, and not how they are connected to others. That is, we can only define a system on by expressing just in terms of and —this is precisely the data of an open system (see Definition 2.9). We now define our algebra , which assigns a set of open systems to a box. Given a wiring diagram and an open system on its domain box, it also gives a functorial procedure for assigning an open system to the codomain box. We will then use this new machinery to further revisit Example 4.1 in Example 5.7.
Definition 4.2. We define as follows. Let . The set of open systems on , denoted , is defined as
We call the set of state variables and its dependent product the state space.
Let be a wiring diagram. Then is given by , where and is defined by the dashed arrows () (see Definition 2.9) that make the diagrams below commute:
One may note strong resemblance between the diagrams in (10) and those in (5).
We give a lax monoidal structure: for any pair we have a coherence map given by
where is as in Lemma 2.14.
Remark 4.3. Recall from Remark 2.7 that is small, so the collection of open systems on is indeed a set.
Remark 4.4. One may also encode an initial condition in by using instead of in Remark 2.7 as the default choice of finite product category, where is the category of pointed smooth manifolds and base point preserving smooth maps. The base point represents the initialization of the state variables.
We now establish that is indeed an algebra.
Proposition 4.5. The pair of Definition 4.2 is a lax monoidal functor, i.e., is a -algebra.
Proof. Let and be wiring diagrams in . To show that is a functor, we must have that . Immediately we have .
Now let and . It suffices to show , or equivalently . One readily sees that . We use (8) and (10) to produce the following diagram; showing it commutes is equivalent to proving that .
The commutativity of this diagram, which is dual to the one for associativity in (6), holds in an arbitrary category with products. Although the middle square fails to commute by itself, the composite of the first two maps equalizes it; that is, the two composite morphisms agree.
Since we proved the analogous result via string diagrams in the proof of Proposition 3.11, we show it concretely using elements this time. Let be an arbitrary element. Composing six morphisms through the left of the diagram gives the same answer as composing through the right; namely,
Since the diagram commutes, we have shown that is a functor. To prove that the pair constitutes a lax monoidal functor , i.e., a -algebra, we must establish coherence. Since simply consists of a coproduct and a product, this is straightforward and will be omitted.
As established in Definition 2.1, the coherence map allows us to define the operad algebra from . This finally provides the formal setting to consider open dynamical systems over operadic wiring diagrams, such as our motivating one in Figure 1. We note that, in contrast to the trivial equality found in Definition 4.2, in the operadic setting we have
This simply means that the set of state variables of the larger box is the disjoint union of the state variables of its constituent boxes . Now that we have the tools to revisit Example 4.1, we do so in the following section, but first we will define the subalgebra to which it belongs—that of linear open systems.
1.5. 5. THE SUBALGEBRA OF LINEAR OPEN SYSTEMS
In this section, we define the algebra , which encodes linear open systems. Here is the category of -typed wiring diagrams, as in Remark 3.2. Of course, one can use Definition 2.1 to construct an operad algebra .
Before we give a formal definition for , we first provide an alternative description for linear open systems and wiring diagrams in . The category enjoys special properties—in particular it is an additive category, as seen by the fact that there is an equivalence of categories . Specifically, finite products and finite coproducts are isomorphic. Hence a morphism in canonically decomposes into a matrix equation
This matrix is naturally equivalent to the whole map by universal properties. We use these to rewrite our relevant maps in Definitions 5.1 and 5.2 below.
Definition 5.1. Suppose that is a linear open system and hence . Then decomposes into the four linear maps:
By Definition 2.9, we know . If we let , these equations can be organized into a single matrix equation
We will exploit this form in Definition 5.4 to define how acts on wiring diagrams in terms of one single matrix equation, in place of the seemingly complicated commutative diagrams in (10). To do so, we also recast wiring diagrams in matrix format in Definition 5.2 below.
Definition 5.2. Suppose is a wiring diagram in . Recalling (7), we apply the dependent product functor to :
Since this is a morphism in , it can be decomposed into four linear maps
By virtue of the no passing wires condition in Definition 3.1, we must have . We can then, as in (12), organize this information in one single matrix:
Remark 5.3. The bijectivity condition in Definition 3.1 implies that is a permutation matrix.
We now employ these matrix characterizations to define the algebra of linear open systems.
Definition 5.4. We define the algebra as follows. Let . Then the set of linear open systems on is defined as
Let be a wiring diagram. Then, as in Definition 4.2, we define . We use the format of Definitions 5.1 and 5.2 to define :
This is really just a linear version of the commutative diagrams in (10). For example, the equation can be read off the diagram for in (10), using the additivity of .
Finally, The coherence map is given, as in Definition 4.2, by .
We now establish that this constitutes an algebra.
Proposition 5.5. The pair of Definition 5.4 is a lax monoidal functor, i.e. a -algebra.
Proof. Since coherence is identical to that in Proposition 4.5, it will suffice to show functoriality. Let and be wiring diagrams with composition . We now rewrite using a matrix equation in terms of and by recasting (5) in matrix form below.
We now prove that . We immediately have . Let and . We must show . Let and . It is then straightforward matrix arithmetic to see that
(15)
Therefore, the pair constitutes a lax monoidal functor , i.e., a -algebra.
Remark 5.6. Although we've been referring to as a subalgebra of , this is technically not the case since they have different source categories. The following diagram illustrates precisely the relationship between the -algebra , defined above, and the -algebra , defined in Section 4.
Here, the natural inclusion corresponds to , and we have a natural transformation . Hence for each , we have a function that sends the linear open system to the open system .
As promised, we now reformulate Example 1.1 in terms of our language.
Example 5.7. For the reader's convenience, we reproduce Figure 1 and Table 3.
The diagram illustrates a dynamical system within a container . It consists of two sub-systems, and , represented as boxes.
- receives two inputs: (3 oz/gal salt) and (30 gal water). It produces two outputs: oz salt and 3 gal/min water.
- receives two inputs: (3 gal/min water) and (20 gal water). It produces two outputs: oz salt and 2.5 gal/min water.
- The entire system is part of a larger environment . has two external inputs: (1 gal/min, 3 oz/gal) and (1.5 gal/min, 1 oz/gal).
- also has two external outputs: (2.5 gal/min) and a bottom output of 1.5 gal/min.
- Arrows indicate the flow of materials between these components.
FIGURE 9. A dynamical system from Boyce and DiPrima interpreted over a wiring diagram in .
TABLE 4
We can invoke the yoga of Definition 5.2 to write as a matrix below:
One can think of as a block permutation matrix consisting of identity and zero matrix blocks. An identity matrix in block entry represents the fact that the port whose state space corresponds to row and the one whose state space corresponds to column get linked by . In general, the dimension of each is equal to the dimension of the corresponding state space and hence the formula in (17) is true, independent of the typing. In the specific example of this system, however, all of these ports are typed in , and so we have in (17).
As promised in Example 4.1, we now write the open systems for the in Figure 1 as elements of . The linear open systems below in (18) represent and , respectively.
Note the proportion of zeros and ones in the -matrices of (18)—this is perhaps why the making explicit of these details was an afterthought in (9). Because we may have arbitrary nonconstant coefficients, our formalism can capture more intricate systems.
We then use (17) to establish that and . This allows us to recover the equations in (9):
The coherence map in Definition 5.4 gives us the combined tank system:
This system can then be written out as a matrix below
Finally, we can apply formula (13) to (19) above to express as a matrix the open system for the outer box .
1.6. REFERENCES
- [Aba15] Joseph Abadi. Orthogonal factorization systems on 1- and 2-cob. In preparation, 2015.
- [AMMO10] Rob Arthan, Ursula Martin, Erik A. Mathiesen, and Paulo Oliva. A general framework for sound and complete Floyd-Hoare logics. ACM Trans. Comput. Log., 11(1):Art. 7, 31, 2010.
- [Awo10] Steve Awodey. Category Theory, volume 52 of Oxford Logic Guides. Oxford University Press, Oxford, second edition, 2010.
- [Bae13] John Baez. The foundations of applied mathematics. ePrint online: math.ucr.edu/home/baez/irvine/irvine.pdf, 5 2013.
- [BB12] John C. Baez and Jacob Biamonte. A course on quantum techniques for stochastic mechanics. ePrint online: www.arXiv.org/abs/1209.3632, 2012.
- [BD65] William E. Boyce and Richard C. DiPrima. Elementary Differential Equations and Boundary Value Problems. John Wiley & Sons, Inc., New York-London-Sydney, 1965.
- [BS11] J. Baez and M. Stay. Physics, topology, logic and computation: a Rosetta Stone. In New Structures for Physics, volume 813 of Lecture Notes in Phys., pages 95–172. Springer, Heidelberg, 2011.
- [Coe13] Bob Coecke. An alternative gospel of structure: order, composition, processes. ePrint online: www.arXiv.org/abs/1307.4038, 2013.
- [DL10] Lee DeVille and Eugene Lerman. Dynamics on networks I. Combinatorial categories of modular continuous-time systems. ePrint online: www.arXiv.org/abs/1008.5359, 2010.
- [DL14] Lee DeVille and Eugene Lerman. Modular dynamical systems on networks. JEMS (to appear). ePrint online: www.arXiv.org/abs/1303.3907, 2014.
- [DL15] Lee DeVille and Eugene Lerman. Dynamics on networks of manifolds. SIGMA Symmetry Integrability Geom. Methods Appl., 11:Paper 022, 21, 2015.
- [Gro13] Mikhail Gromov. In a search for a structure, part 1: On entropy. ePrint online: www.ihes.fr/~gromov/PDF/structure-search-entropy-july5-2012.pdf, 6 2013.
- [JS91] André Joyal and Ross Street. The geometry of tensor calculus. I. Adv. Math., 88(1):55–112, 1991.
- [JSV96] André Joyal, Ross Street, and Dominic Verity. Traced monoidal categories. Math. Proc. Cambridge Philos. Soc., 119(3):447–468, 1996.
- [KFA69] R. E. Kalman, P. L. Falb, and M. A. Arbib. Topics in Mathematical System Theory. McGraw-Hill Book Co., New York-Toronto, Ont.-London, 1969.
- [Koe67] Arthur Koestler. The Ghost in the Machine. Hutchinson & Co., 1967.
- [Lei04] Tom Leinster. Higher Operads, Higher Categories, volume 298 of London Mathematical Society Lecture Note Series. Cambridge University Press, Cambridge, 2004.
- [ML98] Saunders Mac Lane. Categories for the Working Mathematician, volume 5 of Graduate Texts in Mathematics. Springer-Verlag, New York, second edition, 1998.
- [Sco71] Dana Scott. The lattice of flow diagrams. In Symposium on Semantics of Algorithmic Languages, pages 311–366. Lecture Notes in Mathematics, Vol. 188. Springer, Berlin, 1971.
- [Sel11] P. Selinger. A survey of graphical languages for monoidal categories. In New structures for physics, volume 813 of Lecture Notes in Phys., pages 289–355. Springer, Heidelberg, 2011.
- [Spi65] Michael Spivak. Calculus on Manifolds. A Modern Approach to Classical Theorems of Advanced Calculus. W. A. Benjamin, Inc., New York-Amsterdam, 1965.
- [Spi13] David I. Spivak. The operad of wiring diagrams: formalizing a graphical language for databases, recursion, and plug-and-play circuits. ePrint online: www.arXiv.org/abs/arXiv:1305.0297, 2013.
- [Spi14] David I. Spivak. Category Theory for the Sciences. MIT Press, 2014.
- [SR13] David I. Spivak and Dylan Rupel. The operad of temporal wiring diagrams: formalizing a graphical language for discrete-time processes. ePrint online: www.arXiv.org/abs/1307.6894, 2013.
- [SSR15] David I. Spivak, Patrick Schultz, and Dylan Rupel. Traced categories as lax functors out of free compact categories. (In preparation), 2015.
- [Tes12] Gerald Teschl. Ordinary Differential Equations and Dynamical Systems, volume 140 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, 2012.
- [War83] Frank W. Warner. Foundations of Differentiable Manifolds and Lie Groups, volume 94 of Graduate Texts in Mathematics. Springer-Verlag, New York-Berlin, 1983. Corrected reprint of the 1971 edition.