Talk:Function composition

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Mathematics (Rated B-class, Top-priority)
WikiProject Mathematics
This article is within the scope of WikiProject Mathematics, a collaborative effort to improve the coverage of Mathematics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Mathematics rating:
B Class
Top Priority
 Field:  Basics

(*/Archive: someone's homework problem)

I am surprised this article was not categorized so far. Thanks Paul.[edit]

Oleg Alexandrov 01:34, 16 Jun 2005 (UTC)


Any better way to write the operator than the current f o g? ?

Now I saw someone convert small o in another article into Unicode U+2218 ∘ so I looked at this again. 2218 seems to be the right character, but on Talk:Category theory someone points out that it "doesn't display correctly on some browsers, most notably Internet Explorer." Anyway, I suppose other articles in Wikipedia should follow the choice made in this article. See also Template_talk:Unicode. --TuukkaH 18:05, 3 October 2005 (UTC)
I agree that the unicode character is best. It doesn't display because IE just doesn't support Unicode. I use Mozilla.He Who Is 21:41, 4 June 2006 (UTC)
A decade later, there is really no excuse not to use ∘ (Unicode U+2218, the unicode ring operator). Using the degree sign is a hack we should discard. Cerberus (talk) 19:51, 14 September 2016 (UTC)

negative functional powers[edit]

There is an error in the definition of negative functional powers. -- Wasseralm 19:51, 17 August 2005 (UTC)

I don't see it. Can you be more specific? Oleg Alexandrov 20:41, 17 August 2005 (UTC)
I fixed it. It basically said . Rasmus (talk) 20:46, 17 August 2005 (UTC)
Looking at the timestamps, I had seen the article after the error was fixed. :) Thanks, Oleg Alexandrov 20:47, 17 August 2005 (UTC)
OK, this was the easy part. There is another intricate problem in the section, due to the fact that you consider f: X -> Y, where Y can be a proper subset of X. According to the definition of "composition" given at the beginning of the article, f o f cannot be formed (at this point). Intuitively (or with a slightly different definition of composition) f o f is defined and a function X -> Y. Thus all positive powers are defined. f^0 is a problem, becaus it has to be a function X -> X. It gets worse for the negative powers: If f: X -> Y is bijective, then f^(-1) : Y -> X. Thus, F^(-1) cannot composed with itself. To get rid of this problems, better take f : X -> X (compare the german article ("Deutsch"). Yours, -- Wasseralm 20:52, 19 August 2005 (UTC)
That XY should be sufficient for a bijective function f:X->Y to admit negative function powers, right? I added that as a condition. Btw. feel free to make any changes yourself. That is what a wiki is for after all! Rasmus (talk) 21:57, 19 August 2005 (UTC)
You write in your edit summary : "Functional powers - actually, for negative power of function to make sence one would need f:X->X.".
If f:X->Y is bijective, its inverse function f -1:Y->X should be self-composable if and only if XY. Of course in that case, unless X=Y, f is not itself self-composable, so it does not admit positive functional powers, but I do not see why it can't admit negative functional powers. Obviously it is not a necessary condition for negative functional powers that X=Y (quick counter-example: f(x)=2x, X=[0,1], Y=[0,2], f -1(x)=x/2 and f -2 is a nice function with domain [0,2] and codomain [0,0.5]). Rasmus (talk) 16:03, 20 August 2005 (UTC)

OK, you are right. But in this case I would claim we should not try to be too general. The condition f:X->X is in my opinion a very reasonable one to talk about negative functional powers. If the negative functional powers were a really important concept, then maybe it would be worth be general. But since it is just a curiosity, I would think it is not worth the trouble putting the most general condition.

But it is up to you. If you feel like going back to If f:X->Y with Y a subset X, be my guest. :) Oleg Alexandrov 17:34, 20 August 2005 (UTC)

It seems you must have Y = X. Otherwise, there is an element x in XY. If f is a bijection onto its image, then x has nowhere to go without making the proposed "inverse" function no-longer 1-1. Revolver 16:47, 7 October 2005 (UTC)

Composition notation[edit]

We say:

"In the mid-20th century, some mathematicians decided that writing "g o f" to mean "first apply f, then apply g" was too confusing and decided to change notations. They wrote "xf" for "f(x)" and "xfg" for "g(f(x))". However, this movement never caught on, and nowadays this notation is found only in old books."

Does anyone have a reference for this? I'm sure I recall the left-to-right notation being used in my undergrad maths degree, which was only three years ago. — Matt Crypto 11:55, 19 August 2005 (UTC)

I've seen John Baez, who is thoroughly modern , use the left to right notation for composition, especially in the context of category theory. -Lethe | Talk 18:45, 3 October 2005 (UTC)
Edit: actually, I've seen Baez write gf for first act with g and then with f, but I have never seen him write xf for f(x). That notation seems pretty rare to me. -Lethe | Talk 18:48, 3 October 2005 (UTC)
Maybe you just didn't realise it. In any case, it is typical in category theory to conceptualise "elements" of a set as a certain type of morphism, so in that case, it would be perfectly correct and consistent to write xfg for g(f(x)). Revolver 16:47, 7 October 2005 (UTC)
There's another notation, which I think I saw in Jacobson's textbook, is xf for f(x). -Lethe | Talk 17:06, 7 October 2005 (UTC)
Just a passing note from a Haskell programmer: xfg and fg cannot both be correct type-wise, assuming an unambiguous definition of the notation. That is, h = f o g is correct, and Haskell has $ for correctly expressing y = f $ g $ x as well, but o and $ are not interchangeable. Of course, mathematicians needn't fear type errors like Haskell programmers need. In any case, you can see some programmers and programming languages prefer a left-to-right notation, such as cat file | sort | uniq for composition in shell. --TuukkaH 20:36, 3 October 2005 (UTC)
Is it worth noting that most (if not all) concatenative programming languages use a direct equivalent of the xfg syntax to express their programs? --Piet Delport 10:59, 2 January 2006 (UTC)

Sometmes I wish god had only given us only one hand. I suffer from terrible left/right confusion. A kind of dyslexia I suppose, for example I'm always confusing east and west. Which reminds me of the old conundrum: "why does a mirror reverse left and right, but not top and bottom?" Paul August 17:30, 7 October 2005 (UTC)

Having functions act on the right of their arguments is still quite common among algebraists. See, for instance, Smith's Postmodern Algebra for a recent book that does this. Since there are obviously some folks who have put a lot of time into this, I will not edit the paragraph myself, but I strongly recommend that it be rewritten to suggest that the other convention is still in common use.Mkinyon 21:22, 21 February 2006 (UTC)

Note the discussion of this convention at Group homomorphism. I will try to come up with a rewrite for the offending paragraph in the next few days. It is not correct as written, and the pseudo-historical "In the mid-20th century, some mathematicians..." is not up to encyclopedia standards. Michael Kinyon 21:37, 13 March 2006 (UTC)

Fun with composition signs[edit]

JA: As for typography, these tricks work in some settings:

  •  "ο" 
  • f ο g
  • F ο G
  • L ο M

JA: Jon Awbrey 03:20, 27 January 2006 (UTC)

Derivative of composite function[edit]

Would a derivative of a composite function be a "composite derivative"?  ~Kaimbridge~ 20:23, 30 January 2006 (UTC)

I don't know what you mean by a "composite derivative". The derivative of a composition of two functions is given by the chain rule. Paul August 20:47, 30 January 2006 (UTC)
The "composition of two functions" is technically a "composite function", so I was just inquiring if its derivative would be a "composite derivative"——okay, I'll inquire over at chain rule.  ~Kaimbridge~ 20:15, 3 February 2006 (UTC)
  • JA: A function that arises through the composition of functions is just a function. Once it's composed, you cannot say for sure where it came from, since the return decomposition is not in general unique. Hence its derivation, oops, mode of arising, is not its essence, in other words, not a part of its "ontology". Jon Awbrey 13:28, 14 March 2006 (UTC)

Upper Limit of the Composition of Tan and Cos[edit]

Consider the graph of the following function:

As the exponent converges to infinity, the function assumes a quizzical shape. A cyclical zig-zag made up of boxes set side by side. Wach one peaks at about 1.5614, and has a width of about 1.52. The latter seems to is about pi/2, which makes sense, since that makes pi its period. As for the former, I have been trying to find a connection between it and other known constants, and have yet to find anything. Any suggestions? He Who Is 21:54, 4 June 2006 (UTC)

What are f and g? -lethe talk + 21:57, 4 June 2006 (UTC)

Woops... Wasn't thinking when I wrote that. Tangent and cosine. Also, I looked at it more closely and realized that 1 is the maximum of cosx, and the peak of tancostancos...x is tan1. But I still think it is a rather interesting operation, since for everything between pi/4 + npi/2, for all integer n, it converges to tan1. Also, if one looks closely, you can see it has no zeroes, nor does it converge to zero. It actually grows to a value of about .002, shich I assume equals:

. He Who Is 22:00, 4 June 2006 (UTC)

Those are just the solutions of . Repeated iteration of will tend to attractors, such as fixed points of . –EdC 17:08, 5 February 2007 (UTC)


I'm a bit confused by the line "For example, only when ; for all negative , the first expression is undefined." For x < 0 don't we have ? TooMuchMath 05:06, 20 September 2006 (UTC)

Not if f and g are defined to be real-valued functions, which I think is being assumed in the context. Profzoom 22:38, 26 September 2006 (UTC)
I have to go with TooMuchMath on this. The domain was not specified and the commmutativity is invalid anyhow. Let's not say is undefined for since this is false.-- 18:54, 30 November 2006 (UTC)
I agree with TooMuchMath's point on the domain not being specified, but it is true that the square root function and the square function commute under composition only for non-negatives. The last step in TooMuchMath's equation string is wrong: the two negatives should cancel to be a positive. Basically, always returns the input, regardless of its sign, but returns the number with the same magnitude as the input but with a non-negative sign, i.e., it is equivalent to the absolute value function. So for the square root and square functions to commute under composition for a particular number, that number must be the same as its absolute value: . David815 (talk) 23:39, 24 May 2014 (UTC)

Something more general than function composition?[edit]

I'm wondering if there is something more general than function composition.

Example, I have a function f that maps elements of X onto real numbers. I use this function to define another function g that maps subsets of X onto real numbers--perhaps g gives an average, median, total, minimum, maximum etc.

How can I describe the relationship between f and g? Clearly I cannot say g is composed of f. I want to say something like g is 'based on' f. Anyone know of anything in the literature? If so, I guess there should be a link to funciton composition... —The preceding unsigned comment was added by (talk) 00:03, 24 April 2007 (UTC).

Perhaps what you are looking for is the idea of an operator. Operators take one function as input, and spew out another function (or spew out a number, or a set ...). Operators that take two functions as input, and spew something out, are called binary operators. There are many, many operators. The classic example is D, which, given any function, spews out its derivative. One can certainly find ways of defining avg so that it is an operator. linas 03:01, 24 April 2007 (UTC)

Thanks for the suggestion and links. So, in my example, g would be an operator and f its operand. In this article composition is an operator, as is the function g o f. My main problem with this is that "operators" appear to be poorly defined and have multiple--conflicting--meanings. 03:35, 26 April 2007 (UTC)

Don't know how to help you. As the article on operator says, an operator is "just a function". That's all, nothing more. That's neither poorly defined, nor is it conflicting. But you have to think "outside the box" to understand why "composition" (and things like it) are operators (i.e. are "just functions"). You have to answer the questions: what is the domain? what is the range? The domain and range of operators are typically not numbers of any sort. You might be looking for the concept of a dual space. In particular, you might be intersted in the space that is dual to the space of all functions-- see functional analysis. Or perhaps you're just looking for the concept of an integral -- the average of a function is just its integral...linas 04:53, 26 April 2007 (UTC)
To be fair, if an operator were "just a function" then there would be no point to operators at all! We already have functions! For operators to be useful, they must be a _type_ of function. There appears to be some ambiguity with precisely what type of function an operator is!InformationSpace 02:56, 27 April 2007 (UTC)
What you're talking may be related to a closure in computer science. It's a function that takes an argument and returns another function generated from that argument. Karl Dickman talk 21:05, 26 November 2008 (UTC)

In the opening line...[edit]

...the functions f: X → Y and g: Y → Z can be composed by computing the output of f when it has an argument of g(x) instead of x.

Should this not be computing the output of g when it has an argument of f(x) ? Tobz1000 (talk) 17:01, 19 May 2009 (UTC)

They can be composed in either order, but the one you propose would match the second paragraph and the image better, so I swapped them. — Carl (CBM · talk) 17:32, 19 May 2009 (UTC)

For instance, the functions f : X → Y and g : Y → Z can be composed by computing the output of g when it has an argument of f(x) instead of x.

Shouldn't that last bit be instead of y, now that the example has been changed? I don't feel qualified to make an edit, but I conferred with a friend and we agreed that it seemed like the anecdote was g(f(x)), where f(x) replaces y in g(y). GeoffHadlington (talk) 03:27, 29 August 2013 (UTC)

I've rephrased it. The "instead of" was confusing to interpret. — Quondum 06:52, 29 August 2013 (UTC)

Semicolon for functional composition[edit]

A further variation encountered in computer science is the Z notation: is used to denote the traditional (right) composition, but ⨾ (a fat semicolon with Unicode code point U+2A3E[2]) denotes left composition.

The unicode notation is left untranslated on my computer, even though I have Unicode Arial which works well most of the time. I suggest that someone with knowledge of this add an explanation about where to get the font that would render this symbol. Better yet, why not just refer to it as ";"? The details of Z code is a very special subject that may not belong in this article. SixWingedSeraph (talk) 14:58, 31 August 2009 (UTC)

Cambria (typeface) has it (because is M$'s math font). JMP EAX (talk) 06:24, 24 August 2014 (UTC)
You can find a [partial] list of fonts that support it here. The article now mentions the semicolon too. JMP EAX (talk) 06:38, 24 August 2014 (UTC)

Function composition always associative?[edit]

The statement that function composition is always associative is obviously false. The referenced page on associativity gives serveral examples of non-associative functions, including substraction over the integers and cross product of vectors. —Preceding unsigned comment added by (talk) 22:54, 23 March 2010 (UTC)

Sorry, I was momentarily confused with terminology. Of course there is a difference between the order in which one collaspes a chain of maps (associativity of function composition) and the order in which one creates pairs in a sequence of operands for the application of a function of the form A X A -> A (associativity of a binary operator). The later is often but not alway associative. —Preceding unsigned comment added by (talk) 23:55, 23 March 2010 (UTC)

There are many non-associative algebras, for instance octonions or hyperbolic quaternions. A product of four elements will depend on the order of products in the whole. Say we have abcd as the ambiguous product. One association is ((ab)c)d which can be considered the operation of function b, then c, then d. Since the algebra is non-associative other compositions of the three functions may fail to give the same result. Here we have a case where function composition is non-associative. — Rgdboer (talk) 02:51, 29 April 2017 (UTC)
I don't which functions are composed in your example. Isn't your "((ab)c)d" just an example of a non-associative multiplication, not of a non-associative function-composition, similar to the previous 2 comments (of 23 March 2010)? - Jochen Burghardt (talk) 06:08, 29 April 2017 (UTC)

A function may be defined by multiplication: f(x) = 2x for example. I prefer to apply products to the right for agreement with reading order. Now let’s take ((ab)c)d as a sequence of functions on hyperbolic quaternions using a = 1, b = i, c = j, d = j. The first function is "multiply on the right by i", and the second and third functions are "multiply on the right by j". Now if the second and third functions are composed first, then the final result is i, not the –i of the other composition order.

Comprehending such a difference requires entry into a non-associative structure. The lack of symmetry makes such structures unappealing except for mathematicians like those studying octonions or Lie algebras or some other structure with enough order to accommodate non-associativity. But these studies do not arise in secondary school, so hand waving grants "composition of functions is always associative". The Encyclopedia should not perpetuate a false promise.Rgdboer (talk) 00:42, 30 April 2017 (UTC)

Foolishness. Function composition is always associative. This is easily proved (even if the proof is long and boring) usually in a college sophomore level introduction to proofs class. The proof is a direct application of the appropriate definitions and does not depend on any properties of the functions or any structure of the sets these functions relate. The error in your example is easy to see with the proper notation. Let fz(x) = xz where z is any element of the hyperbolic quaternions (or any other non-associative quasigroup). What you are implicitly assuming is that fzfw = fwz which is not valid in a non-associative quasigroup since applied to x the LHS = (xw)z while the RHS = (x)wz.--Bill Cherowitzo (talk) 04:02, 30 April 2017 (UTC)
Let me be more concrete. With respect to the hyperbolic quaternions you have
((1i)j)j = (ij)j = kj = −i while (1i)(jj) = i1 = i so clearly ((1i)j)j ≠ (1i)(jj).
Now consider the function compositions fj∘(fjfi)(1) = fj(fj(fi(1))) = ((1i)j)j = −i and (fjfj)(fi(1)) = x. Now if fjfj is the identity function (multiplication by 1) because jj = 1, then x = i as you claimed in this example. However, this composition is not the identity function. In fact, fjfj(i) = (ij)j = kj = −i, so in fact, x = −i in agreement with the other composition.--Bill Cherowitzo (talk) 18:51, 30 April 2017 (UTC)

Thank you for spelling out that fzfw = fwz presumption and its invalidity. — Rgdboer (talk) 02:40, 1 May 2017 (UTC)

Typography again[edit]

As noted above in #typography about six years ago, the appropriate symbol appears to be Unicode U+2218: ∘. I find it displays correctly on IE9 and Mozilla Firefox 8, and is used in List of mathematical symbols. The large circle symbol used in this article is a disconcertingly large workaround. Is there any reason (now that browsers may reasonably be expected to support the more common Unicode symbols) not to update this accordingly in the article? — Quondum 18:42, 11 May 2012 (UTC)

It depends less on the browser and more on the fonts installed. A list is here: [1]. Support for it is indeed much better than for (say) \fatsemi. JMP EAX (talk) 06:57, 24 August 2014 (UTC)

commutativity and function composition[edit]

Regarding function composition for which g ∘ f = f ∘ g holds: Do composed functions which have this property have a dedicated name? Can they be considered symmetric functions? --Abdull (talk) 11:59, 18 July 2013 (UTC)

No, they can’t. Also, there is no such thing as “functions which have this property”, there are pairs of functions that commute, and this relation is not transitive. The nearest match to your query is a commutative subgroup of a group of transformations; see group action. Incnis Mrsi (talk) 12:37, 18 July 2013 (UTC)
Actually there is. It's called center of a semigroup. [2][3] JMP EAX (talk) 20:23, 23 August 2014 (UTC)
And for a chosen subset (rather than the whole group/semigroup) it's called a centralizer. JMP EAX (talk) 07:13, 24 August 2014 (UTC)
Of course the place where you should have learned that is the article on commutativity (in general), but that's the usual polished turd. JMP EAX (talk) 02:07, 26 August 2014 (UTC)

Should this page be linked to the page: "Piecewise"?[edit]

The term "Composite function" would often be interpreted in mathematics as a "Piecewise" function. The closest wikipedia page to the desired result that turns up in a search of the term "Composite function" is "Function composition". Should someone add something like "Not to be confused with piecewise functions (piecewise)"?

Micsthepick (talk) 01:12, 5 June 2016 (UTC)

New expression of multivariate function composition[edit]

Please read 'New expression of multivariate function composition', Is it easy to be understand? Can you accept it?

For multivariate function composition

We will give it three expressions like (f.g) for unary function composition. In the expression of (f.g), '.' can be considered as a binary operation taking f and g as its operands or a binary function taking f and g as its variables.

For multivariate function, the first expression is like an operation:

The second one is like a function:

The third one is like a fraction:

Why do we use these forms? We can describe any expression in a fire-new way. For example,,first we denote it as , in which and . In addition, we denote subtraction as ,multiplication as , division as , root as and logarithm as respectively. We want give an expression like in which the left part is called bare function containing only symbolics of function and the right part contains only variables.

is an expression of a function of three variables. We consider and as especial functions of three variables too and introduce unary operator to express these especial functions of three variables.

Here or is transitional variable and ..

By these examples we know the meaning of superscript and subscript of and we call it function promotion.

It is clear that we obtain by substituting and in by and respectively. So can be written in:



We never mind how complex they are. We consider them as multivariate functions being composition results of two other multivariate functions being composition results and or promotion results. These new expressions are different from . Actually we had departed bare function from variables in these new expressions and there is only one "x" in them. This is what we want to do when we solve transcendental equations like .

For an unary function promotion, . In special,, in which 'e' is the identity function.

In if and

Note,there is no in the expression.

is called oblique projection of f. Actually it is a function of n-1 variables and is dependent on only f and i,j so we denote it as . For example, — Preceding unsigned comment added by Woodschain175 (talkcontribs) 22:34, 25 June 2017 (UTC)

Pipe symbol in {{math}}[edit]

You're right, my edit was not needed. Background: [4] lists all irregular parameters. Especially "="-sign and "|"-sign may cause trouble in regular parameter input. e.g. when entering {{math||x| = 12}} has both errors.

Now that list has listed these two instances unnecessarily (because, a pipe in a wikilink works fine). When cleaning up that list, I assumed this was a problem. And since the list is recreated every month, I did so twice ;-). THe only advantage of using {{!}} would be, that it does not show up on the list again, in January. -DePiep (talk) 10:24, 4 December 2017 (UTC)

If it is helpful for your editing, I have no objections against {{!}}. I just hadn't understood the reason of your edits (twice); now I do. - Jochen Burghardt (talk) 18:54, 4 December 2017 (UTC)

Generalized composition - what's it good for?[edit]

This article defines something called "generalized composition" which ... strikes me as bizarre. I'm widely read in math, but have never encountered this definition before -- normally, one does not (cannot) assume that the arity of the composed multivariate functions are all identical, like that. Normally, one has just and I'm wondering where the definition here is used, and what it's used for. It feels very linear-algebra-ish, without the linear. The reference on it says "universal algebra" .. I've gone through Paul Cohen's book "Universal Algebra", and I can't even begin to imagine how such a definition of "generalized composition" would appear in there. (I looked: the index points at page 113 which states that the universal functor on the category of sets is the free composition of canonical morphisms. That's not only a mouthful, but is also like a totally different universe than the one here...) Am I being stupid? What is this thing used for? It looks pretty... (talk) 03:21, 21 December 2017 (UTC)

Oh, I think I get it, one can just mash up the arguments I use above into one big giant vector and adjust the defintion of the g's to work with that, and you get the "generalized" definition. Its still kind of bizarre do me, because it "hides" or makes invisible the use of a giant Diagonal morphism, pretending its not there when it is: that is:
is the diagonal morphism that makes n copies of a vector of length m. Hiding the presence of the diagonal in the definition, pretending its not there when it is has already caused grief on an unrelated project I work on. Which is why I'm interest in my original question: what's it good for? (talk) 04:16, 21 December 2017 (UTC)