I do not understand the formal proof that the Metropolis Hastings update generates a Markov chain that satisfies detailed balance as it is given in the the Wikipedia article. Under "formal derivation" it states that
$$\frac{A(x'|x)}{A(x|x')}=\frac{P(x')}{P(x)}\frac{g(x|x')}{g(x'|x)}$$
is fulfilled by the acceptance probability
$$A(x'|x)=min\left(1,\frac{P(x')}{P(x)}\frac{g(x|x')}{g(x'|x)}\right)$$
where $x'$ is the candidate, $x$ the current state, $A(.)$ the acceptance probability, $P(.)$ the target distribution and $g(.)$ the proposal distribution.
I just do not see why this is formally correct.
Link to Wikipedia Article: https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm#Formal_derivation