A compositional approach to networks Brendan Fong, University of - - PowerPoint PPT Presentation

a compositional approach to networks
SMART_READER_LITE
LIVE PREVIEW

A compositional approach to networks Brendan Fong, University of - - PowerPoint PPT Presentation

A compositional approach to networks Brendan Fong, University of Oxford Southampton ECS Seminar 4 February 2015 The big picture Network-style diagrammatic languages have developed to represent and reason about many different sciences: Why?


slide-1
SLIDE 1

A compositional approach to networks

Brendan Fong, University of Oxford

Southampton ECS Seminar 4 February 2015

slide-2
SLIDE 2

The big picture

Network-style diagrammatic languages have developed to represent and reason about many different sciences: Why? Can we formalise their key features and relationships? Can we unify them?

slide-3
SLIDE 3

The big picture

Network-style diagrammatic languages have developed to represent and reason about many different sciences: Why? Can we formalise their key features and relationships? Can we unify them?

slide-4
SLIDE 4

The big picture

Jan C. Willems: . . . classical system-theoretic thinking is unsuitable for

  • dealing. . . with the basic tenets at which system theory

aims, namely, open and interconnected systems.

The behavioural approach to open and interconnected systems, 2007.

Joseph Goguen: Following clues from systems engineering, general systems theory and cybernetics. . . I decided that the most general concepts of engineering might be system, behavior, and interconnection. . .

Tossing algebraic flowers down the great divide, 1999.

slide-5
SLIDE 5

The big picture

Jan C. Willems: . . . classical system-theoretic thinking is unsuitable for

  • dealing. . . with the basic tenets at which system theory

aims, namely, open and interconnected systems.

The behavioural approach to open and interconnected systems, 2007.

Joseph Goguen: Following clues from systems engineering, general systems theory and cybernetics. . . I decided that the most general concepts of engineering might be system, behavior, and interconnection. . .

Tossing algebraic flowers down the great divide, 1999.

slide-6
SLIDE 6

Categories

  • Categories are a great algebraic framework for discussing

interconnection, or composition. They first arose in the 1940s in algebraic topology.

  • From the 1980s, it became clear they had a role to play in

formalising uses of string/network diagrams, such as Feynman diagrams:

slide-7
SLIDE 7

Categories

  • Categories are a great algebraic framework for discussing

interconnection, or composition. They first arose in the 1940s in algebraic topology.

  • From the 1980s, it became clear they had a role to play in

formalising uses of string/network diagrams, such as Feynman diagrams:

slide-8
SLIDE 8

Categories

  • Categories are a great algebraic framework for discussing

interconnection, or composition. They first arose in the 1940s in algebraic topology.

  • From the 1980s, it became clear they had a role to play in

formalising uses of string/network diagrams, such as Feynman diagrams:

slide-9
SLIDE 9

Categories

  • A category C is the structure of one-dimensional flow

charts.

  • They comprise objects, or types:

X, Y, etc. together with morphisms between these types: f

X Y

  • We can compose morphisms of matching types to get new

morphisms: f g h

X

W

Y Z

The composition rule must have such pictures unambiguously describe a morphism.

slide-10
SLIDE 10

Categories

  • A category C is the structure of one-dimensional flow

charts.

  • They comprise objects, or types:

X, Y, etc. together with morphisms between these types: f

X Y

  • We can compose morphisms of matching types to get new

morphisms: f g h

X

W

Y Z

The composition rule must have such pictures unambiguously describe a morphism.

slide-11
SLIDE 11

Categories

  • A category C is the structure of one-dimensional flow

charts.

  • They comprise objects, or types:

X, Y, etc. together with morphisms between these types: f

X Y

  • We can compose morphisms of matching types to get new

morphisms: f g h

X

W

Y Z

The composition rule must have such pictures unambiguously describe a morphism.

slide-12
SLIDE 12

Categories

  • There are various types of categories that allow extra
  • perations.
  • A monoidal category is the structure of two-dimensional

flow charts. f g h k

X Y X Z V

V W X

The key point is that we have a notion of ‘parallel’ or tensor composition.

  • A symmetric monoidal category further allows you to

cross wires:

X X Y Y

slide-13
SLIDE 13

Categories

  • There are various types of categories that allow extra
  • perations.
  • A monoidal category is the structure of two-dimensional

flow charts. f g h k

X Y X Z V

V W X

The key point is that we have a notion of ‘parallel’ or tensor composition.

  • A symmetric monoidal category further allows you to

cross wires:

X X Y Y

slide-14
SLIDE 14

Categories

  • There are various types of categories that allow extra
  • perations.
  • A monoidal category is the structure of two-dimensional

flow charts. f g h k

X Y X Z V

V W X

The key point is that we have a notion of ‘parallel’ or tensor composition.

  • A symmetric monoidal category further allows you to

cross wires:

X X Y Y

slide-15
SLIDE 15

Categories

  • A functor F : C → D is a map between categories.
  • It turns morphisms

f

X Y

in C into morphisms Ff

FX FY

in D. This assignment must preserve composition. That is, the diagram Ff Fg

FX

FY

FZ

must be unambiguous.

slide-16
SLIDE 16

Categories

  • A functor F : C → D is a map between categories.
  • It turns morphisms

f

X Y

in C into morphisms Ff

FX FY

in D. This assignment must preserve composition. That is, the diagram Ff Fg

FX

FY

FZ

must be unambiguous.

slide-17
SLIDE 17

Categories

  • Guiding principle: each diagrammatic language draws

morphisms in some symmetric monoidal category.

  • In this talk we will consider symmetric monoidal categories
  • f electrical circuits, signal flow graphs, and their

behaviours, and functors between them: Circ

  • SigFlow
  • LinRel

(This is known as a commutative diagram.)

slide-18
SLIDE 18

Categories

  • Guiding principle: each diagrammatic language draws

morphisms in some symmetric monoidal category.

  • In this talk we will consider symmetric monoidal categories
  • f electrical circuits, signal flow graphs, and their

behaviours, and functors between them: Circ

  • SigFlow
  • LinRel

(This is known as a commutative diagram.)

slide-19
SLIDE 19

Categories

  • Guiding principle: each diagrammatic language draws

morphisms in some symmetric monoidal category.

  • In this talk we will consider symmetric monoidal categories
  • f electrical circuits, signal flow graphs, and their

behaviours, and functors between them: Circ

  • SigFlow
  • LinRel

(This is known as a commutative diagram.)

slide-20
SLIDE 20

Circuits

  • A (closed) circuit, for us, is a graph with edges labelled by

resistances. 2Ω 3Ω 1Ω 1Ω

  • Given potentials on each node, the circuit induces

pointwise currents. The behaviour of a circuit is the collection of possible potential–current readings.

  • For linear resistors, this is governed by Ohm’s law: the

induced current along an edge is equal to its potential difference divided by its resistance. Letting N be the set of nodes, the behaviour is thus a linear subspace of RN ⊕ RN.

slide-21
SLIDE 21

Circuits

  • A (closed) circuit, for us, is a graph with edges labelled by

resistances. 2Ω 3Ω 1Ω 1Ω

  • Given potentials on each node, the circuit induces

pointwise currents. The behaviour of a circuit is the collection of possible potential–current readings.

  • For linear resistors, this is governed by Ohm’s law: the

induced current along an edge is equal to its potential difference divided by its resistance. Letting N be the set of nodes, the behaviour is thus a linear subspace of RN ⊕ RN.

slide-22
SLIDE 22

Circuits

  • A (closed) circuit, for us, is a graph with edges labelled by

resistances. 2Ω 3Ω 1Ω 1Ω

  • Given potentials on each node, the circuit induces

pointwise currents. The behaviour of a circuit is the collection of possible potential–current readings.

  • For linear resistors, this is governed by Ohm’s law: the

induced current along an edge is equal to its potential difference divided by its resistance. Letting N be the set of nodes, the behaviour is thus a linear subspace of RN ⊕ RN.

slide-23
SLIDE 23

Circuits

But what about interconnections of circuits? To compose circuits, we first mark input and output terminals: 2Ω 3Ω 1Ω 1Ω

slide-24
SLIDE 24

Circuits

But what about interconnections of circuits? To compose circuits, we first mark input and output terminals: 2Ω 3Ω 1Ω 1Ω

slide-25
SLIDE 25

Circuits

But what about interconnections of circuits? To compose circuits, we first mark input and output terminals: X Y 2Ω 3Ω 1Ω 1Ω

slide-26
SLIDE 26

Circuits

Then compose by gluing along identified points:

X Y 2Ω 3Ω 1Ω 1Ω Z 5Ω 8Ω

X Z 2Ω 3Ω 1Ω 1Ω 5Ω 8Ω

slide-27
SLIDE 27

Circuits

Then compose by gluing along identified points:

X Y 2Ω 3Ω 1Ω 1Ω Z 5Ω 8Ω

X Z 2Ω 3Ω 1Ω 1Ω 5Ω 8Ω

slide-28
SLIDE 28

Circuits

Then compose by gluing along identified points:

X Y 2Ω 3Ω 1Ω 1Ω Z 5Ω 8Ω

X Z 2Ω 3Ω 1Ω 1Ω 5Ω 8Ω

slide-29
SLIDE 29

Circuits

We also have monoidal composition, by placing circuits side-by-side:

X Y 2Ω 3Ω 1Ω 1Ω

X′ Y′ 5Ω 1Ω

X + X′ Y + Y′ 2Ω 3Ω 1Ω 1Ω 5Ω 1Ω

slide-30
SLIDE 30

Circuits

We also have monoidal composition, by placing circuits side-by-side:

X Y 2Ω 3Ω 1Ω 1Ω

X′ Y′ 5Ω 1Ω

X + X′ Y + Y′ 2Ω 3Ω 1Ω 1Ω 5Ω 1Ω

slide-31
SLIDE 31

Circuits

We also have monoidal composition, by placing circuits side-by-side:

X Y 2Ω 3Ω 1Ω 1Ω

X′ Y′ 5Ω 1Ω

X + X′ Y + Y′ 2Ω 3Ω 1Ω 1Ω 5Ω 1Ω

slide-32
SLIDE 32

Circuits

We thus have a (symmetric monoidal) category Circ of circuit diagrams: Objects finite sets X of terminals Morphisms (0, ∞)-labelled graphs on a set N together with functions X → N and Y → N marking terminals Composition gluing along the shared terminals Tensor disjoint union of circuits

slide-33
SLIDE 33

Circuits

We thus have a (symmetric monoidal) category Circ of circuit diagrams: Objects finite sets X of terminals Morphisms (0, ∞)-labelled graphs on a set N together with functions X → N and Y → N marking terminals Composition gluing along the shared terminals Tensor disjoint union of circuits

slide-34
SLIDE 34

Circuits

We thus have a (symmetric monoidal) category Circ of circuit diagrams: Objects finite sets X of terminals Morphisms (0, ∞)-labelled graphs on a set N together with functions X → N and Y → N marking terminals Composition gluing along the shared terminals Tensor disjoint union of circuits

slide-35
SLIDE 35

Circuits

We thus have a (symmetric monoidal) category Circ of circuit diagrams: Objects finite sets X of terminals Morphisms (0, ∞)-labelled graphs on a set N together with functions X → N and Y → N marking terminals Composition gluing along the shared terminals Tensor disjoint union of circuits

slide-36
SLIDE 36

Behaviours

  • The behaviour of a circuit is the collection of possible

potential–current readings at terminals, with the sign of the current at the ‘input’ terminals indicating the inward current, and vice versa for the ‘output’ terminals.

  • The potentials and currents at non-terminal nodes are

those that minimize the power Q = IV of the circuit.

  • The behaviour of a circuit X → Y is a linear subspace of

(RX ⊕ RX) ⊕ (RY ⊕ RY). This is also known as a linear relation RX ⊕ RX → RY ⊕ RY.

slide-37
SLIDE 37

Behaviours

  • The behaviour of a circuit is the collection of possible

potential–current readings at terminals, with the sign of the current at the ‘input’ terminals indicating the inward current, and vice versa for the ‘output’ terminals.

  • The potentials and currents at non-terminal nodes are

those that minimize the power Q = IV of the circuit.

  • The behaviour of a circuit X → Y is a linear subspace of

(RX ⊕ RX) ⊕ (RY ⊕ RY). This is also known as a linear relation RX ⊕ RX → RY ⊕ RY.

slide-38
SLIDE 38

Behaviours

  • The behaviour of a circuit is the collection of possible

potential–current readings at terminals, with the sign of the current at the ‘input’ terminals indicating the inward current, and vice versa for the ‘output’ terminals.

  • The potentials and currents at non-terminal nodes are

those that minimize the power Q = IV of the circuit.

  • The behaviour of a circuit X → Y is a linear subspace of

(RX ⊕ RX) ⊕ (RY ⊕ RY). This is also known as a linear relation RX ⊕ RX → RY ⊕ RY.

slide-39
SLIDE 39

Behaviours

Ideal wire

The identity map on one point

X Y

acts as an ideal wire, having behaviour {(φ, i, φ, −i) | φ, i ∈ R} ⊂ (RX ⊕ RX) ⊕ (RY ⊕ RY).

slide-40
SLIDE 40

Behaviours

Y-junction

The circuit

X Y

acts as a junction of three ideal wires. It thus has behaviour {(φ, −(i + j), φ, φ, i, j) | φ, i, j ∈ R} ⊂ (RX ⊕ RX) ⊕ (RY ⊕ RY).

slide-41
SLIDE 41

Behaviours

Resistor

The resistor of resistance r

X Y r

acts according to Ohm’s law: V = rI. This means that the current must be 1

r times the signed

potential difference. It thus has behaviour {(φx, −1

r (φy−φx), φy, 1 r (φy−φx) | φx, φy ∈ R} ⊂ (RX⊕RX)⊕(RY⊕RY).

slide-42
SLIDE 42

Behaviours

Resistor

The resistor of resistance r

X Y r

acts according to Ohm’s law: V = rI. This means that the current must be 1

r times the signed

potential difference. It thus has behaviour {(φx, −1

r (φy−φx), φy, 1 r (φy−φx) | φx, φy ∈ R} ⊂ (RX⊕RX)⊕(RY⊕RY).

slide-43
SLIDE 43

Behaviours

Resistor

The resistor of resistance r

X Y r

acts according to Ohm’s law: V = rI. This means that the current must be 1

r times the signed

potential difference. It thus has behaviour {(φx, −1

r (φy−φx), φy, 1 r (φy−φx) | φx, φy ∈ R} ⊂ (RX⊕RX)⊕(RY⊕RY).

slide-44
SLIDE 44

Behaviours

Given two relations R ⊂ U ⊕ V and S ⊂ V ⊕ W, their composite consists of all elements of (u, w) ∈ U ⊕ W such that there exists v ∈ V with (u, v) ∈ R and (v, w) ∈ S. We thus can define a monoidal category LinRel: Objects finite dimensional vector spaces V Morphisms linear relations R ⊆ V ⊕ W Composition composition of relations Tensor direct sum of relations

slide-45
SLIDE 45

Behaviours

Given two relations R ⊂ U ⊕ V and S ⊂ V ⊕ W, their composite consists of all elements of (u, w) ∈ U ⊕ W such that there exists v ∈ V with (u, v) ∈ R and (v, w) ∈ S. We thus can define a monoidal category LinRel: Objects finite dimensional vector spaces V Morphisms linear relations R ⊆ V ⊕ W Composition composition of relations Tensor direct sum of relations

slide-46
SLIDE 46

Behaviours

Given two relations R ⊂ U ⊕ V and S ⊂ V ⊕ W, their composite consists of all elements of (u, w) ∈ U ⊕ W such that there exists v ∈ V with (u, v) ∈ R and (v, w) ∈ S. We thus can define a monoidal category LinRel: Objects finite dimensional vector spaces V Morphisms linear relations R ⊆ V ⊕ W Composition composition of relations Tensor direct sum of relations

slide-47
SLIDE 47

Behaviours

Given two relations R ⊂ U ⊕ V and S ⊂ V ⊕ W, their composite consists of all elements of (u, w) ∈ U ⊕ W such that there exists v ∈ V with (u, v) ∈ R and (v, w) ∈ S. We thus can define a monoidal category LinRel: Objects finite dimensional vector spaces V Morphisms linear relations R ⊆ V ⊕ W Composition composition of relations Tensor direct sum of relations

slide-48
SLIDE 48

Behaviours

Given two relations R ⊂ U ⊕ V and S ⊂ V ⊕ W, their composite consists of all elements of (u, w) ∈ U ⊕ W such that there exists v ∈ V with (u, v) ∈ R and (v, w) ∈ S. We thus can define a monoidal category LinRel: Objects finite dimensional vector spaces V Morphisms linear relations R ⊆ V ⊕ W Composition composition of relations Tensor direct sum of relations

slide-49
SLIDE 49

Behaviours

Theorem The above discussion defines a monoidal functor Circ − → LinRel In particular, composition of relations describes how behaviours

  • f subcircuits compose to give the behaviour of a circuit.
slide-50
SLIDE 50

Signal flow graphs

  • Signal flow graphs were invented by Shannon to represent

signal flow in physical systems and their controllers.

  • They are directed labelled graphs with two types of node: a

white node which requires the sum of signals out to equal the sum of signals in, and a black node which requires that all signals incident with the node are

  • equal. The labels represent the factor by which a signal

traversing the given edge is multiplied by.

slide-51
SLIDE 51

Signal flow graphs

  • Signal flow graphs were invented by Shannon to represent

signal flow in physical systems and their controllers.

  • They are directed labelled graphs with two types of node: a

white node which requires the sum of signals out to equal the sum of signals in, and a black node which requires that all signals incident with the node are

  • equal. The labels represent the factor by which a signal

traversing the given edge is multiplied by.

slide-52
SLIDE 52

Signal flow graphs

  • In contrast with circuits, signal flow graphs are generally

considered open systems, with given inputs and outputs. As such, they represent a linear relation between the vector spaces generated by the inputs and outputs.

  • For example, working over R, the signal flow graph

r

represents the subspace {(a, b, a + rb, b) | a, b ∈ R}

  • f the four dimensional vector space generated by the two

inputs and two outputs.

slide-53
SLIDE 53

Signal flow graphs

  • In contrast with circuits, signal flow graphs are generally

considered open systems, with given inputs and outputs. As such, they represent a linear relation between the vector spaces generated by the inputs and outputs.

  • For example, working over R, the signal flow graph

r

represents the subspace {(a, b, a + rb, b) | a, b ∈ R}

  • f the four dimensional vector space generated by the two

inputs and two outputs.

slide-54
SLIDE 54

Signal flow graphs

  • In analogy with our discussion of circuits, we may also view

these signal flow graphs as ‘closed’ signal flow graphs with marked terminals.

  • This gives a category SigFlow with objects sets comprising

‘black’ and ‘white’ elements, and morphisms closed signal flow diagrams with marked terminals, such as

r

  • Continuing the analogy with circuits, we get a functor

SigFlow → LinRel.

slide-55
SLIDE 55

Signal flow graphs

  • In analogy with our discussion of circuits, we may also view

these signal flow graphs as ‘closed’ signal flow graphs with marked terminals.

  • This gives a category SigFlow with objects sets comprising

‘black’ and ‘white’ elements, and morphisms closed signal flow diagrams with marked terminals, such as

r

  • Continuing the analogy with circuits, we get a functor

SigFlow → LinRel.

slide-56
SLIDE 56

Signal flow graphs

  • In analogy with our discussion of circuits, we may also view

these signal flow graphs as ‘closed’ signal flow graphs with marked terminals.

  • This gives a category SigFlow with objects sets comprising

‘black’ and ‘white’ elements, and morphisms closed signal flow diagrams with marked terminals, such as

r

  • Continuing the analogy with circuits, we get a functor

SigFlow → LinRel.

slide-57
SLIDE 57

Signal flow graphs

Theorem There is a functor from Circ to SigFlow mapping each finite set X

  • f terminals to the disjoint union X ⊔ X, where the first copy of X is

coloured ‘black’ and the second ‘white’, and on morphisms mapping resistors

X Y r

to signal flow graphs

r X ⊔ X Y ⊔ Y

slide-58
SLIDE 58

Signal flow graphs

Theorem Moreover, this functor makes the diagram Circ

  • SigFlow
  • LinRel

commute.

slide-59
SLIDE 59

Take home messages

  • Categories give a good language in which to formalise

diagrammatic languages.

  • Functors allow semantics for diagrams to be assembled

from the semantics of its parts (cf. functor Circ → LinRel).

  • Functors also allow precise description of relationships

between diagrammatic languages (cf. functor Circ → SigFlow).

slide-60
SLIDE 60

Take home messages

  • Categories give a good language in which to formalise

diagrammatic languages.

  • Functors allow semantics for diagrams to be assembled

from the semantics of its parts (cf. functor Circ → LinRel).

  • Functors also allow precise description of relationships

between diagrammatic languages (cf. functor Circ → SigFlow).

slide-61
SLIDE 61

Take home messages

  • Categories give a good language in which to formalise

diagrammatic languages.

  • Functors allow semantics for diagrams to be assembled

from the semantics of its parts (cf. functor Circ → LinRel).

  • Functors also allow precise description of relationships

between diagrammatic languages (cf. functor Circ → SigFlow).

slide-62
SLIDE 62

Thanks for listening. This is joint work with John Baez; see http://math.ucr.edu/baez/networks/. Slides will be available at http://www.cs.ox.ac.uk/people/brendan.fong/. Citations can be found by clicking on references and images.