There are quite a few questions regarding three prisoners riddle, but my question relating to a particular line of reasoning from Cassella and Berger, as highlighted in the image below.
Could you please explain how the authors derived the first equality? Was it based on some formula/theorem that I'm not aware of? Thank you.