The symbol "=" in mathematics, as you are probably aware, is equivalent to "==" in programming (rather than "="), so basically it's just a function that takes two parameters of any type and returns a boolean value. The symbol "=" as used in programming is very uncommon in mathematics. Even when defining variables for the first time in mathematics, e.g. "let $x=2y$", what really happens technically speaking, is everything that is written below is under the premise that $x==2y$ returns a true value. So technically speaking, even here we are not using the "definition" operator in mathematics (i.e. ":=").
Just think about the expression "$x=x+1$" in programming. It makes perfect sense, it just increments the value of x by 1. Even so, I can't think of a single field of mathematics where this expression would make sense, just like you would never write "$x==x+1$" in programming, but rather just simply "false".
For this reason, redefining variables in the same exercise/formula/context is also not possible. The closest you can get to "redefining" a variable in mathematics, is passing it as an argument in a recursive function.
For example, let's consider a function in programming that returns the sum of the first 10 natural numbers, where the "iterator" and "sum" variable get redefined 9 times.
int f(){
int i = 1, sum = 0;
while(i<=10){
sum += i; //i.e. sum = sum + 1;
i++; //i.e. i = i + 1;
}
return sum;
}
The above function, as simple as it is, is impossible to "translate" into mathematical language. The only way to do such a translation is to define the function in such a way that, whenever you have to redefine a variable, you return the entire function with modified arguments:
//note that when calling the function for the first time, both arguments must be 0
int f(int i = 0, int sum = 0){
if(i<=10) return f(i + 1, sum + i);
return sum;
}
//print(f(0, 0)); will print 55
In the above function, TECHNICALLY speaking, both the "i" and "sum" variables are only defined once per function call (so we have no redefinitions). The following mey not be directly related to the question, but such a function would be "translated" in mathematical language as follows:
$\forall i\forall sum:i\leq10\implies f(i, sum)=f(i+1, sum+i)$
$\forall sum:f(10, sum)=sum$
Both of the above are just true boolean statements, so TECHNICALLY not definitions. Same thing goes for the statement below;
$f(0, 0)=55$