Timings for ExcludedMiddle.v
Require Import HoTT.Basics HoTT.Types.
(** * The law of excluded middle *)
Monomorphic Axiom ExcludedMiddle : Type0.
Existing Class ExcludedMiddle.
(** Mark this axiom as a "global axiom", which some of our tactics will automatically handle. *)
Instance is_global_axiom_excludedmiddle : IsGlobalAxiom ExcludedMiddle := {}.
Axiom LEM : forall `{ExcludedMiddle} (P : Type), IsHProp P -> P + ~P.
Definition ExcludedMiddle_type := forall (P : Type), IsHProp P -> P + ~P.
(** ** LEM means that all propositions are decidable *)
Instance decidable_lem `{ExcludedMiddle} (P : Type) `{IsHProp P} : Decidable P
:= LEM P _.
(** ** Double-negation elimination *)
Definition DNE_type := forall P, IsHProp P -> ~~P -> P.
Definition LEM_to_DNE : ExcludedMiddle -> DNE_type.
intros np; elim (nnp np).
(** This direction requires Funext. *)
Definition DNE_to_LEM `{Funext} :
DNE_type -> ExcludedMiddle_type.
refine (dn (P + ~P) _ _).
intros p np; exact (np p).
(** DNE is equivalent to "every proposition is a negation". *)
Definition allneg_from_DNE (H : DNE_type) (P : Type) `{IsHProp P}
: {Q : Type & P <-> ~Q}.
intros p np; exact (np p).
Definition DNE_from_allneg (H : forall P, IsHProp P -> {Q : Type & P <-> ~Q})
: DNE_type.
destruct (H P _) as [Q e].