proposition: Corollary refine_find_UpperBound {A} : forall (f : A -> nat) ns, refine (⟦ n in ns | UpperBound (fun a a' => f a <= f a') ns n ⟧) (ret (find_UpperBound f ns)).
proof: Proof. intros. setoid_rewrite refine_filtered_list with (P_dec := DecideableEnsembleUpperBound f ns). reflexivity. Qed.
imports: Coq.Arith.Arith Coq.Sets.Ensembles Coq.Lists.List Fiat.Common.List.ListFacts Fiat.Common.DecideableEnsembles Fiat.Computation