Appendix C. Multi-Components

A multi-component is a component that allows any number of input wires. In this appendix we'll look at two examples of multi-components: sum and product. Also we'll take a look at duplication. Although duplication is not a multi-component, it is something quite similar: duplication will allow any number of output wires.

Sums

As we well know, addition takes two inputs and produces an output:
\[ \begin{align} z &= x + y. \end{align} \]
By nesting additions, we can add more than two numbers together.
\[ \begin{align} (5 + 1) + 6 &= 12 \end{align} \]
We know from experience that it makes no difference what order or groupings we use to add the numbers.
\[ \begin{align} 5 + (1 + 6) &= 12 \\ (6 + 1) + 5 &= 12 \\ 1 + (5 + 6) &= 12 \end{align} \]
We'll usually leave out parentheses since they are unnecessary.
\[ \begin{align} 5 + 1 + 6 &= 12 \end{align} \]
Let's introduce another notation for the sum of a list of numbers.
\[ \begin{align} \sumcomponent (5, 1, 6) &= 12 \end{align} \]
Sums makes sense for lists of any length.
\[ \begin{align} \sumcomponent () &= 0 \\ \sumcomponent (a) &= a \\ \sumcomponent (a, b) &= a + b \\ \sumcomponent (a, b, c) &= a + b + c \\ &\vdots \end{align} \]
The following sum law assures us that we've defined a sensible multi-component!
Law.
Any composite of sums is, itself, a sum.
Let's see how this works by looking at a schematic.
Example.
Consider the following composite of sums.
Without looking at this schematic in any detail, we know that it must be equivalent to the sum with three input wires.
Sure enough, using a little algebra we can confirm:
\[ \begin{align} (y + z) + 0 + x &= x + y + z. \end{align} \]

Products

Just as we add a list of numbers to get the sum, we multiply a list of numbers to get the product.
\[ \begin{align} \productcomponent () &= 1 \\ \productcomponent (a) &= a \\ \productcomponent (a, b) &= a \mult b \\ \productcomponent (a, b, c) &= a \mult b \mult c \\ &\vdots \end{align} \]
These definitions ensure that the following product law holds.
Law.
Any composite of products is, itself, a product.
In short, we may regroup and reorder a product of numbers without fear of changing the result.
\[ \begin{align} y \mult (1 \mult (x \mult w)) \mult 1 \mult z &= w \mult x \mult y \mult z \end{align} \]

Duplication

We've seen how a splitter will take an input and produce two copies as output. More generally, we may duplicate an input on any number of output wires.
One-fold duplication just reproduces its input as output: this is equivalent to a plain wire. Zero-fold duplication produces no output. We'll call \( 0 \)-fold duplication a forgetter. Similar to sums and products, we have a duplication law!
Law.
Any composite of duplications is, itself, a duplication.
While we're investigating splitters in some detail, let's take a look at one more law.
Law.
Pushing a splitter to the right past a component makes copies of that component.
We can ensure that splitters always live at the far right of our schematics by applying this law repeatedly.
Example.
Let's clean up the following schematic.
We push the splitter right, duplicating the three-adder.
Now we push the forgetter right, removing components as we go.
The adjacent forgetter and splitter are equivalent to a plain wire.