Kaluza-Klein mechanism reparameterization $A'_\mu=A_\mu-\partial_\mu\lambda$ Polchinski String Theory volume 1 chapter 8 the parameterize of the metric in Kaluza-Klein mechanism
was given by

$$ds^2 =G_{\mu\nu} dx^\mu dx^\nu + G_{dd}(dx^d +A_\mu dx^\mu)^2$$
where $\mu,\nu\in [0,d-1]\cap \mathbb{Z}$ and the selected reparameterizations of $x$ was
$$x^{'d}=x^d +\lambda(x^\mu)$$

Then the book stated that

Under the latter,
$$A'_\mu=A_\mu-\partial_\mu\lambda$$
so gauge transformation arise as part of the higher-dimensional coordinate group. This is the Kaluza-Klein mechanism.

Could you explain why $A'_\mu=A_\mu-\partial_\mu\lambda$? and why $\partial_\mu\lambda(x^\mu)$ became redundant?
 A: Let's use some abbreviations
\begin{eqnarray*}
dx'^d&=&dx^d+\partial_\mu\lambda(x^\mu)\,dx^\mu=:x+\lambda\,\\ 
A'_\mu&=&A_\mu-\lambda_\mu\,,\\
A'_\mu dx^\mu&=&A_\mu dx^\mu-\lambda_\mu dx^\mu=:A-\lambda\,.
\end{eqnarray*}
Then,
\begin{eqnarray*}
&&(dx'^d+A'_\mu d x^\mu)^2\\
&=&(dx'^d)^2+(2dx'^d+A'_\mu dx^\mu)(A'_\nu dx^\nu)\\
&=&x^2+2x\lambda + \lambda^2+(2x+2\lambda+A-\lambda) (A-\lambda)\\
&=&x^2+2x\lambda + \lambda^2-2x\lambda-\lambda^2-\lambda A+2xA+A^2+A\lambda\\
&=&x^2+2xA+A^2\\
&=&(dx^\mu+A_\mu dx^\mu)^2\,.
\end{eqnarray*}
In other words, the metric $ds^2$ is invariant under this gauge transformation.
A: The reasoning is the following:
For the Kaluza-Klein line element in 5-dimensional space-time
$$ds^2 =G_{\mu\nu} dx^\mu dx^\nu + G_{dd}(dx^d +A_\mu dx^\mu)^2 \tag{1}$$
you have a new type of symmetry transformations.
You just define these transformations as
$$\begin{align}
x'^\mu &= x^\mu \\
x'^d &= x^d + \lambda(x^\mu) \\
A'_\mu &= A_\mu - \partial_\mu\lambda \\
\end{align} \tag{2}$$
which is obviously the well-known gauge-transformation
combined with a shift along the fifth coordinate $x^d$.
By using the transformation (2), you can then show that
$$
\begin{align}
 &\ dx'^d +A'_\mu dx'^\mu \\
=&\ d(x^d+\lambda)+(A_\mu-\partial_\mu\lambda)dx^\mu \\
=&\ dx^d+\partial_\mu\lambda\ dx^\mu+A_\mu dx^\mu-\partial_\mu\lambda\ dx^\mu \\
=&\ dx^d+A_\mu dx^\mu
\end{align}$$
You see, the two terms $\partial_\mu\lambda\ dx^\mu$ have
canceled each other. Hence the line element (1) is indeed invariant
$$ds'^2 = ds^2$$
