(**************************************************************)
(*   Copyright Dominique Larchey-Wendling [*]                 *)
(*                                                            *)
(*                             [*] Affiliation LORIA -- CNRS  *)
(**************************************************************)
(*      This file is distributed under the terms of the       *)
(*         CeCILL v2 FREE SOFTWARE LICENSE AGREEMENT          *)
(**************************************************************)
(* ** Reification for bounded quantification *)
Set Implicit Arguments.
(* A nat indexed finite number of conjunctions *)
Definition fmap_reifier_t X (Q : nat -> X -> Prop) k :
(forall i, i < k -> sig (Q i))
-> { f : forall i, i < k -> X | forall i Hi, Q i (f i Hi) }.

Theorem fmap_reifier_default X n (P : nat -> X -> Prop) :
inhabited X
-> (forall x, x < n -> ex (P x))
-> exists f, forall x, x < n -> P x (f x).