~ubuntu-branches/ubuntu/hardy/coq-doc/hardy

« back to all changes in this revision

Viewing changes to library/Coq.Logic.Diaconescu.html

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2004-09-18 13:28:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040918132822-ees5mb8qmzd6a0fw
Tags: 8.0pl1.0-1
* Added the Coq faq, moved the tutorial to the root directory and added
  doc-base files for both, closes: #272204.
* Set dh_compat to level 4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html xmlns="http://www.w3.org/1999/xhtml">
 
2
<head>
 
3
<meta http-equiv="Content-Type" content="text/html; charset="><link rel="stylesheet" href="style.css" type="text/css"><title>Coq.Logic.Diaconescu</title>
 
4
</head>
 
5
 
 
6
<body>
 
7
 
 
8
<h1>Library Coq.Logic.Diaconescu</h1>
 
9
 
 
10
<code>
 
11
<code class="keyword">Section</code> PredExt_GuardRelChoice_imp_EM.<br/>
 
12
 
 
13
<br/>
 
14
<code class="keyword">Definition</code> <a name="PredicateExtensionality"></a>PredicateExtensionality :=<br/>
 
15
&nbsp;&nbsp;forall P Q:<a href="Coq.Init.Datatypes.html#bool">bool</a> -&gt; Prop, (forall b:<a href="Coq.Init.Datatypes.html#bool">bool</a>, P b &lt;-&gt; Q b) -&gt; P = Q.<br/>
 
16
 
 
17
<br/>
 
18
<code class="keyword">Require</code> <code class="keyword">Import</code> ClassicalFacts.<br/>
 
19
 
 
20
<br/>
 
21
<code class="keyword">Variable</code> pred_extensionality : <a href="Coq.Logic.Diaconescu.html#PredicateExtensionality">PredicateExtensionality</a>.<br/>
 
22
&nbsp;&nbsp;<br/>
 
23
<code class="keyword">Lemma</code> <a name="prop_ext"></a>prop_ext : forall A B:Prop, (A &lt;-&gt; B) -&gt; A = B.<br/>
 
24
<code class="keyword">Proof</code>.<br/>
 
25
&nbsp;&nbsp;intros A B H.<br/>
 
26
&nbsp;&nbsp;change ((fun _ =&gt; A) <a href="Coq.Init.Datatypes.html#true">true</a> = (fun _ =&gt; B) <a href="Coq.Init.Datatypes.html#true">true</a>) in |- *.<br/>
 
27
&nbsp;&nbsp;rewrite<br/>
 
28
&nbsp;&nbsp;&nbsp;pred_extensionality with (P:= fun _:<a href="Coq.Init.Datatypes.html#bool">bool</a> =&gt; A) (Q:= fun _:<a href="Coq.Init.Datatypes.html#bool">bool</a> =&gt; B).<br/>
 
29
&nbsp;&nbsp;&nbsp;&nbsp;reflexivity.<br/>
 
30
&nbsp;&nbsp;&nbsp;&nbsp;intros _; exact H.<br/>
 
31
<code class="keyword">Qed</code>.<br/>
 
32
 
 
33
<br/>
 
34
<code class="keyword">Lemma</code> <a name="proof_irrel"></a>proof_irrel : forall (A:Prop) (a1 a2:A), a1 = a2.<br/>
 
35
<code class="keyword">Proof</code>.<br/>
 
36
&nbsp;&nbsp;apply (<a href="Coq.Logic.ClassicalFacts.html#ext_prop_dep_proof_irrel_cic">ext_prop_dep_proof_irrel_cic</a> <a href="Coq.Logic.Diaconescu.html#prop_ext">prop_ext</a>).<br/>
 
37
<code class="keyword">Qed</code>.<br/>
 
38
 
 
39
<br/>
 
40
<code class="keyword">Require</code> <code class="keyword">Import</code> ChoiceFacts.<br/>
 
41
 
 
42
<br/>
 
43
<code class="keyword">Variable</code> rel_choice : <a href="Coq.Logic.ChoiceFacts.html#RelationalChoice">RelationalChoice</a>.<br/>
 
44
 
 
45
<br/>
 
46
<code class="keyword">Lemma</code> <a name="guarded_rel_choice"></a>guarded_rel_choice :<br/>
 
47
&nbsp;forall (A B:Type) (P:A -&gt; Prop) (R:A -&gt; B -&gt; Prop),<br/>
 
48
&nbsp;&nbsp;&nbsp;(forall x:A, P x -&gt;  exists y : B, R x y) -&gt;<br/>
 
49
&nbsp;&nbsp;&nbsp;&nbsp;exists R' : A -&gt; B -&gt; Prop,<br/>
 
50
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(forall x:A,<br/>
 
51
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P x -&gt;<br/>
 
52
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exists y : B, R x y /\ R' x y /\ (forall y':B, R' x y' -&gt; y = y')).<br/>
 
53
<code class="keyword">Proof</code>.<br/>
 
54
&nbsp;&nbsp;exact<br/>
 
55
&nbsp;&nbsp;&nbsp;(<a href="Coq.Logic.ChoiceFacts.html#rel_choice_and_proof_irrel_imp_guarded_rel_choice">rel_choice_and_proof_irrel_imp_guarded_rel_choice</a> rel_choice <a href="Coq.Logic.Diaconescu.html#proof_irrel">proof_irrel</a>).<br/>
 
56
<code class="keyword">Qed</code>.<br/>
 
57
 
 
58
<br/>
 
59
<code class="keyword">Require</code> <code class="keyword">Import</code> Bool.<br/>
 
60
 
 
61
<br/>
 
62
<code class="keyword">Lemma</code> <a name="AC"></a>AC :<br/>
 
63
&nbsp;&nbsp;exists R : (<a href="Coq.Init.Datatypes.html#bool">bool</a> -&gt; Prop) -&gt; <a href="Coq.Init.Datatypes.html#bool">bool</a> -&gt; Prop,<br/>
 
64
&nbsp;&nbsp;&nbsp;(forall P:<a href="Coq.Init.Datatypes.html#bool">bool</a> -&gt; Prop,<br/>
 
65
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(exists b : <a href="Coq.Init.Datatypes.html#bool">bool</a>, P b) -&gt;<br/>
 
66
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exists b : <a href="Coq.Init.Datatypes.html#bool">bool</a>, P b /\ R P b /\ (forall b':<a href="Coq.Init.Datatypes.html#bool">bool</a>, R P b' -&gt; b = b')).<br/>
 
67
<code class="keyword">Proof</code>.<br/>
 
68
&nbsp;&nbsp;apply <a href="Coq.Logic.Diaconescu.html#guarded_rel_choice">guarded_rel_choice</a> with<br/>
 
69
&nbsp;&nbsp;&nbsp;(P:= fun Q:<a href="Coq.Init.Datatypes.html#bool">bool</a> -&gt; Prop =&gt;  exists y : _, Q y)<br/>
 
70
&nbsp;&nbsp;&nbsp;(R:= fun (Q:<a href="Coq.Init.Datatypes.html#bool">bool</a> -&gt; Prop) (y:<a href="Coq.Init.Datatypes.html#bool">bool</a>) =&gt; Q y).<br/>
 
71
&nbsp;&nbsp;exact (fun _ H =&gt; H).<br/>
 
72
<code class="keyword">Qed</code>.<br/>
 
73
 
 
74
<br/>
 
75
<code class="keyword">Theorem</code> <a name="pred_ext_and_rel_choice_imp_EM"></a>pred_ext_and_rel_choice_imp_EM : forall P:Prop, P \/ ~ P.<br/>
 
76
<code class="keyword">Proof</code>.<br/>
 
77
intro P.<br/>
 
78
 
 
79
<br/>
 
80
destruct <a href="Coq.Logic.Diaconescu.html#AC">AC</a> as [R H].<br/>
 
81
 
 
82
<br/>
 
83
set (class_of_true:= fun b =&gt; b = <a href="Coq.Init.Datatypes.html#true">true</a> \/ P).<br/>
 
84
set (class_of_false:= fun b =&gt; b = <a href="Coq.Init.Datatypes.html#false">false</a> \/ P).<br/>
 
85
 
 
86
<br/>
 
87
destruct (H class_of_true) as [b0 [H0 [H0' H0'']]].<br/>
 
88
exists <a href="Coq.Init.Datatypes.html#true">true</a>; left; reflexivity.<br/>
 
89
destruct H0.<br/>
 
90
 
 
91
<br/>
 
92
destruct (H class_of_false) as [b1 [H1 [H1' H1'']]].<br/>
 
93
exists <a href="Coq.Init.Datatypes.html#false">false</a>; left; reflexivity.<br/>
 
94
destruct H1.<br/>
 
95
 
 
96
<br/>
 
97
right.<br/>
 
98
intro HP.<br/>
 
99
assert (Hequiv : forall b:<a href="Coq.Init.Datatypes.html#bool">bool</a>, class_of_true b &lt;-&gt; class_of_false b).<br/>
 
100
intro b; split.<br/>
 
101
unfold class_of_false in |- *; right; assumption.<br/>
 
102
unfold class_of_true in |- *; right; assumption.<br/>
 
103
assert (Heq : class_of_true = class_of_false).<br/>
 
104
apply pred_extensionality with (1 := Hequiv).<br/>
 
105
apply <a href="Coq.Bool.Bool.html#diff_true_false">diff_true_false</a>.<br/>
 
106
rewrite &lt;- H0.<br/>
 
107
rewrite &lt;- H1.<br/>
 
108
rewrite &lt;- H0''. reflexivity.<br/>
 
109
rewrite Heq.<br/>
 
110
assumption.<br/>
 
111
 
 
112
<br/>
 
113
left; assumption.<br/>
 
114
left; assumption.<br/>
 
115
 
 
116
<br/>
 
117
<code class="keyword">Qed</code>.<br/>
 
118
 
 
119
<br/>
 
120
<code class="keyword">End</code> PredExt_GuardRelChoice_imp_EM.<br/>
 
121
</code>
 
122
<hr/><a href="index.html">Index</a><hr/><font size="-1">This page has been generated by <a href="http://www.lri.fr/~filliatr/coqdoc/">coqdoc</a></font>
 
123
</body>
 
124
</html>
 
 
b'\\ No newline at end of file'