Solution (source code)

= Solution

The two definitions of <conditional probability> give
$$
\mathbb P(B\mid A)=\frac{\mathbb P(A\cap B)}{\mathbb P(A)},
\qquad
\mathbb P(A\mid B)\mathbb P(B)=\mathbb P(A\cap B).
$$
Substitution proves <Bayes' theorem>:
$$
\boxed{\mathbb P(B\mid A)=\frac{\mathbb P(A\mid B)\mathbb P(B)}{\mathbb P(A)}.}
$$
The positive <probabilities> assumed in the question make both conditional expressions defined.