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
is fulfilled by the acceptance probability
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