6

Let $X$ be a set and $X\times X\to X: (a, b)\mapsto a\cdot b$ an associative operation on $X$. Now one can prove by induction that it doesn't matter how one places the brackets in a product $x_1\cdot x_2\cdot\text{ }\dots\text{ } \cdot x_n$, the product always evaluates to the same value. This result justifies the notation of a product $x_1\cdot x_2\cdot\text{ }\dots\text{ } \cdot x_n$ without any brackets. But how can one formalize it?

Asaf Karagila
  • 405,794
  • 1
    Isn't this just the associative property of a binary relation? – Alex Ortiz Aug 25 '16 at 17:47
  • @AOrtiz: Well, i supposed that the binary operation is associative in the sense that for three elemets a, b, c of X we have a(bc) = (ab)c. Now I talk about the theorem that the placing of the brackets also doesn't matter for n > 3 elements of X which should be multiplied. – user363804 Aug 25 '16 at 17:51
  • 1
    I think this question is deeper than most people thought. I'd say that the exact answer you want might be long and tedious. – BigbearZzz Aug 25 '16 at 17:52
  • @fleablood Not a priori. Associative only says it for three elements; the case for $n > 3$ is justified using induction. – MT_ Aug 25 '16 at 17:59
  • 1
    @user363804, I'm confused what you mean by "formalize" it. – MT_ Aug 25 '16 at 18:00
  • 4
    There is a proof here that the simple associative law implies the general one. The accepted answer to this question discusses at length and with some references the possible ways of formalizing and proving the general associative law; I’m voting to close this as a duplicate of that question. – Brian M. Scott Aug 25 '16 at 18:01
  • Yes, any mathematician would accept this knowing there is also a proof by induction, because is is not clear a priori. – Janik Aug 25 '16 at 18:18
  • Okay, I'm confused by the question. The OP is not asking for a proof by induction but is accepting one can be done. So I am interpreting the question as "how can one formally state 'brackets don't matter because of the proof thingy'?" The answer to that is simply. "The operations is associative so the order of operation doesn't need to be specified." That is as formal as one needs to be. – fleablood Aug 25 '16 at 18:21
  • 3
    @fleablood: The moment when one wishes to be able to downvote a comment :-) – user363804 Aug 25 '16 at 18:56

4 Answers4

6

One nice way to formalize the general associative law is via binary trees. For us, a tree of operations will be a finite tree, with a root node, where each node is either a leaf (no successors) or has exactly two successors (a left successor and a right successor), and each leaf is labelled with an element of $X$.

The idea is that each leaf of the tree represents an input, and each non-leaf node is an instance of the operation $*$ applied to the values associated to the $*$-product of the left and right sub-trees of that node. So, for instance, $(a*b)*c$ is represented by a tree with one split at the root, and then the left side splits once more; and the leaves are labelled $a, b, c$, respectively.

A vauation of a tree of operations is a map $m$ from the nodes to $X$, satisfying $m(\sigma)$ is the label already on $\sigma$ - if $\sigma$ is a leaf - and $m(\sigma)=m(S_{left}(\sigma))*m(S_{right}(\sigma)),$ where $S_{left}$ and $S_{right}$ are the left and right successors of $\sigma$, if $\sigma$ is not a leaf. We can prove by induction that each tree $T$ of operations has exactly one valuation; call this "$v(T)$."

Note that the leaves of a tree of operations are ordered in a natural way: one leaf $\sigma$ is before another leaf $\tau$ if it is "to the left" of $\tau$, that is, when $\rho$ is the furthest node of the tree above both $\sigma$ and $\tau$ we have that $\sigma$ goes left from $\rho$ while $\tau$ goes right. The general associative law is then:

If $T_1, T_2$ are two trees of operations with the same leaf-labels occurring in the same left-right order, then $v(T_1)$ and $v(T_2)$ assign the same element of $X$ to the root of $T_1$ and $T_2$, respectively.

Noah Schweber
  • 260,658
  • Just a little question: You said that one can "prove by induction that each tree T of operations has exactly one valuation". Why do you need to prove this? Couldn't one just say that $v(T)$ is inductively defined (exactly as you defined $m$)? – user363804 Aug 25 '16 at 18:45
  • @user363804 Some proof is needed somewhere. Strictly speaking, I didn't even prove that valuations exist! All I need for this is that some valuation exists for each tree of operations, but uniqueness of valuations is useful - while I'm in the neighborhood I might as well prove it, too. (Note that definition by induction also requires a proof: I need to prove that something satisfying the inductive property exists! This is usually taken care of by a general lemma, but it's worth pointing out.) – Noah Schweber Aug 25 '16 at 19:09
2

To each rooted planar binary tree $\tau$ we can associate an operation $X^{\times n}\to X$, where $n$ is the arity of the tree (i.e. the number of leaves): if $x_1,\ldots,x_n\in X$ then $\tau(x_1,\ldots,x_n)$ is obtained by putting $x_i$ at the $i$th leaf of the tree, and then "moving down towards the root" by applying the multiplication at the vertices. This shows that planar binary trees are in bijective correspondence with bracketings. Then the statement you are looking for is:

Lemma: Any two planar binary trees of the same arity induce the same operation.

This is easily proven by induction.

Remark: These ideas come quite naturally once you are acquainted with operad theory.

0

Assume your operation is associative, i.e. $\forall a,b,c\in X$: $$a\cdot (b\cdot c) =(a\cdot b)\cdot c$$ Now, we want to prove that brackets don't matter for any general expression using induction.

Starting with a product of three items, the claim is true due to the associative property. Now assume the claim is true for some expression involving $n>3$ terms, which we'll denote by $x_n$. Any expression involving $n+1$ terms, is of the forms: $$x_{n+1}=a\cdot (x_n)\ \text{or}\ x_{n+1}=(a\cdot x_{n_1})\cdot x_{n_2}$$ Where $n_1 + n_2 = n$, and we want to prove these two forms are identical. Due again to the associative property, and the induction hypotheses we have that: $$(a\cdot x_{n_1})\cdot x_{n_2} = a\cdot(x_{n_1}\cdot x_{n_2}) = a \cdot (x_n)$$ Q.E.D

-1

This is called the associative law which says precisely: $$\forall x,y,z [(x*(y*z))=((x*y)*z))] $$

That it extends to arbitrary finite products can then proven using induction.

Some more details: you will prove that every expresention is equivalent to the one with brackets on left e.g. to $(((x*y)*z)*w))$ (every expresion uses each variable only once). Then you can define complexity $C:\mathrm{EXP}\to\mathbb{N}$ of an expression recursively as : $C(x)=0$, and for composed expressions $C(e*f)=C(e)+C(f)+\mathrm{length}(f)-1$, where $e,f$ are expressions and $\mathrm{length}(f)$ is a number of variables in $f$.

Examples: $C(x*y)=C(x)+C(y)+1-1=0$,

$C((x*y)*z))=C(x*y)+C(z)+1-1=0$,

but $C(x*(y*z))=C(x)+C(y*z)+2-1=1$,

and use induction on the complexity. Calculate that any one application of associativity decreases the complexity.

  • That's not a proof, just a name. – Nathaniel Bubis Aug 25 '16 at 17:49
  • I think it's a fine answer. Associativity by definition means the order of operation does not change the result. It's enough to say "the operation is associative so we don't have to distinguish the order of operations with brackets". That is it. – fleablood Aug 25 '16 at 17:59
  • 4
    @fleablood I don't think it is. If you read the body of the post at all, this is just saying what the post already says. It offers no added clarification - the OP actually uses the phrase "associative" and "proven by induction". (I am a downvoter, if anyone cares.) – MT_ Aug 25 '16 at 18:01