Definition procedure_family(A : nat -> Type) := forall n, A n.Definition efficiency_predicate := forall (A : nat -> Type), procedure_family A -> Prop.

Theorem expected_poly_time_if_f : forall (A B: nat -> Type)(f_b : forall n, (A n) -> bool)(f_so f_not : forall n, A n -> B n), efficient _ f_b -> efficient _ f_so -> efficient _ f_not -> efficient _ (fun n (a : A n) => if (f_b n a) then (f_so n a) else (f_not n a)).