Formal Probabilistic Risk Assessment using Theorem Proving with Applications in Power Systems