Derivation
Consider two instances of Bayes' theorem:
Combining these gives
Now defining
this implies
A similar derivation applies for conditioning on multiple events, using the appropriate extension of Bayes' theorem
Read more about this topic: Bayes' Rule