(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \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 formalizes Berardi's paradox which says that in the calculus of constructions, excluded middle (EM) and axiom of choice (AC) imply proof irrelevance (PI). Here, the axiom of choice is not necessary because of the use of inductive types. << @article{Barbanera-Berardi:JFP96, author    = {F. Barbanera and S. Berardi}, title     = {Proof-irrelevance out of Excluded-middle and Choice in the Calculus of Constructions}, journal   = {Journal of Functional Programming}, year      = {1996}, volume    = {6}, number    = {3}, pages     = {519-525} } >> *)
Set Implicit Arguments.
Section Berardis_paradox.
(** Excluded middle *)
Hypothesis EM : forall P:Prop, P \/ ~ P.
(** Conditional on any proposition. *)
Definition IFProp (P B:Prop) (e1 e2:P) :=
match EM B with
| or_introl _ => e1
| or_intror _ => e2
end.

(** Axiom of choice applied to disjunction. Provable in Coq because of dependent elimination. *)
Lemma AC_IF :
forall (P B:Prop) (e1 e2:P) (Q:P -> Prop),
(B -> Q e1) -> (~ B -> Q e2) -> Q (IFProp B e1 e2).