Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate filter.agda @ 368:30de2d9b93c1
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 19 Jul 2020 03:24:39 +0900 |
parents | f74681db63c7 |
children | 1425104bb5d8 |
rev | line source |
---|---|
190 | 1 open import Level |
236 | 2 open import Ordinals |
3 module filter {n : Level } (O : Ordinals {n}) where | |
4 | |
190 | 5 open import zf |
236 | 6 open import logic |
7 import OD | |
193 | 8 |
363 | 9 open import Relation.Nullary |
10 open import Relation.Binary | |
11 open import Data.Empty | |
190 | 12 open import Relation.Binary |
13 open import Relation.Binary.Core | |
363 | 14 open import Relation.Binary.PropositionalEquality |
191
9eb6a8691f02
choice function cannot jump between ordinal level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
190
diff
changeset
|
15 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) |
363 | 16 import BAlgbra |
293 | 17 |
18 open BAlgbra O | |
191
9eb6a8691f02
choice function cannot jump between ordinal level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
190
diff
changeset
|
19 |
236 | 20 open inOrdinal O |
21 open OD O | |
22 open OD.OD | |
277
d9d3654baee1
seperate choice from LEM
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
276
diff
changeset
|
23 open ODAxiom odAxiom |
190 | 24 |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
25 import ODC |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
26 |
236 | 27 open _∧_ |
28 open _∨_ | |
29 open Bool | |
30 | |
295 | 31 -- Kunen p.76 and p.53, we use ⊆ |
329 | 32 record Filter ( L : HOD ) : Set (suc n) where |
191
9eb6a8691f02
choice function cannot jump between ordinal level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
190
diff
changeset
|
33 field |
329 | 34 filter : HOD |
290 | 35 f⊆PL : filter ⊆ Power L |
329 | 36 filter1 : { p q : HOD } → q ⊆ L → filter ∋ p → p ⊆ q → filter ∋ q |
37 filter2 : { p q : HOD } → filter ∋ p → filter ∋ q → filter ∋ (p ∩ q) | |
191
9eb6a8691f02
choice function cannot jump between ordinal level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
190
diff
changeset
|
38 |
292 | 39 open Filter |
40 | |
329 | 41 record prime-filter { L : HOD } (P : Filter L) : Set (suc (suc n)) where |
295 | 42 field |
43 proper : ¬ (filter P ∋ od∅) | |
329 | 44 prime : {p q : HOD } → filter P ∋ (p ∪ q) → ( filter P ∋ p ) ∨ ( filter P ∋ q ) |
292 | 45 |
329 | 46 record ultra-filter { L : HOD } (P : Filter L) : Set (suc (suc n)) where |
295 | 47 field |
48 proper : ¬ (filter P ∋ od∅) | |
329 | 49 ultra : {p : HOD } → p ⊆ L → ( filter P ∋ p ) ∨ ( filter P ∋ ( L \ p) ) |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
50 |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
51 open _⊆_ |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
52 |
329 | 53 trans-⊆ : { A B C : HOD} → A ⊆ B → B ⊆ C → A ⊆ C |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
54 trans-⊆ A⊆B B⊆C = record { incl = λ x → incl B⊆C (incl A⊆B x) } |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
55 |
329 | 56 power→⊆ : ( A t : HOD) → Power A ∋ t → t ⊆ A |
331 | 57 power→⊆ A t PA∋t = record { incl = λ {x} t∋x → ODC.double-neg-eilm O (t1 t∋x) } where |
329 | 58 t1 : {x : HOD } → t ∋ x → ¬ ¬ (A ∋ x) |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
59 t1 = zf.IsZF.power→ isZF A t PA∋t |
292 | 60 |
329 | 61 ∈-filter : {L p : HOD} → (P : Filter L ) → filter P ∋ p → p ⊆ L |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
62 ∈-filter {L} {p} P lt = power→⊆ L p ( incl (f⊆PL P) lt ) |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
63 |
329 | 64 ∪-lemma1 : {L p q : HOD } → (p ∪ q) ⊆ L → p ⊆ L |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
65 ∪-lemma1 {L} {p} {q} lt = record { incl = λ {x} p∋x → incl lt (case1 p∋x) } |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
66 |
329 | 67 ∪-lemma2 : {L p q : HOD } → (p ∪ q) ⊆ L → q ⊆ L |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
68 ∪-lemma2 {L} {p} {q} lt = record { incl = λ {x} p∋x → incl lt (case2 p∋x) } |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
69 |
329 | 70 q∩q⊆q : {p q : HOD } → (q ∩ p) ⊆ q |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
71 q∩q⊆q = record { incl = λ lt → proj1 lt } |
265 | 72 |
331 | 73 open HOD |
74 | |
295 | 75 ----- |
76 -- | |
77 -- ultra filter is prime | |
78 -- | |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
79 |
329 | 80 filter-lemma1 : {L : HOD} → (P : Filter L) → ∀ {p q : HOD } → ultra-filter P → prime-filter P |
295 | 81 filter-lemma1 {L} P u = record { |
82 proper = ultra-filter.proper u | |
83 ; prime = lemma3 | |
84 } where | |
329 | 85 lemma3 : {p q : HOD} → filter P ∋ (p ∪ q) → ( filter P ∋ p ) ∨ ( filter P ∋ q ) |
295 | 86 lemma3 {p} {q} lt with ultra-filter.ultra u (∪-lemma1 (∈-filter P lt) ) |
87 ... | case1 p∈P = case1 p∈P | |
88 ... | case2 ¬p∈P = case2 (filter1 P {q ∩ (L \ p)} (∪-lemma2 (∈-filter P lt)) lemma7 lemma8) where | |
331 | 89 lemma5 : ((p ∪ q ) ∩ (L \ p)) =h= (q ∩ (L \ p)) |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
90 lemma5 = record { eq→ = λ {x} lt → record { proj1 = lemma4 x lt ; proj2 = proj2 lt } |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
91 ; eq← = λ {x} lt → record { proj1 = case2 (proj1 lt) ; proj2 = proj2 lt } |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
92 } where |
331 | 93 lemma4 : (x : Ordinal ) → odef ((p ∪ q) ∩ (L \ p)) x → odef q x |
294
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
94 lemma4 x lt with proj1 lt |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
95 lemma4 x lt | case1 px = ⊥-elim ( proj2 (proj2 lt) px ) |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
96 lemma4 x lt | case2 qx = qx |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
97 lemma6 : filter P ∋ ((p ∪ q ) ∩ (L \ p)) |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
98 lemma6 = filter2 P lt ¬p∈P |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
99 lemma7 : filter P ∋ (q ∩ (L \ p)) |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
100 lemma7 = subst (λ k → filter P ∋ k ) (==→o≡ lemma5 ) lemma6 |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
101 lemma8 : (q ∩ (L \ p)) ⊆ q |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
102 lemma8 = q∩q⊆q |
4340ffcfa83d
ultra-filter P → prime-filter P done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
293
diff
changeset
|
103 |
295 | 104 ----- |
105 -- | |
106 -- if Filter contains L, prime filter is ultra | |
107 -- | |
108 | |
329 | 109 filter-lemma2 : {L : HOD} → (P : Filter L) → filter P ∋ L → prime-filter P → ultra-filter P |
296
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
110 filter-lemma2 {L} P f∋L prime = record { |
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
111 proper = prime-filter.proper prime |
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
112 ; ultra = λ {p} p⊆L → prime-filter.prime prime (lemma p p⊆L) |
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
113 } where |
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
114 open _==_ |
331 | 115 p+1-p=1 : {p : HOD} → p ⊆ L → L =h= (p ∪ (L \ p)) |
116 eq→ (p+1-p=1 {p} p⊆L) {x} lt with ODC.decp O (odef p x) | |
296
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
117 eq→ (p+1-p=1 {p} p⊆L) {x} lt | yes p∋x = case1 p∋x |
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
118 eq→ (p+1-p=1 {p} p⊆L) {x} lt | no ¬p = case2 (record { proj1 = lt ; proj2 = ¬p }) |
331 | 119 eq← (p+1-p=1 {p} p⊆L) {x} ( case1 p∋x ) = subst (λ k → odef L k ) diso (incl p⊆L ( subst (λ k → odef p k) (sym diso) p∋x )) |
296
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
120 eq← (p+1-p=1 {p} p⊆L) {x} ( case2 ¬p ) = proj1 ¬p |
329 | 121 lemma : (p : HOD) → p ⊆ L → filter P ∋ (p ∪ (L \ p)) |
296
42f89e5efb00
if Filter contains L, prime filter is ultra
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
295
diff
changeset
|
122 lemma p p⊆L = subst (λ k → filter P ∋ k ) (==→o≡ (p+1-p=1 p⊆L)) f∋L |
293 | 123 |
329 | 124 record Dense (P : HOD ) : Set (suc n) where |
269
30e419a2be24
disjunction and conjunction
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
268
diff
changeset
|
125 field |
329 | 126 dense : HOD |
368 | 127 incl : dense ⊆ Power P |
329 | 128 dense-f : HOD → HOD |
368 | 129 dense-d : { p : HOD} → p ⊆ P → dense ∋ dense-f p |
130 dense-p : { p : HOD} → p ⊆ P → p ⊆ (dense-f p) | |
266 | 131 |
329 | 132 record Ideal ( L : HOD ) : Set (suc n) where |
293 | 133 field |
329 | 134 ideal : HOD |
293 | 135 i⊆PL : ideal ⊆ Power L |
329 | 136 ideal1 : { p q : HOD } → q ⊆ L → ideal ∋ p → q ⊆ p → ideal ∋ q |
137 ideal2 : { p q : HOD } → ideal ∋ p → ideal ∋ q → ideal ∋ (p ∪ q) | |
293 | 138 |
139 open Ideal | |
140 | |
329 | 141 proper-ideal : {L : HOD} → (P : Ideal L ) → {p : HOD} → Set n |
293 | 142 proper-ideal {L} P {p} = ideal P ∋ od∅ |
143 | |
329 | 144 prime-ideal : {L : HOD} → Ideal L → ∀ {p q : HOD } → Set n |
293 | 145 prime-ideal {L} P {p} {q} = ideal P ∋ ( p ∩ q) → ( ideal P ∋ p ) ∨ ( ideal P ∋ q ) |
146 | |
364 | 147 ------- |
363 | 148 -- the set of finite partial functions from ω to 2 |
149 -- | |
150 -- | |
151 | |
152 import OPair | |
153 open OPair O | |
154 | |
155 ODSuc : (y : HOD) → infinite ∋ y → HOD | |
156 ODSuc y lt = Union (y , (y , y)) | |
157 | |
366 | 158 data Hω2 : (i : Nat) ( x : Ordinal ) → Set n where |
159 hφ : Hω2 0 o∅ | |
160 h0 : {i : Nat} {x : Ordinal } → Hω2 i x → | |
161 Hω2 (Suc i) (od→ord (Union ((< nat→ω i , nat→ω 0 >) , ord→od x ))) | |
162 h1 : {i : Nat} {x : Ordinal } → Hω2 i x → | |
163 Hω2 (Suc i) (od→ord (Union ((< nat→ω i , nat→ω 1 >) , ord→od x ))) | |
164 he : {i : Nat} {x : Ordinal } → Hω2 i x → | |
165 Hω2 (Suc i) x | |
166 | |
167 record Hω2r (x : Ordinal) : Set n where | |
168 field | |
169 count : Nat | |
170 hω2 : Hω2 count x | |
171 | |
172 open Hω2r | |
363 | 173 |
174 HODω2 : HOD | |
366 | 175 HODω2 = record { od = record { def = λ x → Hω2r x } ; odmax = next o∅ ; <odmax = odmax0 } where |
365 | 176 ω<next : {y : Ordinal} → infinite-d y → y o< next o∅ |
177 ω<next = ω<next-o∅ ho< | |
366 | 178 lemma : {i j : Nat} {x : Ordinal } → od→ord (Union (< nat→ω i , nat→ω j > , ord→od x)) o< next x |
179 lemma = {!!} | |
180 odmax0 : {y : Ordinal} → Hω2r y → y o< next o∅ | |
181 odmax0 {y} r with hω2 r | |
182 ... | hφ = x<nx | |
183 ... | h0 {i} {x} t = next< (odmax0 record { count = i ; hω2 = t }) (lemma {i} {0} {x}) | |
184 ... | h1 {i} {x} t = next< (odmax0 record { count = i ; hω2 = t }) (lemma {i} {1} {x}) | |
185 ... | he {i} {x} t = next< (odmax0 record { count = i ; hω2 = t }) x<nx | |
363 | 186 |
368 | 187 data Two : Set n where |
188 i0 : Two | |
189 i1 : Two | |
190 | |
191 record ω2r : Set n where | |
192 field | |
193 func2 : Nat → Two | |
194 ω2 : {!!} | |
195 | |
196 ω→2 : HOD | |
197 ω→2 = Replace infinite (λ x → < x , {!!} > ) | |
198 | |
199 G : (Nat → Two) → Filter HODω2 | |
200 G f = record { | |
365 | 201 filter = {!!} |
202 ; f⊆PL = {!!} | |
203 ; filter1 = {!!} | |
204 ; filter2 = {!!} | |
205 } where | |
206 filter0 : HOD | |
207 filter0 = {!!} | |
208 f⊆PL1 : filter0 ⊆ Power HODω2 | |
209 f⊆PL1 = {!!} | |
210 filter11 : { p q : HOD } → q ⊆ HODω2 → filter0 ∋ p → p ⊆ q → filter0 ∋ q | |
211 filter11 = {!!} | |
212 filter12 : { p q : HOD } → filter0 ∋ p → filter0 ∋ q → filter0 ∋ (p ∩ q) | |
213 filter12 = {!!} | |
214 | |
363 | 215 -- the set of finite partial functions from ω to 2 |
216 | |
217 Hω2f : Set (suc n) | |
218 Hω2f = (Nat → Set n) → Two | |
219 | |
220 Hω2f→Hω2 : Hω2f → HOD | |
221 Hω2f→Hω2 p = record { od = record { def = λ x → (p {!!} ≡ i0 ) ∨ (p {!!} ≡ i1 )}; odmax = {!!} ; <odmax = {!!} } | |
222 | |
223 |