273
|
1 -title: Constructing ZF Set Theory in Agda
|
|
2
|
|
3 --author: Shinji KONO
|
|
4
|
279
|
5 --ZF in Agda
|
|
6
|
|
7 zf.agda axiom of ZF
|
|
8 zfc.agda axiom of choice
|
|
9 Ordinals.agda axiom of Ordinals
|
|
10 ordinal.agda countable model of Ordinals
|
|
11 OD.agda model of ZF based on Ordinal Definable Set with assumptions
|
|
12 ODC.agda Law of exclude middle from axiom of choice assumptions
|
|
13 LEMC.agda model of choice with assumption of the Law of exclude middle
|
|
14 OPair.agda ordered pair on OD
|
|
15
|
|
16 BAlgbra.agda Boolean algebra on OD (not yet done)
|
|
17 filter.agda Filter on OD (not yet done)
|
|
18 cardinal.agda Caedinal number on OD (not yet done)
|
|
19
|
|
20 logic.agda some basics on logic
|
|
21 nat.agda some basics on Nat
|
|
22
|
273
|
23 --Programming Mathematics
|
|
24
|
|
25 Programming is processing data structure with λ terms.
|
|
26
|
|
27 We are going to handle Mathematics in intuitionistic logic with λ terms.
|
|
28
|
|
29 Mathematics is a functional programming which values are proofs.
|
|
30
|
|
31 Programming ZF Set Theory in Agda
|
|
32
|
|
33 --Target
|
|
34
|
|
35 Describe ZF axioms in Agda
|
|
36 Construction a Model of ZF Set Theory in Agda
|
|
37 Show necessary assumptions for the model
|
|
38 Show validities of ZF axioms on the model
|
|
39
|
|
40 This shows consistency of Set Theory (with some assumptions),
|
|
41 without circulating ZF Theory assumption.
|
|
42
|
|
43 <a href="https://github.com/shinji-kono/zf-in-agda">
|
|
44 ZF in Agda https://github.com/shinji-kono/zf-in-agda
|
|
45 </a>
|
|
46
|
|
47 --Why Set Theory
|
|
48
|
|
49 If we can formulate Set theory, it suppose to work on any mathematical theory.
|
|
50
|
|
51 Set Theory is a difficult point for beginners especially axiom of choice.
|
|
52
|
|
53 It has some amount of difficulty and self circulating discussion.
|
|
54
|
|
55 I'm planning to do it in my old age, but I'm enough age now.
|
|
56
|
336
|
57 if you familier with Agda, you can skip to
|
|
58 <a href="#set-theory">
|
|
59 there
|
|
60 </a>
|
273
|
61
|
|
62 --Agda and Intuitionistic Logic
|
|
63
|
|
64 Curry Howard Isomorphism
|
|
65
|
|
66 Proposition : Proof ⇔ Type : Value
|
|
67
|
|
68 which means
|
|
69
|
|
70 constructing a typed lambda calculus which corresponds a logic
|
|
71
|
|
72 Typed lambda calculus which allows complex type as a value of a variable (System FC)
|
|
73
|
|
74 First class Type / Dependent Type
|
|
75
|
|
76 Agda is a such a programming language which has similar syntax of Haskell
|
|
77
|
|
78 Coq is specialized in proof assistance such as command and tactics .
|
|
79
|
|
80 --Introduction of Agda
|
|
81
|
|
82 A length of a list of type A.
|
|
83
|
|
84 length : {A : Set } → List A → Nat
|
|
85 length [] = zero
|
|
86 length (_ ∷ t) = suc ( length t )
|
|
87
|
|
88 Simple functional programming language. Type declaration is mandatory.
|
|
89 A colon means type, an equal means value. Indentation based.
|
|
90
|
|
91 Set is a base type (which may have a level ).
|
|
92
|
|
93 {} means implicit variable which can be omitted if Agda infers its value.
|
|
94
|
|
95 --data ( Sum type )
|
|
96
|
|
97 A data type which as exclusive multiple constructors. A similar one as
|
|
98 union in C or case class in Scala.
|
|
99
|
|
100 It has a similar syntax as Haskell but it has a slight difference.
|
|
101
|
|
102 data List (A : Set ) : Set where
|
|
103 [] : List A
|
|
104 _∷_ : A → List A → List A
|
|
105
|
|
106 _∷_ means infix operator. If use explicit _, it can be used in a normal function
|
|
107 syntax.
|
|
108
|
|
109 Natural number can be defined as a usual way.
|
|
110
|
|
111 data Nat : Set where
|
|
112 zero : Nat
|
|
113 suc : Nat → Nat
|
|
114
|
|
115 -- A → B means "A implies B"
|
|
116
|
|
117 In Agda, a type can be a value of a variable, which is usually called dependent type.
|
|
118 Type has a name Set in Agda.
|
|
119
|
|
120 ex3 : {A B : Set} → Set
|
|
121 ex3 {A}{B} = A → B
|
|
122
|
|
123 ex3 is a type : A → B, which is a value of Set. It also means a formula : A implies B.
|
|
124
|
|
125 A type is a formula, the value is the proof
|
|
126
|
|
127 A value of A → B can be interpreted as an inference from the formula A to the formula B, which
|
|
128 can be a function from a proof of A to a proof of B.
|
|
129
|
|
130 --introduction と elimination
|
|
131
|
|
132 For a logical operator, there are two types of inference, an introduction and an elimination.
|
|
133
|
|
134 intro creating symbol / constructor / introduction
|
|
135 elim using symbolic / accessors / elimination
|
|
136
|
|
137 In Natural deduction, this can be written in proof schema.
|
|
138
|
|
139 A
|
|
140 :
|
|
141 B A A → B
|
|
142 ------------- →intro ------------------ →elim
|
|
143 A → B B
|
|
144
|
|
145 In Agda, this is a pair of type and value as follows. Introduction of → uses λ.
|
|
146
|
|
147 →intro : {A B : Set } → A → B → ( A → B )
|
|
148 →intro _ b = λ x → b
|
|
149
|
|
150 →elim : {A B : Set } → A → ( A → B ) → B
|
|
151 →elim a f = f a
|
|
152
|
|
153 Important
|
|
154
|
|
155 {A B : Set } → A → B → ( A → B )
|
|
156
|
|
157 is
|
|
158
|
|
159 {A B : Set } → ( A → ( B → ( A → B ) ))
|
|
160
|
|
161 This makes currying of function easy.
|
|
162
|
|
163 -- To prove A → B
|
|
164
|
|
165 Make a left type as an argument. (intros in Coq)
|
|
166
|
|
167 ex5 : {A B C : Set } → A → B → C → ?
|
|
168 ex5 a b c = ?
|
|
169
|
|
170 ? is called a hole, which is unspecified part. Agda tell us which kind type is required for the Hole.
|
|
171
|
|
172 We are going to fill the holes, and if we have no warnings nor errors such as type conflict (Red),
|
|
173 insufficient proof or instance (Yellow), Non-termination, the proof is completed.
|
|
174
|
|
175 -- A ∧ B
|
|
176
|
|
177 Well known conjunction's introduction and elimination is as follow.
|
|
178
|
|
179 A B A ∧ B A ∧ B
|
|
180 ------------- ----------- proj1 ---------- proj2
|
|
181 A ∧ B A B
|
|
182
|
|
183 We can introduce a corresponding structure in our functional programming language.
|
|
184
|
|
185 -- record
|
|
186
|
|
187 record _∧_ A B : Set
|
|
188 field
|
|
189 proj1 : A
|
|
190 proj2 : B
|
|
191
|
|
192 _∧_ means infix operator. _∧_ A B can be written as A ∧ B (Haskell uses (∧) )
|
|
193
|
|
194 This a type which constructed from type A and type B. You may think this as an object
|
|
195 or struct.
|
|
196
|
|
197 record { proj1 = x ; proj2 = y }
|
|
198
|
|
199 is a constructor of _∧_.
|
|
200
|
|
201 ex3 : {A B : Set} → A → B → ( A ∧ B )
|
|
202 ex3 a b = record { proj1 = a ; proj2 = b }
|
|
203
|
|
204 ex1 : {A B : Set} → ( A ∧ B ) → A
|
|
205 ex1 a∧b = proj1 a∧b
|
|
206
|
|
207 a∧b is a variable name. If we have no spaces in a string, it is a word even if we have symbols
|
|
208 except parenthesis or colons. A symbol requires space separation such as a type defining colon.
|
|
209
|
|
210 Defining record can be recursively, but we don't use the recursion here.
|
|
211
|
|
212 -- Mathematical structure
|
|
213
|
|
214 We have types of elements and the relationship in a mathematical structure.
|
|
215
|
|
216 logical relation has no ordering
|
|
217 there is a natural ordering in arguments and a value in a function
|
|
218
|
|
219 So we have typical definition style of mathematical structure with records.
|
|
220
|
|
221 record IsOrdinals {n : Level} (ord : Set n)
|
|
222 (_o<_ : ord → ord → Set n) : Set (suc (suc n)) where
|
|
223 field
|
|
224 Otrans : {x y z : ord } → x o< y → y o< z → x o< z
|
|
225
|
|
226 record Ordinals {n : Level} : Set (suc (suc n)) where
|
|
227 field
|
|
228 ord : Set n
|
|
229 _o<_ : ord → ord → Set n
|
|
230 isOrdinal : IsOrdinals ord _o<_
|
|
231
|
|
232 In IsOrdinals, axioms are written in flat way. In Ordinal, we may have
|
|
233 inputs and outputs are put in the field including IsOrdinal.
|
|
234
|
|
235 Fields of Ordinal is existential objects in the mathematical structure.
|
|
236
|
|
237 -- A Model and a theory
|
|
238
|
|
239 Agda record is a type, so we can write it in the argument, but is it really exists?
|
|
240
|
|
241 If we have a value of the record, it simply exists, that is, we need to create all the existence
|
|
242 in the record satisfies all the axioms (= field of IsOrdinal) should be valid.
|
|
243
|
|
244 type of record = theory
|
|
245 value of record = model
|
|
246
|
|
247 We call the value of the record as a model. If mathematical structure has a
|
|
248 model, it exists. Pretty Obvious.
|
|
249
|
|
250 -- postulate と module
|
|
251
|
|
252 Agda proofs are separated by modules, which are large records.
|
|
253
|
|
254 postulates are assumptions. We can assume a type without proofs.
|
|
255
|
|
256 postulate
|
|
257 sup-o : ( Ordinal → Ordinal ) → Ordinal
|
|
258 sup-o< : { ψ : Ordinal → Ordinal } → ∀ {x : Ordinal } → ψ x o< sup-o ψ
|
|
259
|
|
260 sup-o is an example of upper bound of a function and sup-o< assumes it actually
|
|
261 satisfies all the value is less than upper bound.
|
|
262
|
|
263 Writing some type in a module argument is the same as postulating a type, but
|
|
264 postulate can be written the middle of a proof.
|
|
265
|
|
266 postulate can be constructive.
|
|
267
|
336
|
268 postulate can be inconsistent, which result everything has a proof. Actualy this assumption
|
|
269 doesnot work for Ordinals, we discuss this later.
|
273
|
270
|
|
271 -- A ∨ B
|
|
272
|
|
273 data _∨_ (A B : Set) : Set where
|
|
274 case1 : A → A ∨ B
|
|
275 case2 : B → A ∨ B
|
|
276
|
|
277 As Haskell, case1/case2 are patterns.
|
|
278
|
|
279 ex3 : {A B : Set} → ( A ∨ A ) → A
|
|
280 ex3 = ?
|
|
281
|
|
282 In a case statement, Agda command C-C C-C generates possible cases in the head.
|
|
283
|
|
284 ex3 : {A B : Set} → ( A ∨ A ) → A
|
|
285 ex3 (case1 x) = ?
|
|
286 ex3 (case2 x) = ?
|
|
287
|
|
288 Proof schema of ∨ is omit due to the complexity.
|
|
289
|
|
290 -- Negation
|
|
291
|
|
292 ⊥
|
|
293 ------------- ⊥-elim
|
|
294 A
|
|
295
|
|
296 Anything can be derived from bottom, in this case a Set A. There is no introduction rule
|
|
297 in ⊥, which can be implemented as data which has no constructor.
|
|
298
|
|
299 data ⊥ : Set where
|
|
300
|
|
301 ⊥-elim can be proved like this.
|
|
302
|
|
303 ⊥-elim : {A : Set } -> ⊥ -> A
|
|
304 ⊥-elim ()
|
|
305
|
|
306 () means no match argument nor value.
|
|
307
|
|
308 A negation can be defined using ⊥ like this.
|
|
309
|
|
310 ¬_ : Set → Set
|
|
311 ¬ A = A → ⊥
|
|
312
|
|
313 --Equality
|
|
314
|
|
315 All the value in Agda are terms. If we have the same normalized form, two terms are equal.
|
|
316 If we have variables in the terms, we will perform an unification. unifiable terms are equal.
|
|
317 We don't go further on the unification.
|
|
318
|
|
319 { x : A } x ≡ y f x y
|
|
320 --------------- ≡-intro --------------------- ≡-elim
|
|
321 x ≡ x f x x
|
|
322
|
|
323 equality _≡_ can be defined as a data.
|
|
324
|
|
325 data _≡_ {A : Set } : A → A → Set where
|
|
326 refl : {x : A} → x ≡ x
|
|
327
|
|
328 The elimination of equality is a substitution in a term.
|
|
329
|
|
330 subst : {A : Set } → { x y : A } → ( f : A → Set ) → x ≡ y → f x → f y
|
|
331 subst {A} {x} {y} f refl fx = fx
|
|
332
|
|
333 ex5 : {A : Set} {x y z : A } → x ≡ y → y ≡ z → x ≡ z
|
|
334 ex5 {A} {x} {y} {z} x≡y y≡z = subst ( λ k → x ≡ k ) y≡z x≡y
|
|
335
|
|
336
|
|
337 --Equivalence relation
|
|
338
|
|
339 refl' : {A : Set} {x : A } → x ≡ x
|
|
340 refl' = ?
|
|
341 sym : {A : Set} {x y : A } → x ≡ y → y ≡ x
|
|
342 sym = ?
|
|
343 trans : {A : Set} {x y z : A } → x ≡ y → y ≡ z → x ≡ z
|
|
344 trans = ?
|
|
345 cong : {A B : Set} {x y : A } { f : A → B } → x ≡ y → f x ≡ f y
|
|
346 cong = ?
|
|
347
|
|
348 --Ordering
|
|
349
|
|
350 Relation is a predicate on two value which has a same type.
|
|
351
|
|
352 A → A → Set
|
|
353
|
|
354 Defining order is the definition of this type with predicate or a data.
|
|
355
|
|
356 data _≤_ : Rel ℕ 0ℓ where
|
|
357 z≤n : ∀ {n} → zero ≤ n
|
|
358 s≤s : ∀ {m n} (m≤n : m ≤ n) → suc m ≤ suc n
|
|
359
|
|
360
|
|
361 --Quantifier
|
|
362
|
|
363 Handling quantifier in an intuitionistic logic requires special cares.
|
|
364
|
|
365 In the input of a function, there are no restriction on it, that is, it has
|
|
366 a universal quantifier. (If we explicitly write ∀, Agda gives us a type inference on it)
|
|
367
|
|
368 There is no ∃ in agda, the one way is using negation like this.
|
|
369
|
|
370 ∃ (x : A ) → p x = ¬ ( ( x : A ) → ¬ ( p x ) )
|
|
371
|
|
372 On the another way, f : A can be used like this.
|
|
373
|
|
374 p f
|
|
375
|
|
376 If we use a function which can be defined globally which has stronger meaning the
|
|
377 usage of ∃ x in a logical expression.
|
|
378
|
|
379
|
|
380 --Can we do math in this way?
|
|
381
|
|
382 Yes, we can. Actually we have Principia Mathematica by Russell and Whitehead (with out computer support).
|
|
383
|
|
384 In some sense, this story is a reprinting of the work, (but Principia Mathematica has a different formulation than ZF).
|
|
385
|
|
386 define mathematical structure as a record
|
|
387 program inferences as if we have proofs in variables
|
|
388
|
|
389 --Things which Agda cannot prove
|
|
390
|
|
391 The infamous Internal Parametricity is a limitation of Agda, it cannot prove so called Free Theorem, which
|
|
392 leads uniqueness of a functor in Category Theory.
|
|
393
|
|
394 Functional extensionality cannot be proved.
|
|
395 (∀ x → f x ≡ g x) → f ≡ g
|
|
396
|
|
397 Agda has no law of exclude middle.
|
|
398
|
|
399 a ∨ ( ¬ a )
|
|
400
|
|
401 For example, (A → B) → ¬ B → ¬ A can be proved but, ( ¬ B → ¬ A ) → A → B cannot.
|
|
402
|
|
403 It also other problems such as termination, type inference or unification which we may overcome with
|
|
404 efforts or devices or may not.
|
|
405
|
|
406 If we cannot prove something, we can safely postulate it unless it leads a contradiction.
|
|
407
|
|
408 --Classical story of ZF Set Theory
|
|
409
|
336
|
410 <a name="set-theory">
|
273
|
411 Assuming ZF, constructing a model of ZF is a flow of classical Set Theory, which leads
|
|
412 a relative consistency proof of the Set Theory.
|
|
413 Ordinal number is used in the flow.
|
|
414
|
|
415 In Agda, first we defines Ordinal numbers (Ordinals), then introduce Ordinal Definable Set (OD).
|
|
416 We need some non constructive assumptions in the construction. A model of Set theory is
|
|
417 constructed based on these assumptions.
|
|
418
|
|
419 <center><img src="fig/set-theory.svg"></center>
|
|
420
|
|
421 --Ordinals
|
|
422
|
|
423 Ordinals are our intuition of infinite things, which has ∅ and orders on the things.
|
|
424 It also has a successor osuc.
|
|
425
|
|
426 record Ordinals {n : Level} : Set (suc (suc n)) where
|
|
427 field
|
|
428 ord : Set n
|
|
429 o∅ : ord
|
|
430 osuc : ord → ord
|
|
431 _o<_ : ord → ord → Set n
|
|
432 isOrdinal : IsOrdinals ord o∅ osuc _o<_
|
|
433
|
|
434 It is different from natural numbers in way. The order of Ordinals is not defined in terms
|
|
435 of successor. It is given from outside, which make it possible to have higher order infinity.
|
|
436
|
|
437 --Axiom of Ordinals
|
|
438
|
|
439 Properties of infinite things. We request a transfinite induction, which states that if
|
|
440 some properties are satisfied below all possible ordinals, the properties are true on all
|
|
441 ordinals.
|
|
442
|
|
443 Successor osuc has no ordinal between osuc and the base ordinal. There are some ordinals
|
|
444 which is not a successor of any ordinals. It is called limit ordinal.
|
|
445
|
|
446 Any two ordinal can be compared, that is less, equal or more, that is total order.
|
|
447
|
|
448 record IsOrdinals {n : Level} (ord : Set n) (o∅ : ord )
|
|
449 (osuc : ord → ord )
|
|
450 (_o<_ : ord → ord → Set n) : Set (suc (suc n)) where
|
|
451 field
|
|
452 Otrans : {x y z : ord } → x o< y → y o< z → x o< z
|
|
453 OTri : Trichotomous {n} _≡_ _o<_
|
|
454 ¬x<0 : { x : ord } → ¬ ( x o< o∅ )
|
|
455 <-osuc : { x : ord } → x o< osuc x
|
|
456 osuc-≡< : { a x : ord } → x o< osuc a → (x ≡ a ) ∨ (x o< a)
|
|
457 TransFinite : { ψ : ord → Set (suc n) }
|
|
458 → ( (x : ord) → ( (y : ord ) → y o< x → ψ y ) → ψ x )
|
|
459 → ∀ (x : ord) → ψ x
|
|
460
|
336
|
461 --Concrete Ordinals or Countable Ordinals
|
273
|
462
|
|
463 We can define a list like structure with level, which is a kind of two dimensional infinite array.
|
|
464
|
|
465 data OrdinalD {n : Level} : (lv : Nat) → Set n where
|
|
466 Φ : (lv : Nat) → OrdinalD lv
|
|
467 OSuc : (lv : Nat) → OrdinalD {n} lv → OrdinalD lv
|
|
468
|
|
469 The order of the OrdinalD can be defined in this way.
|
|
470
|
|
471 data _d<_ {n : Level} : {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Set n where
|
|
472 Φ< : {lx : Nat} → {x : OrdinalD {n} lx} → Φ lx d< OSuc lx x
|
|
473 s< : {lx : Nat} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y
|
|
474
|
|
475 This is a simple data structure, it has no abstract assumptions, and it is countable many data
|
|
476 structure.
|
|
477
|
|
478 Φ 0
|
|
479 OSuc 2 ( Osuc 2 ( Osuc 2 (Φ 2)))
|
|
480 Osuc 0 (Φ 0) d< Φ 1
|
|
481
|
|
482 --Model of Ordinals
|
|
483
|
|
484 It is easy to show OrdinalD and its order satisfies the axioms of Ordinals.
|
|
485
|
|
486 So our Ordinals has a mode. This means axiom of Ordinals are consistent.
|
|
487
|
|
488 --Debugging axioms using Model
|
|
489
|
|
490 Whether axiom is correct or not can be checked by a validity on a mode.
|
|
491
|
|
492 If not, we may fix the axioms or the model, such as the definitions of the order.
|
|
493
|
|
494 We can also ask whether the inputs exist.
|
|
495
|
|
496 --Countable Ordinals can contains uncountable set?
|
|
497
|
|
498 Yes, the ordinals contains any level of infinite Set in the axioms.
|
|
499
|
|
500 If we handle real-number in the model, only countable number of real-number is used.
|
|
501
|
|
502 from the outside view point, it is countable
|
|
503 from the internal view point, it is uncountable
|
|
504
|
|
505 The definition of countable/uncountable is the same, but the properties are different
|
|
506 depending on the context.
|
|
507
|
|
508 We don't show the definition of cardinal number here.
|
|
509
|
|
510 --What is Set
|
|
511
|
|
512 The word Set in Agda is not a Set of ZF Set, but it is a type (why it is named Set?).
|
|
513
|
|
514 From naive point view, a set i a list, but in Agda, elements have all the same type.
|
|
515 A set in ZF may contain other Sets in ZF, which not easy to implement it as a list.
|
|
516
|
|
517 Finite set may be written in finite series of ∨, but ...
|
|
518
|
|
519 --We don't ask the contents of Set. It can be anything.
|
|
520
|
|
521 From empty set φ, we can think a set contains a φ, and a pair of φ and the set, and so on,
|
|
522 and all of them, and again we repeat this.
|
|
523
|
|
524 φ {φ} {φ,{φ}}, {φ,{φ},...}
|
|
525
|
|
526 It is called V.
|
|
527
|
|
528 This operation can be performed within a ZF Set theory. Classical Set Theory assumes
|
|
529 ZF, so this kind of thing is allowed.
|
|
530
|
|
531 But in our case, we have no ZF theory, so we are going to use Ordinals.
|
|
532
|
336
|
533 The idea is to use an ordinal as a pointer to a record which defines a Set.
|
|
534 If the recored defines a series of Ordinals which is a pointer to the Set.
|
|
535 This record looks like a Set.
|
273
|
536
|
|
537 --Ordinal Definable Set
|
|
538
|
|
539 We can define a sbuset of Ordinals using predicates. What is a subset?
|
|
540
|
|
541 a predicate has an Ordinal argument
|
|
542
|
|
543 is an Ordinal Definable Set (OD). In Agda, OD is defined as follows.
|
|
544
|
|
545 record OD : Set (suc n ) where
|
|
546 field
|
|
547 def : (x : Ordinal ) → Set n
|
|
548
|
|
549 Ordinals itself is not a set in a ZF Set theory but a class. In OD,
|
|
550
|
336
|
551 data One : Set n where
|
|
552 OneObj : One
|
273
|
553
|
336
|
554 record { def = λ x → One }
|
|
555
|
|
556 means it accepets all Ordinals, i.e. this is Ordinals itself, so ODs are larger than ZF Set.
|
|
557 You can say OD is a class in ZF Set Theory term.
|
273
|
558
|
|
559
|
336
|
560 --OD is not ZF Set
|
|
561
|
|
562 If we have 1 to 1 mapping between an OD and an Ordinal, OD contains several ODs and OD looks like
|
|
563 a Set. The idea is to use an ordinal as a pointer to OD.
|
|
564 Unfortunately this scheme does not work well. As we saw OD includes all Ordinals,
|
|
565 which is a maximum of OD, but Ordinals has no maximum at all. So we have a contradction like
|
273
|
566
|
336
|
567 ¬OD-order : ( od→ord : OD → Ordinal )
|
|
568 → ( ord→od : Ordinal → OD ) → ( { x y : OD } → def y ( od→ord x ) → od→ord x o< od→ord y) → ⊥
|
|
569 ¬OD-order od→ord ord→od c<→o< = ?
|
|
570
|
|
571 Actualy we can prove this contrdction, so we need some restrctions on OD.
|
|
572
|
|
573 This is a kind of Russel paradox, that is if OD contains everything, what happens if it contains itself.
|
|
574
|
|
575 -- HOD : Hereditarily Ordinal Definable
|
|
576
|
|
577 What we need is a bounded OD, the containment is limited by an ordinal.
|
273
|
578
|
336
|
579 record HOD : Set (suc n) where
|
|
580 field
|
|
581 od : OD
|
|
582 odmax : Ordinal
|
|
583 <odmax : {y : Ordinal} → def od y → y o< odmax
|
|
584
|
|
585 In classical Set Theory, HOD stands for Hereditarily Ordinal Definable, which means
|
|
586
|
|
587 HOD = { x | TC x ⊆ OD }
|
273
|
588
|
336
|
589 TC x is all transitive closure of x, that is elements of x and following all elements of them are all OD. But
|
|
590 what is x? In this case, x is an Set which we don't have yet. In our case, HOD is a bounded OD.
|
|
591
|
|
592 --1 to 1 mapping between an HOD and an Ordinal
|
|
593
|
|
594 HOD is a predicate on Ordinals and the solution is bounded by some ordinal. If we have a mapping
|
|
595
|
|
596 od→ord : HOD → Ordinal
|
|
597 ord→od : Ordinal → HOD
|
|
598 oiso : {x : HOD } → ord→od ( od→ord x ) ≡ x
|
|
599 diso : {x : Ordinal } → od→ord ( ord→od x ) ≡ x
|
|
600
|
|
601 we can check an HOD is an element of the OD using def.
|
273
|
602
|
|
603 A ∋ x can be define as follows.
|
|
604
|
336
|
605 _∋_ : ( A x : HOD ) → Set n
|
|
606 _∋_ A x = def (od A) ( od→ord x )
|
273
|
607
|
|
608 In ψ : Ordinal → Set, if A is a record { def = λ x → ψ x } , then
|
|
609
|
|
610 A x = def A ( od→ord x ) = ψ (od→ord x)
|
|
611
|
|
612 They say the existing of the mappings can be proved in Classical Set Theory, but we
|
|
613 simply assumes these non constructively.
|
|
614
|
|
615 <center><img src="fig/ord-od-mapping.svg"></center>
|
|
616
|
|
617 --Order preserving in the mapping of OD and Ordinal
|
|
618
|
336
|
619 Ordinals have the order and HOD has a natural order based on inclusion ( def / ∋ ).
|
273
|
620
|
336
|
621 def (od y) ( od→ord x )
|
273
|
622
|
336
|
623 An elements of HOD should be defined before the HOD, that is, an ordinal corresponding an elements
|
|
624 have to be smaller than the corresponding ordinal of the containing OD.
|
|
625 We also assumes subset is always smaller. This is necessary to make a limit of Power Set.
|
273
|
626
|
336
|
627 c<→o< : {x y : HOD } → def (od y) ( od→ord x ) → od→ord x o< od→ord y
|
|
628 ⊆→o≤ : {y z : HOD } → ({x : Ordinal} → def (od y) x → def (od z) x ) → od→ord y o< osuc (od→ord z)
|
273
|
629
|
336
|
630 If wa assumes reverse order preservation,
|
273
|
631
|
|
632 o<→c< : {n : Level} {x y : Ordinal } → x o< y → def (ord→od y) x
|
|
633
|
336
|
634 ∀ x ∋ ∅ becomes true, which manes all OD becomes Ordinals in the model.
|
273
|
635
|
|
636 <center><img src="fig/ODandOrdinals.svg"></center>
|
|
637
|
|
638 --Various Sets
|
|
639
|
|
640 In classical Set Theory, there is a hierarchy call L, which can be defined by a predicate.
|
|
641
|
|
642 Ordinal / things satisfies axiom of Ordinal / extension of natural number
|
|
643 V / hierarchical construction of Set from φ
|
|
644 L / hierarchical predicate definable construction of Set from φ
|
336
|
645 HOD / Hereditarily Ordinal Definable
|
273
|
646 OD / equational formula on Ordinals
|
|
647 Agda Set / Type / it also has a level
|
|
648
|
|
649
|
|
650 --Fixes on ZF to intuitionistic logic
|
|
651
|
|
652 We use ODs as Sets in ZF, and defines record ZF, that is, we have to define
|
|
653 ZF axioms in Agda.
|
|
654
|
|
655 It may not valid in our model. We have to debug it.
|
|
656
|
|
657 Fixes are depends on axioms.
|
|
658
|
|
659 <center><img src="fig/axiom-type.svg"></center>
|
|
660
|
|
661 <a href="fig/zf-record.html">
|
|
662 ZFのrecord
|
|
663 </a>
|
|
664
|
|
665 --Pure logical axioms
|
|
666
|
279
|
667 empty, pair, select, ε-induction??infinity
|
273
|
668
|
|
669 These are logical relations among OD.
|
|
670
|
|
671 empty : ∀( x : ZFSet ) → ¬ ( ∅ ∋ x )
|
|
672 pair→ : ( x y t : ZFSet ) → (x , y) ∋ t → ( t ≈ x ) ∨ ( t ≈ y )
|
|
673 pair← : ( x y t : ZFSet ) → ( t ≈ x ) ∨ ( t ≈ y ) → (x , y) ∋ t
|
|
674 selection : { ψ : ZFSet → Set m } → ∀ { X y : ZFSet } → ( ( y ∈ X ) ∧ ψ y ) ⇔ (y ∈ Select X ψ )
|
|
675 infinity∅ : ∅ ∈ infinite
|
|
676 infinity : ∀( x : ZFSet ) → x ∈ infinite → ( x ∪ ( x , x ) ) ∈ infinite
|
|
677 ε-induction : { ψ : OD → Set (suc n)}
|
|
678 → ( {x : OD } → ({ y : OD } → x ∋ y → ψ y ) → ψ x )
|
|
679 → (x : OD ) → ψ x
|
|
680
|
|
681 finitely can be define by Agda data.
|
|
682
|
|
683 data infinite-d : ( x : Ordinal ) → Set n where
|
|
684 iφ : infinite-d o∅
|
|
685 isuc : {x : Ordinal } → infinite-d x →
|
|
686 infinite-d (od→ord ( Union (ord→od x , (ord→od x , ord→od x ) ) ))
|
|
687
|
|
688 Union (x , ( x , x )) should be an direct successor of x, but we cannot prove it in our model.
|
|
689
|
|
690 --Axiom of Pair
|
|
691
|
|
692 In the Tanaka's book, axiom of pair is as follows.
|
|
693
|
|
694 ∀ x ∀ y ∃ z ∀ t ( z ∋ t ↔ t ≈ x ∨ t ≈ y)
|
|
695
|
|
696 We have fix ∃ z, a function (x , y) is defined, which is _,_ .
|
|
697
|
|
698 _,_ : ( A B : ZFSet ) → ZFSet
|
|
699
|
|
700 using this, we can define two directions in separates axioms, like this.
|
|
701
|
|
702 pair→ : ( x y t : ZFSet ) → (x , y) ∋ t → ( t ≈ x ) ∨ ( t ≈ y )
|
|
703 pair← : ( x y t : ZFSet ) → ( t ≈ x ) ∨ ( t ≈ y ) → (x , y) ∋ t
|
|
704
|
|
705 This is already written in Agda, so we use these as axioms. All inputs have ∀.
|
|
706
|
|
707 --pair in OD
|
|
708
|
|
709 OD is an equation on Ordinals, we can simply write axiom of pair in the OD.
|
|
710
|
336
|
711 _,_ : HOD → HOD → HOD
|
|
712 x , y = record { od = record { def = λ t → (t ≡ od→ord x ) ∨ ( t ≡ od→ord y ) } ; odmax = ? ; <odmax = ? }
|
|
713
|
|
714 It is easy to find out odmax from odmax of x and y.
|
273
|
715
|
|
716 ≡ is an equality of λ terms, but please not that this is equality on Ordinals.
|
|
717
|
|
718 --Validity of Axiom of Pair
|
|
719
|
|
720 Assuming ZFSet is OD, we are going to prove pair→ .
|
|
721
|
|
722 pair→ : ( x y t : OD ) → (x , y) ∋ t → ( t == x ) ∨ ( t == y )
|
|
723 pair→ x y t p = ?
|
|
724
|
|
725 In this program, type of p is ( x , y ) ∋ t , that is
|
|
726 def ( x , y ) that is, (t ≡ od→ord x ) ∨ ( t ≡ od→ord y ) .
|
|
727
|
|
728 Since _∨_ is a data, it can be developed as (C-c C-c : agda2-make-case ).
|
|
729
|
|
730 pair→ x y t (case1 t≡x ) = ?
|
|
731 pair→ x y t (case2 t≡y ) = ?
|
|
732
|
|
733 The type of the ? is ( t == x ) ∨ ( t == y ), again it is data _∨_ .
|
|
734
|
|
735 pair→ x y t (case1 t≡x ) = case1 ?
|
|
736 pair→ x y t (case2 t≡y ) = case2 ?
|
|
737
|
|
738 The ? in case1 is t == x, so we have to create this from t≡x, which is a name of a variable
|
|
739 which type is
|
|
740
|
|
741 t≡x : od→ord t ≡ od→ord x
|
|
742
|
|
743 which is shown by an Agda command (C-C C-E : agda2-show-context ).
|
|
744
|
|
745 But we haven't defined == yet.
|
|
746
|
|
747 --Equality of OD and Axiom of Extensionality
|
|
748
|
|
749 OD is defined by a predicates, if we compares normal form of the predicates, even if
|
|
750 it contains the same elements, it may be different, which is no good as an equality of
|
|
751 Sets.
|
|
752
|
|
753 Axiom of Extensionality requires sets having the same elements are handled in the same way
|
|
754 each other.
|
|
755
|
|
756 ∀ z ( z ∈ x ⇔ z ∈ y ) ⇒ ∀ w ( x ∈ w ⇔ y ∈ w )
|
|
757
|
|
758 We can write this axiom in Agda as follows.
|
|
759
|
|
760 extensionality : { A B w : ZFSet } → ( (z : ZFSet) → ( A ∋ z ) ⇔ (B ∋ z) ) → ( A ∈ w ⇔ B ∈ w )
|
|
761
|
|
762 So we use ( A ∋ z ) ⇔ (B ∋ z) as an equality (_==_) of our model. We have to show
|
|
763 A ∈ w ⇔ B ∈ w from A == B.
|
|
764
|
|
765 x == y can be defined in this way.
|
|
766
|
|
767 record _==_ ( a b : OD ) : Set n where
|
|
768 field
|
|
769 eq→ : ∀ { x : Ordinal } → def a x → def b x
|
|
770 eq← : ∀ { x : Ordinal } → def b x → def a x
|
|
771
|
336
|
772 Actually, (z : HOD) → (A ∋ z) ⇔ (B ∋ z) implies od A == od B.
|
273
|
773
|
336
|
774 extensionality0 : {A B : HOD } → ((z : HOD) → (A ∋ z) ⇔ (B ∋ z)) → od A == od B
|
273
|
775 eq→ (extensionality0 {A} {B} eq ) {x} d = ?
|
|
776 eq← (extensionality0 {A} {B} eq ) {x} d = ?
|
|
777
|
|
778 ? are def B x and def A x and these are generated from eq : (z : OD) → (A ∋ z) ⇔ (B ∋ z) .
|
|
779
|
|
780 Actual proof is rather complicated.
|
|
781
|
336
|
782 eq→ (extensionality0 {A} {B} eq ) {x} d = odef-iso {A} {B} (sym diso) (proj1 (eq (ord→od x))) d
|
|
783 eq← (extensionality0 {A} {B} eq ) {x} d = odef-iso {B} {A} (sym diso) (proj2 (eq (ord→od x))) d
|
273
|
784
|
|
785 where
|
|
786
|
336
|
787 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
|
|
788 odef-iso refl t = t
|
273
|
789
|
|
790 --Validity of Axiom of Extensionality
|
|
791
|
336
|
792 If we can derive (w ∋ A) ⇔ (w ∋ B) from od A == od B, the axiom becomes valid, but it seems impossible,
|
273
|
793 so we assumes
|
|
794
|
336
|
795 ==→o≡ : { x y : HOD } → (od x == od y) → x ≡ y
|
273
|
796
|
|
797 Using this, we have
|
|
798
|
336
|
799 extensionality : {A B w : HOD } → ((z : HOD ) → (A ∋ z) ⇔ (B ∋ z)) → (w ∋ A) ⇔ (w ∋ B)
|
273
|
800 proj1 (extensionality {A} {B} {w} eq ) d = subst (λ k → w ∋ k) ( ==→o≡ (extensionality0 {A} {B} eq) ) d
|
336
|
801 proj2 (extensionality {A} {B} {w} eq ) d = subst (λ k → w ∋ k) (sym ( ==→o≡ (extensionality0 {A} {B} eq) )) d
|
273
|
802
|
|
803 --Non constructive assumptions so far
|
|
804
|
336
|
805 od→ord : HOD → Ordinal
|
|
806 ord→od : Ordinal → HOD
|
|
807 c<→o< : {x y : HOD } → def (od y) ( od→ord x ) → od→ord x o< od→ord y
|
|
808 ⊆→o≤ : {y z : HOD } → ({x : Ordinal} → def (od y) x → def (od z) x ) → od→ord y o< osuc (od→ord z)
|
|
809 oiso : {x : HOD } → ord→od ( od→ord x ) ≡ x
|
|
810 diso : {x : Ordinal } → od→ord ( ord→od x ) ≡ x
|
|
811 ==→o≡ : {x y : HOD } → (od x == od y) → x ≡ y
|
|
812 sup-o : (A : HOD) → ( ( x : Ordinal ) → def (od A) x → Ordinal ) → Ordinal
|
|
813 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
|
814
|
|
815
|
|
816 --Axiom which have negation form
|
|
817
|
|
818 Union, Selection
|
|
819
|
|
820 These axioms contains ∃ x as a logical relation, which can be described in ¬ ( ∀ x ( ¬ p )).
|
|
821
|
|
822 Axiom of replacement uses upper bound of function on Ordinals, which makes it non-constructive.
|
|
823
|
|
824 Power Set axiom requires double negation,
|
|
825
|
|
826 power→ : ∀( A t : ZFSet ) → Power A ∋ t → ∀ {x} → t ∋ x → ¬ ¬ ( A ∋ x )
|
|
827 power← : ∀( A t : ZFSet ) → t ⊆_ A → Power A ∋ t
|
|
828
|
|
829 If we have an assumption of law of exclude middle, we can recover the original A ∋ x form.
|
|
830
|
|
831 --Union
|
|
832
|
|
833 The original form of the Axiom of Union is
|
|
834
|
|
835 ∀ x ∃ y ∀ z (z ∈ y ⇔ ∃ u ∈ x ∧ (z ∈ u))
|
|
836
|
|
837 Union requires the existence of b in a ⊇ ∃ b ∋ x . We will use negation form of ∃.
|
|
838
|
|
839 union→ : ( X z u : ZFSet ) → ( X ∋ u ) ∧ (u ∋ z ) → Union X ∋ z
|
|
840 union← : ( X z : ZFSet ) → (X∋z : Union X ∋ z ) → ¬ ( (u : ZFSet ) → ¬ ((X ∋ u) ∧ (u ∋ z )))
|
|
841
|
|
842 The definition of Union in OD is like this.
|
|
843
|
|
844 Union : OD → OD
|
|
845 Union U = record { def = λ x → ¬ (∀ (u : Ordinal ) → ¬ ((def U u) ∧ (def (ord→od u) x))) }
|
|
846
|
|
847 Proof of validity is straight forward.
|
|
848
|
|
849 union→ : (X z u : OD) → (X ∋ u) ∧ (u ∋ z) → Union X ∋ z
|
|
850 union→ X z u xx not = ⊥-elim ( not (od→ord u) ( record { proj1 = proj1 xx
|
|
851 ; proj2 = subst ( λ k → def k (od→ord z)) (sym oiso) (proj2 xx) } ))
|
|
852 union← : (X z : OD) (X∋z : Union X ∋ z) → ¬ ( (u : OD ) → ¬ ((X ∋ u) ∧ (u ∋ z )))
|
|
853 union← X z UX∋z = FExists _ lemma UX∋z where
|
|
854 lemma : {y : Ordinal} → def X y ∧ def (ord→od y) (od→ord z) → ¬ ((u : OD) → ¬ (X ∋ u) ∧ (u ∋ z))
|
|
855 lemma {y} xx not = not (ord→od y) record { proj1 = subst ( λ k → def X k ) (sym diso) (proj1 xx ) ; proj2 = proj2 xx }
|
|
856
|
|
857 where
|
|
858
|
|
859 FExists : {m l : Level} → ( ψ : Ordinal → Set m )
|
|
860 → {p : Set l} ( P : { y : Ordinal } → ψ y → ¬ p )
|
|
861 → (exists : ¬ (∀ y → ¬ ( ψ y ) ))
|
|
862 → ¬ p
|
|
863 FExists {m} {l} ψ {p} P = contra-position ( λ p y ψy → P {y} ψy p )
|
|
864
|
|
865 which checks existence using contra-position.
|
|
866
|
|
867 --Axiom of replacement
|
|
868
|
|
869 We can replace the elements of a set by a function and it becomes a set. From the book,
|
|
870
|
|
871 ∀ x ∀ y ∀ z ( ( ψ ( x , y ) ∧ ψ ( x , z ) ) → y = z ) → ∀ X ∃ A ∀ y ( y ∈ A ↔ ∃ x ∈ X ψ ( x , y ) )
|
|
872
|
|
873 The existential quantifier can be related by a function,
|
|
874
|
|
875 Replace : OD → (OD → OD ) → OD
|
|
876
|
|
877 The axioms becomes as follows.
|
|
878
|
|
879 replacement← : {ψ : ZFSet → ZFSet} → ∀ ( X x : ZFSet ) → x ∈ X → ψ x ∈ Replace X ψ
|
|
880 replacement→ : {ψ : ZFSet → ZFSet} → ∀ ( X x : ZFSet ) → ( lt : x ∈ Replace X ψ ) → ¬ ( ∀ (y : ZFSet) → ¬ ( x ≈ ψ y ) )
|
|
881
|
|
882 In the axiom, the existence of the original elements is necessary. In order to do that we use OD which has
|
|
883 negation form of existential quantifier in the definition.
|
|
884
|
|
885 in-codomain : (X : OD ) → ( ψ : OD → OD ) → OD
|
|
886 in-codomain X ψ = record { def = λ x → ¬ ( (y : Ordinal ) → ¬ ( def X y ∧ ( x ≡ od→ord (ψ (ord→od y ))))) }
|
|
887
|
|
888 Besides this upper bounds is required.
|
|
889
|
|
890 Replace : OD → (OD → OD ) → OD
|
|
891 Replace X ψ = record { def = λ x → (x o< sup-o ( λ x → od→ord (ψ (ord→od x )))) ∧ def (in-codomain X ψ) x }
|
|
892
|
|
893 We omit the proof of the validity, but it is rather straight forward.
|
|
894
|
|
895 --Validity of Power Set Axiom
|
|
896
|
|
897 The original Power Set Axiom is this.
|
|
898
|
|
899 ∀ X ∃ A ∀ t ( t ∈ A ↔ t ⊆ X ) )
|
|
900
|
|
901 The existential quantifier is replaced by a function
|
|
902
|
|
903 Power : ( A : OD ) → OD
|
|
904
|
|
905 t ⊆ X is a record like this.
|
|
906
|
|
907 record _⊆_ ( A B : OD ) : Set (suc n) where
|
|
908 field
|
|
909 incl : { x : OD } → A ∋ x → B ∋ x
|
|
910
|
|
911 Axiom becomes likes this.
|
|
912
|
|
913 power→ : ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x)
|
|
914 power← : (A t : OD) → ({x : OD} → (t ∋ x → A ∋ x)) → Power A ∋ t
|
|
915
|
|
916 The validity of the axioms are slight complicated, we have to define set of all subset. We define
|
|
917 subset in a different form.
|
|
918
|
|
919 ZFSubset : (A x : OD ) → OD
|
|
920 ZFSubset A x = record { def = λ y → def A y ∧ def x y }
|
|
921
|
|
922 We can prove,
|
|
923
|
|
924 ( {y : OD } → x ∋ y → ZFSubset A x ∋ y ) ⇔ ( x ⊆ A )
|
|
925
|
|
926 We only have upper bound as an ordinal, but we have an obvious OD based on the order of Ordinals,
|
|
927 which is an Ordinals with our Model.
|
|
928
|
|
929 Ord : ( a : Ordinal ) → OD
|
|
930 Ord a = record { def = λ y → y o< a }
|
|
931
|
|
932 Def : (A : OD ) → OD
|
|
933 Def A = Ord ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) )
|
|
934
|
|
935 This is slight larger than Power A, so we replace all elements x by A ∩ x (some of them may empty).
|
|
936
|
|
937 Power : OD → OD
|
|
938 Power A = Replace (Def (Ord (od→ord A))) ( λ x → A ∩ x )
|
|
939
|
|
940 Creating Power Set of Ordinals is rather easy, then we use replacement axiom on A ∩ x since we have this.
|
|
941
|
|
942 ∩-≡ : { a b : OD } → ({x : OD } → (a ∋ x → b ∋ x)) → a == ( b ∩ a )
|
|
943
|
|
944 In case of Ord a intro of Power Set axiom becomes valid.
|
|
945
|
|
946 ord-power← : (a : Ordinal ) (t : OD) → ({x : OD} → (t ∋ x → (Ord a) ∋ x)) → Def (Ord a) ∋ t
|
|
947
|
|
948 Using this, we can prove,
|
|
949
|
|
950 power→ : ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x)
|
|
951 power← : (A t : OD) → ({x : OD} → (t ∋ x → A ∋ x)) → Power A ∋ t
|
|
952
|
|
953
|
|
954 --Axiom of regularity, Axiom of choice, ε-induction
|
|
955
|
|
956 Axiom of regularity requires non self intersectable elements (which is called minimum), if we
|
|
957 replace it by a function, it becomes a choice function. It makes axiom of choice valid.
|
|
958
|
|
959 This means we cannot prove axiom regularity form our model, and if we postulate this, axiom of
|
|
960 choice also becomes valid.
|
|
961
|
|
962 minimal : (x : OD ) → ¬ (x == od∅ )→ OD
|
|
963 x∋minimal : (x : OD ) → ( ne : ¬ (x == od∅ ) ) → def x ( od→ord ( minimal x ne ) )
|
|
964 minimal-1 : (x : OD ) → ( ne : ¬ (x == od∅ ) ) → (y : OD ) → ¬ ( def (minimal x ne) (od→ord y)) ∧ (def x (od→ord y) )
|
|
965
|
|
966 We can avoid this using ε-induction (a predicate is valid on all set if the predicate is true on some element of set).
|
|
967 Assuming law of exclude middle, they say axiom of regularity will be proved, but we haven't check it yet.
|
|
968
|
|
969 ε-induction : { ψ : OD → Set (suc n)}
|
|
970 → ( {x : OD } → ({ y : OD } → x ∋ y → ψ y ) → ψ x )
|
|
971 → (x : OD ) → ψ x
|
|
972
|
|
973 In our model, we assumes the mapping between Ordinals and OD, this is actually the TransFinite induction in Ordinals.
|
|
974
|
|
975 The axiom of choice in the book is complicated using any pair in a set, so we use use a form in the Wikipedia.
|
|
976
|
|
977 ∀ X [ ∅ ∉ X → (∃ f : X → ⋃ X ) → ∀ A ∈ X ( f ( A ) ∈ A ) ]
|
|
978
|
|
979 We can formulate like this.
|
|
980
|
|
981 choice-func : (X : ZFSet ) → {x : ZFSet } → ¬ ( x ≈ ∅ ) → ( X ∋ x ) → ZFSet
|
|
982 choice : (X : ZFSet ) → {A : ZFSet } → ( X∋A : X ∋ A ) → (not : ¬ ( A ≈ ∅ )) → A ∋ choice-func X not X∋A
|
|
983
|
|
984 It does not requires ∅ ∉ X .
|
|
985
|
|
986 --Axiom of choice and Law of Excluded Middle
|
|
987
|
|
988 In our model, since OD has a mapping to Ordinals, it has evident order, which means well ordering theorem is valid,
|
|
989 but it don't have correct form of the axiom yet. They say well ordering axiom is equivalent to the axiom of choice,
|
|
990 but it requires law of the exclude middle.
|
|
991
|
|
992 Actually, it is well known to prove law of the exclude middle from axiom of choice in intuitionistic logic, and we can
|
|
993 perform the proof in our mode. Using the definition like this, predicates and ODs are related and we can ask the
|
|
994 set is empty or not if we have an axiom of choice, so we have the law of the exclude middle p ∨ ( ¬ p ) .
|
|
995
|
|
996 ppp : { p : Set n } { a : OD } → record { def = λ x → p } ∋ a → p
|
|
997 ppp {p} {a} d = d
|
|
998
|
|
999 We can prove axiom of choice from law excluded middle since we have TransFinite induction. So Axiom of choice
|
|
1000 and Law of Excluded Middle is equivalent in our mode.
|
|
1001
|
|
1002 --Relation-ship among ZF axiom
|
|
1003
|
|
1004 <center><img src="fig/axiom-dependency.svg"></center>
|
|
1005
|
|
1006 --Non constructive assumption in our model
|
|
1007
|
|
1008 mapping between OD and Ordinals
|
|
1009
|
|
1010 od→ord : OD → Ordinal
|
|
1011 ord→od : Ordinal → OD
|
|
1012 oiso : {x : OD } → ord→od ( od→ord x ) ≡ x
|
|
1013 diso : {x : Ordinal } → od→ord ( ord→od x ) ≡ x
|
|
1014 c<→o< : {x y : OD } → def y ( od→ord x ) → od→ord x o< od→ord y
|
|
1015
|
|
1016 Equivalence on OD
|
|
1017
|
|
1018 ==→o≡ : { x y : OD } → (x == y) → x ≡ y
|
|
1019
|
|
1020 Upper bound
|
|
1021
|
|
1022 sup-o : ( Ordinal → Ordinal ) → Ordinal
|
|
1023 sup-o< : { ψ : Ordinal → Ordinal } → ∀ {x : Ordinal } → ψ x o< sup-o ψ
|
|
1024
|
|
1025 Axiom of choice and strong axiom of regularity.
|
|
1026
|
|
1027 minimal : (x : OD ) → ¬ (x == od∅ )→ OD
|
|
1028 x∋minimal : (x : OD ) → ( ne : ¬ (x == od∅ ) ) → def x ( od→ord ( minimal x ne ) )
|
|
1029 minimal-1 : (x : OD ) → ( ne : ¬ (x == od∅ ) ) → (y : OD ) → ¬ ( def (minimal x ne) (od→ord y)) ∧ (def x (od→ord y) )
|
|
1030
|
|
1031 --So it this correct?
|
|
1032
|
|
1033 Our axiom are syntactically the same in the text book, but negations are slightly different.
|
|
1034
|
|
1035 If we assumes excluded middle, these are exactly same.
|
|
1036
|
|
1037 Even if we assumes excluded middle, intuitionistic logic itself remains consistent, but we cannot prove it.
|
|
1038
|
|
1039 Except the upper bound, axioms are simple logical relation.
|
|
1040
|
|
1041 Proof of existence of mapping between OD and Ordinals are not obvious. We don't know we prove it or not.
|
|
1042
|
|
1043 Existence of the Upper bounds is a pure assumption, if we have not limit on Ordinals, it may contradicts,
|
|
1044 but we don't have explicit upper limit on Ordinals.
|
|
1045
|
|
1046 Several inference on our model or our axioms are basically parallel to the set theory text book, so it looks like correct.
|
|
1047
|
|
1048 --How to use Agda Set Theory
|
|
1049
|
|
1050 Assuming record ZF, classical set theory can be developed. If necessary, axiom of choice can be
|
|
1051 postulated or assuming law of excluded middle.
|
|
1052
|
|
1053 Instead, simply assumes non constructive assumption, various theory can be developed. We haven't check
|
|
1054 these assumptions are proved in record ZF, so we are not sure, these development is a result of ZF Set theory.
|
|
1055
|
|
1056 ZF record itself is not necessary, for example, topology theory without ZF can be possible.
|
|
1057
|
|
1058 --Topos and Set Theory
|
|
1059
|
|
1060 Topos is a mathematical structure in Category Theory, which is a Cartesian closed category which has a
|
|
1061 sub-object classifier.
|
|
1062
|
|
1063 Topos itself is model of intuitionistic logic.
|
|
1064
|
|
1065 Transitive Sets are objects of Cartesian closed category.
|
|
1066 It is possible to introduce Power Set Functor on it
|
|
1067
|
|
1068 We can use replacement A ∩ x for each element in Transitive Set,
|
|
1069 in the similar way of our power set axiom. I
|
|
1070
|
|
1071 A model of ZF Set theory can be constructed on top of the Topos which is shown in Oisus.
|
|
1072
|
|
1073 Our Agda model is a proof theoretic version of it.
|
|
1074
|
|
1075 --Cardinal number and Continuum hypothesis
|
|
1076
|
|
1077 Axiom of choice is required to define cardinal number
|
|
1078
|
|
1079 definition of cardinal number is not yet done
|
|
1080
|
|
1081 definition of filter is not yet done
|
|
1082
|
|
1083 we may have a model without axiom of choice or without continuum hypothesis
|
|
1084
|
|
1085 Possible representation of continuum hypothesis is this.
|
|
1086
|
|
1087 continuum-hyphotheis : (a : Ordinal) → Power (Ord a) ⊆ Ord (osuc a)
|
|
1088
|
|
1089 --Filter
|
|
1090
|
|
1091 filter is a dual of ideal on boolean algebra or lattice. Existence on natural number
|
|
1092 is depends on axiom of choice.
|
|
1093
|
|
1094 record Filter ( L : OD ) : Set (suc n) where
|
|
1095 field
|
|
1096 filter : OD
|
|
1097 proper : ¬ ( filter ∋ od∅ )
|
|
1098 inL : filter ⊆ L
|
|
1099 filter1 : { p q : OD } → q ⊆ L → filter ∋ p → p ⊆ q → filter ∋ q
|
|
1100 filter2 : { p q : OD } → filter ∋ p → filter ∋ q → filter ∋ (p ∩ q)
|
|
1101
|
|
1102 We may construct a model of non standard analysis or set theory.
|
|
1103
|
|
1104 This may be simpler than classical forcing theory ( not yet done).
|
|
1105
|
|
1106 --Programming Mathematics
|
|
1107
|
|
1108 Mathematics is a functional programming in Agda where proof is a value of a variable. The mathematical
|
|
1109 structure are
|
|
1110
|
|
1111 record and data
|
|
1112
|
|
1113 Proof is check by type consistency not by the computation, but it may include some normalization.
|
|
1114
|
|
1115 Type inference and termination is not so clear in multi recursions.
|
|
1116
|
|
1117 Defining Agda record is a good way to understand mathematical theory, for examples,
|
|
1118
|
|
1119 Category theory ( Yoneda lemma, Floyd Adjunction functor theorem, Applicative functor )
|
|
1120 Automaton ( Subset construction、Language containment)
|
|
1121
|
|
1122 are proved in Agda.
|
|
1123
|
|
1124 --link
|
|
1125
|
|
1126 Summer school of foundation of mathematics (in Japanese)
|
|
1127 <br> <a href="https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/">
|
|
1128 https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/
|
|
1129 </a>
|
|
1130
|
|
1131 Foundation of axiomatic set theory (in Japanese)
|
|
1132 <br> <a href="https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/sakai0.pdf">
|
|
1133 https://www.sci.shizuoka.ac.jp/~math/yorioka/ss2019/sakai0.pdf
|
|
1134 </a>
|
|
1135
|
|
1136 Agda
|
|
1137 <br> <a href="https://agda.readthedocs.io/en/v2.6.0.1/">
|
|
1138 https://agda.readthedocs.io/en/v2.6.0.1/
|
|
1139 </a>
|
|
1140
|
|
1141 ZF-in-Agda source
|
|
1142 <br> <a href="https://github.com/shinji-kono/zf-in-agda.git">
|
|
1143 https://github.com/shinji-kono/zf-in-agda.git
|
|
1144 </a>
|
|
1145
|
|
1146 Category theory in Agda source
|
|
1147 <br> <a href="https://github.com/shinji-kono/category-exercise-in-agda">
|
|
1148 https://github.com/shinji-kono/category-exercise-in-agda
|
|
1149 </a>
|
|
1150
|
|
1151
|
|
1152
|