Does every transitive binary relation imply the existence of $n$-ary relations for all $n$? Related question: Are all n-ary operators simply compositions of binary operators?

Question:
Let's say we have a binary relation $\sim$ and we know that it is transitive, i.e. that $$a \sim b, b \sim c \implies a \sim c$$ Is this enough information to define for all $n$ a valid $n$-ary relation on the same set?
(Note that we also might need the binary relation to be symmetric, although I am not sure.)
Two Examples which might clarify what I am asking:


*

*In this answer I tried to argue that the transitivity of equality as a binary relation allows us to define an $n-$ary equality relation for all $n$, i.e. that the transitive binary relation automatically implies the existence of a well-defined $n-$ary relation for all $n$, and thus that these $n-$ary relations provide us with essentially nothing new. I thought this was an interesting idea although I realized halfway through writing it that I did not know how to prove it formally and thus did not actually know whether it was correct.

*It is well-known that probabilistic independence is not transitive. It is also well-known that pairwise independence (i.e. binary independence) does not imply mutual (i.e. $n-$ary for all $n$) independence. The method in which I answered the question about equality made me realize eventually that I suspect that there is a connection between the two facts, specifically that the former causes the latter. However, again as in the equality case, I don't know how to prove this. Say that the random variables $A, B, C$ are pairwise independent, i.e. $A \sim B, B \sim C, A \sim C$ (it is implicit here that the relation is also symmetric). Then how does the fact that $\sim$ is not transitive preclude us from concluding that $A,B,C$ necessarily satisfy a valid ternary relation?
Honestly it seems like the real problem here is probably that I don't conceptually understand ternary relations or $n-$ary relations for $n>2$. I know that they correspond to subsets of the $n-$fold Cartesian product -- indeed that is a straightforward generalization of the definition of a binary relation -- but this doesn't seem like as much structure as it should be somehow.
 A: I think your are observing that if you have a binary relation $R\subset A\times A$ and you know that $R$ is transitive, then you can define a new ternary relation $S \subset A^3$ by:
$$S(a,b,c) \iff R(a,b) \wedge R(b,c) \wedge R(a,c)$$
or something like that. In other words, you can define a ternary relation $S$ meaning "Each pair of these three points satisfies the $R$ relation." (And as you point out, you may need $S$ to be symmetric to avoid subtleties about whether the order matters when comparing pairs of points with this definition.)
I think you are asking two questions:
(1) Are all $n$-ary relations expressible in terms of binary relations? That is, is every $n$-ary relation of the form "There is a symmetric transitive relation $T$, and this $n$-ary relation holds for a set of $n$ points if and only if $T$ holds for every pair of points."
(2) How can you prove that because the pairwise probabilistic independence relation (call it $D$) is not transitive, pairwise independence does not imply mutual independence?

(1) The answer to your first question is no: some $n$-ary relations are "mutual pairwise" relations in the way you suggest (where the relation holds for $n$ points if and only if every pair of points satisfies the binary relationship $T$). 

But in fact, $n$-ary relations may be much less structured in general. Here is an example of a ternary relation which is not of this form. I'll define a relation on triples of integers $a, b, c$ by defining  $R^\star(a,b,c)$ to mean that $a<b$ and $c=2b$. So for example, $R^\star(1,2,4)$ is true, and $R^\star(5,17,34)$ is true, but $R^\star(1,3,5)$ is false.
It is useful to remember that $n$-ary relations need be nothing more than subsets of the $n$-fold Cartesian product. So, for example, to define a ternary relation, you need only declare which triples you want to be true. Some n-ary relations — like mutual independence of three points — will have more structure, but does not need to.
(2) One of the reasons that it may seem hard to prove the result for your second question is that the proof is essentially by unravelling definitions: 
if $D$ is a relationship which is not transitive, then there must necessarily be elements (distributions) $a$, $b$, $c$ for which $D(a,b)$ and $D(b,c)$ but not $D(a,c)$.
Hence pairwise independence ($D$) does not imply mutual independence, because here we have those same three points $a,b,c$ which are pairwise independent $D(a,b)$ and $D(b,c)$ but not mutually independent, because we don't have $D(a,c)$.
In general, for a symmetric relation $E$, transitivity means the same thing as "pairwise $E$ implies mutual $E$."
