3 ms·
If f: X -> Y and g: Y -> Z are functions, their composite is the function from X to Z which most mathematicians would write as "g o f" (typographically that sho
by bikenaga 4y ago
If f: X -> Y and g: Y -> Z are functions, their composite is the function from X to Z which most mathematicians would write as "g o f" (typographically that should be a small centered circle, not the letter "o" as here), defined by
(g o f)(x) = g(f(x)).
Notice that the function f, which is applied first, appears on the right and g, which is applied second, appears on the left. But if we draw a diagram of the composite, it looks like this:
f g
X ----> Y ----> Z
In the diagram, the first applied function is on the left and the second applied function is on the right. Some people have felt that, for this reason, it would be better to write composites with the arguments on the left, like this: (x)f and [x(f)]g . However, most mathematicians follow the right-to-left convention (that's the way it seems to be in most programming languages, right?).
Anyway, consider how this works if f and g are linear transformations and X, Y, and Z are finite-dimensional vector spaces, as in linear algebra. So we can take X = F^p, Y = F^n, and Z = F^m, where F is the field of scalars, and vectors are just "arrays of numbers".
f: F^p -> F^n, g: F^n -> F^m
You can represent f and g using matrices: f is represented by an n x p matrix B and g is represented by an m x n matrix A. In that case, function application is done by matrix multiplication. The composite g o f is represented by the product A B, which is an m x p matrix. Notice that the matrices are in the same order in "A B" as their functions are in "g o f". Inputs to g o f are p-dimensional vectors; where should a p-dimensional vector go in order that multiplication by A B should represent application of the function g o f?
A B [p x 1 column vector] ---> okay
[1 x p row vector] A B ---> wrong: you can't multiply (1 x p) * (m x p)
In other words, once you commit to the standard convention for writing composites, you're committed to using column vectors as inputs to linear transformations written as matrices, or somewhere you'll probably have an inconsistency in the order of application.
Or you can bite the bullet, write arguments to functions on the left, and then defaulting to row vectors would be okay. It's just notation.