1 (******************************************************************************)
2 (* Zermelo Set Theory + atomic sets *)
4 (* Claudio Sacerdoti Coen *)
8 (* Zermolo Set Theory *)
12 (******************************************************************************)
14 (* This is an extension of Benjamin's encoding of usual Set Theory where I *)
15 (* assume the existence of exactly one atomic set for each object t of type T *)
16 (* where T is a Type in Coq: if (t:T) and (T:Type) then ((atom T t):Ens) *)
17 (* The usual axioms of set theory are modified so that they work in the *)
18 (* usual way if applied to "normal" sets, and in a reasonable way when *)
19 (* applied to atomic sets (for example (Union (atom T t) E) is equal to E for *)
20 (* each non-atomic set E) *)
21 (* All this has been already studied by Fraenkel and Mostowski in the '40, *)
22 (* but with totally different goals (in order to proove some independence *)
23 (* results in set theory) *)
25 (* This is the introduction to the original encoding of Benjamin: *)
26 (* This is an encoding of usual Set Theory, simillar to Peter Aczel's work *)
27 (* in the early 80's. The main difference is that the propositions here *)
28 (* live in the impredicative world of "Prop". Thus, priority is given to *)
29 (* expressivity against constructivity. *)
31 (* Since the definition of Sets is the same for both approaches, I added *)
32 (* most of Aczel's encoding of CZF at the end of the file. Many *)
33 (* definitions are common to both aproaches. *)
35 (* In this work only the encoding of ZFC (and not that of CZF) has been *)
36 (* developed, but it should be straightforward to do. *)
40 (******************************************************************************)
41 (* Useful data types *)
42 (******************************************************************************)
46 Inductive Set Un := void : Un.
48 (* Existential quantification *)
49 Inductive EXType [P:Type; Q:P->Prop]: Prop :=
50 EXTypei : (x:P)(Q x)->(EXType P Q).
52 (* Sigma types -- i.e. computational existentials *)
53 Inductive sig [A:Type;P:A->Prop] : Type :=
54 exist : (x:A)(P x)->(sig A P).
56 (* Existential on the Type level *)
57 Inductive depprod [A:Type; P : A->Type] : Type :=
58 dep_i : (x:A)(P x)->(depprod A P).
60 (* Cartesian product in Type *)
61 Inductive prod_t [A,B:Type] : Type :=
62 pair_t : A->B->(prod_t A B).
64 (******************************************************************************)
65 (* Definition of Ens, EQ, IN *)
66 (******************************************************************************)
68 (* The type representing sets (Ensemble = french for set) *)
69 Inductive Ens : Type :=
70 sup : (A:Type)(A->Ens)->Ens
71 | atom : (A:Type)A->Ens.
73 (* Recursive Definition of the extentional equality on sets *)
74 Definition EQ : Ens -> Ens -> Prop.
81 (EXType ? [y:B](eq1 x (g y))).
83 (EXType ? [x:A](eq1 x (g y))).
95 Exact (eq_depT Type [A:Type]A A a A0 y).
100 (* Membership on sets *)
101 Definition IN: Ens -> Ens -> Prop :=
104 (sup A f) => (EXType ? [y:A](EQ E1 (f y)))
105 | (atom A a) => False
110 (******************************************************************************)
112 (******************************************************************************)
114 Definition INC : Ens -> Ens -> Prop :=
117 (sup A f) (sup B g) => (E:Ens)(IN E E1)->(IN E E2)
118 | (sup A f) (atom B b) => False
119 | (atom A a) (sup B g) => False (* ??? or True? *)
120 | (atom A a) (atom B b) => (EQ E1 E2) (* ??? or False? *)
123 (* EQ is an equivalence relation *)
125 Theorem EQ_refl : (E:Ens)(EQ E E).
127 Intros; Split; Simpl; Intro.
128 Exists x; Exact (H x).
129 Exists y; Exact (H y).
130 Intros; Simpl; Constructor 1.
133 Theorem EQ_tran : (E1,E2,E3:Ens)(EQ E1 E2)->(EQ E2 E3)->(EQ E1 E3).
134 Induction E1; [Intros A1 f1 r1 | Intros A1 a1] ;
135 Induction E2; [Intros A2 f2 r2 | Intros A2 a2 | Intros A2 f2 r2 | Intros A2 a2];
136 Induction E3; [Intros A3 f3 r3 | Auto | Contradiction | Auto |
137 Auto | Contradiction | Auto | Intros A3 a3].
138 Simpl; Intros e1 e2; Split; Elim e1; Intros I1 I2; Elim e2; Intros I3 I4;
139 [ Intros a1; Elim (I1 a1) ; Intros a2 ; Elim (I3 a2) ; Intros a3 ; Exists a3 |
140 Intros a3; Elim (I4 a3) ; Intros a2 ; Elim (I2 a2) ; Intros a1 ; Exists a1 ];
141 Apply r1 with (f2 a2); Assumption.
143 Simpl ; Intros; Inversion H; Inversion H0; Assumption.
146 Theorem EQ_sym : (E1,E2:Ens)(EQ E1 E2)->(EQ E2 E1).
147 Induction E1 ; [ Intros A1 f1 r1 | Intros A1 a1 ];
148 Induction E2 ; [Intros A2 f2 r2 | Contradiction | Contradiction |Intros A2 a2].
150 Induction 1; Intros e1 e2; Split;
151 [ Intros a2; Elim (e2 a2); Intros a1 H1; Exists a1 |
152 Intros a1; Elim (e1 a1); Intros a2 H2; Exists a2 ] ; Apply r1; Assumption.
153 Destruct 1; Apply EQ_refl.
156 Theorem EQ_INC : (E,E':Ens)(EQ E E')->(INC E E').
157 Induction E ; [Intros A f r | Intros A a] ; Induction E' ;
158 [Intros A' f' r' | Contradiction | Contradiction | Intros A' a'].
159 Simpl; Destruct 1; Intros e1 e2.
160 Intros C; Induction 1; Intros a ea; Elim (e1 a); Intros a' ea'; Exists a'.
161 Apply EQ_tran with (f a); Assumption.
162 Destruct 1; Hnf; Constructor 1.
165 Hints Resolve EQ_sym EQ_refl EQ_INC : zfc.
167 Theorem INC_EQ : (E,E':Ens)(INC E E')->(INC E' E)->(EQ E E').
168 Induction E ; [Intros A f r | Intros A a] ; Induction E' ;
169 [Intros A' f' r' | Auto | Auto | Auto].
170 Unfold INC; Simpl; Intros I1 I2; Split.
171 Intros a; Apply I1; Exists a; Apply EQ_refl.
172 Intros a'; Cut (EXType A [x:A](EQ (f' a')(f x))).
173 Induction 1; Intros a ea; Exists a; Apply EQ_sym; Exact ea.
174 Apply I2; Exists a'; Apply EQ_refl.
177 Hints Resolve INC_EQ : zfc.
179 (* Membership is extentional (i.e. is stable w.r.t. EQ) *)
181 Theorem IN_sound_left :
183 (EQ E E')->(IN E E'')->(IN E' E'').
184 Induction E''; [Intros A'' f'' r'' e | Intros A'' a'' e]; Simpl.
185 Induction 1; Intros a'' p; Exists a''; Apply EQ_tran with E;
186 [Apply EQ_sym; Assumption | Assumption].
191 Theorem IN_sound_right :
193 (EQ E' E'')->(IN E E')->(IN E E'').
194 Induction E'; [Intros A' f' r' | Intros A' a']; Induction E'';
195 [Intros A'' f'' r'' | Intros A'' a'' | Intros A'' f'' r'' | Intros A'' a''];
197 Induction 1; Intros e1 e2; Induction 1; Intros a' e'; Elim (e1 a');
198 Intros a'' e''; Exists a''; Apply EQ_tran with (f' a'); Assumption.
204 (* Inclusion is reflexive, transitive, extentional *)
206 Theorem INC_refl : (E:Ens)(INC E E).
207 Induction E; Auto with zfc.
210 Theorem INC_tran : (E,E',E'':Ens)(INC E E')->(INC E' E'')->(INC E E'').
211 Induction E; Induction E'; Induction E''; Simpl;
212 Auto Orelse Contradiction Orelse (Intros; Elim H0; Assumption).
215 Theorem INC_sound_left :
217 (EQ E E')->(INC E E'')->(INC E' E'').
218 Induction E; [Intros A f r | Intros A a]; Induction E';
219 [Intros A' f' r' | Intros A' a' | Intros A' f' r' | Intros A' a'];
220 Induction E''; [Intros A'' f'' r'' | Contradiction | Contradiction |
221 Contradiction | Contradiction | Contradiction | Contradiction |
223 Unfold INC; Intros; Apply H0; Apply IN_sound_right with (sup A' f');
228 Theorem INC_sound_right :
230 (EQ E' E'')->(INC E E')->(INC E E'').
231 Induction E; [Intros A f r | Intros A a]; Induction E';
232 [Intros A' f' r' | Intros A' a' | Intros A' f' r' | Intros A' a'];
233 Induction E''; [Intros A'' f'' r'' | Contradiction | Contradiction |
234 Contradiction | Contradiction | Contradiction | Contradiction |
236 Unfold INC; Intros; Apply IN_sound_right with (sup A' f');
237 [Assumption | Apply H0; Assumption].
241 (******************************************************************************)
243 (******************************************************************************)
245 (* The empty set (vide = french for empty) *)
246 Definition Vide : Ens :=
247 (sup F [f:F]<Ens>Cases f of end).
249 Theorem Vide_est_vide : (E:Ens)(IN E Vide)->F.
250 Unfold Vide; Simpl; Intros E H; Cut False.
252 Elim H; Intros x; Elim x.
255 (* CSC: This is different from Werner *)
256 Theorem tout_vide_est_Vide :
257 (A:Type)(f:A->Ens)((E':Ens)(IN E' (sup A f))->F)->(EQ (sup A f) Vide).
261 Apply H with (f x); Unfold IN; Exists x; Apply EQ_refl.
265 (******************************************************************************)
267 (******************************************************************************)
269 Definition Paire : Ens -> Ens -> Ens :=
270 [E1,E2:Ens] (sup bool [b:bool]Cases b of true => E1 | false => E2 end).
272 (* The pair construction is extentional *)
274 Theorem Paire_sound_left : (A,A',B:Ens)
275 (EQ A A')->(EQ (Paire A B)(Paire A' B)).
280 (Exists true; Auto with zfc).
282 (Exists false; Auto with zfc).
284 (Induction y; Simpl).
285 (Exists true; Auto with zfc).
287 (Exists false; Auto with zfc).
290 Theorem Paire_sound_right : (A,B,B':Ens)
291 (EQ B B')->(EQ (Paire A B)(Paire A B')).
292 Unfold Paire; Simpl; Intros; Split.
294 (Exists true; Auto with zfc).
295 Exists false; Auto with zfc.
297 (Exists true; Auto with zfc).
298 Exists false; Auto with zfc.
301 Hints Resolve Paire_sound_right Paire_sound_left : zfc.
303 Theorem IN_Paire_left : (E,E':Ens)(IN E (Paire E E')).
304 Unfold Paire; Exists true; Apply EQ_refl.
307 Theorem IN_Paire_right : (E,E':Ens)(IN E' (Paire E E')).
308 Unfold Paire; Exists false; Apply EQ_refl.
311 Theorem Paire_IN : (E,E',A:Ens)(IN A (Paire E E'))->(EQ A E)\/(EQ A E').
313 Induction 1; Intros b; Elim b; Auto with zfc.
316 Hints Resolve IN_Paire_left IN_Paire_right Vide_est_vide : zfc.
318 (******************************************************************************)
320 (******************************************************************************)
322 (* CSC: This is different from Benjamin only because I like it more; *)
323 (* theorems are also simpler *)
324 (* In Benjamin's encoding (Sing E) was defined as (Paire E E) *)
325 Definition Sing : Ens -> Ens :=
326 [E:Ens] (sup Un [x:Un]Cases x of void => E end).
328 Theorem IN_Sing : (E:Ens)(IN E (Sing E)).
329 Simpl; Exists void; Apply EQ_refl.
332 Theorem IN_Sing_EQ : (E,E':Ens)(IN E (Sing E'))->(EQ E E').
333 Simpl; Intros; Elim H; Destruct x; Trivial.
336 Hints Resolve IN_Sing IN_Sing_EQ : zfc.
338 Theorem Sing_sound : (A,A':Ens)(EQ A A')->(EQ (Sing A)(Sing A')).
339 Intros; Hnf; Split; [Destruct x | Destruct y]; Exists void; Assumption.
342 Hints Resolve Sing_sound : zfc.
344 Theorem EQ_Sing_EQ : (E1,E2:Ens)(EQ (Sing E1)(Sing E2))->(EQ E1 E2).
345 Intros; Hnf in H; Elim H; Intros; Elim (H0 void); Destruct x; Trivial.
348 Hints Resolve EQ_Sing_EQ : zfc.
350 (******************************************************************************)
351 (* COMPREHENSION (OR SEPARATION) *)
352 (******************************************************************************)
354 Definition Comp: Ens -> (Ens -> Prop) -> Ens.
357 Apply (sup {x:A|(P (f x))}).
358 Induction 1; Intros x p; Exact (f x).
364 Theorem Comp_INC : (E:Ens)(P:Ens->Prop)(INC (Comp E P) E).
366 Intros A f P; Simpl; Destruct E0; [Intros A' f' H | Intros A' a' H];
367 Elim H; Destruct x; Intros x0 p eq; Exists x0; Exact eq.
373 (P:Ens->Prop)((w1,w2:Ens)(P w1)->(EQ w1 w2)->(P w2))->
374 (IN A (Comp E P))->(P A).
376 Simpl; Intros B f Hr A P H i; Elim i; Destruct x; Simpl; Intro b; Intros;
377 Apply H with (f b); Auto with zfc.
383 (P:Ens ->Prop)((w1,w2:Ens)(P w1)->(EQ w1 w2)->(P w2))->
384 (IN A E)->(P A)->(IN A (Comp E P)).
386 Simpl; Intros B f HR A P H i; Elim i; Simpl; Intros; Cut (P (f x)).
388 Exists (exist B [x:B](P (f x)) x Pf); Simpl; Auto with zfc.
389 Apply H with A; Auto with zfc.
393 (* Again, extentionality is not stated, but easy *)
395 (******************************************************************************)
397 (******************************************************************************)
399 (* Projections of a set: *)
400 (* 1: its base type, F for atoms *)
402 Definition pi1: Ens -> Type.
412 (* 2: the function, [_:F]Vide for atoms *)
414 Definition pi2 : (E:Ens)(pi1 E)->Ens.
424 Definition Union : (E:Ens)Ens.
427 Apply (sup (depprod A [x:A](pi1 (f x)))).
428 Induction 1; Intros a b.
436 Theorem EQ_EXType : (E,E':Ens)
439 (EXType (pi1 E') [b:(pi1 E')](EQ (pi2 E a) (pi2 E' b))).
440 Induction E; [Intros A f r | Intros A a]; Induction E';
441 [Intros A' f' r' | Intros A' a' | Intros A' f' r' | Intros A' a'].
442 Simpl; Destruct 1; Intros e1 e2 a; Apply e1.
448 Transparent EQ_EXType.
450 Theorem IN_EXType: (E,E':Ens)(IN E' E)->
451 (EXType (pi1 E) [a:(pi1 E)](EQ E' (pi2 E a))).
453 Simpl; Intros A f r; Induction 1; Intros; Exists x; Assumption.
457 Theorem IN_Union : (E,E',E'':Ens)
458 (IN E' E)->(IN E'' E')->(IN E'' (Union E)).
463 Elim (IN_EXType (sup A f) E' H).
465 Cut (EQ (pi2 (sup A f) x) E').
466 2: Auto with zfc v62.
468 Cut (IN E'' (pi2 (sup A f) x)).
470 Elim (IN_EXType ? ? i1).
473 Exists (dep_i A [x:A](pi1 (f x)) x x0).
476 Apply IN_sound_right with E'; Assumption.
479 (* CSC: This is different from Benjamin *)
480 Theorem IN_INC_Union :
481 (A:Type)(f:A->Ens)(E:Ens)(IN (sup A f) E)->(INC (sup A f) (Union E)).
483 Intros A f r H; Hnf; Hnf in H; Intros; Elim H; Intros x e.
485 Intro in_E0_f0x; Apply IN_Union with (f0 x).
486 Hnf; Split with x; Auto with zfc.
489 Apply IN_sound_right with (sup A f); Trivial.
491 (Simpl; Destruct 2; Destruct x).
494 Theorem Union_IN : (E,E':Ens)(IN E' (Union E))->
495 (EXType ? [E1:Ens](IN E1 E)/\(IN E' E1)).
497 2: (Simpl; Destruct 2; Destruct x).
498 Unfold Union ; Simpl; Intros A f r.
505 (Exists a; Auto with zfc v62).
507 (Apply IN_sound_left with (pi2 (f a) b); Auto with zfc v62).
509 (Generalize b ; Elim (f a); Simpl).
511 (Exists b0; Auto with zfc v62).
516 (* extentionality of union *)
519 : (E,E':Ens)(EQ E E')->(EQ (Union E) (Union E')).
521 Induction E ; [Intros A f r | Intros A a] ; Induction E' ;
522 [Intros A' f' r' | Intros A' a' | Intros A' f' r' | Intros A' a'].
524 Simpl; Induction 1; Intros e1 e2; Split.
525 Intros x; Elim x; Intros a aa; Elim (e1 a); Intros a' ea.
526 Elim (EQ_EXType (f a)(f' a') ea aa); Intros aa' eaa.
527 Exists (dep_i A' [x:A'](pi1 (f' x)) a' aa'); Simpl; Auto with zfc v62.
528 Intros c'; Elim c'; Intros a' aa'; Elim (e2 a'); Intros a ea.
529 Cut (EQ (f' a')(f a)).
530 2 : Auto with zfc v62.
531 Intros ea'; Elim (EQ_EXType (f' a')(f a) ea' aa'); Intros aa eaa.
532 Exists (dep_i A [x:A](pi1 (f x)) a aa); Auto with zfc v62.
536 Destruct 1; Apply EQ_refl.
539 (* The union construction is monotone w.r.t. inclusion *)
541 Theorem Union_mon : (E,E':Ens)(INC E E')->(INC (Union E)(Union E')).
542 Induction E ; [Intros A f r | Intros A a] ; Induction E';
543 [Intros A' f' r' | Contradiction | Contradiction | Intros A' a'].
545 Intro; Cut (E:Ens)(IN E (sup A f))->(IN E (sup A' f')).
547 Intro XXX; Cut ((E:Ens)(IN E (Union (sup A f)))->(IN E (Union (sup A' f'))))
548 ->(INC (Union (sup A f)) (Union (sup A' f'))).
550 Intros X; Apply X; Intros E0 Y; (Elim (Union_IN (sup A f) E0); Auto with zfc).
551 Destruct 1; Intros; Cut (IN x (sup A' f')).
553 Intro; (Apply IN_Union with x; Auto).
556 (******************************************************************************)
558 (******************************************************************************)
560 Definition Inter : (E:Ens)Ens :=
566 [a:A](depprod ? [b:(pi1 (f a))](x:A)(IN (pi2 (f a) b)(f x)))
570 (dep_i a (dep_i b p)) => (pi2 (f a) b)
576 Theorem IN_Inter_all : (E,E':Ens)
578 (E'':Ens)(IN E'' E)->(IN E' E'').
579 Induction E; [Intros A f r | Contradiction]; Intros E'.
580 Induction 1; Intros c; Elim c; Intros a ca; Elim ca; Intros aa paa.
582 Elim e''; Intros a1 ea1.
583 Apply IN_sound_right with (f a1); Auto with zfc v62.
584 Apply IN_sound_left with (pi2 (f a) aa); Auto with zfc v62.
587 Theorem all_IN_Inter : (E,E',E'':Ens)
589 ((E'':Ens)(IN E'' E)->(IN E' E''))->
591 (Induction E; [Intros A f r | Contradiction]).
593 Elim (IN_EXType (sup A f) E'' i).
594 (Intros a e; Simpl in a).
596 (Cut (IN E' E''); Auto with zfc v62).
598 (Cut (IN E' (f a)); Auto with zfc v62).
600 Elim (IN_EXType (f a) E' i0).
603 Cut (x:A)(IN (pi2 (f a) b) (f x)).
608 [b:(pi1 (f a))](x:A)(IN (pi2 (f a) b) (f x)))
611 [b:(pi1 (f a))](x:A)(IN (pi2 (f a) b) (f x)) b H0)).
616 Apply IN_sound_left with E'.
621 (Exists x; Auto with zfc v62).
622 (Apply IN_sound_right with E''; Auto with zfc v62).
625 (******************************************************************************)
627 (******************************************************************************)
629 Definition Power : Ens -> Ens :=
636 [c:(depprod A [a:A](P a))]
642 | (atom A a) => (Sing (atom A a)) (* ??? or Vide? *)
645 Theorem IN_Power_INC : (E,E':Ens)(IN E' (Power E))->(INC E' E).
647 Intros A f r; Unfold INC ; Simpl.
648 Intros E'; Induction 1; Intros P.
652 Induction 1; Intros HA HB.
653 Intros E''; Induction 1; Intros a' e.
655 Induction x; Intros a p.
657 Apply EQ_tran with (f' a'); Auto with zfc v62.
662 (* CSC: This is different from Benjamin *)
663 Theorem INC_IN_Power : (E,E':Ens)(INC E' E)->(IN E' (Power E)).
667 2: (Destruct 1; Unfold Power; Auto with zfc).
668 Intros A f r; Unfold INC; Simpl; Induction E'.
671 Exists [a:A](IN (f a) (sup A' f')).
677 (Cut (EQ (f a) (f' x)); Auto with zfc v62).
679 Exists (dep_i A [a:A](EXType A' [y:A'](EQ (f a) (f' y))) a
680 (EXTypei A' [y:A'](EQ (f a) (f' y)) x e1)).
683 (Exists x; Auto with zfc v62).
684 Induction y; Induction 1; Intros.
685 (Exists x0; Auto with zfc v62).
688 Theorem Power_mon : (E,E':Ens)(INC E E')->(INC (Power E)(Power E')).
689 Induction E; [Intros A f r | Intros A a]; Induction E';
690 [Intros A' f' r' | Contradiction | Contradiction | Destruct 1; Auto with zfc].
693 Cut ((E:Ens)(IN E (Power (sup A f)))->(IN E (Power (sup A' f'))))
694 ->(INC (Power (sup A f)) (Power (sup A' f'))).
699 Cut (INC E0 (sup A f)).
700 2: (Apply IN_Power_INC; Auto).
702 Cut (INC E0 (sup A' f')).
715 Theorem Power_sound : (E,E':Ens)(EQ E E')->(EQ (Power E)(Power E')).
716 Induction E; [Intros A f r | Intros A a]; Induction E';
717 [Intros A' f' r' | Contradiction | Contradiction | Destruct 1; Auto with zfc].
720 Cut ((E:Ens)(IN E (Power (sup A f)))->(IN E (Power (sup A' f'))))
721 ->(INC (Power (sup A f)) (Power (sup A' f'))).
723 Intros; Apply H0; Clear H0; Intros; Cut (INC E0 (sup A f)).
724 2: (Apply IN_Power_INC; Auto with zfc).
725 Clear H0; Intro; Apply INC_IN_Power.
726 (Apply INC_sound_right with (sup A f); Auto).
729 Cut ((E:Ens)(IN E (Power (sup A' f')))->(IN E (Power (sup A f))))
730 ->(INC (Power (sup A' f')) (Power (sup A f))).
732 Intros; Apply H0; Clear H0; Intros; Cut (INC E0 (sup A' f')).
733 2: (Apply IN_Power_INC; Auto with zfc).
734 Clear H0; Intro; Apply INC_IN_Power.
735 (Apply INC_sound_right with (sup A' f'); Auto with zfc).
738 (******************************************************************************)
739 (* ORDERED COUPLES *)
740 (******************************************************************************)
744 Theorem not_EQ_Sing_Vide : (E:Ens)(EQ (Sing E) Vide)->F.
745 Intros E e; Cut False.
748 Simpl; Induction 1; Intros xx; Elim xx; Induction 1.
749 Apply IN_sound_right with (Sing E); Auto with zfc v62.
752 Theorem not_EQ_Vide_Sing : (E:Ens)(EQ Vide (Sing E))->F.
753 Intros E e; Cut False.
756 Simpl; Induction 1; Intros xx; Elim xx; Induction 1.
757 Apply IN_sound_right with (Sing E); Auto with zfc v62.
760 (* This definition of the ordered pair is slightly different from *)
761 (* the usual one, since we want it to work in an intuisionistic *)
762 (* setting. Works the same, neitherless. The soundness proofs are *)
765 Definition Couple := [E,E': Ens](Paire (Sing E) (Paire Vide (Sing E'))).
767 Theorem Couple_inj_left : (A,A',B,B':Ens)
768 (EQ (Couple A A')(Couple B B'))->(EQ A B).
769 (Unfold Couple; Simpl); Induction 1; (Intros HA HB; Elim (HA true)).
770 (Intros x; Elim x; Simpl; Induction 1; Intros H3 H4; Elim (H3 void);
774 Elim (H4 false); Destruct x1; Intros; Cut (EQ (Sing B') Vide).
775 Simpl; Induction 1; Intros yy; Elim (yy void); Destruct x2.
777 Apply EQ_tran with A.
782 Intros; Cut (EQ (Sing B') Vide).
783 Simpl; Induction 1; Intros yy; Elim (yy void); Destruct x1.
785 Apply EQ_tran with A.
788 Elim (H4 true); Destruct x1; Trivial.
791 Theorem Couple_inj_right : (A,A',B,B':Ens)
792 (EQ (Couple A A')(Couple B B'))->(EQ A' B').
793 Unfold Couple; Simpl.
794 Induction 1; Intros H1 H2.
796 Intros bb1; Elim bb1.
798 Change (EQ (Paire Vide (Sing A'))(Sing B)) in HF.
801 Apply (not_EQ_Vide_Sing A').
802 Apply EQ_tran with B.
803 Apply IN_Sing_EQ; Apply IN_sound_right with (Paire Vide (Sing A'));
805 Apply EQ_sym; Apply IN_Sing_EQ;
806 Apply IN_sound_right with (Paire Vide (Sing A')); Auto with zfc v62.
807 Change (EQ (Paire Vide (Sing A'))(Paire Vide (Sing B')))->(EQ A' B').
808 Intros HP; Cut (EQ (Sing A') (Sing B')).
809 Intros; Auto with zfc v62.
810 Cut (IN (Sing A')(Paire Vide (Sing B'))).
811 Intros HI; Elim (Paire_IN Vide (Sing B')(Sing A') HI).
814 Apply not_EQ_Sing_Vide with A'; Assumption.
815 Trivial with zfc v62.
816 Apply IN_sound_right with (Paire Vide (Sing A')); Auto with zfc v62.
819 (******************************************************************************)
821 (******************************************************************************)
823 (* Here we cheat. It is easier to define the cartesian product using *)
824 (* the type theoretical product, i.e. we here use non set-theoretical *)
825 (* constructions. We could however use the usual definitions. *)
827 Definition Prod : Ens -> Ens -> Ens :=
830 (sup A f) (sup A' f') =>
834 (pair_t a a') => (Couple (f a) (f' a'))
840 Hints Resolve Paire_sound_left Paire_sound_right : zfc.
842 Theorem Couple_sound_left :
843 (A,A',B:Ens)(EQ A A')->(EQ (Couple A B)(Couple A' B)).
844 Unfold Couple;Intros; Auto with zfc v62.
847 Theorem Couple_sound_right:
848 (A,B,B':Ens)(EQ B B')->(EQ (Couple A B)(Couple A B')).
849 Unfold Couple;Intros; Auto with zfc v62.
852 Theorem Couple_IN_Prod : (E1,E2,E1',E2':Ens)
853 (IN E1' E1)->(IN E2' E2)->
854 (IN (Couple E1' E2')(Prod E1 E2)).
855 Induction E1; [Intros A1 f1 r1 | Contradiction].
856 Induction E2; [Intros A2 f2 r2 | Contradiction].
857 Intros E1' E2' i1 i2.
858 Elim (IN_EXType (sup A1 f1) E1').
859 (Intros x e1; Simpl in x).
860 Elim (IN_EXType (sup A2 f2) E2').
861 (Intros x0 e2; Simpl in x).
862 Apply IN_sound_left with (Couple (pi2 (sup A1 f1) x) (pi2 (sup A2 f2) x0)).
863 Apply EQ_tran with (Couple (pi2 (sup A1 f1) x) E2').
864 Apply Couple_sound_right.
867 (Apply Couple_sound_left; Auto with zfc v62).
870 Exists (pair_t ? ? x x0).
875 Exists true; Auto with zfc.
876 Exists false; Auto with zfc.
879 Exists true; Auto with zfc.
880 Exists false; Auto with zfc.
885 Theorem Couple_Prod_IN : (E1,E2,E1',E2':Ens)
886 (IN (Couple E1' E2')(Prod E1 E2))->
887 (IN E1' E1)/\(IN E2' E2).
888 Induction E1; [Intros A1 f1 r1 | Destruct 1; Destruct x].
889 Induction E2; [Intros A2 f2 r2 | Destruct 1; Destruct x].
891 Elim (IN_EXType (Prod (sup A1 f1) (sup A2 f2)) (Couple E1' E2') i).
892 Destruct x; Intros a1 a2 e.
893 Change (EQ (Couple E1' E2') (Couple (f1 a1) (f2 a2))) in e.
894 Cut (EQ E1' (f1 a1)).
895 Cut (EQ E2' (f2 a2)).
898 Apply IN_sound_left with (f1 a1); Auto with zfc v62; Simpl; Exists a1;
900 Apply IN_sound_left with (f2 a2); Auto with zfc v62; Simpl; Exists a2;
902 Apply Couple_inj_right with A:=E1' B:=(f1 a1); Auto with zfc v62.
903 Apply Couple_inj_left with E2' (f2 a2); Auto with zfc v62.
906 Theorem IN_Prod_EXType : (E,E',E'':Ens)(IN E'' (Prod E E'))->
907 (EXType ? [A:Ens](EXType ? [B:Ens](EQ (Couple A B) E''))).
908 Induction E ; [Intros A f r | Destruct 1; Destruct x].
909 Induction E'; [Intros A' f' r' | Destruct 1; Destruct x].
910 Intros; Elim (IN_EXType (Prod (sup A f) (sup A' f')) E'').
912 Intros; Exists (f y); Exists (f' y0); Auto with zfc v62.
916 (******************************************************************************)
918 (******************************************************************************)
920 Definition Succ := [E:Ens](Union (Paire E (Sing E))).
922 Inductive Ord : Ens -> Prop :=
924 | So : (E:Ens)(Ord E)->(Ord (Succ E))
925 | Lo : (E:Ens)((e:Ens)(IN e E)->(Ord e))->(Ord (Union E))
926 | Eo : (E,E':Ens)(Ord E)->(EQ E E')->(Ord E').
928 Hints Resolve Oo So Lo : zfc.
930 Definition Nat : nat ->Ens.
938 Theorem Nat_Ord : (n:nat)(Ord (Nat n)).
939 Induction n; Simpl; Auto with zfc v62.
942 Definition Omega : Ens :=
945 Theorem IN_Succ : (E:Ens)(IN E (Succ E)).
946 Intros E; Unfold Succ; Apply IN_Union with (Sing E); Auto with zfc v62.
949 (* CSC: This is different from Werner *)
950 Theorem INC_Succ : (A:Type)(f:A->Ens)(INC (sup A f) (Succ (sup A f))).
951 Intros; Cut ((E:Ens)(IN E (sup A f))->(IN E (Succ (sup A f))))
952 ->(INC (sup A f) (Succ (sup A f))).
953 Intros; Apply H; Unfold Succ; Intros.
954 Apply IN_Union with (sup A f); Auto with zfc.
959 Hints Resolve IN_Succ INC_Succ : zfc.
961 Theorem IN_Succ_or : (E,E':Ens)(IN E' (Succ E))->(EQ E E')\/(IN E' E).
964 Elim (Union_IN (Paire E (Sing E)) E' i).
965 Intros E1; Induction 1; Intros i1 i2.
966 Elim (Paire_IN E (Sing E) E1 i1).
967 Intros; Right; Apply IN_sound_right with E1; Auto with zfc v62.
968 Intros; Left; Cut (IN E' (Sing E)).
970 Apply IN_sound_right with E1; Auto with zfc v62.
973 Theorem E_not_IN_E : (E:Ens)(IN E E)->F.
978 Elim (IN_EXType (sup A f) (sup A f) i); Intros a e.
981 Change (EQ (sup A f) (f a)) in e.
983 Apply IN_sound_right with (sup A f); Auto with zfc v62.
984 Exists a; Auto with zfc v62.
985 Intros; Cut False; Contradiction.
988 Theorem Nat_IN_Omega : (n:nat)(IN (Nat n) Omega).
989 Intros; Simpl; Exists n; Auto with zfc v62.
991 Hints Resolve Nat_IN_Omega : zfc.
993 Theorem IN_Omega_EXType : (E:Ens)(IN E Omega)->(EXType ? [n:nat](EQ (Nat n) E)).
994 (Simpl; Induction 1).
996 (Exists n; Auto with zfc v62).
999 Theorem IN_Nat_EXType : (n:nat)(E:Ens)(IN E (Nat n))->(EXType ? [p:nat](EQ E (Nat p))).
1006 Change (IN E (Succ (Nat n0))) in H0.
1007 Elim (IN_Succ_or (Nat n0) E H0).
1008 (Intros; Exists n0).
1012 (Elim (H E); Auto with zfc v62).
1015 Theorem Omega_EQ_Union : (EQ Omega (Union Omega)).
1017 Cut ((E:Ens)(IN E Omega)->(IN E (Union Omega)))
1018 ->(INC Omega (Union Omega)).
1022 Elim (IN_Omega_EXType E H).
1024 Apply IN_Union with (Nat (S n)).
1027 Apply IN_sound_left with (Nat n).
1030 (Change (IN (Nat n) (Succ (Nat n))); Auto with zfc v62).
1035 Cut ((E:Ens)(IN E (Union Omega))->(IN E Omega))
1036 ->(INC (Union Omega) Omega).
1037 Intros; Apply H; Clear H.
1039 Elim (Union_IN Omega E H).
1043 Elim (IN_Omega_EXType e i1).
1047 (Elim (IN_Nat_EXType n E H0); Intros).
1048 (Apply IN_sound_left with (Nat x); Auto with zfc v62).
1050 (Apply IN_sound_right with e; Auto with zfc v62).
1056 Theorem Omega_Ord : (Ord Omega).
1057 Apply Eo with (Union Omega).
1060 Elim (IN_Omega_EXType e H).
1062 Apply Eo with (Nat n); Auto with zfc v62.
1067 Change (Ord (Succ (Nat n0))); Auto with zfc v62.
1068 Apply EQ_sym; Auto with zfc v62.
1069 Apply Omega_EQ_Union.
1072 Definition Alpha : Ens->Ens.
1078 Exact (Power (r a)).
1079 Intros A a; Exact (atom A a). (* ??? or Vide? *)
1084 (******************************************************************************)
1085 (* AXIOM OF CHOICE *)
1086 (******************************************************************************)
1088 (* A Type-theoretical axiom of choice gives us the collection axiom *)
1090 Definition collection :=
1092 ((x,x',y:Ens)(EQ x x')->(P x y)->(P x' y))->
1093 ((E:Ens)(EXType ? (P E)))->
1094 (E:Ens)(EXType ? [A:Ens](x:Ens)(IN x E)->
1095 (EXType ? [y:Ens](IN y A)/\(P x y))).
1098 Definition choice :=
1099 (A,B:Type)(P:A->B->Prop)
1100 ((a:A)(EXType ? [b:B](P a b)))->
1101 (EXType ? [f:A->B]((a:A)(P a (f a)))).
1103 Theorem Choice_Collection : choice -> collection.
1104 Intro; Unfold collection; Intros P comp G E;
1105 Cut (EXType ? [f:(Ens->Ens)](B:Ens)(P B (f B))).
1106 Induction 1; Intros f Pf; Elim E.
1107 Intros A g hr; Split with (sup A [a:A](f (g a))).
1108 Simpl; Intros X i; Elim i; Intros a ea; Split with (f (g a)).
1110 Exists a; Auto with zfc.
1112 Apply comp with (g a); Auto with zfc.
1116 Intros; Split with Vide; Contradiction.
1118 Unfold choice in H; Apply H; Intros; Elim (G a); Intros b hb; Exists b;
1122 (* If we also assume the excluded middle, we can derive *)
1123 (* the usual replacement schemata. *)
1125 Definition functional :=
1126 [P:Ens->Ens->Prop](x,y,y':Ens)
1127 (P x y)->(P x y')->(EQ y y').
1128 Definition replacement :=
1131 ((x,y,y':Ens)(EQ y y')->(P x y)->(P x y'))->
1132 ((x,x',y:Ens)(EQ x x')->(P x y)->(P x' y))->
1133 (X:Ens)(EXType ? [Y:Ens](y:Ens)
1134 (((IN y Y)->(EXType ? [x:Ens](IN x X)/\(P x y)))
1135 /\((EXType ? [x:Ens](IN x X)/\(P x y))->(IN y Y)))).
1137 Theorem classical_Collection_Replacement :
1138 ((S:Prop)S\/(S->False))->
1141 Unfold replacement; Intros EM Collection P fp comp_r comp_l X.
1142 Cut (EXType ? [Y:Ens](y:Ens)((EXType ? [x:Ens](IN x X)/\(P x y))->(IN y Y))).
1143 Induction 1; Intros Y HY.
1144 Exists (Comp Y [y:Ens](EXType ? [x:Ens](IN x X)/\(P x y))).
1147 Apply (IN_Comp_P Y y [y0:Ens](EXType Ens [x:Ens](IN x X)/\(P x y0))); Auto with zfc v62.
1148 Intros w1 w2; Induction 1; Intros x; Induction 1; Intros Ix Px e.
1149 Exists x; Split; Auto with zfc v62.
1150 Apply comp_r with w1; Auto with zfc v62.
1154 Intros w1 w2; Induction 1; Intros x; Induction 1; Intros Ix Px e.
1155 Exists x; Split; Auto with zfc v62.
1156 Apply comp_r with w1; Auto with zfc v62.
1157 Apply HY; Auto with zfc v62.
1160 Elim (Collection [x,y:Ens]((P x y)\/(((y':Ens)(P x y')->False)/\(EQ y Vide))))
1163 Elim (EM (EXType ? [x:Ens](IN x X)/\(P x Vide))).
1164 Intros Hvide; Elim Hvide; Intros xv Hxv; Exists Y.
1165 Intros y; Induction 1; Intros x; Induction 1; Intros Hx1 Hx2.
1167 Intros y'; Induction 1; Intros Hy'1 Hy'2.
1169 Intros Hy'3; Apply IN_sound_left with y'; Auto with zfc v62.
1170 Apply fp with x; Auto with zfc v62.
1171 Induction 1; Intros Hy'3 Hy'4.
1173 Intros HP; Exists (Comp Y [y:Ens]((EQ y Vide)->False)).
1174 Intros y; Induction 1; Intros x; Induction 1; Intros Hx1 Hx2.
1176 Intros w1 w2 Hw1 Hw Hw2; Apply Hw1; Apply EQ_tran with w2; Auto with zfc v62.
1178 Intros y'; Induction 1; Intros Hy'1 Hy'2.
1179 Elim Hy'2; Intros Hy'3.
1180 Apply IN_sound_left with y'; Auto with zfc v62.
1181 Apply fp with x; Auto with zfc v62.
1182 Elim Hy'3; Intros Hy'4 Hy'5.
1183 Elim (Hy'4 y); Auto with zfc v62.
1185 Intros e; Apply HP; Exists x; Split; Auto with zfc v62;
1186 Apply comp_r with y; Auto with zfc v62; Apply fp; Auto with zfc v62.
1187 Intros x x' y e Hx; Elim Hx; Intros Hx1.
1188 Left; Apply comp_l with x; Auto with zfc v62.
1189 Right; Elim Hx1; Intros Hx2 Hx3; Split.
1191 Intros y' Hy'; Apply (Hx2 y'); Apply comp_l with x'; Auto with zfc v62.
1192 Intros x; Elim (EM (EXType ? [y:Ens](P x y))); Intros Hx.
1193 Elim Hx; Intros x0 Hx0; Exists x0; Left; Assumption.
1194 Exists Vide; Right; Split; Auto with zfc v62.
1195 Intros y Hy; Elim Hx; Exists y; Auto with zfc v62.
1198 (******************************************************************************)
1199 (* SMALL SETS AND THE BIG SET OF SMALL SETS *)
1200 (******************************************************************************)
1202 (* Some definitions replicated on another type level *)
1204 Inductive EXType' [P:Type; Q:P->Prop]: Prop :=
1205 EXTypei' : (x:P)(Q x)->(EXType' P Q).
1207 Inductive prod_t' [A,B:Type] : Type :=
1208 pair_t' : A->B->(prod_t' A B).
1210 Inductive depprod'' [A:Type; P : A->Type] : Type :=
1211 dep_i'' : (x:A)(P x)->(depprod'' A P).
1213 (* The small sets *)
1214 Inductive Ens' : Type :=
1215 sup' : (A:Type)(A->Ens')->Ens'
1216 | atom' : (A:Type)A->Ens'.
1218 (* Equality on small sets *)
1219 Definition EQ' : Ens' -> Ens' -> Prop.
1226 (EXType' ? [y:B](eq1 x (g y))).
1228 (EXType' ? [x:A](eq1 x (g y))).
1239 (*Exact (X == X0).*)
1240 Exact (eq_depT Type [A:Type]A A a A0 y).
1245 (* small sets can be injected into big sets *)
1246 Definition inj : Ens'->Ens.
1247 Induction 1; [Intros A f fr ; Exact (sup A fr) | Intros A a ; Exact (atom A a)].
1252 Theorem inj_sound : (E1,E2:Ens')(EQ' E1 E2)->(EQ (inj E1)(inj E2)).
1253 Induction E1; [Intros A1 f1 r1 | Intros A a] ; Induction E2;
1254 [Intros A2 f2 r2 | Contradiction | Contradiction | Intros A' a'].
1255 (Induction 1; Intros HR1 HR2; Split).
1256 (Intros a1; Elim (HR1 a1); Intros a2 Ha2; Exists a2; Auto with zfc v62).
1257 (Intros a2; Elim (HR2 a2); Intros a1 Ha1; Exists a1; Auto with zfc v62).
1262 Definition Sing' : Ens' -> Ens' :=
1263 [E:Ens'] (sup' Un [x:Un]Cases x of void => E end).
1265 Definition Power' : Ens' -> Ens' :=
1272 [c:(depprod'' A [a:A](P a))]
1274 (dep_i'' a p) => (f a)
1278 | (atom' A a) => (Sing' (atom' A a)) (* ??? or Vide? *)
1281 Theorem Power_sound_inj : (E:Ens')(EQ (inj (Power' E))(Power (inj E))).
1282 Induction E; [Intros A f HR | Intros A a].
1284 Intros P; Exists P; Split.
1285 Intros c; Elim c; Intros a p.
1286 Exists (dep_i A [a0:A](P a0) a p); Simpl; Auto with zfc v62.
1287 Intros c; Elim c; Intros a p.
1288 Exists (dep_i'' A [a0:A](P a0) a p); Simpl; Auto with zfc v62.
1289 Intros P; Exists P; Split.
1290 Intros c; Elim c; Intros a p.
1291 Exists (dep_i A [a0:A](P a0) a p); Simpl; Auto with zfc v62.
1292 Intros c; Elim c; Intros a p.
1293 Exists (dep_i'' A [a0:A](P a0) a p); Simpl; Auto with zfc v62.
1296 Destruct x; Exists void; Auto with zfc.
1297 Destruct y; Exists void; Auto with zfc.
1300 (* The set of small sets *)
1301 Definition Big := (sup Ens' inj).
1303 Theorem Big_is_big : (E:Ens')(IN (inj E) Big).
1304 Intros E; Unfold Big; Simpl; Exists E; Auto with zfc.
1307 Theorem IN_Big_small : (E:Ens)(IN E Big)->(EXType' ? [E':Ens'](EQ E (inj E'))).
1308 Unfold Big; Simpl; Induction 1; Intros E' HE'; Exists E'; Assumption.
1311 Theorem IN_small_small : (E:Ens)(E':Ens')(IN E (inj E'))->
1312 (EXType' ? [E1:Ens'](EQ E (inj E1))).
1313 Induction E'; [Intros A' f' HR' | Contradiction]; Simpl;
1314 Induction 1; Intros a' e'; Exists (f' a'); Assumption.
1317 Theorem Big_closed_for_power : (E:Ens)(IN E Big)->(IN (Power E) Big).
1318 Unfold Big; Simpl; Intros E; Induction 1; Intros E' HE'; Exists (Power' E').
1319 Apply EQ_tran with (Power (inj E')).
1320 Apply Power_sound; Assumption.
1321 Apply EQ_sym; Apply Power_sound_inj.
1324 (******************************************************************************)
1325 (* NO SET OF ALL SETS *)
1326 (******************************************************************************)
1328 (* Just for fun : a proof that there is no set of all sets, using *)
1329 (* Russell's paradox construction *)
1330 (* There, of course, are other proofs (foundation, etc) *)
1332 Theorem Russell : (E:Ens)((E':Ens)(IN E' E))->False.
1334 Cut ([x:Ens](IN x x)->False (Comp U [x:Ens](IN x x)->False)).
1337 (Apply IN_P_Comp; Auto with zfc v62).
1338 (Intros w1 w2 HF e i; Apply HF; Apply IN_sound_left with w2; Auto with zfc v62;
1339 Apply IN_sound_right with w2; Auto with zfc v62).
1341 Cut (IN (Comp U [x:Ens](IN x x)->False) (Comp U [x:Ens](IN x x)->False)).
1342 Change ([x:Ens](IN x x)->False (Comp U [x:Ens](IN x x)->False)).
1343 Cut (w1,w2:Ens)((IN w1 w1)->False)->(EQ w1 w2)->(IN w2 w2)->False.
1345 Exact (IN_Comp_P U (Comp U [x:Ens](IN x x)->False)
1346 [x:Ens](IN x x)->False ww H).
1347 (Intros w1 w2 HF e i; Apply HF; Apply IN_sound_left with w2; Auto with zfc v62;
1348 Apply IN_sound_right with w2; Auto with zfc v62).
1352 (******************************************************************************)
1353 (* SOME AXIOMS AND STRANGE THINGS ;-( *)
1355 (* The need for axioms is due to the usage of dependent equality, or to my *)
1356 (* ignorance about it ;-) *)
1358 (******************************************************************************)
1361 (T:Type)(n,m:T)(existT Type [A:Type]A T n)==(existT Type [A:Type]A T m)->n==m.
1363 (* The main consequence of the previous axiom *)
1364 Theorem a_pi2 : (T:Type)(n,m:T)(atom T n)==(atom T m)->n==m.
1365 Intros; Inversion H; Apply a_de_pi2; Assumption.
1368 (* This theorem is really strange: I can prove this in general, but I can't *)
1369 (* prove any of it's instance: for example I can't prove *)
1370 (* ~(nat==bool)->~(atom nat O)==(atom bool true) due to an internal error of *)
1372 Theorem a_npi1 : (T1,T2:Type)(t1:T1)(t2:T2)~T1==T2->~(atom T1 t1)==(atom T2 t2).
1373 Unfold not; Intros; Apply H; Inversion H0; Reflexivity.
1376 (******************************************************************************)
1377 (* MAPPING A TYPE TO THE SET OF IT'S ELEMENTS *)
1378 (******************************************************************************)
1380 (* (Ens_of_t T t) is thought as the coercion from an element (t:T) to a set *)
1381 Definition Ens_of_t : (T:Type)T->Ens :=
1382 [T:Type][t:T](atom T t).
1384 (* (Ens_of_T T) is thought as the set of the elements of type T ... *)
1385 Definition Ens_of_T : Type -> Ens :=
1386 [T:Type] (sup T [t:T](Ens_of_t T t)).
1388 (* ... and (Prop_on_Ens_of_Prop T P) is thought as the proposition on Ens *)
1389 (* that is true only for (atom T t) where (t:T) and (P t) is true. *)
1390 Inductive Prop_on_Ens_of_Prop [T:Type; P:T->Prop] : Ens->Prop :=
1391 cons : (t:T)(P t)->(Prop_on_Ens_of_Prop T P (atom T t)).
1393 Theorem Prop_on_Ens_of_Prop_atom_Prop :
1394 (T:Type; P:(T->Prop); t:T)(Prop_on_Ens_of_Prop T P (atom T t))->(P t).
1395 Intros; Inversion H; Replace t with t0.
1398 Apply a_de_pi2; Assumption.
1401 Theorem Prop_on_Ens_of_Prop_t :
1402 (T:Type; P:(T->Prop); E:Ens)
1403 (Prop_on_Ens_of_Prop T P E)
1404 ->(EXType T [t:T]E==(atom T t)/\(P t)).
1411 Lemma EQ_atom: (T:Type)(t:T)(E:Ens)(EQ (atom T t) E)->(atom T t)==E.
1421 Theorem Prop_on_Ens_of_Prop_sound :
1422 (E1,E2:Ens)(T:Type)(P:T->Prop)
1424 -> (Prop_on_Ens_of_Prop T P E1)
1425 -> (Prop_on_Ens_of_Prop T P E2).
1427 Cut (EXType ? [t:T]E1==(atom T t)/\(P t)).
1428 Destruct 1; Destruct 1.
1440 Apply Prop_on_Ens_of_Prop_t.
1445 (******************************************************************************)
1446 (* EXAMPLES OF USAGE *)
1447 (******************************************************************************)
1449 (* We could define an implicit coercion from nat to Ens using Ens_of_t *)
1450 Coercion Ens_of_nat := [n:nat](Ens_of_t nat n).
1452 (* CNat is the set of the natural numbers of Coq ... *)
1453 Definition CNat : Ens :=
1457 is_even : nat->Prop :=
1458 is_even_O : (is_even O)
1459 | is_even_S : (n:nat)(is_odd n)->(is_even (S n))
1461 is_odd : nat->Prop :=
1462 id_ood_S : (n:nat)(is_even n)->(is_odd (S n)).
1464 Lemma not_even_odd: (n:nat)(is_even n)->(is_odd n)->False.
1466 Intros; Inversion H0.
1468 Intros; Apply H; [Inversion H1 | Inversion H0]; Assumption.
1471 Definition Cis_even : Ens -> Prop :=
1472 (Prop_on_Ens_of_Prop nat is_even).
1474 Definition Cis_odd : Ens -> Prop :=
1475 (Prop_on_Ens_of_Prop nat is_odd).
1477 (* ... and CEven and COdd are the sets of even/odd natural numbers of Coq *)
1479 Definition CEven := (Comp CNat Cis_even).
1481 Definition COdd := (Comp CNat Cis_odd).
1483 (* And now an easy fact: the intersection of CEven with COdd is empty *)
1484 Fact COdd_Inter_CEven_EQ_Vide: (EQ (Inter (Paire CEven COdd)) Vide).
1486 Cut (E:Ens)(IN E (Inter (Paire CEven COdd)))->(IN E Vide).
1493 Cut (IN E CEven)/\(IN E COdd).
1503 Rewrite <- H6 in H8.
1507 Apply not_even_odd with t; Assumption.
1509 Apply a_pi2; Assumption.
1511 Apply IN_Comp_P with CNat.
1514 Apply Prop_on_Ens_of_Prop_sound with w1; Assumption.
1518 Apply IN_Comp_P with CNat.
1521 Apply Prop_on_Ens_of_Prop_sound with w1; Assumption.
1526 Apply IN_Inter_all with (Paire CEven COdd).
1531 Apply IN_Inter_all with (Paire CEven COdd).
1541 (* Another easy fact: O is not in COdd *)
1542 Fact O_not_IN_COdd : ~(IN O COdd).
1557 Apply IN_Comp_P with CNat.
1560 Apply Prop_on_Ens_of_Prop_sound with w1.