1
$\begingroup$

I'm trying to represent a pipeline of functions, each of which accepts an object and returns a potentially different object, in mathematical notation.

Assume we have sets $X$ and $Y$.

Each function in the pipeline can be defined as follows, I believe:

$f : X \times Y \rightarrow X \times Y$

An ordered set of these (a single pipeline) could be defined, for example, as a tuple (where the pipeline has two items)

$f \times f$

or a triple where it has three

$f \times f \times f$

I'd like to represent the set of all possible such ordered pairs, of any length.

Calling this set $P$ I'd then want:

$P \times X \rightarrow X$

which is the result of sending $X$ through the pipeline.

Is this the correct approach?

  • 0
    Where do the 'Y' values come in? A function $f : X \times Y \to X $ has two arguments.2017-01-11
  • 0
    Fixed in the original post.2017-01-11

1 Answers 1

1

Your written description and the way you define your function contradict each other. $ f : X \times Y \to X $ is a function that takes two arguments and returns a single object.

However it looks like the idea that you are trying to express is called composition. This is where you take two functions $f$ and $g$ and feed the output of the first into the next. $f(g(x))$. The notation used for composistion is $\circ$ and can be defined this way $ (f \circ g)(x) = f(g(x)) $. For this to work the domain of $f$ must be a superset of the codomain of g.

You can extend the notion of composition to create a sigma like operator $\bigcirc (f_0,f_1, \dots ) = f_0 \circ f_1 \circ \dots $ this will have the type $ P \times X \to X $ if all the functions are of the type $ X \to X$.

You can define $P$ recursively first with the base $ P_0 = X^X $ (where $X^X$ is the set of all functions $ X \to X $) and the recursive step $P_n = P_0 \times P_{n-1}$. Then unify the lot with $ P = \bigcup \{ f_n | n \in \mathbb{N} \} $. Alternately you can define $P$ to be the kleene closure of $X^X$.

  • 0
    Edited description to correct this inconsistency. Does the notation you've used define a set of all possible combinations of such functions?2017-01-11
  • 0
    A follow up question would be how to define the set of all possible ordered sets of functions? That is, the set containing $\emptyset$, $(f_0)$, $(f_1)$, $\dots$, $(f_0,f_1)$, $(f_1, f_0)$, $\dots$ and so forth.2017-01-11
  • 1
    @AdamDonahue added a definition for P2017-01-12