forked from DeepSpec/InteractionTrees
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Axioms.v
54 lines (42 loc) · 1.67 KB
/
Axioms.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(** * Axioms used in the ITree library. *)
(** Other ITree modules should import this to avoid accidentally using more
axioms elsewhere. *)
From Coq Require Import
Logic.Classical_Prop
Logic.ClassicalChoice
Logic.EqdepFacts
Logic.FunctionalExtensionality
.
(* Must be imported to use [ddestruction] *)
From Coq Require Export
Program.Equality
.
Set Implicit Arguments.
(* The following tactics may be used:
- [dependent destruction]
- [dependent induction] *)
Ltac ddestruction :=
repeat lazymatch goal with | H : existT _ _ _ = _ |- _ => dependent destruction H end.
(* Consequence of UIP; used by tactic [dependent destrcution] *)
Definition eq_rect_eq := Eqdep.Eq_rect_eq.eq_rect_eq.
Definition classic := Classical_Prop.classic.
Definition choice := ClassicalChoice.choice.
Definition functional_extensionality := @FunctionalExtensionality.functional_extensionality.
(* From Coq.Logic.ChoiceFacts *)
Definition GuardedFunctionalChoice_on {A B} :=
forall P : A -> Prop, forall R : A -> B -> Prop,
inhabited B ->
(forall x : A, P x -> exists y : B, R x y) ->
(exists f : A->B, forall x, P x -> R x (f x)).
Axiom guarded_choice : forall {A B}, @GuardedFunctionalChoice_on A B.
Inductive mwitness : Type :=
| Witness (P : Type) (_ : P)
| NoWitness.
Lemma classicT_inhabited : inhabited (forall (P : Type), P + (P -> False)).
Proof.
destruct (choice (fun (P : Type) (b : mwitness) =>
match b with @Witness Q _ => P = Q | NoWitness => P -> False end)) as [f H].
{ intros P; destruct (classic (inhabited P)) as [[x] | ];
[exists (Witness x) | exists NoWitness]; auto. }
constructor. intros P; specialize (H P); destruct (f P); [subst | ]; auto.
Qed.