Assume $b$ is going to replace member $a$ in set $S$. That is, the set S is initially like this $S=\{a\}$, but now the new member $b$ is going to replace $b$ to have $S=\{b\}$ at the end.
How do you express that in mathematical notation? Is it right to say $a\leftarrow b$
$\endgroup$2 Answers
$\begingroup$This notion of "replacing" an element in a set $S$, while maintaining the same name $S$ for the result, is an example of what assignment statements do in imperative programming languages. You're thinking of $S$ as a variable in such a language, where at any point in time $S$ has a state, and operations mutate that state.
Variables in mathematics typically aren't thought of or used in that way (nor are variables in functional programming languages). The result of removing $a$ from $S$ and adding $b$ to that is another set, call it $S'$: $$ S' = (S\setminus\{a\}) \cup \{b\}.\tag{*} $$ The righthand side of (*) is the operation on $S$ that you describe.
If you wanted to be imperative about it and redefine $S$, I suppose you might change "$S' = $" in (*) to "$S := $" or "$S\leftarrow $". You can do that in a description of an algorithm, but I'd say don't do it in a proof — "it's just not done", and you'll confuse people.
In model theory, there's a related notion, and a notation for it. An assignment is a function $\mathsf{a}\colon\mathsf{Variables}\to U$ from variables to values in a set $U$. Two common scenarios: in propositional logic, $\mathsf{Variables}$ is the set of propositional variables, and $U$ is the set of truth values; in first order logic, $\mathsf{Variables}$ is the set of variables for individuals and $U$ is the universe of a model.
If $\mathsf{a}$ is an assignment, $v$ a variable, and $u\in U$, the notation $\mathsf{a}[v\backslash u]$ is used to denote the assignment $\mathsf{a}'$ which agrees with $\mathsf{a}$ on every variable except possibly $v$, and such that $\mathsf{a}'(v) = b$. This is just replacement of an element of $\mathsf{a}$ by another: $(v, \mathsf{a}(v))$ is replaced by $(v,b)$. So, yes it's similar — but not exactly the same as what you describe, as this notation applies only to functions. In any case, the result of the replacement is rightly regarded as a different assignment of values to variables; the name $\mathsf{a}$ doesn't all of a sudden refer to this different thing.
$\endgroup$ 2 $\begingroup$There's no widely adopted notation for this. This is not a common math operation. Technically if you "replace" a member of a set with some new member, you just get another/new set (and not the original set modified). What you're asking seems to me closer to computer science than to math.
Of course you can introduce your own notation and use it, as long as you have defined it formally/rigorously.
$\endgroup$