Talk:Composition of relations

Empty Fr
It is odd to call the final section 'Further Reading': there are no references there!

It says 'Composition of relations can be seen as a special case of the composition of morphisms in the category of binary relations.' But composition of relations is composition of morphisms in the category of relations, surely.

And I don't think that the sentence 'composition of morphisms in category theory is coined on composition of relations' is true. Do you have a reference for this?

I propose to delete this final section. Any objections? Sam Staton 14:15, 15 January 2007 (UTC)

No objections, so I deleted this section. We can discuss here if that is a problem. Sam Staton 12:00, 1 February 2007 (UTC)

Arrow notation
Currently the article usese arrow notation $$R\colon A\to B$$ for binary relations, but I believe it is standard to reserve this for functions from A to B. There is no source for this notation, and it is not mentioned under binary relation. However, in the context of composition it might be best to replace the arrows with a similarly suggestive notation, e.g. $$f\colon A\multimap B$$. Any pointers to such a notation in the literature? --Hans Adler (talk) 23:25, 5 January 2008 (UTC)


 * Isn't this multimap the notation for arrows in a Kleisli category, so that f itself would have type f : A → MB in the underlying category, where M is the functor of the monad? The notation might be confusing for people who know the other meaning. Since typed relations are arrows in the concrete category Rel of relations, I see nothing wrong by itself with using the arrow notation, as long as it is clear that the entity being typed is a relation. An advantage is that this gives a natural way to fix the embedding of a function f : A → B in the world of relations, where a choice must be made between two dual isomorphic views. Alternatively, I have seen the notation R : A ~ B used, but this is not standard. --Lambiam 09:29, 6 January 2008 (UTC)
 * I only used $$\multimap$$ for illustrative purposes, and I would be much more happy with ~. (I didn't think of this.)
 * I also didn't think of the category Rel (or any category theory at all) in the context of this article. Now that you have suggested it, I have brought the article in line with the binary relation article and added a paragraph on Rel. --Hans Adler (talk) 23:42, 6 January 2008 (UTC)
 * Note that Rel is the Kleisli category of the powerset monad. I'm not sure how standard the lollypop is for Kleisli categories, though, so I'm not arguing for its use. For relations, Paul Taylor, in his book, uses a symbol like $$\rightleftharpoons$$ except the two arrows are one. He says (Notation 1.3.4) that he invented the symbol for this purpose. Peter Johnstone, in the Elephant, uses $$\looparrowright$$. Others use a right arrow with a vertical line through it. Since there is no universal standard, it seems reasonable to stick with $$\rightarrow$$ here, and include the explanation that Hans provided. I am not very keen on the tilde because it is so different from the usual arrow notation for morphisms. Sam Staton (talk) 10:20, 7 January 2008 (UTC)
 * In lectures Johnstone uses a regular arrow, but in green chalk. He even sent round an email telling everyone to bring a different-coloured pen for the purpose. Algebraist 21:17, 16 April 2009 (UTC)

Trial exercise
Find the composition of the relations
 * {(1,2),(1,6),(2,4),(3,4),(3,6),(3,8)} & {(2,u),(4,s),(4,t),(6,t),(8,u)}

— —Preceding unsigned comment added by 119.154.63.163 (talk) 17:55, 3 April 2009 (UTC)
 * Illustrative exercise from Multan, Pakistan.
 * Solution: (1,u), (1,t), (2,s), (2,t), (3,s), (3,t), (3,u). — Rgdboer (talk) 22:19, 14 May 2018 (UTC)

Semicolon notation
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)

Left-to-right
In English we read from the left margin of a page to its right margin. This ordering has implications for mathematical notation. After page 18, Graphs and Relations uses juxtaposition for composition of relations. The other major textbook, Relational Mathematics, uses semicolons from the outset. The reverse ordering follows from notation in courses of study of real variables and the chain rule for differentiation of a function. The context in such a course of study involves emphasis on functions rather than their arguments, giving the notation f(x), putting the function f in front of the argument x. Then composition with another function g is written g(f(x)), beginning a backwards notation. A similar backwardness shows up in the study of linear algebra where column vectors are sometimes transformed by a matrix. Thoughtful authors, cited at row and column vectors, use row vectors instead. The input of a row vector to the left of a matrix results in a row vector. Two composed linear transformations can be multiplied as matrices, or can be applied one after another to give the same result. Backwardness in linear algebra cannot be accomplished with the standard matrix multiplication. Perpetuating backward notation for composition of relations is unnecessary, serves no purpose, and contributes to confusion and mistakes. It is suggested that such notation should not be used. — Rgdboer (talk) 21:04, 19 July 2019 (UTC)


 * Could you elaborate your issues with linear algebra? If the vectors are columns and application of linear maps as well as matrix multiplication happens from the left, the composition of functions results in the product of matrices in the same order. Peter Grabs (talk) 01:55, 1 April 2024 (UTC)

The semicolon for infix notation was put in the § Definition. A subsection "Notational variations" was inserted to acknowledge differences in use. Comments expected. — Rgdboer (talk) 22:20, 25 July 2019 (UTC)