11Require Import init.imports.
2+ Require Import Inductive .Predicates.
23
34Section Definitions.
45
@@ -108,7 +109,7 @@ End Properties.
108109
109110Section ClosureProperties.
110111
111- Lemma decidabledisj {X : UU} (p q : X → hProp) : (deptypeddecider p) → (deptypeddecider q) → (deptypeddecider (λ (x : X), (p x) ∨ (q x) )).
112+ Lemma decidabledisj {X : UU} (p q : X → hProp) : (deptypeddecider p) → (deptypeddecider q) → (deptypeddecider (preddisj p q )).
112113 Proof .
113114 intros decp decq x.
114115 induction (decp x).
@@ -125,7 +126,7 @@ Section ClosureProperties.
125126 * exact (sumofmaps b b0).
126127 Qed .
127128
128- Lemma decidableconj {X : UU} (p q : X → hProp) : (deptypeddecider p) → (deptypeddecider q) → (deptypeddecider (λ (x : X), (p x) ∧ (q x) )).
129+ Lemma decidableconj {X : UU} (p q : X → hProp) : (deptypeddecider p) → (deptypeddecider q) → (deptypeddecider (predconj p q )).
129130 Proof .
130131 intros decp decq x.
131132 induction (decp x), (decq x).
@@ -135,7 +136,7 @@ Section ClosureProperties.
135136 - right. intros [pp qq]. exact (b pp).
136137 Qed .
137138
138- Lemma decidableneg {X : UU} (p q : X → hProp) : (deptypeddecider p) → (deptypeddecider (λ (x : X), hneg (p x) )).
139+ Lemma decidableneg {X : UU} (p : X → hProp) : (deptypeddecider p) → (deptypeddecider (predneg p )).
139140 Proof .
140141 intros decp x.
141142 induction (decp x).
@@ -144,105 +145,3 @@ Section ClosureProperties.
144145 Qed .
145146
146147End ClosureProperties.
147-
148- Section EqualityDeciders.
149-
150- Definition iseqdecider (X : UU) (f : X → X → bool) : UU := ∏ (x1 x2 : X), x1 = x2 <-> f x1 x2 = true.
151-
152- Definition eqdecider (X : UU) := ∑ (f : X → X → bool), (iseqdecider X f).
153-
154- Definition make_eqdecider {X : UU} {f : X → X → bool} : (iseqdecider X f) → eqdecider (X) := (λ is : (iseqdecider X f), (f,, is)).
155-
156- Lemma eqdecidertodeptypedeqdecider (X : UU) : (eqdecider X) → (isdeceq X).
157- Proof .
158- intros [f is] x y.
159- destruct (is x y) as [impl1 impl2].
160- induction (f x y).
161- - left; apply impl2; apply idpath.
162- - right. intros eq. apply nopathsfalsetotrue. exact (impl1 eq).
163- Qed .
164-
165- Lemma deptypedeqdecidertoeqdecider (X : UU) : (isdeceq X) → (eqdecider X).
166- Proof .
167- intros is.
168- use tpair.
169- - intros x y.
170- induction (is x y).
171- + exact true.
172- + exact false.
173- - intros x y.
174- induction (is x y); simpl; split.
175- + exact (λ a : (x = y), (idpath true)).
176- + exact (λ b : (true = true), a).
177- + intros; apply fromempty; exact (b X0).
178- + intros; apply fromempty; exact (nopathsfalsetotrue X0).
179- Qed .
180-
181- Lemma eqdecidertoisapropeq (X : UU) (f : eqdecider X) : ∏ (x y : X) ,(isaprop (x = y)).
182- Proof .
183- intros x.
184- apply isaproppathsfromisolated.
185- intros y.
186- set (dec := eqdecidertodeptypedeqdecider X f).
187- apply (dec x).
188- Qed .
189-
190- Lemma isapropiseqdecider (X : UU) (f : X → X → bool) : (isaprop (iseqdecider X f)).
191- Proof .
192- apply isofhlevelsn.
193- intros is.
194- repeat (apply impred_isaprop + intros).
195- apply isapropdirprod; apply isapropimpl.
196- - induction (f t).
197- + apply isapropifcontr.
198- use iscontrloopsifisaset.
199- exact isasetbool.
200- + apply isapropifnegtrue.
201- exact nopathsfalsetotrue.
202- - apply eqdecidertoisapropeq.
203- use make_eqdecider.
204- + exact f.
205- + exact is.
206- Qed .
207-
208- Lemma pathseqdeciders (X : UU) (f g : X → X → bool) (isf : iseqdecider X f) (isg : iseqdecider X g) : f = g.
209- Proof .
210- apply funextsec; intros x.
211- apply funextsec; intros y.
212- destruct (isf x y) as [implf1 implf2].
213- destruct (isg x y) as [implg1 implg2].
214- induction (g x y).
215- - apply implf1; apply implg2.
216- apply idpath.
217- - induction (f x y).
218- + apply fromempty, nopathsfalsetotrue, implg1, implf2.
219- exact (idpath true).
220- + exact (idpath false).
221- Qed .
222-
223- Lemma isapropeqdecider (X : UU) : (isaprop (eqdecider X)).
224- Proof .
225- apply invproofirrelevance.
226- intros [f isf] [g isg].
227- induction (pathseqdeciders X f g isf isg).
228- assert (eq : isf = isg).
229- - apply proofirrelevance.
230- apply isapropiseqdecider.
231- - induction eq.
232- apply idpath.
233- Qed .
234-
235- Lemma weqisdeceqiseqdecider (X : UU) : (isdeceq X) ≃ (eqdecider X).
236- Proof .
237- use make_weq.
238- - exact (deptypedeqdecidertoeqdecider X).
239- - apply isweqimplimpl.
240- + exact (eqdecidertodeptypedeqdecider X).
241- + exact (isapropisdeceq X).
242- + exact (isapropeqdecider X).
243- Qed .
244- End EqualityDeciders.
245-
246- Section ChoiceFunction.
247-
248- End ChoiceFunction.
0 commit comments