proposition: Theorem constant_cost_compose_binary_const_r : forall (A B C D: Type) (f1 : A -> B)(c : C)(f3 : B -> C -> D) c1 c2, cost f1 c1 -> cost (fun x => f3 x c) c2 -> cost (fun a => f3 (f1 a) c) (c1 + c2).
proof: Proof. intuition. eapply constant_cost_le. eapply (constant_cost_compose f1 (fun _ x => f3 x c)). eauto. eapply constant_cost_const. intuition. eauto. lia. Qed.
imports: FCF.Crypto