(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** This file provides classical logic and definite description, which is equivalent to providing classical logic and Church's iota operator *)
(** Classical logic and definite descriptions implies excluded-middle in [Set] and leads to a classical world populated with non computable functions. It conflicts with the impredicativity of [Set] *)
Set Implicit Arguments.
Require Export Classical.   (* Axiomatize classical reasoning *)
Require Export Description. (* Axiomatize constructive form of Church's iota *)
Local Notation inhabited A := A (only parsing).
(** The idea for the following proof comes from [ChicliPottierSimpson02] *)
(** Church's iota operator *)
Definition iota (A : Type) (i:inhabited A) (P : A->Prop) : A
:= proj1_sig (classical_definite_description P i).
Definition iota_spec (A : Type) (i:inhabited A) (P : A->Prop) :
(exists! x:A, P x) -> P (iota i P)
:= proj2_sig (classical_definite_description P i).

Theorem unique_choice :
forall (A B:Type) (R:A -> B -> Prop),
(forall x:A,  exists! y : B, R x y) ->
(exists f : A -> B, forall x:A, R x (f x)).