-
Notifications
You must be signed in to change notification settings - Fork 3
/
Ordinal_theory.v
274 lines (217 loc) · 6.96 KB
/
Ordinal_theory.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
(* This program is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1 *)
(* of the License, or (at your option) any later version. *)
(* *)
(* This program is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU Lesser General Public *)
(* License along with this program; if not, write to the Free *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA *)
(* Contribution to the Coq Library V6.3 (July 1999) *)
Require Export Plump.
Lemma Vee_sound : forall E1 E2 : Ens, EQ E1 E2 -> EQ (Vee E1) (Vee E2).
simple induction E1; intros A1 f1 HR1; simple induction E2; intros A2 f2 HR2.
simple induction 1; intros e1 e2.
apply INC_EQ; unfold INC in |- *.
change
(forall E : Ens,
IN E (Union (sup A1 (fun a1 : A1 => Power (Vee (f1 a1))))) ->
IN E (Union (sup A2 (fun a2 : A2 => Power (Vee (f2 a2))))))
in |- *.
intros E i.
apply
IN_sound_right with (Union (sup A1 (fun a1 : A1 => Power (Vee (f1 a1)))));
try trivial with zfc.
apply Union_sound.
split.
intros a1; elim (e1 a1).
intros a2 h.
exists a2.
apply Power_sound.
apply HR1.
assumption.
intros a2; elim (e2 a2); intros a1 h; exists a1; apply Power_sound;
auto with zfc.
change
(forall E : Ens,
IN E (Union (sup A2 (fun a2 : A2 => Power (Vee (f2 a2))))) ->
IN E (Union (sup A1 (fun a1 : A1 => Power (Vee (f1 a1))))))
in |- *.
intros E i.
apply
IN_sound_right with (Union (sup A2 (fun a2 : A2 => Power (Vee (f2 a2))))).
apply Union_sound.
split.
intros a2; elim (e2 a2); intros a1 h; exists a1.
apply Power_sound; auto with zfc.
intros a1; elim (e1 a1); intros a2 h; exists a2.
apply Power_sound; auto with zfc.
assumption.
Qed.
Lemma IN_Vee :
forall V W : Ens, IN W V -> forall E : Ens, INC E (Vee W) -> IN E (Vee V).
simple induction V; intros A f HR.
intros W i E inc.
change (IN E (Union (sup A (fun a : A => Power (Vee (f a)))))) in |- *.
apply IN_Union with (Power (Vee W)).
elim i; intros a h.
exists a.
apply Power_sound; apply Vee_sound; auto with zfc.
auto with zfc.
apply INC_IN_Power.
assumption.
Qed.
Lemma INC_IN_Vee_Succ :
forall E L : Ens, Ord L -> INC E (Vee L) -> IN E (Vee (Succ L)).
simple induction L; intros A f HR.
intros o inc.
unfold Succ in |- *.
apply IN_Vee with (sup A f).
apply IN_P_Comp.
intros; apply Ord_sound with w1; auto with zfc.
auto with zfc.
apply INC_IN_Power; auto with zfc.
assumption.
assumption.
Qed.
Definition PI1 (A : Type) (P : A -> Type) (c : depprod A P) :=
match c with
| dep_i a p => a
end.
Definition PI2 (A : Type) (P : A -> Type) (c : depprod A P) :=
match c return (P (PI1 A P c)) with
| dep_i a p => p
end.
Lemma IN_Vee_EXType :
forall E X : Ens,
IN X (Vee E) -> EXType Ens (fun Y : Ens => IN Y E /\ INC X (Vee Y)).
simple induction E; intros A f HR X.
intros i.
change (IN X (Union (sup A (fun a : A => Power (Vee (f a)))))) in i.
elim (Union_IN _ _ i).
intros T c.
elim c; intros i1 i2.
elim i1; intros a e.
exists (f a); split.
exists a; auto with zfc.
apply IN_Power_INC.
apply IN_sound_right with T; auto with zfc.
Qed.
Lemma mon_Vee : forall E1 E2 : Ens, INC E1 E2 -> INC (Vee E1) (Vee E2).
intros E1 E2 inc; unfold INC in |- *; intros X i.
elim (IN_Vee_EXType _ _ i).
intros Y; simple induction 1; intros i1 inc1.
apply IN_Vee with Y; auto with zfc.
Qed.
Hint Resolve IN_Power_INC: zfc.
Lemma IN_Succ_INC : forall E X : Ens, IN X (Succ E) -> INC X E.
unfold Succ in |- *.
intros E X i.
cut (IN X (Power E)).
auto with zfc.
auto with zfc.
apply (Comp_INC (Power E) Ord); try trivial with zfc.
Qed.
Hint Resolve Ord_Succ: zfc.
Lemma IN_Vee_Succ_EXType :
forall E X : Ens,
Ord E ->
IN X (Vee (Succ E)) ->
EXType _ (fun Y : Ens => INC Y E /\ Ord Y /\ INC X (Vee Y)).
intros E X o i.
elim (IN_Vee_EXType _ _ i).
intros Y; simple induction 1; intros i1 inc.
exists Y; split.
apply IN_Succ_INC; auto with zfc.
split.
auto with zfc.
apply IN_Ord_Ord with (Succ E); auto with zfc.
auto with zfc.
Qed.
Lemma IN_Vee_Succ :
forall E X : Ens,
Ord E ->
forall Y : Ens, Ord Y -> INC Y E -> INC X (Vee Y) -> IN X (Vee (Succ E)).
intros E X o Y o1 inc inc1.
apply IN_Vee with Y.
auto with zfc.
unfold Succ in |- *; apply IN_P_Comp; auto with zfc.
intros; apply Ord_sound with w1; auto with zfc.
auto with zfc.
apply INC_IN_Power; auto with zfc.
auto with zfc.
Qed.
Inductive depprod1 (A : Type) (P : A -> Type) : Type :=
dep_i1 : forall x : A, P x -> depprod1 A P.
Definition PI11 (A : Type) (P : A -> Type) (c : depprod1 A P) :=
match c with
| dep_i1 a p => a
end.
Definition PI21 (A : Type) (P : A -> Type) (c : depprod1 A P) :=
match c return (P (PI11 A P c)) with
| dep_i1 a p => p
end.
Lemma ex_rk :
forall E : Ens, depprod1 _ (fun L : Ens => Ord L /\ IN E (Vee L)).
simple induction E; intros A f HR.
exists (Succ (Union (sup A (fun a : A => PI11 _ _ (HR a))))).
split.
apply Ord_Succ.
apply Union_Ord.
simple induction 1; intros a h.
apply
Ord_sound with (PI11 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a)).
auto with zfc.
elim (PI21 _ _ (HR a)).
auto with zfc.
apply
IN_Vee_Succ
with
(Union
(sup A
(fun a : A =>
PI11 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a)))).
apply Union_Ord.
intros E'; simple induction 1; intros a c.
apply
Ord_sound with (PI11 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a)).
elim (PI21 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a));
auto with zfc.
elim (PI21 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a));
auto with zfc.
apply Union_Ord.
intros E'; simple induction 1; intros a e.
apply
Ord_sound with (PI11 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a));
auto with zfc.
elim (PI21 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a));
auto with zfc.
auto with zfc.
unfold INC in |- *; intros E' i.
elim i; intros a e.
apply IN_sound_left with (f a); auto with zfc.
cut
(INC (PI11 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a))
(Union
(sup A
(fun a0 : A =>
PI11 Ens (fun L : Ens => Ord L /\ IN (f a0) (Vee L)) (HR a0))))).
intros inc.
apply
(mon_Vee (PI11 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a))
(Union
(sup A
(fun a0 : A =>
PI11 Ens (fun L : Ens => Ord L /\ IN (f a0) (Vee L)) (HR a0))))
inc).
elim (PI21 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a)).
elim (PI21 Ens (fun L : Ens => Ord L /\ IN (f a) (Vee L)) (HR a)).
auto with zfc.
apply IN_INC_Union.
exists a; auto with zfc.
Qed.