annotate zf-in-agda.ind @ 322:a9d380378efd

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