273
|
1 <html>
|
|
2 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
|
3 <head>
|
|
4 <STYLE type="text/css">
|
|
5 .main { width:100%; }
|
|
6 .side { top:0px; width:0%; position:fixed; left:80%; display:none}
|
|
7 </STYLE>
|
|
8 <script type="text/javascript">
|
|
9 function showElement(layer){
|
|
10 var myLayer = document.getElementById(layer);
|
|
11 var main = document.getElementById('mmm');
|
|
12 if(myLayer.style.display=="none"){
|
|
13 myLayer.style.width="20%";
|
|
14 main.style.width="80%";
|
|
15 myLayer.style.display="block";
|
|
16 myLayer.backgroundPosition="top";
|
|
17 } else {
|
|
18 myLayer.style.width="0%";
|
|
19 main.style.width="100%";
|
|
20 myLayer.style.display="none";
|
|
21 }
|
|
22 }
|
|
23 </script>
|
|
24 <title>Constructing ZF Set Theory in Agda </title>
|
|
25 </head>
|
|
26 <body>
|
|
27 <div class="main" id="mmm">
|
|
28 <h1>Constructing ZF Set Theory in Agda </h1>
|
|
29 <a href="#" right="0px" onclick="javascript:showElement('menu')">
|
|
30 <span>Menu</span>
|
|
31 </a>
|
|
32 <a href="#" left="0px" onclick="javascript:showElement('menu')">
|
|
33 <span>Menu</span>
|
|
34 </a>
|
|
35
|
|
36 <p>
|
|
37
|
|
38 <author> Shinji KONO</author>
|
|
39
|
|
40 <hr/>
|
279
|
41 <h2><a name="content000">ZF in Agda</a></h2>
|
|
42
|
|
43 <pre>
|
|
44 zf.agda axiom of ZF
|
|
45 zfc.agda axiom of choice
|
|
46 Ordinals.agda axiom of Ordinals
|
|
47 ordinal.agda countable model of Ordinals
|
|
48 OD.agda model of ZF based on Ordinal Definable Set with assumptions
|
|
49 ODC.agda Law of exclude middle from axiom of choice assumptions
|
|
50 LEMC.agda model of choice with assumption of the Law of exclude middle
|
|
51 OPair.agda ordered pair on OD
|
|
52 BAlgbra.agda Boolean algebra on OD (not yet done)
|
|
53 filter.agda Filter on OD (not yet done)
|
|
54 cardinal.agda Caedinal number on OD (not yet done)
|
|
55 logic.agda some basics on logic
|
|
56 nat.agda some basics on Nat
|
|
57
|
|
58 </pre>
|
|
59
|
|
60 <hr/>
|
|
61 <h2><a name="content001">Programming Mathematics</a></h2>
|
|
62
|
|
63 <p>
|
273
|
64 Programming is processing data structure with λ terms.
|
|
65 <p>
|
|
66 We are going to handle Mathematics in intuitionistic logic with λ terms.
|
|
67 <p>
|
|
68 Mathematics is a functional programming which values are proofs.
|
|
69 <p>
|
|
70 Programming ZF Set Theory in Agda
|
|
71 <p>
|
|
72
|
|
73 <hr/>
|
279
|
74 <h2><a name="content002">Target</a></h2>
|
273
|
75
|
|
76 <pre>
|
|
77 Describe ZF axioms in Agda
|
|
78 Construction a Model of ZF Set Theory in Agda
|
|
79 Show necessary assumptions for the model
|
|
80 Show validities of ZF axioms on the model
|
|
81
|
|
82 </pre>
|
|
83 This shows consistency of Set Theory (with some assumptions),
|
|
84 without circulating ZF Theory assumption.
|
|
85 <p>
|
|
86 <a href="https://github.com/shinji-kono/zf-in-agda">
|
|
87 ZF in Agda https://github.com/shinji-kono/zf-in-agda
|
|
88 </a>
|
|
89 <p>
|
|
90
|
|
91 <hr/>
|
279
|
92 <h2><a name="content003">Why Set Theory</a></h2>
|
273
|
93 If we can formulate Set theory, it suppose to work on any mathematical theory.
|
|
94 <p>
|
|
95 Set Theory is a difficult point for beginners especially axiom of choice.
|
|
96 <p>
|
|
97 It has some amount of difficulty and self circulating discussion.
|
|
98 <p>
|
|
99 I'm planning to do it in my old age, but I'm enough age now.
|
|
100 <p>
|
338
|
101 if you familier with Agda, you can skip to <a href="#set-theory">
|
|
102 there
|
|
103 </a>
|
273
|
104 <p>
|
|
105
|
|
106 <hr/>
|
279
|
107 <h2><a name="content004">Agda and Intuitionistic Logic </a></h2>
|
273
|
108 Curry Howard Isomorphism
|
|
109 <p>
|
|
110
|
|
111 <pre>
|
|
112 Proposition : Proof ⇔ Type : Value
|
|
113
|
|
114 </pre>
|
|
115 which means
|
|
116 <p>
|
|
117 constructing a typed lambda calculus which corresponds a logic
|
|
118 <p>
|
|
119 Typed lambda calculus which allows complex type as a value of a variable (System FC)
|
|
120 <p>
|
|
121 First class Type / Dependent Type
|
|
122 <p>
|
|
123 Agda is a such a programming language which has similar syntax of Haskell
|
|
124 <p>
|
|
125 Coq is specialized in proof assistance such as command and tactics .
|
|
126 <p>
|
|
127
|
|
128 <hr/>
|
279
|
129 <h2><a name="content005">Introduction of Agda </a></h2>
|
273
|
130 A length of a list of type A.
|
|
131 <p>
|
|
132
|
|
133 <pre>
|
|
134 length : {A : Set } → List A → Nat
|
|
135 length [] = zero
|
|
136 length (_ ∷ t) = suc ( length t )
|
|
137
|
|
138 </pre>
|
|
139 Simple functional programming language. Type declaration is mandatory.
|
|
140 A colon means type, an equal means value. Indentation based.
|
|
141 <p>
|
|
142 Set is a base type (which may have a level ).
|
|
143 <p>
|
|
144 {} means implicit variable which can be omitted if Agda infers its value.
|
|
145 <p>
|
|
146
|
|
147 <hr/>
|
279
|
148 <h2><a name="content006">data ( Sum type )</a></h2>
|
273
|
149 A data type which as exclusive multiple constructors. A similar one as
|
|
150 union in C or case class in Scala.
|
|
151 <p>
|
|
152 It has a similar syntax as Haskell but it has a slight difference.
|
|
153 <p>
|
|
154
|
|
155 <pre>
|
|
156 data List (A : Set ) : Set where
|
|
157 [] : List A
|
|
158 _∷_ : A → List A → List A
|
|
159
|
|
160 </pre>
|
|
161 _∷_ means infix operator. If use explicit _, it can be used in a normal function
|
|
162 syntax.
|
|
163 <p>
|
|
164 Natural number can be defined as a usual way.
|
|
165 <p>
|
|
166
|
|
167 <pre>
|
|
168 data Nat : Set where
|
|
169 zero : Nat
|
|
170 suc : Nat → Nat
|
|
171
|
|
172 </pre>
|
|
173
|
|
174 <hr/>
|
279
|
175 <h2><a name="content007"> A → B means "A implies B"</a></h2>
|
273
|
176
|
|
177 <p>
|
|
178 In Agda, a type can be a value of a variable, which is usually called dependent type.
|
|
179 Type has a name Set in Agda.
|
|
180 <p>
|
|
181
|
|
182 <pre>
|
|
183 ex3 : {A B : Set} → Set
|
|
184 ex3 {A}{B} = A → B
|
|
185
|
|
186 </pre>
|
|
187 ex3 is a type : A → B, which is a value of Set. It also means a formula : A implies B.
|
|
188 <p>
|
|
189
|
|
190 <pre>
|
|
191 A type is a formula, the value is the proof
|
|
192
|
|
193 </pre>
|
|
194 A value of A → B can be interpreted as an inference from the formula A to the formula B, which
|
|
195 can be a function from a proof of A to a proof of B.
|
|
196 <p>
|
|
197
|
|
198 <hr/>
|
279
|
199 <h2><a name="content008">introduction と elimination</a></h2>
|
273
|
200 For a logical operator, there are two types of inference, an introduction and an elimination.
|
|
201 <p>
|
|
202
|
|
203 <pre>
|
|
204 intro creating symbol / constructor / introduction
|
|
205 elim using symbolic / accessors / elimination
|
|
206
|
|
207 </pre>
|
|
208 In Natural deduction, this can be written in proof schema.
|
|
209 <p>
|
|
210
|
|
211 <pre>
|
|
212 A
|
|
213 :
|
|
214 B A A → B
|
|
215 ------------- →intro ------------------ →elim
|
|
216 A → B B
|
|
217
|
|
218 </pre>
|
|
219 In Agda, this is a pair of type and value as follows. Introduction of → uses λ.
|
|
220 <p>
|
|
221
|
|
222 <pre>
|
|
223 →intro : {A B : Set } → A → B → ( A → B )
|
|
224 →intro _ b = λ x → b
|
|
225 →elim : {A B : Set } → A → ( A → B ) → B
|
|
226 →elim a f = f a
|
|
227
|
|
228 </pre>
|
|
229 Important
|
|
230 <p>
|
|
231
|
|
232 <pre>
|
|
233 {A B : Set } → A → B → ( A → B )
|
|
234
|
|
235 </pre>
|
|
236 is
|
|
237 <p>
|
|
238
|
|
239 <pre>
|
|
240 {A B : Set } → ( A → ( B → ( A → B ) ))
|
|
241
|
|
242 </pre>
|
|
243 This makes currying of function easy.
|
|
244 <p>
|
|
245
|
|
246 <hr/>
|
279
|
247 <h2><a name="content009"> To prove A → B </a></h2>
|
273
|
248 Make a left type as an argument. (intros in Coq)
|
|
249 <p>
|
|
250
|
|
251 <pre>
|
|
252 ex5 : {A B C : Set } → A → B → C → ?
|
|
253 ex5 a b c = ?
|
|
254
|
|
255 </pre>
|
|
256 ? is called a hole, which is unspecified part. Agda tell us which kind type is required for the Hole.
|
|
257 <p>
|
|
258 We are going to fill the holes, and if we have no warnings nor errors such as type conflict (Red),
|
|
259 insufficient proof or instance (Yellow), Non-termination, the proof is completed.
|
|
260 <p>
|
|
261
|
|
262 <hr/>
|
279
|
263 <h2><a name="content010"> A ∧ B</a></h2>
|
273
|
264 Well known conjunction's introduction and elimination is as follow.
|
|
265 <p>
|
|
266
|
|
267 <pre>
|
|
268 A B A ∧ B A ∧ B
|
|
269 ------------- ----------- proj1 ---------- proj2
|
|
270 A ∧ B A B
|
|
271
|
|
272 </pre>
|
|
273 We can introduce a corresponding structure in our functional programming language.
|
|
274 <p>
|
|
275
|
|
276 <hr/>
|
279
|
277 <h2><a name="content011"> record</a></h2>
|
273
|
278
|
|
279 <pre>
|
|
280 record _∧_ A B : Set
|
|
281 field
|
|
282 proj1 : A
|
|
283 proj2 : B
|
|
284
|
|
285 </pre>
|
|
286 _∧_ means infix operator. _∧_ A B can be written as A ∧ B (Haskell uses (∧) )
|
|
287 <p>
|
|
288 This a type which constructed from type A and type B. You may think this as an object
|
|
289 or struct.
|
|
290 <p>
|
|
291
|
|
292 <pre>
|
|
293 record { proj1 = x ; proj2 = y }
|
|
294
|
|
295 </pre>
|
|
296 is a constructor of _∧_.
|
|
297 <p>
|
|
298
|
|
299 <pre>
|
|
300 ex3 : {A B : Set} → A → B → ( A ∧ B )
|
|
301 ex3 a b = record { proj1 = a ; proj2 = b }
|
|
302 ex1 : {A B : Set} → ( A ∧ B ) → A
|
|
303 ex1 a∧b = proj1 a∧b
|
|
304
|
|
305 </pre>
|
|
306 a∧b is a variable name. If we have no spaces in a string, it is a word even if we have symbols
|
|
307 except parenthesis or colons. A symbol requires space separation such as a type defining colon.
|
|
308 <p>
|
|
309 Defining record can be recursively, but we don't use the recursion here.
|
|
310 <p>
|
|
311
|
|
312 <hr/>
|
279
|
313 <h2><a name="content012"> Mathematical structure</a></h2>
|
273
|
314 We have types of elements and the relationship in a mathematical structure.
|
|
315 <p>
|
|
316
|
|
317 <pre>
|
|
318 logical relation has no ordering
|
|
319 there is a natural ordering in arguments and a value in a function
|
|
320
|
|
321 </pre>
|
|
322 So we have typical definition style of mathematical structure with records.
|
|
323 <p>
|
|
324
|
|
325 <pre>
|
|
326 record IsOrdinals {n : Level} (ord : Set n)
|
|
327 (_o<_ : ord → ord → Set n) : Set (suc (suc n)) where
|
|
328 field
|
|
329 Otrans : {x y z : ord } → x o< y → y o< z → x o< z
|
|
330 record Ordinals {n : Level} : Set (suc (suc n)) where
|
|
331 field
|
|
332 ord : Set n
|
|
333 _o<_ : ord → ord → Set n
|
|
334 isOrdinal : IsOrdinals ord _o<_
|
|
335
|
|
336 </pre>
|
|
337 In IsOrdinals, axioms are written in flat way. In Ordinal, we may have
|
|
338 inputs and outputs are put in the field including IsOrdinal.
|
|
339 <p>
|
|
340 Fields of Ordinal is existential objects in the mathematical structure.
|
|
341 <p>
|
|
342
|
|
343 <hr/>
|
359
|
344 <h2><a name="content013"> Limit Ordinal</a></h2>
|
|
345 If an ordinal is not a succesor of other, it is called limit ordinal. We need predicate to decide it.
|
|
346 <p>
|
|
347
|
|
348 <pre>
|
|
349 not-limit-p : ( x : ord ) → Dec ( ¬ ((y : ord) → ¬ (x ≡ osuc y) ))
|
|
350
|
|
351 </pre>
|
|
352 An ordinal may have an imeditate limit ordinal, we call it next x. Axiom of nrext is this.
|
|
353 <p>
|
|
354
|
|
355 <pre>
|
|
356 record IsNext {n : Level } (ord : Set n) (o∅ : ord ) (osuc : ord → ord )
|
|
357 (_o<_ : ord → ord → Set n) (next : ord → ord ) : Set (suc (suc n)) where
|
|
358 field
|
|
359 x<nx : { y : ord } → (y o< next y )
|
|
360 osuc<nx : { x y : ord } → x o< next y → osuc x o< next y
|
|
361 ¬nx<nx : {x y : ord} → y o< x → x o< next y → ¬ ((z : ord) → ¬ (x ≡ osuc z))
|
|
362
|
|
363 </pre>
|
|
364 We show some intresting lemma.
|
|
365 <p>
|
|
366
|
|
367 <pre>
|
|
368 next< : {x y z : Ordinal} → x o< next z → y o< next x → y o< next z
|
|
369 nexto=n : {x y : Ordinal} → x o< next (osuc y) → x o< next y
|
|
370 nexto≡ : {x : Ordinal} → next x ≡ next (osuc x)
|
|
371 next-is-limit : {x y : Ordinal} → ¬ (next x ≡ osuc y)
|
|
372
|
|
373 </pre>
|
|
374 These are proved from the axiom. Our countable ordinal satisfies these.
|
|
375 <p>
|
|
376
|
|
377 <hr/>
|
|
378 <h2><a name="content014"> A Model and a theory</a></h2>
|
273
|
379 Agda record is a type, so we can write it in the argument, but is it really exists?
|
|
380 <p>
|
|
381 If we have a value of the record, it simply exists, that is, we need to create all the existence
|
|
382 in the record satisfies all the axioms (= field of IsOrdinal) should be valid.
|
|
383 <p>
|
|
384
|
|
385 <pre>
|
|
386 type of record = theory
|
|
387 value of record = model
|
|
388
|
|
389 </pre>
|
|
390 We call the value of the record as a model. If mathematical structure has a
|
|
391 model, it exists. Pretty Obvious.
|
|
392 <p>
|
|
393
|
|
394 <hr/>
|
359
|
395 <h2><a name="content015"> postulate と module</a></h2>
|
273
|
396 Agda proofs are separated by modules, which are large records.
|
|
397 <p>
|
|
398 postulates are assumptions. We can assume a type without proofs.
|
|
399 <p>
|
|
400
|
|
401 <pre>
|
|
402 postulate
|
|
403 sup-o : ( Ordinal → Ordinal ) → Ordinal
|
|
404 sup-o< : { ψ : Ordinal → Ordinal } → ∀ {x : Ordinal } → ψ x o< sup-o ψ
|
|
405
|
|
406 </pre>
|
|
407 sup-o is an example of upper bound of a function and sup-o< assumes it actually satisfies all the value is less than upper bound.
|
|
408 <p>
|
|
409 Writing some type in a module argument is the same as postulating a type, but
|
|
410 postulate can be written the middle of a proof.
|
|
411 <p>
|
|
412 postulate can be constructive.
|
|
413 <p>
|
338
|
414 postulate can be inconsistent, which result everything has a proof. Actualy this assumption
|
|
415 doesnot work for Ordinals, we discuss this later.
|
273
|
416 <p>
|
|
417
|
|
418 <hr/>
|
359
|
419 <h2><a name="content016"> A ∨ B</a></h2>
|
273
|
420
|
|
421 <pre>
|
|
422 data _∨_ (A B : Set) : Set where
|
|
423 case1 : A → A ∨ B
|
|
424 case2 : B → A ∨ B
|
|
425
|
|
426 </pre>
|
|
427 As Haskell, case1/case2 are patterns.
|
|
428 <p>
|
|
429
|
|
430 <pre>
|
|
431 ex3 : {A B : Set} → ( A ∨ A ) → A
|
|
432 ex3 = ?
|
|
433
|
|
434 </pre>
|
|
435 In a case statement, Agda command C-C C-C generates possible cases in the head.
|
|
436 <p>
|
|
437
|
|
438 <pre>
|
|
439 ex3 : {A B : Set} → ( A ∨ A ) → A
|
|
440 ex3 (case1 x) = ?
|
|
441 ex3 (case2 x) = ?
|
|
442
|
|
443 </pre>
|
|
444 Proof schema of ∨ is omit due to the complexity.
|
|
445 <p>
|
|
446
|
|
447 <hr/>
|
359
|
448 <h2><a name="content017"> Negation</a></h2>
|
273
|
449
|
|
450 <pre>
|
|
451 ⊥
|
|
452 ------------- ⊥-elim
|
|
453 A
|
|
454
|
|
455 </pre>
|
|
456 Anything can be derived from bottom, in this case a Set A. There is no introduction rule
|
|
457 in ⊥, which can be implemented as data which has no constructor.
|
|
458 <p>
|
|
459
|
|
460 <pre>
|
|
461 data ⊥ : Set where
|
|
462
|
|
463 </pre>
|
|
464 ⊥-elim can be proved like this.
|
|
465 <p>
|
|
466
|
|
467 <pre>
|
|
468 ⊥-elim : {A : Set } -> ⊥ -> A
|
|
469 ⊥-elim ()
|
|
470
|
|
471 </pre>
|
|
472 () means no match argument nor value.
|
|
473 <p>
|
|
474 A negation can be defined using ⊥ like this.
|
|
475 <p>
|
|
476
|
|
477 <pre>
|
|
478 ¬_ : Set → Set
|
|
479 ¬ A = A → ⊥
|
|
480
|
|
481 </pre>
|
|
482
|
|
483 <hr/>
|
359
|
484 <h2><a name="content018">Equality </a></h2>
|
273
|
485
|
|
486 <p>
|
|
487 All the value in Agda are terms. If we have the same normalized form, two terms are equal.
|
|
488 If we have variables in the terms, we will perform an unification. unifiable terms are equal.
|
|
489 We don't go further on the unification.
|
|
490 <p>
|
|
491
|
|
492 <pre>
|
|
493 { x : A } x ≡ y f x y
|
|
494 --------------- ≡-intro --------------------- ≡-elim
|
|
495 x ≡ x f x x
|
|
496
|
|
497 </pre>
|
|
498 equality _≡_ can be defined as a data.
|
|
499 <p>
|
|
500
|
|
501 <pre>
|
|
502 data _≡_ {A : Set } : A → A → Set where
|
|
503 refl : {x : A} → x ≡ x
|
|
504
|
|
505 </pre>
|
|
506 The elimination of equality is a substitution in a term.
|
|
507 <p>
|
|
508
|
|
509 <pre>
|
|
510 subst : {A : Set } → { x y : A } → ( f : A → Set ) → x ≡ y → f x → f y
|
|
511 subst {A} {x} {y} f refl fx = fx
|
|
512 ex5 : {A : Set} {x y z : A } → x ≡ y → y ≡ z → x ≡ z
|
|
513 ex5 {A} {x} {y} {z} x≡y y≡z = subst ( λ k → x ≡ k ) y≡z x≡y
|
|
514
|
|
515 </pre>
|
|
516
|
|
517 <hr/>
|
359
|
518 <h2><a name="content019">Equivalence relation</a></h2>
|
273
|
519
|
|
520 <p>
|
|
521
|
|
522 <pre>
|
|
523 refl' : {A : Set} {x : A } → x ≡ x
|
|
524 refl' = ?
|
|
525 sym : {A : Set} {x y : A } → x ≡ y → y ≡ x
|
|
526 sym = ?
|
|
527 trans : {A : Set} {x y z : A } → x ≡ y → y ≡ z → x ≡ z
|
|
528 trans = ?
|
|
529 cong : {A B : Set} {x y : A } { f : A → B } → x ≡ y → f x ≡ f y
|
|
530 cong = ?
|
|
531
|
|
532 </pre>
|
|
533
|
|
534 <hr/>
|
359
|
535 <h2><a name="content020">Ordering</a></h2>
|
273
|
536
|
|
537 <p>
|
|
538 Relation is a predicate on two value which has a same type.
|
|
539 <p>
|
|
540
|
|
541 <pre>
|
|
542 A → A → Set
|
|
543
|
|
544 </pre>
|
|
545 Defining order is the definition of this type with predicate or a data.
|
|
546 <p>
|
|
547
|
|
548 <pre>
|
|
549 data _≤_ : Rel ℕ 0ℓ where
|
|
550 z≤n : ∀ {n} → zero ≤ n
|
|
551 s≤s : ∀ {m n} (m≤n : m ≤ n) → suc m ≤ suc n
|
|
552
|
|
553 </pre>
|
|
554
|
|
555 <hr/>
|
359
|
556 <h2><a name="content021">Quantifier</a></h2>
|
273
|
557
|
|
558 <p>
|
|
559 Handling quantifier in an intuitionistic logic requires special cares.
|
|
560 <p>
|
|
561 In the input of a function, there are no restriction on it, that is, it has
|
|
562 a universal quantifier. (If we explicitly write ∀, Agda gives us a type inference on it)
|
|
563 <p>
|
|
564 There is no ∃ in agda, the one way is using negation like this.
|
|
565 <p>
|
|
566 ∃ (x : A ) → p x = ¬ ( ( x : A ) → ¬ ( p x ) )
|
|
567 <p>
|
|
568 On the another way, f : A can be used like this.
|
|
569 <p>
|
|
570
|
|
571 <pre>
|
|
572 p f
|
|
573
|
|
574 </pre>
|
|
575 If we use a function which can be defined globally which has stronger meaning the
|
|
576 usage of ∃ x in a logical expression.
|
|
577 <p>
|
|
578
|
|
579 <hr/>
|
359
|
580 <h2><a name="content022">Can we do math in this way?</a></h2>
|
273
|
581 Yes, we can. Actually we have Principia Mathematica by Russell and Whitehead (with out computer support).
|
|
582 <p>
|
|
583 In some sense, this story is a reprinting of the work, (but Principia Mathematica has a different formulation than ZF).
|
|
584 <p>
|
|
585
|
|
586 <pre>
|
|
587 define mathematical structure as a record
|
|
588 program inferences as if we have proofs in variables
|
|
589
|
|
590 </pre>
|
|
591
|
|
592 <hr/>
|
359
|
593 <h2><a name="content023">Things which Agda cannot prove</a></h2>
|
273
|
594
|
|
595 <p>
|
|
596 The infamous Internal Parametricity is a limitation of Agda, it cannot prove so called Free Theorem, which
|
|
597 leads uniqueness of a functor in Category Theory.
|
|
598 <p>
|
|
599 Functional extensionality cannot be proved.
|
|
600 <pre>
|
|
601 (∀ x → f x ≡ g x) → f ≡ g
|
|
602
|
|
603 </pre>
|
|
604 Agda has no law of exclude middle.
|
|
605 <p>
|
|
606
|
|
607 <pre>
|
|
608 a ∨ ( ¬ a )
|
|
609
|
|
610 </pre>
|
|
611 For example, (A → B) → ¬ B → ¬ A can be proved but, ( ¬ B → ¬ A ) → A → B cannot.
|
|
612 <p>
|
|
613 It also other problems such as termination, type inference or unification which we may overcome with
|
|
614 efforts or devices or may not.
|
|
615 <p>
|
|
616 If we cannot prove something, we can safely postulate it unless it leads a contradiction.
|
|
617 <pre>
|
|
618
|
|
619
|
|
620 </pre>
|
|
621
|
|
622 <hr/>
|
359
|
623 <h2><a name="content024">Classical story of ZF Set Theory</a></h2>
|
273
|
624
|
|
625 <p>
|
338
|
626 <a name="set-theory">
|
273
|
627 Assuming ZF, constructing a model of ZF is a flow of classical Set Theory, which leads
|
|
628 a relative consistency proof of the Set Theory.
|
|
629 Ordinal number is used in the flow.
|
|
630 <p>
|
|
631 In Agda, first we defines Ordinal numbers (Ordinals), then introduce Ordinal Definable Set (OD).
|
|
632 We need some non constructive assumptions in the construction. A model of Set theory is
|
|
633 constructed based on these assumptions.
|
|
634 <p>
|
|
635 <img src="fig/set-theory.svg">
|
|
636
|
|
637 <p>
|
|
638
|
|
639 <hr/>
|
359
|
640 <h2><a name="content025">Ordinals</a></h2>
|
273
|
641 Ordinals are our intuition of infinite things, which has ∅ and orders on the things.
|
|
642 It also has a successor osuc.
|
|
643 <p>
|
|
644
|
|
645 <pre>
|
|
646 record Ordinals {n : Level} : Set (suc (suc n)) where
|
|
647 field
|
|
648 ord : Set n
|
|
649 o∅ : ord
|
|
650 osuc : ord → ord
|
|
651 _o<_ : ord → ord → Set n
|
|
652 isOrdinal : IsOrdinals ord o∅ osuc _o<_
|
|
653
|
|
654 </pre>
|
|
655 It is different from natural numbers in way. The order of Ordinals is not defined in terms
|
|
656 of successor. It is given from outside, which make it possible to have higher order infinity.
|
|
657 <p>
|
|
658
|
|
659 <hr/>
|
359
|
660 <h2><a name="content026">Axiom of Ordinals</a></h2>
|
273
|
661 Properties of infinite things. We request a transfinite induction, which states that if
|
|
662 some properties are satisfied below all possible ordinals, the properties are true on all
|
|
663 ordinals.
|
|
664 <p>
|
|
665 Successor osuc has no ordinal between osuc and the base ordinal. There are some ordinals
|
|
666 which is not a successor of any ordinals. It is called limit ordinal.
|
|
667 <p>
|
|
668 Any two ordinal can be compared, that is less, equal or more, that is total order.
|
|
669 <p>
|
|
670
|
|
671 <pre>
|
|
672 record IsOrdinals {n : Level} (ord : Set n) (o∅ : ord )
|
|
673 (osuc : ord → ord )
|
|
674 (_o<_ : ord → ord → Set n) : Set (suc (suc n)) where
|
|
675 field
|
|
676 Otrans : {x y z : ord } → x o< y → y o< z → x o< z
|
|
677 OTri : Trichotomous {n} _≡_ _o<_
|
|
678 ¬x<0 : { x : ord } → ¬ ( x o< o∅ )
|
|
679 <-osuc : { x : ord } → x o< osuc x
|
|
680 osuc-≡< : { a x : ord } → x o< osuc a → (x ≡ a ) ∨ (x o< a)
|
|
681 TransFinite : { ψ : ord → Set (suc n) }
|
|
682 → ( (x : ord) → ( (y : ord ) → y o< x → ψ y ) → ψ x )
|
|
683 → ∀ (x : ord) → ψ x
|
|
684
|
|
685 </pre>
|
|
686
|
|
687 <hr/>
|
359
|
688 <h2><a name="content027">Concrete Ordinals or Countable Ordinals</a></h2>
|
273
|
689
|
|
690 <p>
|
|
691 We can define a list like structure with level, which is a kind of two dimensional infinite array.
|
|
692 <p>
|
|
693
|
|
694 <pre>
|
|
695 data OrdinalD {n : Level} : (lv : Nat) → Set n where
|
|
696 Φ : (lv : Nat) → OrdinalD lv
|
|
697 OSuc : (lv : Nat) → OrdinalD {n} lv → OrdinalD lv
|
|
698
|
|
699 </pre>
|
|
700 The order of the OrdinalD can be defined in this way.
|
|
701 <p>
|
|
702
|
|
703 <pre>
|
|
704 data _d<_ {n : Level} : {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Set n where
|
|
705 Φ< : {lx : Nat} → {x : OrdinalD {n} lx} → Φ lx d< OSuc lx x
|
|
706 s< : {lx : Nat} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y
|
|
707
|
|
708 </pre>
|
|
709 This is a simple data structure, it has no abstract assumptions, and it is countable many data
|
|
710 structure.
|
|
711 <p>
|
|
712
|
|
713 <pre>
|
|
714 Φ 0
|
|
715 OSuc 2 ( Osuc 2 ( Osuc 2 (Φ 2)))
|
|
716 Osuc 0 (Φ 0) d< Φ 1
|
|
717
|
|
718 </pre>
|
|
719
|
|
720 <hr/>
|
359
|
721 <h2><a name="content028">Model of Ordinals</a></h2>
|
273
|
722
|
|
723 <p>
|
|
724 It is easy to show OrdinalD and its order satisfies the axioms of Ordinals.
|
|
725 <p>
|
|
726 So our Ordinals has a mode. This means axiom of Ordinals are consistent.
|
|
727 <p>
|
|
728
|
|
729 <hr/>
|
359
|
730 <h2><a name="content029">Debugging axioms using Model</a></h2>
|
273
|
731 Whether axiom is correct or not can be checked by a validity on a mode.
|
|
732 <p>
|
|
733 If not, we may fix the axioms or the model, such as the definitions of the order.
|
|
734 <p>
|
|
735 We can also ask whether the inputs exist.
|
|
736 <p>
|
|
737
|
|
738 <hr/>
|
359
|
739 <h2><a name="content030">Countable Ordinals can contains uncountable set?</a></h2>
|
273
|
740 Yes, the ordinals contains any level of infinite Set in the axioms.
|
|
741 <p>
|
|
742 If we handle real-number in the model, only countable number of real-number is used.
|
|
743 <p>
|
|
744
|
|
745 <pre>
|
|
746 from the outside view point, it is countable
|
|
747 from the internal view point, it is uncountable
|
|
748
|
|
749 </pre>
|
|
750 The definition of countable/uncountable is the same, but the properties are different
|
|
751 depending on the context.
|
|
752 <p>
|
|
753 We don't show the definition of cardinal number here.
|
|
754 <p>
|
|
755
|
|
756 <hr/>
|
359
|
757 <h2><a name="content031">What is Set</a></h2>
|
273
|
758 The word Set in Agda is not a Set of ZF Set, but it is a type (why it is named Set?).
|
|
759 <p>
|
|
760 From naive point view, a set i a list, but in Agda, elements have all the same type.
|
|
761 A set in ZF may contain other Sets in ZF, which not easy to implement it as a list.
|
|
762 <p>
|
|
763 Finite set may be written in finite series of ∨, but ...
|
|
764 <p>
|
|
765
|
|
766 <hr/>
|
359
|
767 <h2><a name="content032">We don't ask the contents of Set. It can be anything.</a></h2>
|
273
|
768 From empty set φ, we can think a set contains a φ, and a pair of φ and the set, and so on,
|
|
769 and all of them, and again we repeat this.
|
|
770 <p>
|
|
771
|
|
772 <pre>
|
|
773 φ {φ} {φ,{φ}}, {φ,{φ},...}
|
|
774
|
|
775 </pre>
|
|
776 It is called V.
|
|
777 <p>
|
|
778 This operation can be performed within a ZF Set theory. Classical Set Theory assumes
|
|
779 ZF, so this kind of thing is allowed.
|
|
780 <p>
|
|
781 But in our case, we have no ZF theory, so we are going to use Ordinals.
|
|
782 <p>
|
338
|
783 The idea is to use an ordinal as a pointer to a record which defines a Set.
|
|
784 If the recored defines a series of Ordinals which is a pointer to the Set. This record looks like a Set.
|
|
785 <p>
|
273
|
786
|
|
787 <hr/>
|
359
|
788 <h2><a name="content033">Ordinal Definable Set</a></h2>
|
273
|
789 We can define a sbuset of Ordinals using predicates. What is a subset?
|
|
790 <p>
|
|
791
|
|
792 <pre>
|
|
793 a predicate has an Ordinal argument
|
|
794
|
|
795 </pre>
|
|
796 is an Ordinal Definable Set (OD). In Agda, OD is defined as follows.
|
|
797 <p>
|
|
798
|
|
799 <pre>
|
|
800 record OD : Set (suc n ) where
|
|
801 field
|
|
802 def : (x : Ordinal ) → Set n
|
|
803
|
|
804 </pre>
|
|
805 Ordinals itself is not a set in a ZF Set theory but a class. In OD,
|
|
806 <p>
|
|
807
|
|
808 <pre>
|
338
|
809 data One : Set n where
|
|
810 OneObj : One
|
|
811 record { def = λ x → One }
|
273
|
812
|
|
813 </pre>
|
338
|
814 means it accepets all Ordinals, i.e. this is Ordinals itself, so ODs are larger than ZF Set.
|
|
815 You can say OD is a class in ZF Set Theory term.
|
|
816 <p>
|
|
817
|
|
818 <hr/>
|
359
|
819 <h2><a name="content034">OD is not ZF Set</a></h2>
|
338
|
820 If we have 1 to 1 mapping between an OD and an Ordinal, OD contains several ODs and OD looks like
|
|
821 a Set. The idea is to use an ordinal as a pointer to OD.
|
|
822 Unfortunately this scheme does not work well. As we saw OD includes all Ordinals, which is a maximum of OD, but Ordinals has no maximum at all. So we have a contradction like
|
|
823 <p>
|
|
824
|
|
825 <pre>
|
|
826 ¬OD-order : ( od→ord : OD → Ordinal )
|
|
827 → ( ord→od : Ordinal → OD ) → ( { x y : OD } → def y ( od→ord x ) → od→ord x o< od→ord y) → ⊥
|
|
828 ¬OD-order od→ord ord→od c<→o< = ?
|
|
829
|
|
830 </pre>
|
|
831 Actualy we can prove this contrdction, so we need some restrctions on OD.
|
|
832 <p>
|
|
833 This is a kind of Russel paradox, that is if OD contains everything, what happens if it contains itself.
|
273
|
834 <p>
|
|
835
|
|
836 <hr/>
|
359
|
837 <h2><a name="content035"> HOD : Hereditarily Ordinal Definable</a></h2>
|
338
|
838 What we need is a bounded OD, the containment is limited by an ordinal.
|
|
839 <p>
|
|
840
|
|
841 <pre>
|
|
842 record HOD : Set (suc n) where
|
|
843 field
|
|
844 od : OD
|
|
845 odmax : Ordinal
|
|
846 <odmax : {y : Ordinal} → def od y → y o< odmax
|
|
847
|
|
848 </pre>
|
|
849 In classical Set Theory, HOD stands for Hereditarily Ordinal Definable, which means
|
273
|
850 <p>
|
|
851
|
|
852 <pre>
|
338
|
853 HOD = { x | TC x ⊆ OD }
|
273
|
854
|
|
855 </pre>
|
338
|
856 TC x is all transitive closure of x, that is elements of x and following all elements of them are all OD. But what is x? In this case, x is an Set which we don't have yet. In our case, HOD is a bounded OD.
|
|
857 <p>
|
|
858
|
|
859 <hr/>
|
359
|
860 <h2><a name="content036">1 to 1 mapping between an HOD and an Ordinal</a></h2>
|
338
|
861 HOD is a predicate on Ordinals and the solution is bounded by some ordinal. If we have a mapping
|
|
862 <p>
|
|
863
|
|
864 <pre>
|
|
865 od→ord : HOD → Ordinal
|
|
866 ord→od : Ordinal → HOD
|
|
867 oiso : {x : HOD } → ord→od ( od→ord x ) ≡ x
|
|
868 diso : {x : Ordinal } → od→ord ( ord→od x ) ≡ x
|
|
869
|
|
870 </pre>
|
|
871 we can check an HOD is an element of the OD using def.
|
273
|
872 <p>
|
|
873 A ∋ x can be define as follows.
|
|
874 <p>
|
|
875
|
|
876 <pre>
|
338
|
877 _∋_ : ( A x : HOD ) → Set n
|
|
878 _∋_ A x = def (od A) ( od→ord x )
|
273
|
879
|
|
880 </pre>
|
|
881 In ψ : Ordinal → Set, if A is a record { def = λ x → ψ x } , then
|
|
882 <p>
|
|
883
|
|
884 <pre>
|
|
885 A x = def A ( od→ord x ) = ψ (od→ord x)
|
|
886
|
|
887 </pre>
|
|
888 They say the existing of the mappings can be proved in Classical Set Theory, but we
|
|
889 simply assumes these non constructively.
|
|
890 <p>
|
|
891 <img src="fig/ord-od-mapping.svg">
|
|
892
|
|
893 <p>
|
|
894
|
|
895 <hr/>
|
359
|
896 <h2><a name="content037">Order preserving in the mapping of OD and Ordinal</a></h2>
|
338
|
897 Ordinals have the order and HOD has a natural order based on inclusion ( def / ∋ ).
|
273
|
898 <p>
|
|
899
|
|
900 <pre>
|
338
|
901 def (od y) ( od→ord x )
|
273
|
902
|
|
903 </pre>
|
338
|
904 An elements of HOD should be defined before the HOD, that is, an ordinal corresponding an elements
|
273
|
905 have to be smaller than the corresponding ordinal of the containing OD.
|
338
|
906 We also assumes subset is always smaller. This is necessary to make a limit of Power Set.
|
273
|
907 <p>
|
|
908
|
|
909 <pre>
|
338
|
910 c<→o< : {x y : HOD } → def (od y) ( od→ord x ) → od→ord x o< od→ord y
|
|
911 ⊆→o≤ : {y z : HOD } → ({x : Ordinal} → def (od y) x → def (od z) x ) → od→ord y o< osuc (od→ord z)
|
273
|
912
|
|
913 </pre>
|
338
|
914 If wa assumes reverse order preservation,
|
273
|
915 <p>
|
|
916
|
|
917 <pre>
|
|
918 o<→c< : {n : Level} {x y : Ordinal } → x o< y → def (ord→od y) x
|
|
919
|
|
920 </pre>
|
338
|
921 ∀ x ∋ ∅ becomes true, which manes all OD becomes Ordinals in the model.
|
273
|
922 <p>
|
|
923 <img src="fig/ODandOrdinals.svg">
|
|
924
|
|
925 <p>
|
|
926
|
|
927 <hr/>
|
359
|
928 <h2><a name="content038">Various Sets</a></h2>
|
273
|
929 In classical Set Theory, there is a hierarchy call L, which can be defined by a predicate.
|
|
930 <p>
|
|
931
|
|
932 <pre>
|
|
933 Ordinal / things satisfies axiom of Ordinal / extension of natural number
|
|
934 V / hierarchical construction of Set from φ
|
|
935 L / hierarchical predicate definable construction of Set from φ
|
338
|
936 HOD / Hereditarily Ordinal Definable
|
273
|
937 OD / equational formula on Ordinals
|
|
938 Agda Set / Type / it also has a level
|
|
939
|
|
940 </pre>
|
|
941
|
|
942 <hr/>
|
361
|
943 <h2><a name="content039">Fixing ZF axom to fit intuitionistic logic</a></h2>
|
273
|
944
|
|
945 <p>
|
|
946 We use ODs as Sets in ZF, and defines record ZF, that is, we have to define
|
|
947 ZF axioms in Agda.
|
|
948 <p>
|
|
949 It may not valid in our model. We have to debug it.
|
|
950 <p>
|
|
951 Fixes are depends on axioms.
|
|
952 <p>
|
|
953 <img src="fig/axiom-type.svg">
|
|
954
|
|
955 <p>
|
|
956 <a href="fig/zf-record.html">
|
|
957 ZFのrecord </a>
|
|
958 <p>
|
|
959
|
|
960 <hr/>
|
359
|
961 <h2><a name="content040">Pure logical axioms</a></h2>
|
273
|
962
|
|
963 <pre>
|
279
|
964 empty, pair, select, ε-induction??infinity
|
273
|
965
|
|
966 </pre>
|
|
967 These are logical relations among OD.
|
|
968 <p>
|
|
969
|
|
970 <pre>
|
|
971 empty : ∀( x : ZFSet ) → ¬ ( ∅ ∋ x )
|
|
972 pair→ : ( x y t : ZFSet ) → (x , y) ∋ t → ( t ≈ x ) ∨ ( t ≈ y )
|
|
973 pair← : ( x y t : ZFSet ) → ( t ≈ x ) ∨ ( t ≈ y ) → (x , y) ∋ t
|
|
974 selection : { ψ : ZFSet → Set m } → ∀ { X y : ZFSet } → ( ( y ∈ X ) ∧ ψ y ) ⇔ (y ∈ Select X ψ )
|
|
975 infinity∅ : ∅ ∈ infinite
|
|
976 infinity : ∀( x : ZFSet ) → x ∈ infinite → ( x ∪ ( x , x ) ) ∈ infinite
|
|
977 ε-induction : { ψ : OD → Set (suc n)}
|
|
978 → ( {x : OD } → ({ y : OD } → x ∋ y → ψ y ) → ψ x )
|
|
979 → (x : OD ) → ψ x
|
|
980
|
|
981 </pre>
|
|
982 finitely can be define by Agda data.
|
|
983 <p>
|
|
984
|
|
985 <pre>
|
|
986 data infinite-d : ( x : Ordinal ) → Set n where
|
|
987 iφ : infinite-d o∅
|
|
988 isuc : {x : Ordinal } → infinite-d x →
|
|
989 infinite-d (od→ord ( Union (ord→od x , (ord→od x , ord→od x ) ) ))
|
|
990
|
|
991 </pre>
|
|
992 Union (x , ( x , x )) should be an direct successor of x, but we cannot prove it in our model.
|
|
993 <p>
|
|
994
|
|
995 <hr/>
|
359
|
996 <h2><a name="content041">Axiom of Pair</a></h2>
|
273
|
997 In the Tanaka's book, axiom of pair is as follows.
|
|
998 <p>
|
|
999
|
|
1000 <pre>
|
|
1001 ∀ x ∀ y ∃ z ∀ t ( z ∋ t ↔ t ≈ x ∨ t ≈ y)
|
|
1002
|
|
1003 </pre>
|
|
1004 We have fix ∃ z, a function (x , y) is defined, which is _,_ .
|
|
1005 <p>
|
|
1006
|
|
1007 <pre>
|
|
1008 _,_ : ( A B : ZFSet ) → ZFSet
|
|
1009
|
|
1010 </pre>
|
|
1011 using this, we can define two directions in separates axioms, like this.
|
|
1012 <p>
|
|
1013
|
|
1014 <pre>
|
|
1015 pair→ : ( x y t : ZFSet ) → (x , y) ∋ t → ( t ≈ x ) ∨ ( t ≈ y )
|
|
1016 pair← : ( x y t : ZFSet ) → ( t ≈ x ) ∨ ( t ≈ y ) → (x , y) ∋ t
|
|
1017
|
|
1018 </pre>
|
|
1019 This is already written in Agda, so we use these as axioms. All inputs have ∀.
|
|
1020 <p>
|
|
1021
|
|
1022 <hr/>
|
359
|
1023 <h2><a name="content042">pair in OD</a></h2>
|
273
|
1024 OD is an equation on Ordinals, we can simply write axiom of pair in the OD.
|
|
1025 <p>
|
|
1026
|
|
1027 <pre>
|
338
|
1028 _,_ : HOD → HOD → HOD
|
|
1029 x , y = record { od = record { def = λ t → (t ≡ od→ord x ) ∨ ( t ≡ od→ord y ) } ; odmax = ? ; <odmax = ? }
|
273
|
1030
|
|
1031 </pre>
|
338
|
1032 It is easy to find out odmax from odmax of x and y.
|
|
1033 <p>
|
273
|
1034 ≡ is an equality of λ terms, but please not that this is equality on Ordinals.
|
|
1035 <p>
|
|
1036
|
|
1037 <hr/>
|
359
|
1038 <h2><a name="content043">Validity of Axiom of Pair</a></h2>
|
273
|
1039 Assuming ZFSet is OD, we are going to prove pair→ .
|
|
1040 <p>
|
|
1041
|
|
1042 <pre>
|
|
1043 pair→ : ( x y t : OD ) → (x , y) ∋ t → ( t == x ) ∨ ( t == y )
|
|
1044 pair→ x y t p = ?
|
|
1045
|
|
1046 </pre>
|
|
1047 In this program, type of p is ( x , y ) ∋ t , that is def ( x , y ) that is, (t ≡ od→ord x ) ∨ ( t ≡ od→ord y ) .
|
|
1048 <p>
|
|
1049 Since _∨_ is a data, it can be developed as (C-c C-c : agda2-make-case ).
|
|
1050 <p>
|
|
1051
|
|
1052 <pre>
|
|
1053 pair→ x y t (case1 t≡x ) = ?
|
|
1054 pair→ x y t (case2 t≡y ) = ?
|
|
1055
|
|
1056 </pre>
|
|
1057 The type of the ? is ( t == x ) ∨ ( t == y ), again it is data _∨_ .
|
|
1058 <p>
|
|
1059
|
|
1060 <pre>
|
|
1061 pair→ x y t (case1 t≡x ) = case1 ?
|
|
1062 pair→ x y t (case2 t≡y ) = case2 ?
|
|
1063
|
|
1064 </pre>
|
|
1065 The ? in case1 is t == x, so we have to create this from t≡x, which is a name of a variable
|
|
1066 which type is
|
|
1067 <p>
|
|
1068
|
|
1069 <pre>
|
|
1070 t≡x : od→ord t ≡ od→ord x
|
|
1071
|
|
1072 </pre>
|
|
1073 which is shown by an Agda command (C-C C-E : agda2-show-context ).
|
|
1074 <p>
|
|
1075 But we haven't defined == yet.
|
|
1076 <p>
|
|
1077
|
|
1078 <hr/>
|
359
|
1079 <h2><a name="content044">Equality of OD and Axiom of Extensionality </a></h2>
|
273
|
1080 OD is defined by a predicates, if we compares normal form of the predicates, even if
|
|
1081 it contains the same elements, it may be different, which is no good as an equality of
|
|
1082 Sets.
|
|
1083 <p>
|
|
1084 Axiom of Extensionality requires sets having the same elements are handled in the same way
|
|
1085 each other.
|
|
1086 <p>
|
|
1087
|
|
1088 <pre>
|
|
1089 ∀ z ( z ∈ x ⇔ z ∈ y ) ⇒ ∀ w ( x ∈ w ⇔ y ∈ w )
|
|
1090
|
|
1091 </pre>
|
|
1092 We can write this axiom in Agda as follows.
|
|
1093 <p>
|
|
1094
|
|
1095 <pre>
|
|
1096 extensionality : { A B w : ZFSet } → ( (z : ZFSet) → ( A ∋ z ) ⇔ (B ∋ z) ) → ( A ∈ w ⇔ B ∈ w )
|
|
1097
|
|
1098 </pre>
|
|
1099 So we use ( A ∋ z ) ⇔ (B ∋ z) as an equality (_==_) of our model. We have to show
|
|
1100 A ∈ w ⇔ B ∈ w from A == B.
|
|
1101 <p>
|
|
1102 x == y can be defined in this way.
|
|
1103 <p>
|
|
1104
|
|
1105 <pre>
|
|
1106 record _==_ ( a b : OD ) : Set n where
|
|
1107 field
|
|
1108 eq→ : ∀ { x : Ordinal } → def a x → def b x
|
|
1109 eq← : ∀ { x : Ordinal } → def b x → def a x
|
|
1110
|
|
1111 </pre>
|
338
|
1112 Actually, (z : HOD) → (A ∋ z) ⇔ (B ∋ z) implies od A == od B.
|
273
|
1113 <p>
|
|
1114
|
|
1115 <pre>
|
338
|
1116 extensionality0 : {A B : HOD } → ((z : HOD) → (A ∋ z) ⇔ (B ∋ z)) → od A == od B
|
273
|
1117 eq→ (extensionality0 {A} {B} eq ) {x} d = ?
|
|
1118 eq← (extensionality0 {A} {B} eq ) {x} d = ?
|
|
1119
|
|
1120 </pre>
|
|
1121 ? are def B x and def A x and these are generated from eq : (z : OD) → (A ∋ z) ⇔ (B ∋ z) .
|
|
1122 <p>
|
|
1123 Actual proof is rather complicated.
|
|
1124 <p>
|
|
1125
|
|
1126 <pre>
|
338
|
1127 eq→ (extensionality0 {A} {B} eq ) {x} d = odef-iso {A} {B} (sym diso) (proj1 (eq (ord→od x))) d
|
|
1128 eq← (extensionality0 {A} {B} eq ) {x} d = odef-iso {B} {A} (sym diso) (proj2 (eq (ord→od x))) d
|
273
|
1129
|
|
1130 </pre>
|
|
1131 where
|
|
1132 <p>
|
|
1133
|
|
1134 <pre>
|
338
|
1135 odef-iso : {A B : HOD } {x y : Ordinal } → x ≡ y → (def A (od y) → def (od B) y) → def (od A) x → def (od B) x
|
|
1136 odef-iso refl t = t
|
273
|
1137
|
|
1138 </pre>
|
|
1139
|
|
1140 <hr/>
|
359
|
1141 <h2><a name="content045">Validity of Axiom of Extensionality</a></h2>
|
273
|
1142
|
|
1143 <p>
|
338
|
1144 If we can derive (w ∋ A) ⇔ (w ∋ B) from od A == od B, the axiom becomes valid, but it seems impossible, so we assumes
|
273
|
1145 <p>
|
|
1146
|
|
1147 <pre>
|
338
|
1148 ==→o≡ : { x y : HOD } → (od x == od y) → x ≡ y
|
273
|
1149
|
|
1150 </pre>
|
|
1151 Using this, we have
|
|
1152 <p>
|
|
1153
|
|
1154 <pre>
|
338
|
1155 extensionality : {A B w : HOD } → ((z : HOD ) → (A ∋ z) ⇔ (B ∋ z)) → (w ∋ A) ⇔ (w ∋ B)
|
273
|
1156 proj1 (extensionality {A} {B} {w} eq ) d = subst (λ k → w ∋ k) ( ==→o≡ (extensionality0 {A} {B} eq) ) d
|
338
|
1157 proj2 (extensionality {A} {B} {w} eq ) d = subst (λ k → w ∋ k) (sym ( ==→o≡ (extensionality0 {A} {B} eq) )) d
|
273
|
1158
|
|
1159 </pre>
|
|
1160
|
|
1161 <hr/>
|
359
|
1162 <h2><a name="content046">Axiom of infinity</a></h2>
|
|
1163
|
|
1164 <p>
|
|
1165 It means it has ω as a ZF Set. It is ususally written like this.
|
|
1166 <p>
|
|
1167
|
|
1168 <pre>
|
|
1169 ∃ A ( ∅ ∈ A ∧ ∀ x ∈ A ( x ∪ { x } ∈ A ) )
|
|
1170
|
|
1171 </pre>
|
|
1172 x ∪ { x } is Union (x , (x , x)) in our notation. It contains existential quantifier, so we introduce a function
|
|
1173 <p>
|
|
1174
|
|
1175 <pre>
|
|
1176 infinite : ZFSet
|
|
1177 infinity∅ : ∅ ∈ infinite
|
|
1178 infinity : ∀( x : ZFSet ) → x ∈ infinite → ( x ∪ { x }) ∈ infinite
|
|
1179
|
|
1180 </pre>
|
|
1181
|
|
1182 <hr/>
|
|
1183 <h2><a name="content047">ω in HOD</a></h2>
|
|
1184
|
|
1185 <p>
|
|
1186 To define an OD which arrows od→ord (Union (x , (x , x))) as a predicate, we can use Agda data structure.
|
|
1187 <p>
|
|
1188
|
|
1189 <pre>
|
|
1190 data infinite-d : ( x : Ordinal ) → Set n where
|
|
1191 iφ : infinite-d o∅
|
|
1192 isuc : {x : Ordinal } → infinite-d x →
|
|
1193 infinite-d (od→ord ( Union (ord→od x , (ord→od x , ord→od x ) ) ))
|
|
1194
|
|
1195 </pre>
|
|
1196 It has simular structure as Data.Nat in Agda, and it defines a correspendence of HOD and the data structure. Now
|
|
1197 we can define HOD like this.
|
|
1198 <p>
|
|
1199
|
|
1200 <pre>
|
|
1201 infinite : HOD
|
|
1202 infinite = record { od = record { def = λ x → infinite-d x } ; odmax = ? ; <odmax = ? }
|
|
1203
|
|
1204 </pre>
|
|
1205 So what is the bound of ω? Analyzing the definition, it depends on the value of od→ord (x , x), which
|
|
1206 cannot know the aboslute value. This is because we don't have constructive definition of od→ord : HOD → Ordinal.
|
|
1207 <p>
|
361
|
1208
|
|
1209 <hr/>
|
|
1210 <h2><a name="content048">HOD Ordrinal mapping</a></h2>
|
|
1211 We have large freedom on HOD. We reqest no minimality on odmax, so it may arbitrary larger.
|
|
1212 The address of HOD can be larger at least it have to be larger than the content's address.
|
|
1213 We only have a relative ordering such as
|
|
1214 <p>
|
|
1215
|
|
1216 <pre>
|
|
1217 pair-xx<xy : {x y : HOD} → od→ord (x , x) o< osuc (od→ord (x , y) )
|
|
1218 pair<y : {x y : HOD } → y ∋ x → od→ord (x , x) o< osuc (od→ord y)
|
|
1219
|
|
1220 </pre>
|
|
1221 Basicaly, we cannot know the concrete address of HOD other than empty set.
|
|
1222 <p>
|
|
1223 <img src="fig/address-of-HOD.svg">
|
|
1224
|
|
1225 <p>
|
|
1226
|
|
1227 <hr/>
|
|
1228 <h2><a name="content049">Possible restriction on HOD</a></h2>
|
359
|
1229 We need some restriction on the HOD-Ordinal mapping. Simple one is this.
|
|
1230 <p>
|
|
1231
|
|
1232 <pre>
|
|
1233 ωmax : Ordinal
|
|
1234 <ωmax : {y : Ordinal} → infinite-d y → y o< ωmax
|
|
1235
|
|
1236 </pre>
|
|
1237 It depends on infinite-d and put no assuption on the other similar construction. A more general one may be
|
|
1238 <p>
|
|
1239
|
|
1240 <pre>
|
|
1241 hod-ord< : {x : HOD } → Set n
|
|
1242 hod-ord< {x} = od→ord x o< next (odmax x)
|
|
1243
|
|
1244 </pre>
|
|
1245 next : Ordinal → Ordinal means imediate next limit ordinal of x. It supress unecessary space between address of HOD and
|
|
1246 its bound.
|
|
1247 <p>
|
|
1248 In other words, the space between address of HOD and its bound is arbitrary, it is possible to assume ω has no bound.
|
|
1249 This is the reason of necessity of Axiom of infinite.
|
|
1250 <p>
|
|
1251
|
|
1252 <hr/>
|
361
|
1253 <h2><a name="content050">increment pase of address of HOD</a></h2>
|
|
1254 Assuming, hod-ord< , we have
|
359
|
1255 <p>
|
|
1256
|
|
1257 <pre>
|
|
1258 pair-ord< : {x : HOD } → ( {y : HOD } → od→ord y o< next (odmax y) ) → od→ord ( x , x ) o< next (od→ord x)
|
|
1259 pair-ord< {x} ho< = subst (λ k → od→ord (x , x) o< k ) lemmab0 lemmab1 where
|
|
1260 lemmab0 : next (odmax (x , x)) ≡ next (od→ord x)
|
|
1261
|
|
1262 </pre>
|
361
|
1263 So the address of ( x , x) and Union (x , (x , x)) is restricted in the limit ordinal. This makes ω bound. We can prove
|
359
|
1264 <p>
|
361
|
1265
|
|
1266 <pre>
|
|
1267 infinite-bound : ({x : HOD} → od→ord x o< next (odmax x)) → {y : Ordinal} → infinite-d y → y o< next o∅
|
|
1268
|
|
1269 </pre>
|
359
|
1270 We also notice that if we have od→ord (x , x) ≡ osuc (od→ord x), c<→o< can be drived from ⊆→o≤ .
|
|
1271 <p>
|
|
1272
|
|
1273 <pre>
|
|
1274 ⊆→o≤→c<→o< : ({x : HOD} → od→ord (x , x) ≡ osuc (od→ord x) )
|
|
1275 → ({y z : HOD } → ({x : Ordinal} → def (od y) x → def (od z) x ) → od→ord y o< osuc (od→ord z) )
|
|
1276 → {x y : HOD } → def (od y) ( od→ord x ) → od→ord x o< od→ord y
|
|
1277
|
|
1278 </pre>
|
|
1279
|
|
1280 <hr/>
|
361
|
1281 <h2><a name="content051">Non constructive assumptions so far</a></h2>
|
338
|
1282
|
273
|
1283 <p>
|
|
1284
|
|
1285 <pre>
|
338
|
1286 od→ord : HOD → Ordinal
|
|
1287 ord→od : Ordinal → HOD
|
|
1288 c<→o< : {x y : HOD } → def (od y) ( od→ord x ) → od→ord x o< od→ord y
|
|
1289 ⊆→o≤ : {y z : HOD } → ({x : Ordinal} → def (od y) x → def (od z) x ) → od→ord y o< osuc (od→ord z)
|
|
1290 oiso : {x : HOD } → ord→od ( od→ord x ) ≡ x
|
|
1291 diso : {x : Ordinal } → od→ord ( ord→od x ) ≡ x
|
|
1292 ==→o≡ : {x y : HOD } → (od x == od y) → x ≡ y
|
|
1293 sup-o : (A : HOD) → ( ( x : Ordinal ) → def (od A) x → Ordinal ) → Ordinal
|
|
1294 sup-o< : (A : HOD) → { ψ : ( x : Ordinal ) → def (od A) x → Ordinal } → ∀ {x : Ordinal } → (lt : def (od A) x ) → ψ x lt o< sup-o A ψ
|
273
|
1295
|
|
1296 </pre>
|
|
1297
|
|
1298 <hr/>
|
361
|
1299 <h2><a name="content052">Axiom which have negation form</a></h2>
|
273
|
1300
|
|
1301 <p>
|
|
1302
|
|
1303 <pre>
|
|
1304 Union, Selection
|
|
1305
|
|
1306 </pre>
|
|
1307 These axioms contains ∃ x as a logical relation, which can be described in ¬ ( ∀ x ( ¬ p )).
|
|
1308 <p>
|
|
1309 Axiom of replacement uses upper bound of function on Ordinals, which makes it non-constructive.
|
|
1310 <p>
|
|
1311 Power Set axiom requires double negation,
|
|
1312 <p>
|
|
1313
|
|
1314 <pre>
|
|
1315 power→ : ∀( A t : ZFSet ) → Power A ∋ t → ∀ {x} → t ∋ x → ¬ ¬ ( A ∋ x )
|
|
1316 power← : ∀( A t : ZFSet ) → t ⊆_ A → Power A ∋ t
|
|
1317
|
|
1318 </pre>
|
|
1319 If we have an assumption of law of exclude middle, we can recover the original A ∋ x form.
|
|
1320 <p>
|
|
1321
|
|
1322 <hr/>
|
361
|
1323 <h2><a name="content053">Union </a></h2>
|
273
|
1324 The original form of the Axiom of Union is
|
|
1325 <p>
|
|
1326
|
|
1327 <pre>
|
|
1328 ∀ x ∃ y ∀ z (z ∈ y ⇔ ∃ u ∈ x ∧ (z ∈ u))
|
|
1329
|
|
1330 </pre>
|
|
1331 Union requires the existence of b in a ⊇ ∃ b ∋ x . We will use negation form of ∃.
|
|
1332 <p>
|
|
1333
|
|
1334 <pre>
|
|
1335 union→ : ( X z u : ZFSet ) → ( X ∋ u ) ∧ (u ∋ z ) → Union X ∋ z
|
|
1336 union← : ( X z : ZFSet ) → (X∋z : Union X ∋ z ) → ¬ ( (u : ZFSet ) → ¬ ((X ∋ u) ∧ (u ∋ z )))
|
|
1337
|
|
1338 </pre>
|
359
|
1339 The definition of Union in HOD is like this.
|
273
|
1340 <p>
|
|
1341
|
|
1342 <pre>
|
359
|
1343 Union : HOD → HOD
|
|
1344 Union U = record { od = record { def = λ x → ¬ (∀ (u : Ordinal ) → ¬ ((odef U u) ∧ (odef (ord→od u) x))) }
|
|
1345 ; odmax = osuc (od→ord U) ; <odmax = ? }
|
273
|
1346
|
|
1347 </pre>
|
359
|
1348 The bound of Union is evident, but its proof is rather complicated.
|
|
1349 <p>
|
273
|
1350 Proof of validity is straight forward.
|
|
1351 <p>
|
|
1352
|
|
1353 <pre>
|
359
|
1354 union→ : (X z u : HOD) → (X ∋ u) ∧ (u ∋ z) → Union X ∋ z
|
273
|
1355 union→ X z u xx not = ⊥-elim ( not (od→ord u) ( record { proj1 = proj1 xx
|
359
|
1356 ; proj2 = subst ( λ k → odef k (od→ord z)) (sym oiso) (proj2 xx) } ))
|
|
1357 union← : (X z : HOD) (X∋z : Union X ∋ z) → ¬ ( (u : HOD ) → ¬ ((X ∋ u) ∧ (u ∋ z )))
|
273
|
1358 union← X z UX∋z = FExists _ lemma UX∋z where
|
359
|
1359 lemma : {y : Ordinal} → odef X y ∧ odef (ord→od y) (od→ord z) → ¬ ((u : HOD) → ¬ (X ∋ u) ∧ (u ∋ z))
|
|
1360 lemma {y} xx not = not (ord→od y) record { proj1 = subst ( λ k → odef X k ) (sym diso) (proj1 xx ) ; proj2 = proj2 xx }
|
273
|
1361
|
|
1362 </pre>
|
|
1363 where
|
|
1364 <p>
|
|
1365
|
|
1366 <pre>
|
|
1367 FExists : {m l : Level} → ( ψ : Ordinal → Set m )
|
|
1368 → {p : Set l} ( P : { y : Ordinal } → ψ y → ¬ p )
|
|
1369 → (exists : ¬ (∀ y → ¬ ( ψ y ) ))
|
|
1370 → ¬ p
|
|
1371 FExists {m} {l} ψ {p} P = contra-position ( λ p y ψy → P {y} ψy p )
|
|
1372
|
|
1373 </pre>
|
|
1374 which checks existence using contra-position.
|
|
1375 <p>
|
|
1376
|
|
1377 <hr/>
|
361
|
1378 <h2><a name="content054">Axiom of replacement</a></h2>
|
273
|
1379 We can replace the elements of a set by a function and it becomes a set. From the book,
|
|
1380 <p>
|
|
1381
|
|
1382 <pre>
|
|
1383 ∀ x ∀ y ∀ z ( ( ψ ( x , y ) ∧ ψ ( x , z ) ) → y = z ) → ∀ X ∃ A ∀ y ( y ∈ A ↔ ∃ x ∈ X ψ ( x , y ) )
|
|
1384
|
|
1385 </pre>
|
|
1386 The existential quantifier can be related by a function,
|
|
1387 <p>
|
|
1388
|
|
1389 <pre>
|
359
|
1390 Replace : HOD → (HOD → HOD ) → HOD
|
273
|
1391
|
|
1392 </pre>
|
|
1393 The axioms becomes as follows.
|
|
1394 <p>
|
|
1395
|
|
1396 <pre>
|
|
1397 replacement← : {ψ : ZFSet → ZFSet} → ∀ ( X x : ZFSet ) → x ∈ X → ψ x ∈ Replace X ψ
|
|
1398 replacement→ : {ψ : ZFSet → ZFSet} → ∀ ( X x : ZFSet ) → ( lt : x ∈ Replace X ψ ) → ¬ ( ∀ (y : ZFSet) → ¬ ( x ≈ ψ y ) )
|
|
1399
|
|
1400 </pre>
|
|
1401 In the axiom, the existence of the original elements is necessary. In order to do that we use OD which has
|
|
1402 negation form of existential quantifier in the definition.
|
|
1403 <p>
|
|
1404
|
|
1405 <pre>
|
|
1406 in-codomain : (X : OD ) → ( ψ : OD → OD ) → OD
|
|
1407 in-codomain X ψ = record { def = λ x → ¬ ( (y : Ordinal ) → ¬ ( def X y ∧ ( x ≡ od→ord (ψ (ord→od y ))))) }
|
|
1408
|
|
1409 </pre>
|
359
|
1410 in-codomain is a logical relation-ship, and it is written in OD.
|
273
|
1411 <p>
|
|
1412
|
|
1413 <pre>
|
359
|
1414 Replace : HOD → (HOD → HOD) → HOD
|
|
1415 Replace X ψ = record { od = record { def = λ x → (x o< sup-o X (λ y X∋y → od→ord (ψ (ord→od y)))) ∧ def (in-codomain X ψ) x }
|
|
1416 ; odmax = rmax ; <odmax = rmax<} where
|
|
1417 rmax : Ordinal
|
|
1418 rmax = sup-o X (λ y X∋y → od→ord (ψ (ord→od y)))
|
|
1419 rmax< : {y : Ordinal} → (y o< rmax) ∧ def (in-codomain X ψ) y → y o< rmax
|
|
1420 rmax< lt = proj1 lt
|
273
|
1421
|
|
1422 </pre>
|
359
|
1423 The bbound of Replace is defined by supremum, that is, it is not limited in a limit ordinal of original ZF Set.
|
|
1424 <p>
|
|
1425 Once we have a bound, validity of the axiom is an easy task to check the logical relation-ship.
|
273
|
1426 <p>
|
|
1427
|
|
1428 <hr/>
|
361
|
1429 <h2><a name="content055">Validity of Power Set Axiom</a></h2>
|
273
|
1430 The original Power Set Axiom is this.
|
|
1431 <p>
|
|
1432
|
|
1433 <pre>
|
|
1434 ∀ X ∃ A ∀ t ( t ∈ A ↔ t ⊆ X ) )
|
|
1435
|
|
1436 </pre>
|
|
1437 The existential quantifier is replaced by a function
|
|
1438 <p>
|
|
1439
|
|
1440 <pre>
|
|
1441 Power : ( A : OD ) → OD
|
|
1442
|
|
1443 </pre>
|
|
1444 t ⊆ X is a record like this.
|
|
1445 <p>
|
|
1446
|
|
1447 <pre>
|
|
1448 record _⊆_ ( A B : OD ) : Set (suc n) where
|
|
1449 field
|
|
1450 incl : { x : OD } → A ∋ x → B ∋ x
|
|
1451
|
|
1452 </pre>
|
|
1453 Axiom becomes likes this.
|
|
1454 <p>
|
|
1455
|
|
1456 <pre>
|
|
1457 power→ : ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x)
|
|
1458 power← : (A t : OD) → ({x : OD} → (t ∋ x → A ∋ x)) → Power A ∋ t
|
|
1459
|
|
1460 </pre>
|
|
1461 The validity of the axioms are slight complicated, we have to define set of all subset. We define
|
|
1462 subset in a different form.
|
|
1463 <p>
|
|
1464
|
|
1465 <pre>
|
359
|
1466 ZFSubset : (A x : HOD ) → HOD
|
|
1467 ZFSubset A x = record { od = record { def = λ y → odef A y ∧ odef x y } ; odmax = omin (odmax A) (odmax x) ; <odmax = lemma } where
|
|
1468 lemma : {y : Ordinal} → def (od A) y ∧ def (od x) y → y o< omin (odmax A) (odmax x)
|
|
1469 lemma {y} and = min1 (<odmax A (proj1 and)) (<odmax x (proj2 and))
|
273
|
1470
|
|
1471 </pre>
|
|
1472 We can prove,
|
|
1473 <p>
|
|
1474
|
|
1475 <pre>
|
359
|
1476 ( {y : HOD } → x ∋ y → ZFSubset A x ∋ y ) ⇔ ( x ⊆ A )
|
273
|
1477
|
|
1478 </pre>
|
|
1479 We only have upper bound as an ordinal, but we have an obvious OD based on the order of Ordinals,
|
|
1480 which is an Ordinals with our Model.
|
|
1481 <p>
|
|
1482
|
|
1483 <pre>
|
|
1484 Ord : ( a : Ordinal ) → OD
|
|
1485 Ord a = record { def = λ y → y o< a }
|
|
1486 Def : (A : OD ) → OD
|
|
1487 Def A = Ord ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) )
|
|
1488
|
|
1489 </pre>
|
|
1490 This is slight larger than Power A, so we replace all elements x by A ∩ x (some of them may empty).
|
|
1491 <p>
|
|
1492
|
|
1493 <pre>
|
|
1494 Power : OD → OD
|
|
1495 Power A = Replace (Def (Ord (od→ord A))) ( λ x → A ∩ x )
|
|
1496
|
|
1497 </pre>
|
|
1498 Creating Power Set of Ordinals is rather easy, then we use replacement axiom on A ∩ x since we have this.
|
|
1499 <p>
|
|
1500
|
|
1501 <pre>
|
359
|
1502 ∩-≡ : { a b : HOD } → ({x : HOD } → (a ∋ x → b ∋ x)) → od a == od ( b ∩ a )
|
273
|
1503
|
|
1504 </pre>
|
|
1505 In case of Ord a intro of Power Set axiom becomes valid.
|
|
1506 <p>
|
|
1507
|
|
1508 <pre>
|
359
|
1509 ord-power← : (a : Ordinal ) (t : HOD) → ({x : HOD} → (t ∋ x → (Ord a) ∋ x)) → OPwr (Ord a) ∋ t
|
273
|
1510
|
|
1511 </pre>
|
|
1512 Using this, we can prove,
|
|
1513 <p>
|
|
1514
|
|
1515 <pre>
|
359
|
1516 power→ : ( A t : HOD) → Power A ∋ t → {x : HOD} → t ∋ x → ¬ ¬ (A ∋ x)
|
|
1517 power← : (A t : HOD) → ({x : HOD} → (t ∋ x → A ∋ x)) → Power A ∋ t
|
273
|
1518
|
|
1519 </pre>
|
|
1520
|
|
1521 <hr/>
|
361
|
1522 <h2><a name="content056">Axiom of regularity, Axiom of choice, ε-induction</a></h2>
|
273
|
1523
|
|
1524 <p>
|
|
1525 Axiom of regularity requires non self intersectable elements (which is called minimum), if we
|
|
1526 replace it by a function, it becomes a choice function. It makes axiom of choice valid.
|
|
1527 <p>
|
|
1528 This means we cannot prove axiom regularity form our model, and if we postulate this, axiom of
|
|
1529 choice also becomes valid.
|
|
1530 <p>
|
|
1531
|
|
1532 <pre>
|
359
|
1533 minimal : (x : HOD ) → ¬ (x == od∅ )→ OD
|
|
1534 x∋minimal : (x : HOD ) → ( ne : ¬ (x == od∅ ) ) → def x ( od→ord ( minimal x ne ) )
|
|
1535 minimal-1 : (x : HOD ) → ( ne : ¬ (x == od∅ ) ) → (y : HOD ) → ¬ ( def (minimal x ne) (od→ord y)) ∧ (def x (od→ord y) )
|
273
|
1536
|
|
1537 </pre>
|
|
1538 We can avoid this using ε-induction (a predicate is valid on all set if the predicate is true on some element of set).
|
|
1539 Assuming law of exclude middle, they say axiom of regularity will be proved, but we haven't check it yet.
|
|
1540 <p>
|
|
1541
|
|
1542 <pre>
|
359
|
1543 ε-induction : { ψ : HOD → Set (suc n)}
|
|
1544 → ( {x : HOD } → ({ y : HOD } → x ∋ y → ψ y ) → ψ x )
|
|
1545 → (x : HOD ) → ψ x
|
273
|
1546
|
|
1547 </pre>
|
|
1548 In our model, we assumes the mapping between Ordinals and OD, this is actually the TransFinite induction in Ordinals.
|
|
1549 <p>
|
|
1550 The axiom of choice in the book is complicated using any pair in a set, so we use use a form in the Wikipedia.
|
|
1551 <p>
|
|
1552
|
|
1553 <pre>
|
|
1554 ∀ X [ ∅ ∉ X → (∃ f : X → ⋃ X ) → ∀ A ∈ X ( f ( A ) ∈ A ) ]
|
|
1555
|
|
1556 </pre>
|
|
1557 We can formulate like this.
|
|
1558 <p>
|
|
1559
|
|
1560 <pre>
|
|
1561 choice-func : (X : ZFSet ) → {x : ZFSet } → ¬ ( x ≈ ∅ ) → ( X ∋ x ) → ZFSet
|
|
1562 choice : (X : ZFSet ) → {A : ZFSet } → ( X∋A : X ∋ A ) → (not : ¬ ( A ≈ ∅ )) → A ∋ choice-func X not X∋A
|
|
1563
|
|
1564 </pre>
|
|
1565 It does not requires ∅ ∉ X .
|
|
1566 <p>
|
|
1567
|
|
1568 <hr/>
|
361
|
1569 <h2><a name="content057">Axiom of choice and Law of Excluded Middle</a></h2>
|
359
|
1570 In our model, since HOD has a mapping to Ordinals, it has evident order, which means well ordering theorem is valid,
|
273
|
1571 but it don't have correct form of the axiom yet. They say well ordering axiom is equivalent to the axiom of choice,
|
|
1572 but it requires law of the exclude middle.
|
|
1573 <p>
|
|
1574 Actually, it is well known to prove law of the exclude middle from axiom of choice in intuitionistic logic, and we can
|
|
1575 perform the proof in our mode. Using the definition like this, predicates and ODs are related and we can ask the
|
|
1576 set is empty or not if we have an axiom of choice, so we have the law of the exclude middle p ∨ ( ¬ p ) .
|
|
1577 <p>
|
|
1578
|
|
1579 <pre>
|
359
|
1580 ppp : { p : Set n } { a : HOD } → record { def = λ x → p } ∋ a → p
|
273
|
1581 ppp {p} {a} d = d
|
|
1582
|
|
1583 </pre>
|
|
1584 We can prove axiom of choice from law excluded middle since we have TransFinite induction. So Axiom of choice
|
|
1585 and Law of Excluded Middle is equivalent in our mode.
|
|
1586 <p>
|
|
1587
|
|
1588 <hr/>
|
361
|
1589 <h2><a name="content058">Relation-ship among ZF axiom</a></h2>
|
273
|
1590 <img src="fig/axiom-dependency.svg">
|
|
1591
|
|
1592 <p>
|
|
1593
|
|
1594 <hr/>
|
361
|
1595 <h2><a name="content059">Non constructive assumption in our model</a></h2>
|
359
|
1596 mapping between HOD and Ordinals
|
273
|
1597 <p>
|
|
1598
|
|
1599 <pre>
|
359
|
1600 od→ord : HOD → Ordinal
|
273
|
1601 ord→od : Ordinal → OD
|
359
|
1602 oiso : {x : HOD } → ord→od ( od→ord x ) ≡ x
|
273
|
1603 diso : {x : Ordinal } → od→ord ( ord→od x ) ≡ x
|
359
|
1604 c<→o< : {x y : HOD } → def y ( od→ord x ) → od→ord x o< od→ord y
|
|
1605 ⊆→o≤ : {y z : HOD } → ({x : Ordinal} → def (od y) x → def (od z) x ) → od→ord y o< osuc (od→ord z)
|
273
|
1606
|
|
1607 </pre>
|
|
1608 Equivalence on OD
|
|
1609 <p>
|
|
1610
|
|
1611 <pre>
|
359
|
1612 ==→o≡ : { x y : HOD } → (od x == od y) → x ≡ y
|
273
|
1613
|
|
1614 </pre>
|
|
1615 Upper bound
|
|
1616 <p>
|
|
1617
|
|
1618 <pre>
|
359
|
1619 sup-o : (A : HOD) → ( ( x : Ordinal ) → def (od A) x → Ordinal ) → Ordinal
|
|
1620 sup-o< : (A : HOD) → { ψ : ( x : Ordinal ) → def (od A) x → Ordinal } → ∀ {x : Ordinal } → (lt : def (od A) x ) → ψ x lt o< sup-o A ψ
|
|
1621
|
|
1622 </pre>
|
|
1623 In order to have bounded ω,
|
|
1624 <p>
|
|
1625
|
|
1626 <pre>
|
|
1627 hod-ord< : {x : HOD} → od→ord x o< next (odmax x)
|
273
|
1628
|
|
1629 </pre>
|
|
1630 Axiom of choice and strong axiom of regularity.
|
|
1631 <p>
|
|
1632
|
|
1633 <pre>
|
359
|
1634 minimal : (x : HOD ) → ¬ (x =h= od∅ )→ HOD
|
|
1635 x∋minimal : (x : HOD ) → ( ne : ¬ (x =h= od∅ ) ) → odef x ( od→ord ( minimal x ne ) )
|
|
1636 minimal-1 : (x : HOD ) → ( ne : ¬ (x =h= od∅ ) ) → (y : HOD ) → ¬ ( odef (minimal x ne) (od→ord y)) ∧ (odef x (od→ord y) )
|
273
|
1637
|
|
1638 </pre>
|
|
1639
|
|
1640 <hr/>
|
361
|
1641 <h2><a name="content060">So it this correct?</a></h2>
|
273
|
1642
|
|
1643 <p>
|
|
1644 Our axiom are syntactically the same in the text book, but negations are slightly different.
|
|
1645 <p>
|
|
1646 If we assumes excluded middle, these are exactly same.
|
|
1647 <p>
|
|
1648 Even if we assumes excluded middle, intuitionistic logic itself remains consistent, but we cannot prove it.
|
|
1649 <p>
|
|
1650 Except the upper bound, axioms are simple logical relation.
|
|
1651 <p>
|
359
|
1652 Proof of existence of mapping between HOD and Ordinals are not obvious. We don't know we prove it or not.
|
273
|
1653 <p>
|
|
1654 Existence of the Upper bounds is a pure assumption, if we have not limit on Ordinals, it may contradicts,
|
|
1655 but we don't have explicit upper limit on Ordinals.
|
|
1656 <p>
|
|
1657 Several inference on our model or our axioms are basically parallel to the set theory text book, so it looks like correct.
|
|
1658 <p>
|
|
1659
|
|
1660 <hr/>
|
361
|
1661 <h2><a name="content061">How to use Agda Set Theory</a></h2>
|
273
|
1662 Assuming record ZF, classical set theory can be developed. If necessary, axiom of choice can be
|
|
1663 postulated or assuming law of excluded middle.
|
|
1664 <p>
|
|
1665 Instead, simply assumes non constructive assumption, various theory can be developed. We haven't check
|
|
1666 these assumptions are proved in record ZF, so we are not sure, these development is a result of ZF Set theory.
|
|
1667 <p>
|
|
1668 ZF record itself is not necessary, for example, topology theory without ZF can be possible.
|
|
1669 <p>
|
|
1670
|
|
1671 <hr/>
|
361
|
1672 <h2><a name="content062">Topos and Set Theory</a></h2>
|
273
|
1673 Topos is a mathematical structure in Category Theory, which is a Cartesian closed category which has a
|
|
1674 sub-object classifier.
|
|
1675 <p>
|
|
1676 Topos itself is model of intuitionistic logic.
|
|
1677 <p>
|
|
1678 Transitive Sets are objects of Cartesian closed category.
|
|
1679 It is possible to introduce Power Set Functor on it
|
|
1680 <p>
|
|
1681 We can use replacement A ∩ x for each element in Transitive Set,
|
|
1682 in the similar way of our power set axiom. I
|
|
1683 <p>
|
|
1684 A model of ZF Set theory can be constructed on top of the Topos which is shown in Oisus.
|
|
1685 <p>
|
|
1686 Our Agda model is a proof theoretic version of it.
|
|
1687 <p>
|
|
1688
|
|
1689 <hr/>
|
361
|
1690 <h2><a name="content063">Cardinal number and Continuum hypothesis</a></h2>
|
273
|
1691 Axiom of choice is required to define cardinal number
|
|
1692 <p>
|
|
1693 definition of cardinal number is not yet done
|
|
1694 <p>
|
|
1695 definition of filter is not yet done
|
|
1696 <p>
|
|
1697 we may have a model without axiom of choice or without continuum hypothesis
|
|
1698 <p>
|
|
1699 Possible representation of continuum hypothesis is this.
|
|
1700 <p>
|
|
1701
|
|
1702 <pre>
|
|
1703 continuum-hyphotheis : (a : Ordinal) → Power (Ord a) ⊆ Ord (osuc a)
|
|
1704
|
|
1705 </pre>
|
|
1706
|
|
1707 <hr/>
|
361
|
1708 <h2><a name="content064">Filter</a></h2>
|
273
|
1709
|
|
1710 <p>
|
|
1711 filter is a dual of ideal on boolean algebra or lattice. Existence on natural number
|
|
1712 is depends on axiom of choice.
|
|
1713 <p>
|
|
1714
|
|
1715 <pre>
|
359
|
1716 record Filter ( L : HOD ) : Set (suc n) where
|
273
|
1717 field
|
|
1718 filter : OD
|
|
1719 proper : ¬ ( filter ∋ od∅ )
|
|
1720 inL : filter ⊆ L
|
359
|
1721 filter1 : { p q : HOD } → q ⊆ L → filter ∋ p → p ⊆ q → filter ∋ q
|
|
1722 filter2 : { p q : HOD } → filter ∋ p → filter ∋ q → filter ∋ (p ∩ q)
|
273
|
1723
|
|
1724 </pre>
|
|
1725 We may construct a model of non standard analysis or set theory.
|
|
1726 <p>
|
|
1727 This may be simpler than classical forcing theory ( not yet done).
|
|
1728 <p>
|
|
1729
|
|
1730 <hr/>
|
361
|
1731 <h2><a name="content065">Programming Mathematics</a></h2>
|
273
|
1732 Mathematics is a functional programming in Agda where proof is a value of a variable. The mathematical
|
|
1733 structure are
|
|
1734 <p>
|
|
1735
|
|
1736 <pre>
|
|
1737 record and data
|
|
1738
|
|
1739 </pre>
|
|
1740 Proof is check by type consistency not by the computation, but it may include some normalization.
|
|
1741 <p>
|
|
1742 Type inference and termination is not so clear in multi recursions.
|
|
1743 <p>
|
|
1744 Defining Agda record is a good way to understand mathematical theory, for examples,
|
|
1745 <p>
|
|
1746
|
|
1747 <pre>
|
|
1748 Category theory ( Yoneda lemma, Floyd Adjunction functor theorem, Applicative functor )
|
|
1749 Automaton ( Subset construction、Language containment)
|
|
1750
|
|
1751 </pre>
|
|
1752 are proved in Agda.
|
|
1753 <p>
|
|
1754
|
|
1755 <hr/>
|
361
|
1756 <h2><a name="content066">link</a></h2>
|
273
|
1757 Summer school of foundation of mathematics (in Japanese)<br> <a href="https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/">https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/</a>
|
|
1758 <p>
|
|
1759 Foundation of axiomatic set theory (in Japanese)<br> <a href="https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/sakai0.pdf">https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/sakai0.pdf
|
|
1760 </a>
|
|
1761 <p>
|
|
1762 Agda
|
|
1763 <br> <a href="https://agda.readthedocs.io/en/v2.6.0.1/">https://agda.readthedocs.io/en/v2.6.0.1/</a>
|
|
1764 <p>
|
|
1765 ZF-in-Agda source
|
|
1766 <br> <a href="https://github.com/shinji-kono/zf-in-agda.git">https://github.com/shinji-kono/zf-in-agda.git
|
|
1767 </a>
|
|
1768 <p>
|
|
1769 Category theory in Agda source
|
|
1770 <br> <a href="https://github.com/shinji-kono/category-exercise-in-agda">https://github.com/shinji-kono/category-exercise-in-agda
|
|
1771 </a>
|
|
1772 <p>
|
|
1773 </div>
|
|
1774 <ol class="side" id="menu">
|
|
1775 Constructing ZF Set Theory in Agda
|
279
|
1776 <li><a href="#content000"> ZF in Agda</a>
|
|
1777 <li><a href="#content001"> Programming Mathematics</a>
|
|
1778 <li><a href="#content002"> Target</a>
|
|
1779 <li><a href="#content003"> Why Set Theory</a>
|
|
1780 <li><a href="#content004"> Agda and Intuitionistic Logic </a>
|
|
1781 <li><a href="#content005"> Introduction of Agda </a>
|
|
1782 <li><a href="#content006"> data ( Sum type )</a>
|
|
1783 <li><a href="#content007"> A → B means "A implies B"</a>
|
|
1784 <li><a href="#content008"> introduction と elimination</a>
|
|
1785 <li><a href="#content009"> To prove A → B </a>
|
|
1786 <li><a href="#content010"> A ∧ B</a>
|
|
1787 <li><a href="#content011"> record</a>
|
|
1788 <li><a href="#content012"> Mathematical structure</a>
|
359
|
1789 <li><a href="#content013"> Limit Ordinal</a>
|
|
1790 <li><a href="#content014"> A Model and a theory</a>
|
|
1791 <li><a href="#content015"> postulate と module</a>
|
|
1792 <li><a href="#content016"> A ∨ B</a>
|
|
1793 <li><a href="#content017"> Negation</a>
|
|
1794 <li><a href="#content018"> Equality </a>
|
|
1795 <li><a href="#content019"> Equivalence relation</a>
|
|
1796 <li><a href="#content020"> Ordering</a>
|
|
1797 <li><a href="#content021"> Quantifier</a>
|
|
1798 <li><a href="#content022"> Can we do math in this way?</a>
|
|
1799 <li><a href="#content023"> Things which Agda cannot prove</a>
|
|
1800 <li><a href="#content024"> Classical story of ZF Set Theory</a>
|
|
1801 <li><a href="#content025"> Ordinals</a>
|
|
1802 <li><a href="#content026"> Axiom of Ordinals</a>
|
|
1803 <li><a href="#content027"> Concrete Ordinals or Countable Ordinals</a>
|
|
1804 <li><a href="#content028"> Model of Ordinals</a>
|
|
1805 <li><a href="#content029"> Debugging axioms using Model</a>
|
|
1806 <li><a href="#content030"> Countable Ordinals can contains uncountable set?</a>
|
|
1807 <li><a href="#content031"> What is Set</a>
|
|
1808 <li><a href="#content032"> We don't ask the contents of Set. It can be anything.</a>
|
|
1809 <li><a href="#content033"> Ordinal Definable Set</a>
|
|
1810 <li><a href="#content034"> OD is not ZF Set</a>
|
|
1811 <li><a href="#content035"> HOD : Hereditarily Ordinal Definable</a>
|
|
1812 <li><a href="#content036"> 1 to 1 mapping between an HOD and an Ordinal</a>
|
|
1813 <li><a href="#content037"> Order preserving in the mapping of OD and Ordinal</a>
|
|
1814 <li><a href="#content038"> Various Sets</a>
|
361
|
1815 <li><a href="#content039"> Fixing ZF axom to fit intuitionistic logic</a>
|
359
|
1816 <li><a href="#content040"> Pure logical axioms</a>
|
|
1817 <li><a href="#content041"> Axiom of Pair</a>
|
|
1818 <li><a href="#content042"> pair in OD</a>
|
|
1819 <li><a href="#content043"> Validity of Axiom of Pair</a>
|
|
1820 <li><a href="#content044"> Equality of OD and Axiom of Extensionality </a>
|
|
1821 <li><a href="#content045"> Validity of Axiom of Extensionality</a>
|
|
1822 <li><a href="#content046"> Axiom of infinity</a>
|
|
1823 <li><a href="#content047"> ω in HOD</a>
|
361
|
1824 <li><a href="#content048"> HOD Ordrinal mapping</a>
|
|
1825 <li><a href="#content049"> Possible restriction on HOD</a>
|
|
1826 <li><a href="#content050"> increment pase of address of HOD</a>
|
|
1827 <li><a href="#content051"> Non constructive assumptions so far</a>
|
|
1828 <li><a href="#content052"> Axiom which have negation form</a>
|
|
1829 <li><a href="#content053"> Union </a>
|
|
1830 <li><a href="#content054"> Axiom of replacement</a>
|
|
1831 <li><a href="#content055"> Validity of Power Set Axiom</a>
|
|
1832 <li><a href="#content056"> Axiom of regularity, Axiom of choice, ε-induction</a>
|
|
1833 <li><a href="#content057"> Axiom of choice and Law of Excluded Middle</a>
|
|
1834 <li><a href="#content058"> Relation-ship among ZF axiom</a>
|
|
1835 <li><a href="#content059"> Non constructive assumption in our model</a>
|
|
1836 <li><a href="#content060"> So it this correct?</a>
|
|
1837 <li><a href="#content061"> How to use Agda Set Theory</a>
|
|
1838 <li><a href="#content062"> Topos and Set Theory</a>
|
|
1839 <li><a href="#content063"> Cardinal number and Continuum hypothesis</a>
|
|
1840 <li><a href="#content064"> Filter</a>
|
|
1841 <li><a href="#content065"> Programming Mathematics</a>
|
|
1842 <li><a href="#content066"> link</a>
|
273
|
1843 </ol>
|
|
1844
|
361
|
1845 <hr/> Shinji KONO / Fri Jul 17 13:42:02 2020
|
273
|
1846 </body></html>
|