forked from SSProve/ssprove
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAxioms.v
61 lines (51 loc) · 1.74 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
55
56
57
58
59
60
61
Set Warnings "-notation-overridden,-ambiguous-paths".
From mathcomp Require Import all_ssreflect all_algebra reals boolp.
Set Warnings "notation-overridden,ambiguous-paths".
Local Open Scope ring_scope.
(*
In this file we assume several axioms.
*)
Parameter (R:realType).
Parameter (absord : R -> R -> bool). (*sealed order on real numbers*)
Parameter (unlock_absord : absord = (fun x y : R => x <= y)). (*unseal with this*)
(* We can obtain proof_irrelevance from boolp in mathcomp: *)
Definition proof_irrelevance : forall (P:Prop) (p1 p2:P), p1 = p2 := Prop_irrelevance.
From Coq Require Export FunctionalExtensionality.
(* The following are not axioms per se, but come from boolp using axioms *)
Local Definition func (A B : Type) (R : A -> B -> Prop) :
(forall a : A, exists b : B, R a b) -> forall a : A, { b : B | R a b }.
intros H a.
specialize (H a).
apply constructive_indefinite_description in H.
destruct H as [b H].
exists b. assumption.
Qed.
Local Definition ext_func (A B : Type) (R : A -> B -> Prop) (H : forall a : A, { b : B | R a b }) :
A -> B.
intros a.
specialize (H a).
destruct H as [b H].
exact b.
Defined.
Local Theorem fchoice (A B : Type) (R : A -> B -> Prop) :
(forall a : A, exists b : B , R a b) -> exists (f : A -> B), forall a : A, R a (f a).
intros H.
remember (func A B R H) as F.
exists (ext_func A B R F).
unfold ext_func.
cbv; intuition.
remember (F a) as W.
destruct W.
assumption.
Qed.
Theorem schoice (A B : Type) (R : A -> B -> Prop) :
(forall a : A, exists b : B , R a b) -> { f : A -> B | forall a : A, R a (f a) }.
intros H.
remember (func A B R H) as F.
exists (ext_func A B R F).
unfold ext_func.
cbv; intuition.
remember (F a) as W.
destruct W.
assumption.
Qed.