import proveit
theory = proveit.Theory() # the theorem's theory
from proveit import defaults
from proveit.physics.quantum.QPE import (
_Omega, _fail_def, _sample_space_def, _sample_space_bijection, _Omega_is_sample_space)
%proving _pfail_in_real
defaults.assumptions = _pfail_in_real.conditions
pfail = _fail_def.instantiate()
pfail_as_event_prob = pfail.inner_expr().rhs.define(_Omega)
fail_event = pfail_as_event_prob.rhs.operand
_sample_space_def
from proveit.logic import SubsetEq
SubsetEq(fail_event, _sample_space_def.rhs).prove()
event_prob_in_domain = pfail_as_event_prob.rhs.deduce_in_prob_domain(_sample_space_def.rhs)
pfail_as_event_prob.sub_left_side_into(event_prob_in_domain)
%qed