# Notation for sets

This is a revision of the section of abstractmath.org on notation for sets.

## Sets of numbers

The following notation for sets of numbers is fairly standard.

### Remarks

• Some authors use $\mathbb{I}$ for $\mathbb{Z}$, but $\mathbb{I}$ is also used for the unit interval.
• Many authors use $\mathbb{N}$ to denote the nonnegative integers instead
of the positive ones.
• To remember $\mathbb{Q}$, think “quotient”.
• $\mathbb{Z}$ is used because the German word for “integer” is “Zahl”.

Until the 1930’s, Germany was the world center for scientific and mathematical study, and at least until the 1960’s, being able to read scientific German was was required of anyone who wanted a degree in science. A few years ago I was asked to transcribe some hymns from a German hymnbook — not into English, but merely from fraktur (the old German alphabet) into the Roman alphabet. I sometimes feel that I am the last living American to be able to read fraktur easily.

## Element notation

The expression “$x\in A$” means that $x$ is an element of the set $A$. The expression “$x\notin A$” means that $x$ is not an element of $A$.

“$x\in A$” is pronounced in any of the following ways:

• “$x$ is in $S$”.
• “$x$ is an element of $S$”.
• “$x$ is a member of $S$”.
• “$S$ contains $x$”.
• “$x$ is contained in $S$”.

### Remarks

• Warning: The math English phrase “$A$ contains $B$” can mean either “$B\in A$” or “$B\subseteq A$”.
• The Greek letter epsilon occurs in two forms in math, namely $\epsilon$ and $\varepsilon$. Neither of them is the symbol for “element of”, which is “$\in$”. Nevertheless, it is not uncommon to see either “$\epsilon$” or “$\varepsilon$” being used to mean “element of”.
##### Examples
• $4$ is an element of all the sets $\mathbb{N}$, $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$.
• $-5\notin \mathbb{N}$ but it is an element of all the others.

## List notation

### Definition: list notation

A set with a small number of elements may be denoted by listing the elements inside braces (curly brackets). The list must include exactly all of the elements of the set and nothing else.

##### Example

The set $\{1,\,3,\,\pi \}$ contains the numbers $1$, $3$ and $\pi$ as elements, and no others. So $3\in \{1,3,\pi \}$ but $-3\notin \{1,\,3,\,\pi \}$.

### Properties of list notation

#### List notation shows every element and nothing else

If $a$ occurs in a list notation, then $a$ is in the set the notation defines.  If it does not occur, then it is not in the set.

##### Be careful

When I say “$a$ occurs” I don’t mean it necessarily occurs using that name. For example, $3\in\{3+5,2+3,1+2\}$.

#### The order in which the elements are listed is irrelevant

For example, $\{2,5,6\}$ and $\{5,2,6\}$ are the same set.

#### Repetitions don’t matter

$\{2,5,6\}$, $\{5,2,6\}$, $\{2,2,5,6 \}$ and $\{2,5,5,5,6,6\}$ are all different representations of the same set. That set has exactly three elements, no matter how many numbers you see in the list notation.

Multisets may be written with braces and repeated entries, but then the repetitions mean something.

### When elements are sets

When (some of) the elements in list notation are themselves sets (more about that here), care is required.  For example, the numbers $1$ and $2$  are not elements of the set $S:=\left\{ \left\{ 1,\,2,\,3 \right\},\,\,\left\{ 3,\,4 \right\},\,3,\,4 \right\}$The elements listed include the set $\{1, 2, 3\}$ among others, but not the number $2$.  The set $S$ contains four elements, two sets and two numbers.

Another way of saying this is that the element relation is not transitive: The facts that $A\in B$ and $B\in C$ do not imply that $A\in C$.

### Sets are arbitrary

• Any mathematical object can be the element of a set.
• The elements of a set do not have to have anything in common.
• The elements of a set do not have to form a pattern.
##### Examples
• $\{1,3,5,6,7,9,11,13,15,17,19\}$ is a set. There is no point in asking, “Why did you put that $6$ in there?” (Sets can be arbitrary.)
• Let $f$ be the function on the reals for which $f(x)=x^3-2$. Then $\left\{\pi^3,\mathbb{Q},f,42,\{1,2,7\}\right\}$ is a set. Sets do not have to be homogeneous in any sense.

## Setbuilder notation

### Definition:

Suppose $P$ is an assertion. Then the expression “$\left\{x|P(x) \right\}$” denotes the set of all objects $x$ for which $P(x)$ is true. It contains no other elements.

• The notation “$\left\{ x|P(x) \right\}$” is called setbuilder notation.
• The assertion $P$ is called the defining condition for the set.
• The set $\left\{ x|P(x) \right\}$ is called the truth set of the assertion $P$.
##### Examples

In these examples, $n$ is an integer variable and $x$ is a real variable..

• The expression “$\{n| 1\lt n\lt 6 \}$” denotes the set $\{2, 3, 4, 5\}$. The defining condition is “$1\lt n\lt 6$”.  The set $\{2, 3, 4, 5\}$ is the truth set of the assertion “n is an integer and $1\lt n\lt 6$”.
• The notation $\left\{x|{{x}^{2}}-4=0 \right\}$ denotes the set $\{2,-2\}$.
• $\left\{ x|x+1=x \right\}$ denotes the empty set.
• $\left\{ x|x+0=x \right\}=\mathbb{R}$.
• $\left\{ x|x\gt6 \right\}$ is the infinite set of all real numbers bigger than $6$.  For example, $6\notin \left\{ x|x\gt6 \right\}$ and $17\pi \in \left\{ x|x\gt6 \right\}$.
• The set $\mathbb{I}$ defined by $\mathbb{I}=\left\{ x|0\le x\le 1 \right\}$ has among its elements $0$, $1/4$, $\pi /4$, $1$, and an infinite number of
other numbers. $\mathbb{I}$ is fairly standard notation for this set – it is called the unit interval.

### Usage and terminology

• A colon may be used instead of “|”. So $\{x|x\gt6\}$ could be written $\{x:x\gt6\}$.
• Logicians and some mathematicians called the truth set of $P$ the extension of $P$. This is not connected with the usual English meaning of “extension” as an add-on.
• When the assertion $P$ is an equation, the truth set of $P$ is usually called the solution set of $P$. So $\{2,-2\}$ is the solution set of $x^2=4$.
• The expression “$\{n|1\lt n\lt6\}$” is commonly pronounced as “The set of integers such that $1\lt n$ and $n\lt6$.” This means exactly the set $\{2,3,4,5\}$. Students whose native language is not English sometimes assume that a set such as $\{2,4,5\}$ fits the description.

### Setbuilder notation is tricky

#### Looking different doesn’t mean they are different.

A set can be expressed in many different ways in setbuilder notation. For example, $\left\{ x|x\gt6 \right\}=\left\{ x|x\ge 6\text{ and }x\ne 6 \right\}$. Those two expressions denote exactly the same set. (But $\left\{x|x^2\gt36 \right\}$ is a different set.)

In certain areas of math research, setbuilder notation can go seriously wrong. See Russell’s Paradox if you are curious.

### Variations on setbuilder notation

An expression may be used left of the vertical line in setbuilder notation, instead of a single variable.

#### Giving the type of the variable

You can use an expression on the left side of setbuilder notation to indicate the type of the variable.

##### Example

The unit interval $I$ could be defined as $\mathbb{I}=\left\{x\in \mathrm{R}\,|\,0\le x\le 1 \right\}$making it clear that it is a set of real numbers rather than, say rational numbers.  You can always get rid of the type expression to the left of the vertical line by complicating the defining condition, like this:$\mathbb{I}=\left\{ x|x\in \mathrm{R}\text{ and }0\le x\le 1 \right\}$

#### Other expressions on the left side

Other kinds of expressions occur before the vertical line in setbuilder notation as well.

##### Example

The set$\left\{ {{n}^{2}}\,|\,n\in \mathbb{Z} \right\}$consists of all the squares of integers; in other words its elements are 0,1,4,9,16,….  This definition could be rewritten as $\left\{m|\text{ there is an }n\in \mathrm{}\text{ such that }m={{n}^{2}} \right\}$.

##### Example

Let $A=\left\{1,3,6 \right\}$.  Then $\left\{ n-2\,|\,n\in A\right\}=\left\{ -1,1,4 \right\}$.

##### Warning

Be careful when you read such expressions.

##### Example

The integer $9$ is an element of the set $\left\{{{n}^{2}}\,|\,n\in \text{ Z and }n\ne 3 \right\}$It is true that $9={{3}^{2}}$ and that $3$ is excluded by the defining condition, but it is also true that $9={{(-3)}^{2}}$ and $-3$ is not an integer ruled out by the defining condition.

## Reference

Sets. Previous post.

Send to Kindle

# Pattern recognition in understanding math

## Abstract patterns

This post is a revision of the article on pattern recognition in abstractmath.org.

When you do math, you must recognize abstract patterns that occur in

• Symbolic expressions
• Geometric figures
• Relations between different kinds of math structures.
• Your own mental representations of mathematical objects

This happens in high school algebra and in calculus, not just in the higher levels of abstract math.

## Examples

Most of these examples are revisited in the section called Laws and Constraints.

### At most

For real numbers $x$ and $y$, the phrase “$x$ is at most $y$” means by definition $x\le y$. To understand this definition requires recognizing the pattern “$x$ is at most $y$” no matter what expressions occur in place of $x$ and $y$, as long as they evaluate to real numbers.

#### Examples

• “$\sin x$ is at most $1$” means that $\sin x\le 1$. This happens to be true for all real $x$.
• “$3$ is at most $7$” means that $3\leq7$. You may think that “$3$ is at most $7$” is a silly thing to say, but it nevertheless means that $3\leq7$ and so is a correct statement.
• “$x^2+(y-1)^2$ is at most $5$” means that
$x^2+(y-1)^2\leq5$. This is true for some pairs $(x,y)$ and false for others, so it is a constraint. It defines the disk below:

### The product rule for derivatives

The product rule for differentiable functions $f$ and $g$ tells you that the derivative of $f(x)g(x)$ is $f'(x)\,g(x)+f(x)\,g'(x)$

#### Example

You recognize that the expression ${{x}^{2}}\sin x$ fits the pattern $f(x)g(x)$ with $f(x)={{x}^{2}}$ and $g(x)=\sin x$. Therefore you know that the derivative of ${{x}^{2}}\,\sin x$ is $2x\sin x+{{x}^{2}}\cos x$

### The quadratic formula

The quadratic formula for the solutions of an equation of the form $a{{x}^{2}}+bx+c=0$ is usually given as$r=\frac{-b\pm \sqrt{{{b}^{2}}-4ac}}{2a}$

#### Example

If you are asked for the roots of $3{{x}^{2}}-2x-1=0$, you recognize that the polynomial on the left fits the pattern $a{{x}^{2}}+bx+c$ with

• $a\leftarrow3$ (“$a$ replaced by $3$”)
• $b\leftarrow-2$
• and $c\leftarrow-1$.

Then
substituting those values in the quadratic formula gives you the roots $-1/3$ and $1$.

#### Difficulties with the quadratic formula

##### A little problem

The quadratic formula is easy to use but it can still cause pattern recognition problems. Suppose you are asked to find the solutions of $3{{x}^{2}}-7=0$. Of course you can do this by simple algebra — but pretend that the first thing you thought of was using the quadratic formula.

• Then you got upset because you have to apply it to $a{{x}^{2}}+bx+c$
• and $3{{x}^{2}}-7$ has only two terms
• but $a{{x}^{2}}+bx+c$ has three terms…
• (Help!)
• Do Not Be Anguished:
• Write
$3{{x}^{2}}-7$ as $3{{x}^{2}}+0\cdot x-7$, so $a=3$, $b=0$ and $c=-7$.
• Then put those values into the quadratic formula and you get $x=\pm \sqrt{\frac{7}{3}}$.
• This is an example of the following useful principle:

 Write zero cleverly.

I suspect that most people reading this would not have had the problem with $3{{x}^{2}}-7$ that I have just described. But before you get all insulted, remember:

 The thing about really easy examples is that they give you the point without getting you lost in some complicated stuff you don’t understand very well.

##### A fiendisher problem

Even college students may have trouble with the following problem (I know because I have tried it on them):

What are the solutions of the equation $a+bx+c{{x}^{2}}=0$?

$r=\frac{-b\pm \sqrt{{{b}^{2}}-4ac}}{2a}$

is wrong. The correct answer is

$r=\frac{-b\pm \sqrt{{{b}^{2}}-4ac}}{2c}$

 When you remember a pattern with particular letters in it and an example has some of the same letters in it, make sure they match the pattern!

### The substitution rule for integration

The chain rule says that the derivative of a function of the form $f(g(x))$ is $f'(g(x))g'(x)$. From this you get the substitution rule for finding indefinite integrals:

$\int{f'(g(x))g'(x)\,dx}=f(g(x))+C$

#### Example

To find $\int{2x\,\cos ({{x}^{2}})\,dx}$, you recognize that you can take $f(x)=\sin x$and $g(x)={{x}^{2}}$ in the formula, getting $\int{2x\,\cos ({{x}^{2}})\,dx}=\sin ({{x}^{2}})$    Note that in the way I wrote the integral, the functions occur in the opposite order from the pattern. That kind of thing happens a lot.

## Laws and constraints

• The statement “$(x+1)^2=x^2+2x+1$” is a pattern that is true for all numbers $x$. $3^2=2^2+2\times2+1$ and $(-2)^2=(-1)^2+2\times(-1)+1$, and so on. Such a pattern is a universal assertion, so it is a theorem. When the statement is an equation, as in this case, it is also called a law.
• The statement “$\sin x\leq 1$” is also true for all $x$, and so is a theorem.
• The statement “$x^2+(y-1)^2$ is at most $5$” is true for some real numbers and not others, so it is not a theorem, although it is a constraint.
• The quadratic formula says that:

The solutions of an equation
of the form $a{{x}^{2}}+bx+c=0$ is
given by$r=\frac{-b\pm \sqrt{{{b}^{2}}-4ac}}{2a}$

This is true for all complex numbers $a$, $b$, $c$.
The $x$ in the equation is not a free variable, but a “variable to be solved for” and does not appear in the quadratic formula. Theorems like the quadratic formula are usually called “formulas” rather than “laws”.

• The product rule for derivatives

The derivative of $f(x)g(x)$ is $f'(x)\,g(x)+f(x)\,g'(x)$

is true for all differentiable functions $f$ and $g$. That means it is true for both of these choices of $f$ and $g$:

• $f(x)=x$ and $g(x)=x\sin x$
• $f(x)=x^2$ and $g(x)=\sin x$

But both choices of $f$ and $g$ refer to the same function $x^2\sin x$, so if you apply the product rule in either case you should get the same answer. (Try it).

## Some bothersome types of pattern recognition

### Dependence on conventions

Definition: A quadratic polynomial in $x$is an expression of the form $a{{x}^{2}}+bx+c$.

#### Examples

• $-5{{x}^{2}}+32x-5$ is a quadratic polynomial: You have to recognize that it fits the pattern in the definition by writing it as $(-5){{x}^{2}}+32x+(-5)$
• So is ${{x}^{2}}-1$: You have to recognize that it fits the definition by writing it as ${{x}^{2}}+0\cdot x+(-1)$ (I wrote zero cleverly).

Some authors would just say, “A quadratic polynomial is an expression of the form $a{{x}^{2}}+bx+c$” leaving you to deduce from conventions on variables that it is a polynomial in $x$ instead of in $a$ (for example).

Note also that I have deliberately not mentioned what sorts of numbers $a$, $b$, $c$ and $x$ are. The authors may assume that you know they are using real numbers.

### An expression as an instance of substitution

One particular type of pattern recognition that comes up all the time in math is recognizing that a given expression is an instance of a substitution into a known expression.

#### Example

Students are sometimes baffled when a proof uses the fact that ${{2}^{n}}+{{2}^{n}}={{2}^{n+1}}$ for positive integers $n$. This requires the recognition of the patterns $x+x=2x$ and $2\cdot \,{{2}^{n}}={{2}^{n+1}}$.

Similarly ${{3}^{n}}+{{3}^{n}}+{{3}^{n}}={{3}^{n+1}}$.

#### Example

The assertion

${{x}^{2}}+{{y}^{2}}\ge 0\ \ \ \ \ \text{(1)}$

has as a special case

$(-x^2-y^2)^2+(y^2-x^2)^2\ge 0\ \ \ \ \ \text{(2)}$

which involves the substitutions $x\leftarrow -{{x}^{2}}-{{y}^{2}}$ and $y\leftarrow {{y}^{2}}-{{x}^{2}}$.

##### Remarks
• If you see (2) in a text and the author blithely says it is “never negative”, that is because it is of the form ${{x}^{2}}+{{y}^{2}}\ge 0$ with certain expressions substituted for $x$ and $y$. (See substitution and The only axiom for algebra.)
• The fact that there are minus signs in (2) and that $x$ and $y$ play different roles in (1) and in (2) are red herrings. See ratchet effect and variable clash.
• Most people with some experience in algebra would see quickly that (2) is correct by using chunking. They would visualize (2) as

$(\text{something})^2+(\text{anothersomething})^2\ge0$
This shows that in many cases

 chunking is a psychological inverse to substitution

• Note that when you make these substitutions you have to insert appropriate parentheses (more here). After you make the substitution, the expression of course can be simplified a whole bunch, to

$2({{x}^{4}}+{{y}^{4}})\ge0$

• A common cause of error in doing this (a mistake I make sometimes) is to try to substitute and simplify at the same time. If the situation is complicated, it is best to

 substitute as literally as possible and then simplify

#### Integration by Parts

The rule for integration by parts says that

$\int{f(x)\,g'(x)\,dx=f(x)\,g(x)-\int{f'(x)\,g(x)\,dx}}$

Suppose you need to find $\int{\log x\,dx}$.(In abstractmath.org, “log” means ${{\log }_{e}}$).  Then we can recognize this integral as having the pattern for the left side of the parts formula with $f(x)=1$ and $g(x)=\log \,x$. Therefore

$\int{\log x\,dx=x\log x-\int{\frac{1}{x}dx=x\log \,x-x+c}}$

How on earth did I think to recognize $\log x$ as $1\cdot \log x$??
Well, to tell the truth because some nerdy guy (perhaps I should say some other nerdy guy) clued me in when I was taking freshman calculus. Since then I have used this device lots of times without someone telling me — but not the first time.

This is an example of another really useful principle:

 Write $1$ cleverly.

### Two different substitutions give the same expression

Some proofs involve recognizing that a symbolic expression or figure fits a pattern in two different ways. This is illustrated by the next two examples. (See also the remark about the product rule above.) I have seen students flummoxed by Example ID, and Example ISO is a proof that is supposed to have flummoxed medieval geometry students.

#### Example ID

Definition: In a set with an associative binary operation and an identity element $e$, an element $y$ is the inverse of an element $x$ if

$xy=e\ \ \ \ \text{and}\ \ \ \ yx=e \ \ \ \ (1)$

In this situation, it is easy to see that $x$ has only one inverse: If $xy=e$ and $xz=e$ and $yx=e$ and $zx=e$, then $y=ey=(zx)y=z(xy)=ze=z$

Theorem: ${{({{x}^{-1}})}^{-1}}=x$.

Proof: I am given that ${{x}^{-1}}$ is the inverse of $x$, By definition, this means that

$x{{x}^{-1}}=e\ \ \ \text{and}\ \ \ {{x}^{-1}}x=e \ \ \ \ (2)$

To prove the theorem, I must show that $x$ is the inverse of ${{x}^{-1}}$. Because $x^{-1}$ has only one inverse, all we have to do is prove that

${{x}^{-1}}x=e\ \ \ \text{and}\ \ \ x{{x}^{-1}}=e\ \ \ \ (3)$

But (2) and (3) are equivalent! (“And” is commutative.)

#### Example ISO

This sort of double substitution occurs in geometry, too.

Theorem: If a triangle has two equal angles, then it has two equal sides.

Proof: In the figure, assume $\angle ABC=\angle ACB$. Then triangle $ABC$ is congruent to triangle $ACB$ since the sides $BC$ and $CB$ are equal (they are the same line segment!) and the adjoining angles are equal by hypothesis.

The point is that although triangles $ABC$ and $ACB$ are the same triangle, and sides $BC$ and $CB$ are the same line segment, the proof involves recognizing them as geometric figures in two different ways.

This proof (not Euclid’s origi­nal proof) is hundreds of years old and is called the pons asinorum (bridge of donkeys). It became famous as the first theorem in Euclid’s books that many medi­eval stu­dents could not under­stand. I con­jecture that the name comes from the fact that the triangle as drawn here resembles an ancient arched bridge. These days, isos­ce­les tri­angles are usually drawn taller than they are wide.

## Technical problems in carrying out pattern matching

### Parentheses

In matching a pattern you may have to insert parentheses. For example, if you substitute $x+1$ for $a$, $2y$ for
$b$ and $4$ for $c$ in the expression ${{a}^{2}}+{{b}^{2}}={{c}^{2}}$ you get ${{(x+1)}^{2}}+4{{y}^{2}}=16$
If you did the substitution literally without editing the expression so that it had the correct meaning, you would get $x+{{1}^{2}}+2{{y}^{2}}={{4}^{2}}$ which is not the result of performing the substitution in the expression ${{a}^{2}}+{{b}^{2}}={{c}^{2}}$.

### Order switching

You can easily get confused if the patterns involve a switch in the order of the variables.

#### Notation for integer division

• For integers $m$ and $n$, the phrase “$m$ divides $n$” means there is an integer $q$ for which $n=qm$.
• In number theory (which in spite of its name means the theory of positive integers) the vertical bar is used to denote integer division. So $3|6$ because $6=2\times 3$ ($q$ is $2$ in this case). But “$3|7$” is false because there is no integer $q$ for which $7=q\times 3$.
• An equivalent definition of division says that $m|n$ if and only if $n/m$ is an integer. Note that $6/3=2$, an integer, but $7/3$ is not an integer.
• Now look at those expressions:
• “$m|n$” means that there is an integer $q$ for which $n=qm$.In these two expressions, $m$ and $n$ occur in opposite order.
• “$m|n$” is true only if $n/m$ is an integer. Again, they are in opposite order. Another way of writing $n/m$ is $\frac{n}{m}$. When math people pronounce “$\frac{n}{m}$” they usually say, “$n$ over $m$” using the same order.
• I taught these notation in courses for computer engineering and math majors for years. Some of the students stayed hopelessly confused through several lectures and lost points repeatedly on homework and exams by getting these symbols wrong.
• The problem was not helped by the fact that “$|$” and “$/$” are similar but have very different syntax:

Math notation gives you no clue which symbols are operators (used to form expressions) and which are verbs (used to form assertions).

• A majority of the students didn’t have so much trouble with this kind of syntax. I have noticed that many people have no sense of syntax and other people have good intuitive understanding of syntax. I suspect the second type of people find learning foreign languages easy.
• Many of the articles in the references below concern syntax.
• ## References

Send to Kindle

# The only axiom of algebra

This is one of a series of posts I am writing to help me develop my thoughts about how particular topics in my book Abstracting Algebra (“AbAl“) should be organized. This post concerns the relation between substitution and evaluation that essentially constitutes the definition of algebra. The Mathematica code for the diagrams is in Subs Eval.nb.

## Substitution and evaluation

This post depends heavily on your understanding of the ideas in the post Presenting binary operations as trees.

### Notation for evaluation

I have been denoting evaluation of an expression represented as a tree like this:

In standard algebra notation this would be written:$(6-4)-1=2-1=1$

This treatment of evaluation is intended to give you an intuition about evaluation that is divorced from the usual one-dimensional (well, nearly) notation of standard algebra. So it is sloppy. It omits fine points that will have to be included in AbAl.

• The evaluation goes from bottom up until it reaches a single value.
• If you reach an expression with an empty box, evaluation stops. Thus $(6-3)-a$ evaluates only to $3-a$.
• $(6-a)-1$ doesn’t evaluate further at all, although you can use properties peculiar to “minus” to change it to $5-a$.
• I used the boxed “1” to show that the value is represented as a trivial tree, not a number. That’s so it can be substituted into another tree.

### Notation for substitution

I will use a configuration like this

to indicate the data needed to substitute the lower tree into the upper one at the variable (blank box). The result of the substitution is the tree

In standard algebra one would say, “Substitute $3\times 4$ for $a$ in the expression $a+5$.” Note that in doing this you have to name the variable.

#### Example

“If you substitute $12$ for $a$ in $a+5$ you get $12+5$”:

results in

#### Example

“If you substitute $3\times 4$ for $a$ in $a+b$ you get $3\times4+b$”:

results in

Like evaluation, this treatment of substitution omits details that will have to be included in AbAl.

• You can also substitute on the right side.
• Substitution in standard algebraic notation often requires sudden syntactic changes because the standard notation is essentially two-dimensional. Example: “If you substitute $3+ 4$ for $a$ in $a\times b$ you get $(3+4)\times b$”.
• The allowed renaming of free variables except when there is a clash causes students much trouble. This has to be illustrated and contrasted with the “binop is tree” treatment which is context-free. Example: The variable $b$ in the expression $(3\times 4)+b$ by itself could be changed to $a$ or $c$, but in the sentence “If you substitute $3+ 4$ for $a$ in $a\times b$ you get $(3+4)\times b$”, the $b$ is bound. It is going to be difficult to decide how much of this needs explaining.

## The axiom

The Axiom for Algebra says that the operations of substitution and evaluation commute: if you apply them in either order, you get the same resulting tree. That says that for the current example, this diagram commutes:

The Only Axiom for Algebra

In standard algebra notation, this becomes:

• Substitute, then evaluate: If $a=3\times 4$, then $a+5=3\times 4+5=12+5$.
• Evaluate, then substitute: If $a=3\times 4$, then $a=12$, so $a+5=12+5$.

Well, how underwhelming. In ordinary algebra notation my so-called Only Axiom amounts to a mere rewording. But that’s the point:

 The Only Axiom of Algebra is what makes algebraic manipulation work.

• In functional notation, the Only Axiom says precisely that $\text{eval}∘\text{subst}=\text{subst}∘(\text{eval},\text{id})$.
• The Only Axiom has a symmetric form: $\text{eval}∘\text{subst}=\text{subst}∘(\text{id},\text{eval})$ for the right branch.
• You may expostulate: “What about associativity and commutativity. They are axioms of algebra.” But they are axioms of particular parts of algebra. That’s why I include examples using operations such as subtraction. The Only Axiom is the (ahem) only one that applies to all algebraic expressions.
• You may further expostulate: Using monads requires the unitary or oneidentity axiom. Here that means that a binary operation $\Delta$ can be applied to one element $a$, and the result is $a$. My post Monads for high school III. shows how it is used for associative operations. The unitary axiom is necessary for representing arbitrary binary operations as a monad, which is a useful way to give a theoretical treatment of algebra. I don’t know if anyone has investigated monads-without-the-unitary-axiom. It sounds icky.
• The Only Axiom applies to things such as single valued functions, which are unary operations, and ternary and higher operations. They also apply to algebraic expressions involving many different operations of different arities. In that sense, my presentation of the Only Axiom only gives a special case.
• In the case of unary operations, evaluation is what we usually call evaluation. If you think about sets the way I do (as a special kind of category), evaluation is the same as composition. See “Rethinking Set Theory”, by Tom Leinster, American Mathematical Monthly, May, 2014.
• Calculus functions such as sine and the exponential are unary operations. But not all of calculus is algebra, because substitution in the differential and integral operators is context-sensitive.

## References

### Preceding posts in this series

##### Remarks concerning these posts
• Each of the posts in this series discusses how I will present a small part of AbAl.
• The wording of some parts of the posts may look like a first draft, and such wording may indeed appear in the text.
• In many places I will talk about how I should present the topic, since I am not certain about it.

### Other references

Send to Kindle

# Binary operations as trees

This is one of a series of posts I am writing to help me develop my thoughts about how particular topics in my book Abstracting Algebra (“AbAl“) should be organized. In some parts, I present various options that I have not decided between.

This post concerns the presen­ta­tion of binary operations as trees. The Mathematica code for the diagrams is in Substitution in algebra.nb

## Binary operations as functions

A binary operation or binop $\Delta$ is a function of two variables whose value at $(a,b)$ is traditionally denoted by $a\Delta b$. Most commonly, the function is restricted to having inputs and outputs in the same set. In other words, a binary operation is a function $\Delta:S\times S\to S$ defined on some set $S$. $S$ is the underlying set of the operation. For now, this will be the definition, although binops may be generalized to multiple sets later in the book.

In AbAl:

• Binops will be defined as functions in the way just described.
• Algebraic expressions will be represented
as trees, which exhibit more clearly the structure of the expressions that is encoded in algebraic notation.
• They will also be represented using the usual infix expressions such as “$3\times 5$” and “$3-5$”,

### Fine points

The definition of a binop as a function has termi­no­logical consequences. The correct point of view concerning a function is that it determines its domain and its codomain. In particular:

A binary operation determines its underlying set.

Thus if we talk about an arbitrary binop $\Delta$, we don’t have to give a name to its underlying set. We can just say “the underlying set of $\Delta$” or “$U(\Delta)$”.

#### Examples

“$+$” is not one binary operation.

• $+:\mathbb{Z}\times\mathbb{Z}\to\mathbb{Z}$ is a binary operation.
• $+:\mathbb{R}\times\mathbb{R}\to\mathbb{R}$ is another binary operation.

Mathematicians commonly refer to these particular binops as “addition on the integers” and “addition on the reals”.

#### Remark

You almost never see this attitude in textbooks on algebra. It is required by both category theory and type theory, two Waves flooding into math. Category theory is a middle-aged Wave and type theory, in the version of homo­topy type theory, is a brand new baby Wave. Both Waves have changed and will change our under­standing of math in deep ways.

## Trees

An arbitrary binop $\Delta$ can be represented as a binary tree in this way:

generic binop

This tree represents the expression that in standard algebraic notation is “$a\Delta b$”.

In more detail, the tree is an ordered rooted binary tree. The “ordered” part means that the leaves (nodes with no descendants) are in a specific left to right order. In AbAl, I will define trees in some detail, with lots of pictures.

The root shows the operation and the two leaves show elements of the underlying set. I follow the custom in computing science to put the root at the top.

Metaphors should not dictate your life by being taken literally.

#### Remark

The Wikipedia treatment of trees is scat­tered over many articles and they almost always describe things mostly in words, not pictures. Describing math objects in words when you could use pictures is against my religion. Describing is not the same as defining, which usually requires words.

#### Some concrete examples:

3trees

These are represen­ta­tions of the expressions “$3+5$”, “$3\times5$”, and “$3-5$”.

Just as “$5+3$” is a different expression from “$3+5$”, the left tree in 3trees above is a different expression from this one:

switch

They have the same value, but they are distinct as expressions — otherwise, how could you state the commutative law?

#### Fine points

I regard an expression as an abstract math object that can have many repre­sentations. For example “$3+5$” and the left tree in 3trees are two different represen­ta­tions of the same (abstract) expression. This deviates from the usual idea that “expression” refers to a typographical construction.

In previous posts, when the operation is not commutative, I have sometimes labeled the legs like this:

I have thought about using this notation consistently in AbAl, but I suspect it would be awkward in places.

## Evaluation and substitution

 The two basic operations on algebraic expressions are evaluation and substitution.

They and the Only Axiom of Algebra, which I will discuss in a later post, are all that is needed to express the true nature of algebra.

### Evaluation

• If you evaluate $3+5$ you get $8$.
• If you evaluate $3\times 5$ you get $15$.
• If you evaluate $3-5$ you get $-2$.

I will show evaluation on trees like this:

#### Evaluation with trace

A more elaborate version, valuation with trace, would look like this. This allows you to keep track of where the valuations come from.

You could also keep track of the operation used at each node. An interactive illustration of this is in the post Visible algebra I supplement. That illustration requires CDF Player to be installed on your computer. You can get it free from the Mathematica website.

### Variables

In the tree above, the $a$ and $b$ are variables, just as they are in the equivalent expression $a\Delta b$. Algebra beginners have a hard time understanding variables.

• You can’t evaluate an expression until you substitute numbers for the letters, which produces an instance of expression. (“Instance” is the preferable name for this, but I often refer to such a thing as an “example”.)
• If a variable is repeated you have to substitute the same value for each occurrence. So $a\Delta b$ is a different expression from $a\Delta a$: $2+3$ is an instance of $a+b$ but it is not an instance of $a+a$. But $a\Delta a$ and $b\Delta b$ are the same expression: any instance of one is an instance of the other.
• Substitute $a\Delta b$ for $a$ in $a\Delta b$ and you get $(a\Delta b)\Delta b$. You may have committed variable clash. You might have meant $(a\Delta b)\Delta c$. (Somebody please tell me a good link that describes variable clash.)
• Later, you will deal with multiplication tables for algebraic structures. There the elements are denoted by letters of the alphabet. They can’t be substituted for.

#### Empty boxes

A straightforward way to denote variables would be to use empty boxes:

The idea is that a number (element of the underlying set) can be inserted in each box. If $3$ (left) and $5$ (right) are placed in the boxes, evaluation would place the value of $3\Delta5$ in the root. Each empty box represents a separate variable.

Empty boxes could also be used in the standard algebraic notation: $\Delta$ or $+$ or $-$.
I have seen that notation in texts explaining variables, but I don’t know a reference. I expect to use this notation with trees in AbAl.

To achieve the effect of one variable in two different places, as in

we can cause it to repeat, as below, where “$\text{id}$” denotes the identity function on the underlying set:

To evaluate at a number (member of the underlying set) you insert a number into the only empty box

which evaluates to

which of course evaluates to $3\Delta3$.

This way of treating repeated variables exhibits the nature of repeated variables explicitly and naturally, putting the values automatically in the correct places. This process, like everything in this section, comes from monad theory. It also reminds me of linear logic in that it shows that if you want to use a value more than once you have to copy it.

### Substitution

Given two binary trees

you could attach the root of the first one to one of the leaves of the second one, in two different ways, to get these trees:

2trees

which in standard algebra notation would be written $(a-b)-c)$ and $a-(b-c)$ respectively. Note that this tree

would be represented in algebra as $(a-b)-b$.

In general, substituting a tree for an input (variable or empty box) consists of replacing the empty box by the whole tree, identifying the root of the new tree with the empty box. In graph theorem, “substitution” may be called “grafting”, which is a good metaphor.

You can evaluate the left tree in 2trees at particular numbers to evaluate it in two stages:

Of course, evaluating the right one at the same values would give you a different answer, since subtraction is not associative. Here is another example:

#### Binary trees in general

By repeated substitution, you can create general binary trees built up of individual trees of this form:

In AbAl I will give examples of such things and their counterparts in algebraic notation. This will include binary trees involving more than one binop, as well. I showed an example in the previous post, which example I repeat here:

It represents the precise unsimplified expression

$A=wh+\frac{1}{2}\left(\pi(\frac{1}{2}w)^2\right)$

Some of the operations in that tree are associative and commutative, which is why the expression can be simplified. The collection of all (finite) binary trees built out of a single binop with no assumption that it satisfies laws (associative, commutative and so on) is the free algebra on that binary operation. It is the mother of all binary operations, so it plays the same role for an arbitrary binop that the set of lists plays for associative operations, as described in Monads for High School III: Algebras. All this will be covered in later chapters of AbAl.

## References

### Other references

Send to Kindle

# Presenting binary operations

This is the first of a set of notes I am writing to help me develop my thoughts about how particular topics in my book Abstracting algebra should be organized. This article describes my plan for the book in some detail. The present post has some thoughts about presenting binary operations.

## Before binary operations are introduced

Traditionally, an abstract algebra book assumes that the student is familiar with high school algebra and will then proceed with an observation that such operations as $+$ and $\times$ can be thought of as functions of two variables that take a number to another number. So the first abstract idea is typically the concept of binary operation, although in another post I will consider whether that really should be the first abstract concept.

The Abstracting Algebra book will have a chapter that presents concrete examples of algebraic operations and expressions on numbers as in elementary school and as in high school algebra. This section of the post outlines what should be presented there. Each subsection needs to be expanded with lots of examples.

### In elementary school

In elementary school you see expressions such as

• $3+4$
• $3\times 4$
• $3-4$

The student invariably thinks of these expressions as commands to calculate the value given by the expression.

They will also see expressions such as
$\begin{array}[b]{r} 23\\ 355\\ + 96\\ \hline \end{array}$
which they will take as a command to calculate the sum of the whole list:
$\begin{array}[b]{r} 23\\ 355\\ + 96\\ \hline 474 \end{array}$

That uses the fact that addition is associative, and the format suggests using the standard school algorithm for adding up lists. You don’t usually see the same format with more than two numbers for multiplication, even though it is associative as well. In some elementary schools in recent years students are learning other ways of doing arithmetic and in particular are encouraged to figure out short cuts for problems that allow them. But the context is always “do it”, not “this represents a number”.

### Algebra

In algebra you start using letters for numbers. In algebra, “$a\times b$” and “$a+b$” are expressions in the symbolic language of math, which means they are like noun phrases in English such as “My friend” and “The car I bought last week and immediately totaled” in that both are used semantically as names of objects. English and the symbolic language are both languages, but the symbolic language is not a natural language, nor is it a formal language.

#### Example

In beginning algebra, we say “$3+5=8$”, which is a (true) statement.

The expressions “$3+5$” and “$8$”

• are not the same expression
• but in the standard semantics of algebra they have the same meaning
• and therefore the equation communicates information that neither “$3+5$” nor “$8$” communicate.

Another example is “$3+5=6+2$”.

Facts like this example need to be communicated explicitly before binary operations are introduced formally. The students in a college abstract algebra class probably know the meaning of an equation operationally (subconsciously) but they have never seen it made explicit. See Algebra is a difficult foreign language.

#### Note

The equation “$3+5=6+2$” is an expression just as much as “$3+5$” and “$6+2$” are. It denotes an object of type “equation”, which is a mathematical object in the same way as numbers are. Most mathematicians do not talk this way, but they should.

## Binary operations

### Early examples

Consciousness-expanding examples should appear early and often after binary operations are introduced.

#### Common operations

• The GCD is a binary operation on the natural numbers. This disturbs some students because it is not written in infix form. It is associative. The GCD can be defined conceptually, but for computation purposes needs (Euclid’s) algorithm. This gives you an early example of conceptual definitions and algorithms.
• The maximum function is another example of this sort. This is a good place to point out that a binary operation with the “same” definition cen be defined on different sets. The max function on the natural numbers does not have quite the same conceptual definition as the max on the integers.

#### Extensional definitions

In order to emphasize the arbitrariness of definitions, some random operations on a small finite sets should be given by a multiplication table, on sets of numbers and sets represented by letters of the alphabet. This will elicit the common reaction, “What operation is it?” Hidden behind this question is the fact that you are giving an extensional definition instead of a formula — an algorithm or a combination of familiar operations.

#### Properties

The associative and commutative properties should be introduced early just for consciousness-raising. Subtraction is not associative or commutative. Rock paper scissors is commutative but not associative. Groups of symmetries are associative but not commutative.

### Binary operation as function

The first definition of binary operation should be as a function. For example, “$+$” is a function that takes pairs of numbers to numbers. In other words, $+:\mathbb{Z}\times\mathbb{Z}\to\mathbb{Z}$ is a function.

We then abstract from that example and others like it from specific operations to arbitrary functions $\Delta:S\times S\to S$ for arbitrary sets $S$.

This is abstraction twice.

• First we replace the example operations by an arbitrary operation. such as multiplication, subtraction, GCD and MAX on $\mathbb{Z}$, or something complicated such as $(x,y)\mapsto 3(xy-1)^2(x^2+xy^3)^3$.
• Then we replace sets of numbers by arbitrary sets. An example would be the random multiplication on the set $\{1,2,5\}$ given by the table
$\begin{array}{c|ccc} \Delta& 1&2&5\\ \hline 1&2&2&1\\ 2&5&2&1\\ 5&2&1&5 \end{array}$
This defines a function $\Delta:\{1,2,5\}\times\{1,2,5\}\to\{1,2,5\}$ for which for example $\Delta(2,1)=5$, or $2\Delta 1=5$. This example uses numbers as elements of the set and is good for eliciting the “What operation is it?” question.
• I will use examples where the elements are letters of the alphabet, as well. That sort of example makes the students think the letters are variables they can substitute for, another confusion to be banished by the wise professor who know the right thing to say to make it clear. (Don’t ask me; I taught algebra for 35 years and I still don’t know the right thing to say.)

It is important to define prefix notation and infix notation right away and to use both of them in examples.

### Other representations of binary operations.

The main way of representing binary operations in Abstracting Algebra will be as trees, which I will cover in later posts. Those posts will be much more interesting than this one.

#### Binary operations in high school and college algebra

• Some binops are represented in infix notation: “$a+b$”, “$a-b$”, and “$a\times b$”.
• “$a\times b$” is usually written “$ab$” for letters and with the “$\times$” symbol for numbers.
• Some binops have idiosyncratic representation: “$a^b$”, “${a}\choose{b}$”.
• A lot of binops such as GCD and MAX are given as functions of two variables (prefix notation) and their status as binary operations usually goes unmentioned. (That is not necessarily wrong.)
• The symbol “$(a,b)$” is used to denote the GCD (a binop) and is also used to denote a point in the plane or an open interval, both of which are not strictly binops. They are binary operations in a multisorted algebra (a concept I expect to introduce later in the book.)
• Some apparent binops are in infix notation but have flaws: In “$a/b$”, the second entry can’t be $0$, and the expression when $a$ and $b$ are integers is often treated as having good forms ($3/4$) and bad forms ($6/8$).

#### Trees

The chaotic nature of algebraic notation I just described is a stumbling block, but not the primary reason high school algebra is a stumbling block for many students. The big reason it is hard is that the notation requires students to create and hold complicated abstract structures in their head.

##### Example

This example is a teaser for future posts on using trees to represent binary operations. The tree below shows much more of the structure of a calculation of the area of a rectangle surmounted by a semicircle than the expression

$A=wh+\frac{1}{2}\left(\pi(\frac{1}{2}w)^2\right)$
does.

The tree explicitly embodies the thought process that leads to the formula:

• You need to add the area of the rectangle and the area of the semicircle.
• The area of the rectangle is width times height.
• The area of the semicircle is $\frac{1}{2}(\pi r^2)$.
• In this case, $r=\frac{1}{2}w$.

Any mathematician will extract the same abstract structure from the formula$A=wh+\frac{1}{2}\left(\pi(\frac{1}{2}w)^2\right)$ This is difficult for students beginning algebra.

## References

Send to Kindle

# Algebra is a difficult foreign language

Note: This post uses MathJax.  If you see mathematical formulas with dollar signs around them, or badly formatted formulas, try refreshing the screen. Sometimes you have to do it two or three times.

## Algebra

In a previous post, I said that the symbolic language of mathematics is difficult to learn and that we don't teach it well. (The symbolic language includes as a subset the notation used in high school algebra, precalculus, and calculus.) I gave some examples in that post but now I want to go into more detail.  This discussion is an incomplete sketch of some aspects of the syntax of the symbolic language.  I will write one or more posts about the semantics later.

### The languages of math

First, let's distinguish between mathematical English and the symbolic language of math.

• Mathematical English is a special register or jargon of English. It has not only its special vocabulary, like any jargon, but also used ordinary English words such as "If…then", "definition" and "let" in special ways.
• The symbolic language of math is a distinct, special-purpose written language which is not a dialect of the English language and can in fact be read by mathematicians with little knowledge of English.
• It has its own symbols and rules that are quite different from spoken languages.
• Simple expressions can be pronounced, but complicated expressions may only be pointed to or referred to.
• A mathematical article or book is typically written using mathematical English interspersed with expressions in the symbolic language of math.

### Symbolic expressions

A symbolic noun (logicians call it a term) is an expression in the symbolic language that names a number or other mathematical object, and may carry other information as well.

• "3" is a noun denoting the number 3.
• "$\text{Sym}_3$" is a noun denoting the symmetric group of order 3.
• "$2+1$" is a noun denoting the number 3.  But it contains more information than that: it describes a way of calculating 3 as a sum.
• "$\sin^2\frac{\pi}{4}$" is a noun denoting the number $\frac{1}{2}$, and it also describes a computation that yields the number $\frac{1}{2}$.  If you understand the symbolic language and know that $\sin$ is a numerical function, you can recognize "$\sin^2\frac{\pi}{4}$" as a symbolic noun representing a number even if you don't know how to calculate it.
• "$2+1$" and "$\sin^2\frac{\pi}{4}$" are said to be encapsulated computations.
• The word "encapsulated" refers to the fact that to understand what the expressions mean, you must think of the computation not as a process but as an object.
• Note that a computer program is also an object, not a process.
• "$a+1$" and "$\sin^2\frac{\pi x}{4}$" are encapsulated computations containing variables that represent numbers. In these cases you can calculate the value of these computations if you give values to the variables.

symbolic statement is a symbolic expression that represents a statement that is either true or false or free, meaning that it contains variables and is true or false depending on the values assigned to the variables.

• $\pi\gt0$ is a symbolic assertion that is true.
• $\pi\lt0$ is a symbolic assertion that it is false.  The fact that it is false does not stop it from being a symbolic assertion.
• $x^2-5x+4\gt0$ is an assertion that is true for $x=5$ and false for $x=1$.
• $x^2-5x+4=0$ is an assertion that is true for $x=1$ and $x=4$ and false for all other numbers $x$.
• $x^2+2x+1=(x+1)^2$ is an assertion that is true for all numbers $x$.

### Properties of the symbolic language

The constituents of a symbolic expression are symbols for numbers, variables and other mathematical objects. In a particular expression, the symbols are arranged according to conventions that must be understood by the reader. These conventions form the syntax or grammar of symbolic expressions.

The symbolic language has been invented piecemeal by mathematicians over the past several centuries. It is thus a natural language and like all natural languages it has irregularities and often results in ambiguous expressions. It is therefore difficult to learn and requires much practice to learn to use it well. Students learn the grammar in school and are often expected to understand it by osmosis instead of by being taught specifically.  However, it is not as difficult to learn well as a foreign language is.

In the basic symbolic language, expressions are written as strings of symbols.

• The symbolic language gives (sometimes ambiguous) meaning to symbols placed above or below the line of symbols, so the strings are in some sense more than one dimensional but less than two-dimensional.
• Integral notation, limit notation, and others, are two-dimensional enough to have two or three levels of symbols.
• Matrices are fully two-dimensional symbols, and so are commutative diagrams.
• I will not consider graphs (in both senses) and geometric drawings in this post because I am not sure what I want to write about them.

## Syntax of the language

One of the basic methods of the symbolic language is the use of constructors.  These can usually be analyzed as functions or operators, but I am thinking of "constructor" as a linguistic device for producing an expression denoting a mathematical object or assertion. Ordinary languages have constructors, too; for example "-ness" makes a noun out of a verb ("good" to "goodness") and "and" forms a grouping ("men and women").

### Special symbols

The language uses special symbols both as names of specific objects and as constructors.

• The digits "0", "1", "2" are named by special symbols.  So are some other objects: "$\emptyset$", "$\infty$".
• Certain verbs are represented by special symbols: "$=$", "$\lt$", "$\in$", "$\subseteq$".
• Some constructors are infixes: "$2+3$" denotes the sum of 2 and 3 and "$2-3$" denotes the difference between them.
• Others are placed before, after, above or even below the name of an object.  Examples: $a'$, which can mean the derivative of $a$ or the name of another variable; $n!$ denotes $n$ factorial; $a^\star$ is the dual of $a$ in some contexts; $\vec{v}$ constructs a vector whose name is "$v$".
• Letters from other alphabets may be used as names of objects, either defined in the context of a particular article, or with more nearly global meaning such as "$\pi$" (but "$\pi$" can denote a projection, too).

This is a lot of stuff for students to learn. Each symbol has its own rules of use (where you put it, which sort of expression you may it with, etc.)  And the meaning is often determined by context. For example $\pi x$ usually means $\pi$ multiplied by $x$, but in some books it can mean the function $\pi$ evaluated at $x$. (But this is a remark about semantics — more in another post.)

### "Systematic" notation

• The form "$f(x)$" is systematically used to denote the value of a function $f$ at the input $x$.  But this usage has variations that confuse beginning students:
• "$\sin\,x$" is more common than "$\sin(x)$".
• When the function has just been named as a letter, "$f(x)$" is more common that "$fx$" but many authors do use the latter.
• Raising a symbol after another symbol commonly denotes exponentiation: "$x^2$" denotes $x$ times $x$.  But it is used in a different meaning in the case of tensors (and elsewhere).
• Lowering a symbol after another symbol, as in "$x_i$"  may denote an item in a sequence.  But "$f_x$" is more likely to denote a partial derivative.
• The integral notation is quite complicated.  The expression $\int_a^b f(x)\,dx$ has three parameters, $a$, $b$ and $f$, and a bound variable $x$ that specifies the variable used in the formula for $f$.  Students gradually learn the significance of these facts as they work with integrals.

### Variables

Variables have deep problems concerned with their meaning (semantics). But substitution for variables causes syntactic problems that students have difficulty with as well.

• Substituting $4$ for $x$ in the expression $3+x$ results in $3+4$.
• Substituting $4$ for $x$ in the expression $3x$ results in $12$, not $34$.
• Substituting "$y+z$" in the expression $3x$ results in $3(y+z)$, not $3y+z$.  Some of my calculus students in preforming this substitution would write $3\,\,y+z$, using a space to separate.  The rules don't allow that, but I think it is a perfectly natural mistake.

### Using expressions and writing about them

• If I write "If $x$ is an odd integer, then $3+x$ is odd", then I am using $3+x$ in a sentence. It is a noun denoting an unspecified number which can be constructed in a specified way.
• When I mention substituting $4$ for $x$ in "$3+x$", I am talking about the expression $3+x$.  I am not writing about a number, I am writing about a string of symbols.  This distinction causes students major difficulties and teacher hardly ever talk about it.
• In the section on variables, I wrote "the expression $3+x$", which shows more explicitly that I am talking about it as an expression.
• Note that quotes in novels don't mean you are talking about the expression inside the quotes, it means you are describing the act of a person saying something.
• It is very common to write something like, "If I substitute $4$ for $x$ in $3x$ I get $3 \times 4=12$".  This is called a parenthetic assertion, and it is literally nonsense (it says I get an equation).
• If I pronounce the sentence "We know that $x\gt0$" we pronounce "$x\gt0$" as "$x$ is greater than zero",  If I pronounce the sentence "For any $x\gt0$ there is $y\gt0$ for which $x\gt y$", then I pronounce the expression "$x\gt0$" as "$x$ greater than zero$", This is an example of context-sensitive pronunciation • There is a lot more about parenthetic assertions and context-sensitive pronunciation in More about the languages of math. ## Conclusion I have described some aspects of the syntax of the symbolic language of math. Learning that syntax is difficult and requires a lot of practice. Students who manage to learn the syntax and semantics can go on to learn further math, but students who don't are forever blocked from many rewarding careers. I heard someone say at the MathFest in Madison that about 25% of all high school students never really understand algebra. I have only taught college students, but some students (maybe 5%) who get into freshman calculus in college are weak enough in algebra that they cannot continue. I am not proposing that all aspects of the syntax (or semantics) be taught explicitly. A lot must be learned by doing algebra, where they pick up the syntax subconsciously just as they pick up lots of other behavior-information in and out of school. But teachers should explicitly understand the structure of algebra at least in some basic way so that they can be aware of the source of many of the students' problems. It is likely that the widespread use of computers will allow some parts of the symbolic language of math to be replaced by other methods such as using Excel or some visual manipulation of operations as suggested in my post Mathematical and linguistic ability. It is also likely that the symbolic language will gradually be improved to get rid of ambiguities and irregularities. But a deliberate top-down effort to simplify notation will not succeed. Such things rarely succeed. ## References Send to Kindle # A visualization of a computation in tree form The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome. The source code is the Mathematica Notebook Live evaluation of expressions in TreeForm 3, which is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The code is ad-hoc. It might be worthwhile for someone to design a package that produces this sort of tree for any expression. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work. This demonstration shows the step by step computation of the value of the expression$3x^2+2(1+y)$shown as a tree. By moving the first slider from right to left, you go through the six steps of the computation. You may select the values of$x$and$y\$ with the second and third sliders.  If you click on the plus sign next to a slide, a menu opens up that allows you to make the slider move automatically, shows the values, and other things.

Note that subtrees on the same level are evaluate left to right.  Parallel processing would save two steps.

A previous post related to this post is Making visible the abstraction in algebraic notation.

Send to Kindle