Section PRF_Encryption_IND_CPA.
Variable State : nat -> Set.
Variable A1 : forall n, OracleComp (Plaintext n) (Ciphertext n) (Plaintext n * Plaintext n * State n).
Variable A2 : forall n, State n -> Ciphertext n -> OracleComp (Plaintext n) (Ciphertext n) bool.
Hypothesis A1_admissible :
admissible_oc cost _ _ _ A1.
Hypothesis A2_admissible :
admissible_oc_func_2 cost _ _ _ _ _ A2.
unfold poly_time_nonuniform_oc_func_2.
exists (fun x o => o + 3*x).
exists (fun x => 2 * x).
intuition.
eapply polynomial_plus; intuition.
eapply polynomial_mult.
eapply polynomial_const.
eapply polynomial_ident.
eapply polynomial_mult.
eapply polynomial_const.
eapply polynomial_ident.
eapply cost_le.
eapply cost_curry.
eapply (PRFE_Encrypt_OC_cost_1 n).
eapply (@PRFE_Encrypt_OC_cost_2 n); eauto.
omega.
eapply PRFE_Encrypt_OC_oc_cost; intuition.
Qed.
intuition.
econstructor.
econstructor.
wftac.
intuition.
econstructor.
econstructor.
intuition.
econstructor.
wftac.
Qed.
intuition.
econstructor.
econstructor.
eapply A1_admissible.
eapply PRFE_Encrypt_wf.
intuition.
econstructor.
econstructor.
wftac.
intuition.
econstructor.
econstructor.
wftac.
intuition.
econstructor.
econstructor.
intuition.
econstructor.
econstructor.
simpl.
eapply A2_admissible.
intuition.
eapply PRFE_Encrypt_wf.
intuition.
econstructor.
wftac.
Qed.

Theorem PRF_A'_poly_time :
poly_time_nonuniform_oc cost _ _ _ (fun n => PRF_A' (A1 n) (@A2 n)).