Solutions to the exercises of 7 Sketches, Chapter 5: 7S Chapter 5 Exercises. Index: Map of Content.
Solution 5.5
1–2. Any two functions; acts as on the first three elements and as , shifted by , on the last two (Eq. 5.4). 3. . 4. : parallel wires. 5. for and for : the block swap (e.g. ).
Sources: 7 Sketches, Exercise 5.5 and Solution A.5.
Solution 5.9
The discrete order ( iff ); the usual order; the reverse of the usual order. Quasi-example: the codiscrete preorder (not a poset). Non-example: divisibility — and but , so is not monotone.
Sources: 7 Sketches, Exercise 5.9 and Solution A.5.
Solution 5.10
: is empty unless (then elements); identity ; or ; composition of bijections; for , otherwise. : equivalence relations on ; identity the pairing ; symmetry pairs corresponding elements; composition “travel within classes” (Corelation); acts on each half with no interaction. : subsets ; identity the diagonal; symmetry the swap relation; relational composition; (Category of Relations).
Sources: 7 Sketches, Exercise 5.10 and Solution A.5.
Solution 5.16
Stick the two port graphs end to end, connecting the outer outputs of the first to the outer inputs of the second in order, remove the two outer boxes and draw a new outer box around everything. E.g. composing a graph with boxes and one with boxes yields one with boxes wired in sequence.
Sources: 7 Sketches, Exercise 5.16 and Solution A.5.
Solution 5.18
Stack the picture on top of itself: a -port graph with boxes and no wires between the two copies. See Port Graph.
Sources: 7 Sketches, Exercise 5.18 and Solution A.5.
Solution 5.20
- iff there is a chain with ( gives reflexivity); by assumption , so by induction and transitivity .
- implies (the closure contains ), hence . This is the universal property of the free preorder — about maps out (Free Prop).
Sources: 7 Sketches, Exercise 5.20 and Solution A.5.
Solution 5.21
- Yes, since implies . 2. No: , with ; is monotone ( is reflexive) but . “Maps between structured objects preserve constraints, so the domain must be more constrained than the codomain: fewest constraints = most maps out.”
Sources: 7 Sketches, Exercise 5.21 and Solution A.5.
Solution 5.23
- Each morphism has a domain and codomain . 2. A functor restricts to on vertices and length-1 paths; conversely extends to paths by , and the two constructions are inverse (functoriality forces the action on all paths). 3. Yes, it is the underlying graph ; part 2 says is an Adjunction (Free Category).
Sources: 7 Sketches, Exercise 5.23 and Solution A.5.
Solution 5.24
- with . 2. via . 3. Words in and :
Sources: 7 Sketches, Exercise 5.24 and Solution A.5.
Solution 5.28
Both have objects . A morphism of is a -labeled port graph; since has exactly one generator of each arity, the labeling is forced () and contributes nothing, so morphisms are exactly port graphs; composition and monoidal product are by definition those of .
Sources: 7 Sketches, Exercise 5.28 and Solution A.5.
Solution 5.32
Three input wires; the top passes through box ; then wires 1 and 2 cross; then wires 2 and 3 enter ; the two remaining wires cross; finally both enter , giving two outputs. See Free Prop (prop expressions).
Sources: 7 Sketches, Exercise 5.32 and Solution A.5.
Solution 5.35
For all intents and purposes yes; the only “subtle difference” is that between a set and its quotient by the trivial equivalence relation (elements vs. singleton classes), which are naturally isomorphic — “category-theoretically the difference will never make a difference”.
Sources: 7 Sketches, Exercise 5.35 and Solution A.5.
Solution 5.41
- The identity matrix ( on the diagonal, elsewhere). 2. : , give but .
Sources: 7 Sketches, Exercise 5.41 and Solution A.5.
Solution 5.43
— by tracing signals or summing over paths.
Sources: 7 Sketches, Exercise 5.43 and Solution A.5.
Solution 5.51
See Prop of Matrices.
Sources: 7 Sketches, Exercise 5.51 and Solution A.5.
Solution 5.55
Both represent ; yes, equal — coassociativity of copy (Graphical Linear Algebra).
Sources: 7 Sketches, Exercise 5.55 and Solution A.5.
Solution 5.58
- Three inputs: discard the first, pass the second, amplify the third by 2, add all into one output (or, minimally: discard input 1, amplify input 3 by 2, add). 2. Discard both inputs; two zero outputs. 3. Copy each of the two inputs three times, amplify by resp. , permute, and add pairwise into three outputs (the four-layer normal form of Proposition 5.56).
Sources: 7 Sketches, Exercise 5.58 and Solution A.5.
Solution 5.59
Layer 1: where makes copies (composite of copies with identities). Layer 2: , scalars in row-major order. Layer 3: , a permutation of swaps and identities sending the -th wire to the -th. Layer 4: where adds inputs. By Proposition 5.54 there is exactly one path from input to output , carrying scalar , so .
Sources: 7 Sketches, Exercise 5.59 and Solution A.5.
Solution 5.62
E.g. for : “discard input 1, add inputs 2 and (input 3 amplified by 2)” vs. the normal form with a zero scalar; rewrite using ” = discard-then-zero” and “zero into add = identity”. For the zero matrix: two discards and two zeros vs. scalars : use = discard-then-zero and the bialgebra laws. For the matrix: two normal forms differing by the order of copying and adding, related by coassociativity/associativity and the bialgebra law. See Graphical Linear Algebra.
Sources: 7 Sketches, Exercise 5.62 and Solution A.5.
Solution 5.63
- One graph has a path from an input to an output that the other lacks. The only equation of Theorem 5.60 that breaks a left-to-right path is ” = discard-then-zero”, which requires a scalar; no appears and products/sums of nonzero naturals are nonzero, so the path cannot be removed. 2. Replacing by , the scalars become = discard-then-zero, and the diagram simplifies (using the bialgebra and unit laws) to a graph with the surviving -amplification only.
Sources: 7 Sketches, Exercise 5.63 and Solution A.5.
Solution 5.67
Check (a) , (b) , (c) i.e. ; identically for with . Diagrammatically, both paths around each square agree.
Sources: 7 Sketches, Exercise 5.67 and Solution A.5.
Solution 5.69
- and canonically. 2. A Monoidal Functor preserves the monoid diagrams: , componentwise. 3. The additive one: .
Sources: 7 Sketches, Exercise 5.69 and Solution A.5.
Solution 5.77
; . See Behavior of a Signal Flow Graph.
Sources: 7 Sketches, Exercise 5.77 and Solution A.5.
Solution 5.80
. See Category of Relations.
Sources: 7 Sketches, Exercise 5.80 and Solution A.5.
Solution 5.82
, ; their composite is , and since are functions this is .
Sources: 7 Sketches, Exercise 5.82 and Solution A.5.
Solution 5.83
, ; composing over the middle gives .
Sources: 7 Sketches, Exercise 5.83 and Solution A.5.
Solution 5.84
- The reversed zero has behaviour ; its -fold sum is ; composing with gives . 2. Reversed discard has behaviour all of ; composing with gives . 3. is linear, so is closed under scalars and sums; likewise ; and composites of linear relations are linear (7S Exercise 5.85). See Graphical Linear Algebra.
Sources: 7 Sketches, Exercise 5.84 and Solution A.5.
Solution 5.85
If via , then and , so ; if also via , then and , so . Hence linear relations form the sub-prop .
Sources: 7 Sketches, Exercise 5.85 and Solution A.5.