Mutable Mathematics

564 Views Asked by At

Wondering if there is the study of mutable objects in math. A comment on Is There a Mathematical Symbol For Mutable & Immutable values? says:

In mathematics, it's extremely uncommon to have a mutable variable outside of a code/pseudocode block.

I am interested in mutable objects related to groups in group theory. An example is:

$$a \circ b = a'$$

If that was part of a larger equation, the first operation on $a$ would give $a'$, and then you can't use $a$ anymore.

$$x(a) = a \circ b \land a \circ c$$

would not be a thing necessarily since the first operation changed $a$.

If there isn't any, wondering why not.

This comes up in programming, where you are changing the memory. A simple add operation stores its result in memory, so the memory is changed. Wondering how that sort of stuff is modeled, and just generically mutable objects.

2

There are 2 best solutions below

1
On BEST ANSWER

This is largely the purpose and role served by subscripts in mathematical writing.

In analysis, you frequently want to show that some special value $x$ exists which has some special property. It is frequently easier to construct a sequence $\{x_n\}$ which you can demonstrate must be convergent to some value---which happens to have the special property you wanted---then to directly show that $x$ must exist.

In this usage, a particular value $x_{n+1}$ is frequently constructed out of the previous values $x_0, x_1, \ldots, x_n$ either by some formula or by appealing to some existence theorem. In any case, the term $x_{n+1}$ becomes the focus of consideration at the $n+1$st step, and the previous items in the sequence are largely incidental.

This usage is nice in that it gives you a common symbol---in this case $x$--- to hold on to, to let you know these quantities are somehow related and the indices reflect that some sort of recursive construction is happening.

This usage also extends to sets in that you might create a sequence of sets $\{A_n\}$ which, again, the term $A_{n+1}$ is somehow built out of the previous $A_0, A_1, \ldots, A_n$ in some manner. This construction usually ends up with you worrying about the sets $$\bigcup_{n=1}^\infty A_n,\quad \bigcap_{n=1}^\infty A_n,\quad \liminf A_n,\quad\text{and}\quad\limsup A_n$$ instead of some quantity.

0
On

Generally, math is written in terms of statements that can be true or false, not actions. This is natural, because in math the goal is to deduce what is true, not to produce an output as in an algorithm. When you write code, you know that the lines will be executed consecutively, so that at any given moment there is a well-defined state of your variables. When we write a paragraph of math, we are giving an argument for some proposition, not following an algorithm. There's no notion of time - a variable $x$ should be the same at the start of the paragraph and at the end of the paragraph. So we usually don't say things like

Now set $x = 2x$ and ...

since $x=2x$ is impossible unless $x=0$. We could write something like $x \leftarrow 2x$ for this purpose, but this is a bit confusing. If I wrote something later referring to $x$, it might be unclear whether I meant the original $x$ or the mutated $x$. Generally it is preferable to write something like

Define a sequence $x_n$ by $x_1 = 1$, $x_{n+1} = 2 \, x_n$. Then...

Then the notion of $x$ changing is explicitly encoded into the index variable $n$ so that it's clear exactly which $x$ you are referring to at a given time.