Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate src/zorn.agda @ 686:b854c1f07873
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 10 Jul 2022 10:08:59 +0900 |
parents | 6826883cfbf8 |
children | af1d69eb429e |
rev | line source |
---|---|
478 | 1 {-# OPTIONS --allow-unsolved-metas #-} |
508 | 2 open import Level hiding ( suc ; zero ) |
431 | 3 open import Ordinals |
552 | 4 open import Relation.Binary |
5 open import Relation.Binary.Core | |
6 open import Relation.Binary.PropositionalEquality | |
497 | 7 import OD |
552 | 8 module zorn {n : Level } (O : Ordinals {n}) (_<_ : (x y : OD.HOD O ) → Set n ) (PO : IsStrictPartialOrder _≡_ _<_ ) where |
431 | 9 |
560 | 10 -- |
11 -- Zorn-lemma : { A : HOD } | |
12 -- → o∅ o< & A | |
13 -- → ( ( B : HOD) → (B⊆A : B ⊆ A) → IsTotalOrderSet B → SUP A B ) -- SUP condition | |
14 -- → Maximal A | |
15 -- | |
16 | |
431 | 17 open import zf |
477 | 18 open import logic |
19 -- open import partfunc {n} O | |
20 | |
21 open import Relation.Nullary | |
22 open import Data.Empty | |
23 import BAlgbra | |
431 | 24 |
555 | 25 open import Data.Nat hiding ( _<_ ; _≤_ ) |
26 open import Data.Nat.Properties | |
27 open import nat | |
28 | |
431 | 29 |
30 open inOrdinal O | |
31 open OD O | |
32 open OD.OD | |
33 open ODAxiom odAxiom | |
477 | 34 import OrdUtil |
35 import ODUtil | |
431 | 36 open Ordinals.Ordinals O |
37 open Ordinals.IsOrdinals isOrdinal | |
38 open Ordinals.IsNext isNext | |
39 open OrdUtil O | |
477 | 40 open ODUtil O |
41 | |
42 | |
43 import ODC | |
44 | |
45 | |
46 open _∧_ | |
47 open _∨_ | |
48 open Bool | |
431 | 49 |
50 | |
51 open HOD | |
52 | |
560 | 53 -- |
54 -- Partial Order on HOD ( possibly limited in A ) | |
55 -- | |
56 | |
571 | 57 _<<_ : (x y : Ordinal ) → Set n -- Set n order |
570 | 58 x << y = * x < * y |
59 | |
60 POO : IsStrictPartialOrder _≡_ _<<_ | |
61 POO = record { isEquivalence = record { refl = refl ; sym = sym ; trans = trans } | |
62 ; trans = IsStrictPartialOrder.trans PO | |
63 ; irrefl = λ x=y x<y → IsStrictPartialOrder.irrefl PO (cong (*) x=y) x<y | |
64 ; <-resp-≈ = record { fst = λ {x} {y} {y1} y=y1 xy1 → subst (λ k → x << k ) y=y1 xy1 ; snd = λ {x} {x1} {y} x=x1 x1y → subst (λ k → k << x ) x=x1 x1y } } | |
65 | |
528
8facdd7cc65a
TransitiveClosure with x <= f x is possible
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
527
diff
changeset
|
66 _≤_ : (x y : HOD) → Set (Level.suc n) |
8facdd7cc65a
TransitiveClosure with x <= f x is possible
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
527
diff
changeset
|
67 x ≤ y = ( x ≡ y ) ∨ ( x < y ) |
8facdd7cc65a
TransitiveClosure with x <= f x is possible
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
527
diff
changeset
|
68 |
554 | 69 ≤-ftrans : {x y z : HOD} → x ≤ y → y ≤ z → x ≤ z |
70 ≤-ftrans {x} {y} {z} (case1 refl ) (case1 refl ) = case1 refl | |
71 ≤-ftrans {x} {y} {z} (case1 refl ) (case2 y<z) = case2 y<z | |
72 ≤-ftrans {x} {_} {z} (case2 x<y ) (case1 refl ) = case2 x<y | |
73 ≤-ftrans {x} {y} {z} (case2 x<y) (case2 y<z) = case2 ( IsStrictPartialOrder.trans PO x<y y<z ) | |
74 | |
556 | 75 <-irr : {a b : HOD} → (a ≡ b ) ∨ (a < b ) → b < a → ⊥ |
76 <-irr {a} {b} (case1 a=b) b<a = IsStrictPartialOrder.irrefl PO (sym a=b) b<a | |
77 <-irr {a} {b} (case2 a<b) b<a = IsStrictPartialOrder.irrefl PO refl | |
78 (IsStrictPartialOrder.trans PO b<a a<b) | |
490 | 79 |
561 | 80 ptrans = IsStrictPartialOrder.trans PO |
81 | |
492 | 82 open _==_ |
83 open _⊆_ | |
84 | |
530 | 85 -- |
560 | 86 -- Closure of ≤-monotonic function f has total order |
530 | 87 -- |
88 | |
89 ≤-monotonic-f : (A : HOD) → ( Ordinal → Ordinal ) → Set (Level.suc n) | |
90 ≤-monotonic-f A f = (x : Ordinal ) → odef A x → ( * x ≤ * (f x) ) ∧ odef A (f x ) | |
91 | |
551 | 92 data FClosure (A : HOD) (f : Ordinal → Ordinal ) (s : Ordinal) : Ordinal → Set n where |
600 | 93 init : odef A s → FClosure A f s s |
555 | 94 fsuc : (x : Ordinal) ( p : FClosure A f s x ) → FClosure A f s (f x) |
554 | 95 |
556 | 96 A∋fc : {A : HOD} (s : Ordinal) {y : Ordinal } (f : Ordinal → Ordinal) (mf : ≤-monotonic-f A f) → (fcy : FClosure A f s y ) → odef A y |
600 | 97 A∋fc {A} s f mf (init as) = as |
556 | 98 A∋fc {A} s f mf (fsuc y fcy) = proj2 (mf y ( A∋fc {A} s f mf fcy ) ) |
555 | 99 |
556 | 100 s≤fc : {A : HOD} (s : Ordinal ) {y : Ordinal } (f : Ordinal → Ordinal) (mf : ≤-monotonic-f A f) → (fcy : FClosure A f s y ) → * s ≤ * y |
600 | 101 s≤fc {A} s {.s} f mf (init x) = case1 refl |
556 | 102 s≤fc {A} s {.(f x)} f mf (fsuc x fcy) with proj1 (mf x (A∋fc s f mf fcy ) ) |
103 ... | case1 x=fx = subst (λ k → * s ≤ * k ) (*≡*→≡ x=fx) ( s≤fc {A} s f mf fcy ) | |
104 ... | case2 x<fx with s≤fc {A} s f mf fcy | |
105 ... | case1 s≡x = case2 ( subst₂ (λ j k → j < k ) (sym s≡x) refl x<fx ) | |
106 ... | case2 s<x = case2 ( IsStrictPartialOrder.trans PO s<x x<fx ) | |
555 | 107 |
557 | 108 fcn : {A : HOD} (s : Ordinal) { x : Ordinal} {f : Ordinal → Ordinal} → (mf : ≤-monotonic-f A f) → FClosure A f s x → ℕ |
600 | 109 fcn s mf (init as) = zero |
558 | 110 fcn {A} s {x} {f} mf (fsuc y p) with proj1 (mf y (A∋fc s f mf p)) |
111 ... | case1 eq = fcn s mf p | |
112 ... | case2 y<fy = suc (fcn s mf p ) | |
557 | 113 |
558 | 114 fcn-inject : {A : HOD} (s : Ordinal) { x y : Ordinal} {f : Ordinal → Ordinal} → (mf : ≤-monotonic-f A f) |
115 → (cx : FClosure A f s x ) (cy : FClosure A f s y ) → fcn s mf cx ≡ fcn s mf cy → * x ≡ * y | |
559 | 116 fcn-inject {A} s {x} {y} {f} mf cx cy eq = fc00 (fcn s mf cx) (fcn s mf cy) eq cx cy refl refl where |
117 fc00 : (i j : ℕ ) → i ≡ j → {x y : Ordinal } → (cx : FClosure A f s x ) (cy : FClosure A f s y ) → i ≡ fcn s mf cx → j ≡ fcn s mf cy → * x ≡ * y | |
600 | 118 fc00 zero zero refl (init _) (init x₁) i=x i=y = refl |
119 fc00 zero zero refl (init as) (fsuc y cy) i=x i=y with proj1 (mf y (A∋fc s f mf cy ) ) | |
120 ... | case1 y=fy = subst (λ k → * s ≡ k ) y=fy ( fc00 zero zero refl (init as) cy i=x i=y ) | |
121 fc00 zero zero refl (fsuc x cx) (init as) i=x i=y with proj1 (mf x (A∋fc s f mf cx ) ) | |
122 ... | case1 x=fx = subst (λ k → k ≡ * s ) x=fx ( fc00 zero zero refl cx (init as) i=x i=y ) | |
559 | 123 fc00 zero zero refl (fsuc x cx) (fsuc y cy) i=x i=y with proj1 (mf x (A∋fc s f mf cx ) ) | proj1 (mf y (A∋fc s f mf cy ) ) |
124 ... | case1 x=fx | case1 y=fy = subst₂ (λ j k → j ≡ k ) x=fx y=fy ( fc00 zero zero refl cx cy i=x i=y ) | |
125 fc00 (suc i) (suc j) i=j {.(f x)} {.(f y)} (fsuc x cx) (fsuc y cy) i=x j=y with proj1 (mf x (A∋fc s f mf cx ) ) | proj1 (mf y (A∋fc s f mf cy ) ) | |
126 ... | case1 x=fx | case1 y=fy = subst₂ (λ j k → j ≡ k ) x=fx y=fy ( fc00 (suc i) (suc j) i=j cx cy i=x j=y ) | |
127 ... | case1 x=fx | case2 y<fy = subst (λ k → k ≡ * (f y)) x=fx (fc02 x cx i=x) where | |
128 fc02 : (x1 : Ordinal) → (cx1 : FClosure A f s x1 ) → suc i ≡ fcn s mf cx1 → * x1 ≡ * (f y) | |
129 fc02 .(f x1) (fsuc x1 cx1) i=x1 with proj1 (mf x1 (A∋fc s f mf cx1 ) ) | |
560 | 130 ... | case1 eq = trans (sym eq) ( fc02 x1 cx1 i=x1 ) -- derefence while f x ≡ x |
559 | 131 ... | case2 lt = subst₂ (λ j k → * (f j) ≡ * (f k )) &iso &iso ( cong (λ k → * ( f (& k ))) fc04) where |
132 fc04 : * x1 ≡ * y | |
133 fc04 = fc00 i j (cong pred i=j) cx1 cy (cong pred i=x1) (cong pred j=y) | |
134 ... | case2 x<fx | case1 y=fy = subst (λ k → * (f x) ≡ k ) y=fy (fc03 y cy j=y) where | |
135 fc03 : (y1 : Ordinal) → (cy1 : FClosure A f s y1 ) → suc j ≡ fcn s mf cy1 → * (f x) ≡ * y1 | |
136 fc03 .(f y1) (fsuc y1 cy1) j=y1 with proj1 (mf y1 (A∋fc s f mf cy1 ) ) | |
137 ... | case1 eq = trans ( fc03 y1 cy1 j=y1 ) eq | |
138 ... | case2 lt = subst₂ (λ j k → * (f j) ≡ * (f k )) &iso &iso ( cong (λ k → * ( f (& k ))) fc05) where | |
139 fc05 : * x ≡ * y1 | |
140 fc05 = fc00 i j (cong pred i=j) cx cy1 (cong pred i=x) (cong pred j=y1) | |
141 ... | case2 x₁ | case2 x₂ = subst₂ (λ j k → * (f j) ≡ * (f k) ) &iso &iso (cong (λ k → * (f (& k))) (fc00 i j (cong pred i=j) cx cy (cong pred i=x) (cong pred j=y))) | |
557 | 142 |
600 | 143 |
557 | 144 fcn-< : {A : HOD} (s : Ordinal ) { x y : Ordinal} {f : Ordinal → Ordinal} → (mf : ≤-monotonic-f A f) |
145 → (cx : FClosure A f s x ) (cy : FClosure A f s y ) → fcn s mf cx Data.Nat.< fcn s mf cy → * x < * y | |
558 | 146 fcn-< {A} s {x} {y} {f} mf cx cy x<y = fc01 (fcn s mf cy) cx cy refl x<y where |
147 fc01 : (i : ℕ ) → {y : Ordinal } → (cx : FClosure A f s x ) (cy : FClosure A f s y ) → (i ≡ fcn s mf cy ) → fcn s mf cx Data.Nat.< i → * x < * y | |
148 fc01 (suc i) {y} cx (fsuc y1 cy) i=y (s≤s x<i) with proj1 (mf y1 (A∋fc s f mf cy ) ) | |
149 ... | case1 y=fy = subst (λ k → * x < k ) y=fy ( fc01 (suc i) {y1} cx cy i=y (s≤s x<i) ) | |
150 ... | case2 y<fy with <-cmp (fcn s mf cx ) i | |
151 ... | tri> ¬a ¬b c = ⊥-elim ( nat-≤> x<i c ) | |
152 ... | tri≈ ¬a b ¬c = subst (λ k → k < * (f y1) ) (fcn-inject s mf cy cx (sym (trans b (cong pred i=y) ))) y<fy | |
153 ... | tri< a ¬b ¬c = IsStrictPartialOrder.trans PO fc02 y<fy where | |
154 fc03 : suc i ≡ suc (fcn s mf cy) → i ≡ fcn s mf cy | |
155 fc03 eq = cong pred eq | |
156 fc02 : * x < * y1 | |
157 fc02 = fc01 i cx cy (fc03 i=y ) a | |
557 | 158 |
559 | 159 fcn-cmp : {A : HOD} (s : Ordinal) { x y : Ordinal } (f : Ordinal → Ordinal) (mf : ≤-monotonic-f A f) |
554 | 160 → (cx : FClosure A f s x) → (cy : FClosure A f s y ) → Tri (* x < * y) (* x ≡ * y) (* y < * x ) |
559 | 161 fcn-cmp {A} s {x} {y} f mf cx cy with <-cmp ( fcn s mf cx ) (fcn s mf cy ) |
162 ... | tri< a ¬b ¬c = tri< fc11 (λ eq → <-irr (case1 (sym eq)) fc11) (λ lt → <-irr (case2 fc11) lt) where | |
163 fc11 : * x < * y | |
164 fc11 = fcn-< {A} s {x} {y} {f} mf cx cy a | |
165 ... | tri≈ ¬a b ¬c = tri≈ (λ lt → <-irr (case1 (sym fc10)) lt) fc10 (λ lt → <-irr (case1 fc10) lt) where | |
166 fc10 : * x ≡ * y | |
167 fc10 = fcn-inject {A} s {x} {y} {f} mf cx cy b | |
168 ... | tri> ¬a ¬b c = tri> (λ lt → <-irr (case2 fc12) lt) (λ eq → <-irr (case1 eq) fc12) fc12 where | |
169 fc12 : * y < * x | |
170 fc12 = fcn-< {A} s {y} {x} {f} mf cy cx c | |
171 | |
600 | 172 |
562 | 173 fcn-imm : {A : HOD} (s : Ordinal) { x y : Ordinal } (f : Ordinal → Ordinal) (mf : ≤-monotonic-f A f) |
174 → (cx : FClosure A f s x) → (cy : FClosure A f s y ) → ¬ ( ( * x < * y ) ∧ ( * y < * (f x )) ) | |
563 | 175 fcn-imm {A} s {x} {y} f mf cx cy ⟪ x<y , y<fx ⟫ = fc21 where |
176 fc20 : fcn s mf cy Data.Nat.< suc (fcn s mf cx) → (fcn s mf cy ≡ fcn s mf cx) ∨ ( fcn s mf cy Data.Nat.< fcn s mf cx ) | |
177 fc20 y<sx with <-cmp ( fcn s mf cy ) (fcn s mf cx ) | |
178 ... | tri< a ¬b ¬c = case2 a | |
179 ... | tri≈ ¬a b ¬c = case1 b | |
180 ... | tri> ¬a ¬b c = ⊥-elim ( nat-≤> y<sx (s≤s c)) | |
181 fc17 : {x y : Ordinal } → (cx : FClosure A f s x) → (cy : FClosure A f s y ) → suc (fcn s mf cx) ≡ fcn s mf cy → * (f x ) ≡ * y | |
182 fc17 {x} {y} cx cy sx=y = fc18 (fcn s mf cy) cx cy refl sx=y where | |
183 fc18 : (i : ℕ ) → {y : Ordinal } → (cx : FClosure A f s x ) (cy : FClosure A f s y ) → (i ≡ fcn s mf cy ) → suc (fcn s mf cx) ≡ i → * (f x) ≡ * y | |
184 fc18 (suc i) {y} cx (fsuc y1 cy) i=y sx=i with proj1 (mf y1 (A∋fc s f mf cy ) ) | |
185 ... | case1 y=fy = subst (λ k → * (f x) ≡ k ) y=fy ( fc18 (suc i) {y1} cx cy i=y sx=i) -- dereference | |
186 ... | case2 y<fy = subst₂ (λ j k → * (f j) ≡ * (f k) ) &iso &iso (cong (λ k → * (f (& k) ) ) fc19) where | |
187 fc19 : * x ≡ * y1 | |
188 fc19 = fcn-inject s mf cx cy (cong pred ( trans sx=i i=y )) | |
189 fc21 : ⊥ | |
190 fc21 with <-cmp (suc ( fcn s mf cx )) (fcn s mf cy ) | |
191 ... | tri< a ¬b ¬c = <-irr (case2 y<fx) (fc22 a) where -- suc ncx < ncy | |
192 cxx : FClosure A f s (f x) | |
193 cxx = fsuc x cx | |
194 fc16 : (x : Ordinal ) → (cx : FClosure A f s x) → (fcn s mf cx ≡ fcn s mf (fsuc x cx)) ∨ ( suc (fcn s mf cx ) ≡ fcn s mf (fsuc x cx)) | |
600 | 195 fc16 x (init as) with proj1 (mf s as ) |
563 | 196 ... | case1 _ = case1 refl |
197 ... | case2 _ = case2 refl | |
198 fc16 .(f x) (fsuc x cx ) with proj1 (mf (f x) (A∋fc s f mf (fsuc x cx)) ) | |
199 ... | case1 _ = case1 refl | |
200 ... | case2 _ = case2 refl | |
201 fc22 : (suc ( fcn s mf cx )) Data.Nat.< (fcn s mf cy ) → * (f x) < * y | |
202 fc22 a with fc16 x cx | |
203 ... | case1 eq = fcn-< s mf cxx cy (subst (λ k → k Data.Nat.< fcn s mf cy ) eq (<-trans a<sa a)) | |
204 ... | case2 eq = fcn-< s mf cxx cy (subst (λ k → k Data.Nat.< fcn s mf cy ) eq a ) | |
205 ... | tri≈ ¬a b ¬c = <-irr (case1 (fc17 cx cy b)) y<fx | |
206 ... | tri> ¬a ¬b c with fc20 c -- ncy < suc ncx | |
207 ... | case1 y=x = <-irr (case1 ( fcn-inject s mf cy cx y=x )) x<y | |
208 ... | case2 y<x = <-irr (case2 x<y) (fcn-< s mf cy cx y<x ) | |
209 | |
560 | 210 -- open import Relation.Binary.Properties.Poset as Poset |
211 | |
212 IsTotalOrderSet : ( A : HOD ) → Set (Level.suc n) | |
213 IsTotalOrderSet A = {a b : HOD} → odef A (& a) → odef A (& b) → Tri (a < b) (a ≡ b) (b < a ) | |
214 | |
567 | 215 ⊆-IsTotalOrderSet : { A B : HOD } → B ⊆ A → IsTotalOrderSet A → IsTotalOrderSet B |
568 | 216 ⊆-IsTotalOrderSet {A} {B} B⊆A T ax ay = T (incl B⊆A ax) (incl B⊆A ay) |
567 | 217 |
568 | 218 _⊆'_ : ( A B : HOD ) → Set n |
219 _⊆'_ A B = {x : Ordinal } → odef A x → odef B x | |
560 | 220 |
221 -- | |
222 -- inductive maxmum tree from x | |
223 -- tree structure | |
224 -- | |
554 | 225 |
567 | 226 record HasPrev (A B : HOD) {x : Ordinal } (xa : odef A x) ( f : Ordinal → Ordinal ) : Set n where |
533 | 227 field |
534 | 228 y : Ordinal |
541 | 229 ay : odef B y |
534 | 230 x=fy : x ≡ f y |
529 | 231 |
570 | 232 record IsSup (A B : HOD) {x : Ordinal } (xa : odef A x) : Set n where |
654 | 233 field |
571 | 234 x<sup : {y : Ordinal} → odef B y → (y ≡ x ) ∨ (y << x ) |
568 | 235 |
656 | 236 record SUP ( A B : HOD ) : Set (Level.suc n) where |
237 field | |
238 sup : HOD | |
239 A∋maximal : A ∋ sup | |
240 x<sup : {x : HOD} → B ∋ x → (x ≡ sup ) ∨ (x < sup ) -- B is Total, use positive | |
241 | |
662 | 242 -- Union of supf z which o< x |
243 -- | |
661 | 244 record UChain (x : Ordinal) (chain : (z : Ordinal ) → z o< x → HOD) (z : Ordinal) : Set n where |
626 | 245 field |
655 | 246 u : Ordinal |
247 u<x : u o< x | |
661 | 248 chain∋z : odef (chain u u<x) z |
653 | 249 |
656 | 250 ∈∧P→o< : {A : HOD } {y : Ordinal} → {P : Set n} → odef A y ∧ P → y o< & A |
251 ∈∧P→o< {A } {y} p = subst (λ k → k o< & A) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso ) (proj1 p ))) | |
252 | |
663 | 253 UnionCF : (A : HOD) (x : Ordinal) (chainf : (z : Ordinal ) → z o< x → HOD ) → HOD |
254 UnionCF A x chainf = record { od = record { def = λ z → odef A z ∧ UChain x chainf z } ; odmax = & A ; <odmax = λ {y} sy → ∈∧P→o< sy } | |
255 | |
673 | 256 data Chain (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) : Ordinal → Ordinal → Set n where |
257 ch-init : (x z : Ordinal) → x ≡ o∅ → FClosure A f y z → Chain A f mf ay x z | |
684
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
258 ch-is-sup : {x z : Ordinal } (0<x : o∅ o< x) ( ax : odef A x ) |
673 | 259 → ( is-sup : (x1 w : Ordinal) → x1 o< x → Chain A f mf ay x1 w → w << x ) → ( fc : FClosure A f x z ) → Chain A f mf ay x z |
662 | 260 |
664 | 261 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal } (ay : odef A y ) ( z : Ordinal ) : Set (Level.suc n) where |
655 | 262 field |
676 | 263 psup : Ordinal → Ordinal |
681 | 264 p≤z : (x : Ordinal ) → odef A (psup x) |
680 | 265 chainf : (x : Ordinal) → HOD |
266 is-chain : (x w : Ordinal) → odef (chainf x) w → Chain A f mf ay (psup x ) w | |
681 | 267 psup-mono : (x : Ordinal) → (x≤z : x o≤ z ) → chainf x ⊆' chainf z |
673 | 268 |
674 | 269 record ZChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {init : Ordinal} (ay : odef A init) |
270 (zc0 : (x : Ordinal) → ZChain1 A f mf ay x ) ( z : Ordinal ) : Set (Level.suc n) where | |
608
6655f03984f9
mutual tranfinite in zorn
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
607
diff
changeset
|
271 chain : HOD |
680 | 272 chain = ZChain1.chainf (zc0 (& A)) z |
568 | 273 field |
680 | 274 chain-mono : (px py : Ordinal) → (x≤y : px o≤ py ) (y≤z : py o≤ z ) → (w : Ordinal ) |
275 → ZChain1.chainf (zc0 (& A)) px ⊆' ZChain1.chainf (zc0 (& A)) py | |
568 | 276 chain⊆A : chain ⊆' A |
653 | 277 chain∋init : odef chain init |
278 initial : {y : Ordinal } → odef chain y → * init ≤ * y | |
568 | 279 f-next : {a : Ordinal } → odef chain a → odef chain (f a) |
654 | 280 f-total : IsTotalOrderSet chain |
568 | 281 is-max : {a b : Ordinal } → (ca : odef chain a ) → b o< osuc z → (ab : odef A b) |
574 | 282 → HasPrev A chain ab f ∨ IsSup A chain ab |
568 | 283 → * a < * b → odef chain b |
653 | 284 |
568 | 285 record Maximal ( A : HOD ) : Set (Level.suc n) where |
286 field | |
287 maximal : HOD | |
288 A∋maximal : A ∋ maximal | |
289 ¬maximal<x : {x : HOD} → A ∋ x → ¬ maximal < x -- A is Partial, use negative | |
567 | 290 |
533 | 291 SupCond : ( A B : HOD) → (B⊆A : B ⊆ A) → IsTotalOrderSet B → Set (Level.suc n) |
292 SupCond A B _ _ = SUP A B | |
293 | |
684
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
294 -- data Chain (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) : Ordinal → Ordinal → Set n where |
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
295 -- |
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
296 -- data Chain is total |
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
297 |
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
298 chain-total : (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) |
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
299 {s s1 a b : Ordinal } ( ca : Chain A f mf ay s a ) ( cb : Chain A f mf ay s1 b ) → Tri (* a < * b) (* a ≡ * b) (* b < * a ) |
685 | 300 chain-total A f mf {y} ay {s} {s1} {a} {b} ca cb = ct-ind s ca cb where |
301 ct-ind : (x : Ordinal) → {s1 a b : Ordinal} → Chain A f mf ay x a → Chain A f mf ay s1 b → Tri (* a < * b) (* a ≡ * b) (* b < * a) | |
302 ct-ind x {s1} {a} {b} (ch-init s a x=0 fca) (ch-init s1 b x=0' fcb) = fcn-cmp y f mf fca fcb | |
303 ct-ind x {s1} {a} {b} (ch-init s a x=0 fca) (ch-is-sup 0<x as supb fcb) = tri< ct01 (λ eq → <-irr (case1 (sym eq)) ct01) (λ lt → <-irr (case2 ct01) lt) where | |
304 ct00 : * a < * s1 | |
305 ct00 = supb _ _ 0<x (subst (λ k → Chain A f mf ay k a) x=0 (ch-init s a x=0 fca) ) | |
306 ct01 : * a < * b | |
307 ct01 with s≤fc s1 f mf fcb | |
308 ... | case1 eq = subst (λ k → * a < k ) eq ct00 | |
309 ... | case2 lt = IsStrictPartialOrder.trans POO ct00 lt | |
310 ct-ind x {s1} {a} {b} (ch-is-sup 0<x as supa fca) (ch-init s1 b x=0' fcb) = ? | |
311 ct-ind x {s1} {a} {b} (ch-is-sup 0<x as supa fca) (ch-is-sup 0<x' as' supb fcb) with trio< x s1 | |
312 ... | tri< a₁ ¬b ¬c = tri< ct02 (λ eq → <-irr (case1 (sym eq)) ct02) (λ lt → <-irr (case2 ct02) lt) where | |
313 ct03 : * a < * s1 | |
314 ct03 = supb _ _ a₁ (ch-is-sup 0<x as supa fca) | |
315 ct02 : * a < * b | |
316 ct02 with s≤fc s1 f mf fcb | |
317 ... | case1 eq = subst (λ k → * a < k ) eq ct03 | |
318 ... | case2 lt = IsStrictPartialOrder.trans POO ct03 lt | |
684
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
319 ... | tri≈ ¬a refl ¬c = fcn-cmp s1 f mf fca fcb |
685 | 320 ... | tri> ¬a ¬b c = tri> (λ lt → <-irr (case2 ct04) lt) (λ eq → <-irr (case1 (eq)) ct04) ct04 where |
321 ct05 : * b < * x | |
322 ct05 = supa _ _ c (ch-is-sup 0<x' as' supb fcb) | |
323 ct04 : * b < * a | |
324 ct04 with s≤fc x f mf fca | |
325 ... | case1 eq = subst (λ k → * b < k ) eq ct05 | |
326 ... | case2 lt = IsStrictPartialOrder.trans POO ct05 lt | |
684
822fce8af579
no transfinite on data Chain trichotomos
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
683
diff
changeset
|
327 |
497 | 328 Zorn-lemma : { A : HOD } |
464 | 329 → o∅ o< & A |
568 | 330 → ( ( B : HOD) → (B⊆A : B ⊆' A) → IsTotalOrderSet B → SUP A B ) -- SUP condition |
497 | 331 → Maximal A |
552 | 332 Zorn-lemma {A} 0<A supP = zorn00 where |
571 | 333 <-irr0 : {a b : HOD} → A ∋ a → A ∋ b → (a ≡ b ) ∨ (a < b ) → b < a → ⊥ |
334 <-irr0 {a} {b} A∋a A∋b = <-irr | |
537 | 335 z07 : {y : Ordinal} → {P : Set n} → odef A y ∧ P → y o< & A |
336 z07 {y} p = subst (λ k → k o< & A) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso ) (proj1 p ))) | |
530 | 337 s : HOD |
338 s = ODC.minimal O A (λ eq → ¬x<0 ( subst (λ k → o∅ o< k ) (=od∅→≡o∅ eq) 0<A )) | |
568 | 339 as : A ∋ * ( & s ) |
340 as = subst (λ k → odef A (& k) ) (sym *iso) ( ODC.x∋minimal O A (λ eq → ¬x<0 ( subst (λ k → o∅ o< k ) (=od∅→≡o∅ eq) 0<A )) ) | |
608
6655f03984f9
mutual tranfinite in zorn
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
607
diff
changeset
|
341 as0 : odef A (& s ) |
6655f03984f9
mutual tranfinite in zorn
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
607
diff
changeset
|
342 as0 = subst (λ k → odef A k ) &iso as |
547 | 343 s<A : & s o< & A |
568 | 344 s<A = c<→o< (subst (λ k → odef A (& k) ) *iso as ) |
530 | 345 HasMaximal : HOD |
537 | 346 HasMaximal = record { od = record { def = λ x → odef A x ∧ ( (m : Ordinal) → odef A m → ¬ (* x < * m)) } ; odmax = & A ; <odmax = z07 } |
347 no-maximum : HasMaximal =h= od∅ → (x : Ordinal) → odef A x ∧ ((m : Ordinal) → odef A m → odef A x ∧ (¬ (* x < * m) )) → ⊥ | |
348 no-maximum nomx x P = ¬x<0 (eq→ nomx {x} ⟪ proj1 P , (λ m ma p → proj2 ( proj2 P m ma ) p ) ⟫ ) | |
532 | 349 Gtx : { x : HOD} → A ∋ x → HOD |
537 | 350 Gtx {x} ax = record { od = record { def = λ y → odef A y ∧ (x < (* y)) } ; odmax = & A ; <odmax = z07 } |
351 z08 : ¬ Maximal A → HasMaximal =h= od∅ | |
352 z08 nmx = record { eq→ = λ {x} lt → ⊥-elim ( nmx record {maximal = * x ; A∋maximal = subst (λ k → odef A k) (sym &iso) (proj1 lt) | |
353 ; ¬maximal<x = λ {y} ay → subst (λ k → ¬ (* x < k)) *iso (proj2 lt (& y) ay) } ) ; eq← = λ {y} lt → ⊥-elim ( ¬x<0 lt )} | |
354 x-is-maximal : ¬ Maximal A → {x : Ordinal} → (ax : odef A x) → & (Gtx (subst (λ k → odef A k ) (sym &iso) ax)) ≡ o∅ → (m : Ordinal) → odef A m → odef A x ∧ (¬ (* x < * m)) | |
355 x-is-maximal nmx {x} ax nogt m am = ⟪ subst (λ k → odef A k) &iso (subst (λ k → odef A k ) (sym &iso) ax) , ¬x<m ⟫ where | |
356 ¬x<m : ¬ (* x < * m) | |
357 ¬x<m x<m = ∅< {Gtx (subst (λ k → odef A k ) (sym &iso) ax)} {* m} ⟪ subst (λ k → odef A k) (sym &iso) am , subst (λ k → * x < k ) (cong (*) (sym &iso)) x<m ⟫ (≡o∅→=od∅ nogt) | |
543 | 358 |
560 | 359 -- Uncountable ascending chain by axiom of choice |
530 | 360 cf : ¬ Maximal A → Ordinal → Ordinal |
532 | 361 cf nmx x with ODC.∋-p O A (* x) |
362 ... | no _ = o∅ | |
363 ... | yes ax with is-o∅ (& ( Gtx ax )) | |
538 | 364 ... | yes nogt = -- no larger element, so it is maximal |
365 ⊥-elim (no-maximum (z08 nmx) x ⟪ subst (λ k → odef A k) &iso ax , x-is-maximal nmx (subst (λ k → odef A k ) &iso ax) nogt ⟫ ) | |
532 | 366 ... | no not = & (ODC.minimal O (Gtx ax) (λ eq → not (=od∅→≡o∅ eq))) |
537 | 367 is-cf : (nmx : ¬ Maximal A ) → {x : Ordinal} → odef A x → odef A (cf nmx x) ∧ ( * x < * (cf nmx x) ) |
368 is-cf nmx {x} ax with ODC.∋-p O A (* x) | |
369 ... | no not = ⊥-elim ( not (subst (λ k → odef A k ) (sym &iso) ax )) | |
370 ... | yes ax with is-o∅ (& ( Gtx ax )) | |
371 ... | yes nogt = ⊥-elim (no-maximum (z08 nmx) x ⟪ subst (λ k → odef A k) &iso ax , x-is-maximal nmx (subst (λ k → odef A k ) &iso ax) nogt ⟫ ) | |
372 ... | no not = ODC.x∋minimal O (Gtx ax) (λ eq → not (=od∅→≡o∅ eq)) | |
606 | 373 |
374 --- | |
375 --- infintie ascention sequence of f | |
376 --- | |
530 | 377 cf-is-<-monotonic : (nmx : ¬ Maximal A ) → (x : Ordinal) → odef A x → ( * x < * (cf nmx x) ) ∧ odef A (cf nmx x ) |
537 | 378 cf-is-<-monotonic nmx x ax = ⟪ proj2 (is-cf nmx ax ) , proj1 (is-cf nmx ax ) ⟫ |
530 | 379 cf-is-≤-monotonic : (nmx : ¬ Maximal A ) → ≤-monotonic-f A ( cf nmx ) |
532 | 380 cf-is-≤-monotonic nmx x ax = ⟪ case2 (proj1 ( cf-is-<-monotonic nmx x ax )) , proj2 ( cf-is-<-monotonic nmx x ax ) ⟫ |
543 | 381 |
674 | 382 sp0 : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) (zc0 : (x : Ordinal) → ZChain1 A f mf as0 x ) (zc : ZChain A f mf as0 zc0 (& A) ) |
653 | 383 (total : IsTotalOrderSet (ZChain.chain zc) ) → SUP A (ZChain.chain zc) |
384 sp0 f mf zc0 zc total = supP (ZChain.chain zc) (ZChain.chain⊆A zc) total | |
543 | 385 zc< : {x y z : Ordinal} → {P : Set n} → (x o< y → P) → x o< z → z o< y → P |
386 zc< {x} {y} {z} {P} prev x<z z<y = prev (ordtrans x<z z<y) | |
387 | |
388 --- | |
560 | 389 --- the maximum chain has fix point of any ≤-monotonic function |
543 | 390 --- |
674 | 391 fixpoint : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) (zc0 : (x : Ordinal) → ZChain1 A f mf as0 x) (zc : ZChain A f mf as0 zc0 (& A) ) |
633
6cd4a483122c
ZChain1 is not strictly positive
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
392 → (total : IsTotalOrderSet (ZChain.chain zc) ) |
653 | 393 → f (& (SUP.sup (sp0 f mf zc0 zc total ))) ≡ & (SUP.sup (sp0 f mf zc0 zc total)) |
394 fixpoint f mf zc0 zc total = z14 where | |
538 | 395 chain = ZChain.chain zc |
653 | 396 sp1 = sp0 f mf zc0 zc total |
565 | 397 z10 : {a b : Ordinal } → (ca : odef chain a ) → b o< osuc (& A) → (ab : odef A b ) |
570 | 398 → HasPrev A chain ab f ∨ IsSup A chain {b} ab -- (supO chain (ZChain.chain⊆A zc) (ZChain.f-total zc) ≡ b ) |
538 | 399 → * a < * b → odef chain b |
400 z10 = ZChain.is-max zc | |
543 | 401 z11 : & (SUP.sup sp1) o< & A |
402 z11 = c<→o< ( SUP.A∋maximal sp1) | |
538 | 403 z12 : odef chain (& (SUP.sup sp1)) |
404 z12 with o≡? (& s) (& (SUP.sup sp1)) | |
653 | 405 ... | yes eq = subst (λ k → odef chain k) eq ( ZChain.chain∋init zc ) |
406 ... | no ne = z10 {& s} {& (SUP.sup sp1)} ( ZChain.chain∋init zc ) (ordtrans z11 <-osuc ) (SUP.A∋maximal sp1) | |
570 | 407 (case2 z19 ) z13 where |
538 | 408 z13 : * (& s) < * (& (SUP.sup sp1)) |
653 | 409 z13 with SUP.x<sup sp1 ( ZChain.chain∋init zc ) |
538 | 410 ... | case1 eq = ⊥-elim ( ne (cong (&) eq) ) |
411 ... | case2 lt = subst₂ (λ j k → j < k ) (sym *iso) (sym *iso) lt | |
570 | 412 z19 : IsSup A chain {& (SUP.sup sp1)} (SUP.A∋maximal sp1) |
571 | 413 z19 = record { x<sup = z20 } where |
414 z20 : {y : Ordinal} → odef chain y → (y ≡ & (SUP.sup sp1)) ∨ (y << & (SUP.sup sp1)) | |
415 z20 {y} zy with SUP.x<sup sp1 (subst (λ k → odef chain k ) (sym &iso) zy) | |
570 | 416 ... | case1 y=p = case1 (subst (λ k → k ≡ _ ) &iso ( cong (&) y=p )) |
417 ... | case2 y<p = case2 (subst (λ k → * y < k ) (sym *iso) y<p ) | |
418 -- λ {y} zy → subst (λ k → (y ≡ & k ) ∨ (y << & k)) ? (SUP.x<sup sp1 ? ) } | |
653 | 419 z14 : f (& (SUP.sup (sp0 f mf zc0 zc total ))) ≡ & (SUP.sup (sp0 f mf zc0 zc total )) |
633
6cd4a483122c
ZChain1 is not strictly positive
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
420 z14 with total (subst (λ k → odef chain k) (sym &iso) (ZChain.f-next zc z12 )) z12 |
631 | 421 ... | tri< a ¬b ¬c = ⊥-elim z16 where |
422 z16 : ⊥ | |
423 z16 with proj1 (mf (& ( SUP.sup sp1)) ( SUP.A∋maximal sp1 )) | |
424 ... | case1 eq = ⊥-elim (¬b (subst₂ (λ j k → j ≡ k ) refl *iso (sym eq) )) | |
425 ... | case2 lt = ⊥-elim (¬c (subst₂ (λ j k → k < j ) refl *iso lt )) | |
426 ... | tri≈ ¬a b ¬c = subst ( λ k → k ≡ & (SUP.sup sp1) ) &iso ( cong (&) b ) | |
427 ... | tri> ¬a ¬b c = ⊥-elim z17 where | |
428 z15 : (* (f ( & ( SUP.sup sp1 ))) ≡ SUP.sup sp1) ∨ (* (f ( & ( SUP.sup sp1 ))) < SUP.sup sp1) | |
429 z15 = SUP.x<sup sp1 (subst (λ k → odef chain k ) (sym &iso) (ZChain.f-next zc z12 )) | |
430 z17 : ⊥ | |
431 z17 with z15 | |
432 ... | case1 eq = ¬b eq | |
433 ... | case2 lt = ¬a lt | |
560 | 434 |
435 -- ZChain contradicts ¬ Maximal | |
436 -- | |
571 | 437 -- ZChain forces fix point on any ≤-monotonic function (fixpoint) |
560 | 438 -- ¬ Maximal create cf which is a <-monotonic function by axiom of choice. This contradicts fix point of ZChain |
439 -- | |
674 | 440 z04 : (nmx : ¬ Maximal A ) → (zc0 : (x : Ordinal) → ZChain1 A (cf nmx) (cf-is-≤-monotonic nmx) as0 x) (zc : ZChain A (cf nmx) (cf-is-≤-monotonic nmx) as0 zc0 (& A)) |
664 | 441 → IsTotalOrderSet (ZChain.chain zc) → ⊥ |
653 | 442 z04 nmx zc0 zc total = <-irr0 {* (cf nmx c)} {* c} (subst (λ k → odef A k ) (sym &iso) (proj1 (is-cf nmx (SUP.A∋maximal sp1 )))) |
571 | 443 (subst (λ k → odef A (& k)) (sym *iso) (SUP.A∋maximal sp1) ) |
653 | 444 (case1 ( cong (*)( fixpoint (cf nmx) (cf-is-≤-monotonic nmx ) zc0 zc total ))) -- x ≡ f x ̄ |
633
6cd4a483122c
ZChain1 is not strictly positive
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
445 (proj1 (cf-is-<-monotonic nmx c (SUP.A∋maximal sp1 ))) where -- x < f x |
6cd4a483122c
ZChain1 is not strictly positive
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
446 sp1 : SUP A (ZChain.chain zc) |
653 | 447 sp1 = sp0 (cf nmx) (cf-is-≤-monotonic nmx) zc0 zc total |
538 | 448 c = & (SUP.sup sp1) |
548 | 449 |
560 | 450 -- |
547 | 451 -- create all ZChains under o< x |
560 | 452 -- |
608
6655f03984f9
mutual tranfinite in zorn
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
607
diff
changeset
|
453 |
630 | 454 sind : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → (x : Ordinal) |
664 | 455 → ((z : Ordinal) → z o< x → ZChain1 A f mf ay z ) → ZChain1 A f mf ay x |
630 | 456 sind f mf {y} ay x prev with Oprev-p x |
457 ... | yes op = sc4 where | |
654 | 458 open ZChain1 |
630 | 459 px = Oprev.oprev op |
656 | 460 px<x : px o< x |
461 px<x = subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc | |
664 | 462 sc : ZChain1 A f mf ay px |
656 | 463 sc = prev px px<x |
675 | 464 pchain : HOD |
681 | 465 pchain = chainf sc px |
675 | 466 |
683 | 467 no-ext : ZChain1 A f mf ay x |
468 no-ext = record { psup = psup1 ; p≤z = p≤z1 ; chainf = chainf1 ; is-chain = is-chain1 ; psup-mono = sc0 } where | |
469 psup1 : Ordinal → Ordinal | |
470 psup1 z with o≤? z x | |
471 ... | yes _ = ZChain1.psup sc z | |
472 ... | no _ = ZChain1.psup sc x | |
473 p≤z1 : (z : Ordinal ) → odef A (psup1 z) | |
474 p≤z1 z with o≤? z x | |
475 ... | yes _ = ZChain1.p≤z sc z | |
476 ... | no _ = ZChain1.p≤z sc x | |
477 chainf1 : (z : Ordinal ) → HOD | |
478 chainf1 z with o≤? z x | |
479 ... | yes _ = ZChain1.chainf sc z | |
480 ... | no _ = ZChain1.chainf sc x | |
481 sc0 : (z : Ordinal) → z o≤ x → chainf1 z ⊆' chainf1 x | |
482 sc0 z = ? | |
483 is-chain1 : ? | |
484 is-chain1 = ? | |
664 | 485 sc4 : ZChain1 A f mf ay x |
681 | 486 sc4 with ODC.∋-p O A (* x) |
683 | 487 ... | no noax = no-ext |
675 | 488 ... | yes ax with ODC.p∨¬p O ( HasPrev A pchain ax f ) |
683 | 489 ... | case1 pr = no-ext |
675 | 490 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A pchain ax ) |
681 | 491 ... | case1 is-sup = record { psup = ? ; p≤z = ? ; chainf = ? ; is-chain = ? ; psup-mono = ? } where |
630 | 492 schain : HOD |
673 | 493 schain = ? -- record { od = record { def = λ z → odef A z ∧ ( odef (ZChain1.chain sc ) z ∨ (FClosure A f x z)) } |
494 -- ; odmax = & A ; <odmax = λ {y} sy → ∈∧P→o< sy } | |
683 | 495 ... | case2 ¬x=sup = no-ext |
664 | 496 ... | no ¬ox = sc4 where |
681 | 497 pchainf : (z : Ordinal) → z o< x → HOD |
498 pchainf z z<x = ZChain1.chainf (prev z z<x) z | |
683 | 499 pzc : (z : Ordinal) → z o< x → ZChain1 A f mf ay z |
500 pzc z z<x = prev z z<x | |
681 | 501 UZ : HOD |
502 UZ = UnionCF A x pchainf | |
686 | 503 total-UZ : IsTotalOrderSet UZ |
504 total-UZ {a} {b} ca cb = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso uz01 where | |
505 uz01 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) | |
506 uz01 = chain-total A f mf ay (ZChain1.is-chain (pzc _ (UChain.u<x (proj2 ca))) _ _ (UChain.chain∋z (proj2 ca))) | |
507 (ZChain1.is-chain (pzc _ (UChain.u<x (proj2 cb))) _ _ (UChain.chain∋z (proj2 cb))) | |
683 | 508 usup : SUP A UZ |
686 | 509 usup = supP UZ (λ lt → proj1 lt) total-UZ |
683 | 510 sc4 : ZChain1 A f mf ay x |
511 sc4 = record { psup = psup1 ; p≤z = p≤z1 ; chainf = chainf1 ; is-chain = is-chain1 ; psup-mono = sc0 } where | |
512 psup1 : Ordinal → Ordinal | |
513 psup1 z with o≤? x z | |
686 | 514 ... | yes _ = & (SUP.sup usup) |
683 | 515 ... | no z<x = ZChain1.psup (pzc z (o¬≤→< z<x)) z |
516 p≤z1 : (z : Ordinal ) → odef A (psup1 z) | |
517 p≤z1 z with o≤? x z | |
686 | 518 ... | yes _ = SUP.A∋maximal usup |
683 | 519 ... | no z<x = ZChain1.p≤z (pzc z (o¬≤→< z<x)) z |
520 chainf1 : (z : Ordinal ) → HOD | |
521 chainf1 z with o≤? x z | |
522 ... | yes _ = UZ | |
523 ... | no z<x = ZChain1.chainf (pzc z (o¬≤→< z<x)) z | |
524 sc0 : (z : Ordinal) → z o≤ x → chainf1 z ⊆' chainf1 x | |
686 | 525 sc0 z z≤x {i} lt with o≤? x z |
526 ... | yes _ = ? | |
527 ... | no z<x = ? where -- subst (λ k → odef k i) refl sc1 where | |
528 sc1 : odef (ZChain1.chainf (pzc z (o¬≤→< z<x)) z) i | |
529 sc1 = ZChain1.psup-mono (pzc z (o¬≤→< z<x)) _ o≤-refl lt | |
683 | 530 is-chain1 : ? |
531 is-chain1 = ? | |
630 | 532 |
674 | 533 ind : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → (x : Ordinal) |
534 → (zc0 : (x : Ordinal) → ZChain1 A f mf ay x) | |
664 | 535 → ((z : Ordinal) → z o< x → ZChain A f mf ay zc0 z) → ZChain A f mf ay zc0 x |
682 | 536 ind f mf {y} ay x zc0 prev with Oprev-p x |
537 ... | yes op = ? where | |
538 -- | |
539 -- we have previous ordinal to use induction | |
540 -- | |
541 px = Oprev.oprev op | |
542 supf : Ordinal → HOD | |
543 supf x = ? -- ChainF A f mf ay x zc0 | |
544 zc : ZChain A f mf ay zc0 (Oprev.oprev op) | |
545 zc = prev px (subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc ) | |
546 px<x : px o< x | |
547 px<x = subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc | |
611 | 548 -- if previous chain satisfies maximality, we caan reuse it |
549 -- | |
682 | 550 no-extenion : ( {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain ?) a → b o< osuc x → (ab : odef A b) → |
551 HasPrev A (ZChain.chain zc ) ab f ∨ IsSup A (ZChain.chain ? ) ab → | |
552 * a < * b → odef (ZChain.chain zc ) b ) → ZChain A f mf ay zc0 x | |
677 | 553 no-extenion is-max = ? |
610 | 554 |
664 | 555 zc4 : ZChain A f mf ay zc0 x |
675 | 556 zc4 with o≤? x o∅ |
557 ... | yes x=0 = ? | |
558 ... | no 0<x with ODC.∋-p O A (* x) | |
626 | 559 ... | no noax = no-extenion zc1 where -- ¬ A ∋ p, just skip |
682 | 560 zc1 : {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain zc ) a → b o< osuc x → (ab : odef A b) → |
561 HasPrev A (ZChain.chain zc ) ab f ∨ IsSup A (ZChain.chain zc ) ab → | |
562 * a < * b → odef (ZChain.chain zc ) b | |
675 | 563 zc1 {a} {b} z<x za b<ox ab P a<b with osuc-≡< b<ox |
568 | 564 ... | case1 eq = ⊥-elim ( noax (subst (λ k → odef A k) (trans eq (sym &iso)) ab ) ) |
682 | 565 ... | case2 lt = ZChain.is-max zc za ? ab P a<b |
566 ... | yes ax with ODC.p∨¬p O ( HasPrev A (ZChain.chain zc ) ax f ) | |
674 | 567 -- we have to check adding x preserve is-max ZChain A y f mf zc0 x |
626 | 568 ... | case1 pr = no-extenion zc7 where -- we have previous A ∋ z < x , f z ≡ x, so chain ∋ f z ≡ x because of f-next |
682 | 569 chain0 = ZChain.chain zc |
570 zc7 : {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain zc ) a → b o< osuc x → (ab : odef A b) → | |
571 HasPrev A (ZChain.chain zc ) ab f ∨ IsSup A (ZChain.chain zc ) ab → | |
572 * a < * b → odef (ZChain.chain zc ) b | |
675 | 573 zc7 {a} {b} z<x za b<ox ab P a<b with osuc-≡< b<ox |
682 | 574 ... | case2 lt = ZChain.is-max zc za ? ab P a<b |
575 ... | case1 b=x = ? -- subst (λ k → odef chain0 k ) (trans (sym (HasPrev.x=fy pr )) (trans &iso (sym b=x)) ) ( ZChain.f-next zc (HasPrev.ay pr)) | |
576 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A (ZChain.chain zc ) ax ) | |
577 ... | case1 is-sup = -- x is a sup of zc | |
654 | 578 record { chain⊆A = {!!} ; f-next = {!!} ; f-total = {!!} |
579 ; initial = {!!} ; chain∋init = {!!} ; is-max = {!!} } where | |
682 | 580 sup0 : SUP A (ZChain.chain zc ) |
571 | 581 sup0 = record { sup = * x ; A∋maximal = ax ; x<sup = x21 } where |
682 | 582 x21 : {y : HOD} → ZChain.chain zc ∋ y → (y ≡ * x) ∨ (y < * x) |
571 | 583 x21 {y} zy with IsSup.x<sup is-sup zy |
584 ... | case1 y=x = case1 ( subst₂ (λ j k → j ≡ * k ) *iso &iso ( cong (*) y=x) ) | |
585 ... | case2 y<x = case2 (subst₂ (λ j k → j < * k ) *iso &iso y<x ) | |
570 | 586 sp : HOD |
561 | 587 sp = SUP.sup sup0 |
570 | 588 x=sup : x ≡ & sp |
589 x=sup = sym &iso | |
682 | 590 chain0 = ZChain.chain zc |
604 | 591 sc<A : {y : Ordinal} → odef chain0 y ∨ FClosure A f (& sp) y → y o< & A |
682 | 592 sc<A {y} (case1 zx) = subst (λ k → k o< (& A)) &iso ( c<→o< (ZChain.chain⊆A zc (subst (λ k → odef chain0 k) (sym &iso) zx ))) |
561 | 593 sc<A {y} (case2 fx) = subst (λ k → k o< (& A)) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso) (A∋fc (& sp) f mf fx )) ) |
552 | 594 schain : HOD |
604 | 595 schain = record { od = record { def = λ x → odef chain0 x ∨ (FClosure A f (& sp) x) } ; odmax = & A ; <odmax = λ {y} sy → sc<A {y} sy } |
631 | 596 supf0 : Ordinal → HOD |
597 supf0 z with trio< z x | |
674 | 598 ... | tri< a ¬b ¬c = ? -- supf z |
631 | 599 ... | tri≈ ¬a b ¬c = schain |
600 ... | tri> ¬a ¬b c = schain | |
561 | 601 A∋schain : {x : HOD } → schain ∋ x → A ∋ x |
682 | 602 A∋schain (case1 zx ) = ZChain.chain⊆A zc zx |
561 | 603 A∋schain {y} (case2 fx ) = A∋fc (& sp) f mf fx |
569 | 604 s⊆A : schain ⊆' A |
682 | 605 s⊆A {x} (case1 zx) = ZChain.chain⊆A zc zx |
569 | 606 s⊆A {x} (case2 fx) = A∋fc (& sp) f mf fx |
604 | 607 cmp : {a b : HOD} (za : odef chain0 (& a)) (fb : FClosure A f (& sp) (& b)) → Tri (a < b) (a ≡ b) (b < a ) |
561 | 608 cmp {a} {b} za fb with SUP.x<sup sup0 za | s≤fc (& sp) f mf fb |
609 ... | case1 sp=a | case1 sp=b = tri≈ (λ lt → <-irr (case1 (sym eq)) lt ) eq (λ lt → <-irr (case1 eq) lt ) where | |
610 eq : a ≡ b | |
611 eq = trans sp=a (subst₂ (λ j k → j ≡ k ) *iso *iso sp=b ) | |
612 ... | case1 sp=a | case2 sp<b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b) lt ) where | |
613 a<b : a < b | |
614 a<b = subst (λ k → k < b ) (sym sp=a) (subst₂ (λ j k → j < k ) *iso *iso sp<b ) | |
615 ... | case2 a<sp | case1 sp=b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b) lt ) where | |
616 a<b : a < b | |
617 a<b = subst (λ k → a < k ) (trans sp=b *iso ) (subst (λ k → a < k ) (sym *iso) a<sp ) | |
618 ... | case2 a<sp | case2 sp<b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b) lt ) where | |
619 a<b : a < b | |
620 a<b = ptrans (subst (λ k → a < k ) (sym *iso) a<sp ) ( subst₂ (λ j k → j < k ) refl *iso sp<b ) | |
621 scmp : {a b : HOD} → odef schain (& a) → odef schain (& b) → Tri (a < b) (a ≡ b) (b < a ) | |
682 | 622 scmp {a} {b} (case1 za) (case1 zb) = {!!} -- ZChain.f-total zc {px} {px} o≤-refl za zb |
561 | 623 scmp {a} {b} (case1 za) (case2 fb) = cmp za fb |
624 scmp (case2 fa) (case1 zb) with cmp zb fa | |
625 ... | tri< a ¬b ¬c = tri> ¬c (λ eq → ¬b (sym eq)) a | |
626 ... | tri≈ ¬a b ¬c = tri≈ ¬c (sym b) ¬a | |
627 ... | tri> ¬a ¬b c = tri< c (λ eq → ¬b (sym eq)) ¬a | |
628 scmp (case2 fa) (case2 fb) = subst₂ (λ a b → Tri (a < b) (a ≡ b) (b < a ) ) *iso *iso (fcn-cmp (& sp) f mf fa fb) | |
629 scnext : {a : Ordinal} → odef schain a → odef schain (f a) | |
682 | 630 scnext {x} (case1 zx) = case1 (ZChain.f-next zc zx) |
561 | 631 scnext {x} (case2 sx) = case2 ( fsuc x sx ) |
632 scinit : {x : Ordinal} → odef schain x → * y ≤ * x | |
682 | 633 scinit {x} (case1 zx) = ZChain.initial zc zx |
634 scinit {x} (case2 sx) with (s≤fc (& sp) f mf sx ) | SUP.x<sup sup0 (subst (λ k → odef chain0 k ) (sym &iso) ( ZChain.chain∋init zc ) ) | |
562 | 635 ... | case1 sp=x | case1 y=sp = case1 (trans y=sp (subst (λ k → k ≡ * x ) *iso sp=x ) ) |
636 ... | case1 sp=x | case2 y<sp = case2 (subst (λ k → * y < k ) (trans (sym *iso) sp=x) y<sp ) | |
637 ... | case2 sp<x | case1 y=sp = case2 (subst (λ k → k < * x ) (trans *iso (sym y=sp )) sp<x ) | |
638 ... | case2 sp<x | case2 y<sp = case2 (ptrans y<sp (subst (λ k → k < * x ) *iso sp<x) ) | |
604 | 639 A∋za : {a : Ordinal } → odef chain0 a → odef A a |
682 | 640 A∋za za = ZChain.chain⊆A zc za |
604 | 641 za<sup : {a : Ordinal } → odef chain0 a → ( * a ≡ sp ) ∨ ( * a < sp ) |
642 za<sup za = SUP.x<sup sup0 (subst (λ k → odef chain0 k ) (sym &iso) za ) | |
571 | 643 s-ismax : {a b : Ordinal} → odef schain a → b o< osuc x → (ab : odef A b) |
644 → HasPrev A schain ab f ∨ IsSup A schain ab | |
569 | 645 → * a < * b → odef schain b |
571 | 646 s-ismax {a} {b} sa b<ox ab p a<b with osuc-≡< b<ox -- b is x? |
600 | 647 ... | case1 b=x = case2 (subst (λ k → FClosure A f (& sp) k ) (sym (trans b=x x=sup )) (init (SUP.A∋maximal sup0) )) |
571 | 648 s-ismax {a} {b} (case1 za) b<ox ab (case1 p) a<b | case2 b<x = z21 p where -- has previous |
568 | 649 z21 : HasPrev A schain ab f → odef schain b |
567 | 650 z21 record { y = y ; ay = (case1 zy) ; x=fy = x=fy } = |
682 | 651 case1 (ZChain.is-max zc za ? ab (case1 record { y = y ; ay = zy ; x=fy = x=fy }) a<b ) |
567 | 652 z21 record { y = y ; ay = (case2 sy) ; x=fy = x=fy } = subst (λ k → odef schain k) (sym x=fy) (case2 (fsuc y sy) ) |
682 | 653 s-ismax {a} {b} (case1 za) b<ox ab (case2 p) a<b | case2 b<x = case1 (ZChain.is-max zc za ? ab (case2 z22) a<b ) where -- previous sup |
654 z22 : IsSup A (ZChain.chain zc ) ab | |
571 | 655 z22 = record { x<sup = λ {y} zy → IsSup.x<sup p (case1 zy ) } |
656 s-ismax {a} {b} (case2 sa) b<ox ab (case1 p) a<b | case2 b<x with HasPrev.ay p | |
682 | 657 ... | case1 zy = case1 (subst (λ k → odef chain0 k ) (sym (HasPrev.x=fy p)) (ZChain.f-next zc zy )) -- in previous closure of f |
571 | 658 ... | case2 sy = case2 (subst (λ k → FClosure A f (& (* x)) k ) (sym (HasPrev.x=fy p)) (fsuc (HasPrev.y p) sy )) -- in current closure of f |
626 | 659 s-ismax {a} {b} (case2 sa) b<ox ab (case2 p) a<b | case2 b<x = case1 z23 where -- sup o< x is already in zc |
682 | 660 z24 : IsSup A schain ab → IsSup A (ZChain.chain zc ) ab |
571 | 661 z24 p = record { x<sup = λ {y} zy → IsSup.x<sup p (case1 zy ) } |
604 | 662 z23 : odef chain0 b |
682 | 663 z23 with IsSup.x<sup (z24 p) ( ZChain.chain∋init zc ) |
664 ... | case1 y=b = subst (λ k → odef chain0 k ) y=b ( ZChain.chain∋init zc ) | |
665 ... | case2 y<b = ZChain.is-max zc (ZChain.chain∋init zc ) ? ab (case2 (z24 p)) y<b | |
624 | 666 seq : schain ≡ supf0 x |
611 | 667 seq with trio< x x |
668 ... | tri< a ¬b ¬c = ⊥-elim ( ¬b refl ) | |
624 | 669 ... | tri≈ ¬a b ¬c = refl |
670 ... | tri> ¬a ¬b c = refl | |
674 | 671 seq<x : {b : Ordinal } → b o< x → ? -- supf b ≡ supf0 b |
611 | 672 seq<x {b} b<x with trio< b x |
673 ... | tri< a ¬b ¬c = refl | |
674 ... | tri≈ ¬a b₁ ¬c = ⊥-elim (¬a b<x ) | |
675 ... | tri> ¬a ¬b c = ⊥-elim (¬a b<x ) | |
676 | |
677 ... | case2 ¬x=sup = no-extenion z18 where -- x is not f y' nor sup of former ZChain from y -- no extention | |
682 | 678 z18 : {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain zc ) a → b o< osuc x → (ab : odef A b) → |
679 HasPrev A (ZChain.chain zc ) ab f ∨ IsSup A (ZChain.chain zc ) ab → | |
680 * a < * b → odef (ZChain.chain zc ) b | |
675 | 681 z18 {a} {b} z<x za b<x ab p a<b with osuc-≡< b<x |
682 | 682 ... | case2 lt = ZChain.is-max zc za ? ab p a<b |
565 | 683 ... | case1 b=x with p |
675 | 684 ... | case1 pr = ⊥-elim ( ¬fy<x record {y = HasPrev.y pr ; ay = ? ; x=fy = trans (trans &iso (sym b=x) ) (HasPrev.x=fy pr ) } ) |
571 | 685 ... | case2 b=sup = ⊥-elim ( ¬x=sup record { |
675 | 686 x<sup = λ {y} zy → subst (λ k → (y ≡ k) ∨ (y << k)) (trans b=x (sym &iso)) (IsSup.x<sup b=sup ? ) } ) |
682 | 687 ... | no op = zc5 where |
688 supf : (z : Ordinal ) → z o< x → HOD | |
689 supf x lt = ZChain1.chainf ( zc0 (& A) ) x | |
690 uzc : {z : Ordinal} → (u : UChain x supf z) → ZChain A f mf ay zc0 (UChain.u u) | |
691 uzc {z} u = prev (UChain.u u) (UChain.u<x u) | |
692 Uz : HOD | |
693 Uz = record { od = record { def = λ z → odef A z ∧ ( UChain x supf z ∨ FClosure A f y z ) } ; odmax = & A ; <odmax = {!!} } | |
683 | 694 Uzchain : ¬ (odef (ZChain1.chainf (zc0 (& A) ) x) x) → ZChain A f mf ay zc0 x |
695 Uzchain nz = record { chain-mono = ? ; chain⊆A = ? ; chain∋init = ? ; initial = ? ; f-next = ? ; f-total = ? ; is-max = ? } | |
682 | 696 zc5 : ZChain A f mf ay zc0 x |
697 zc5 with o≤? x o∅ | |
698 ... | yes x=0 = ? | |
699 ... | no 0<x with ODC.∋-p O A (* x) | |
700 ... | no noax = ? where -- ¬ A ∋ p, just skip | |
701 ... | yes ax with ODC.p∨¬p O ( HasPrev A Uz ax f ) | |
702 -- we have to check adding x preserve is-max ZChain A y f mf zc0 x | |
703 ... | case1 pr = ? where -- we have previous A ∋ z < x , f z ≡ x, so chain ∋ f z ≡ x because of f-next | |
704 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A Uz ax ) | |
705 ... | case1 is-sup = ? -- x is a sup of (zc ?) | |
706 ... | case2 ¬x=sup = ? -- no-extenion z18 where -- x is not f y' nor sup of former ZChain from y -- no extention | |
707 | |
553 | 708 |
664 | 709 SZ0 : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) → {y : Ordinal} (ay : odef A y) → (x : Ordinal) → ZChain1 A f mf ay x |
710 SZ0 f mf ay x = TransFinite {λ z → ZChain1 A f mf ay z} (sind f mf ay ) x | |
629 | 711 |
674 | 712 SZ : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) → {y : Ordinal} (ay : odef A y) → ZChain A f mf ay (SZ0 f mf ay ) (& A) |
713 SZ f mf {y} ay = TransFinite {λ z → ZChain A f mf ay (SZ0 f mf ay ) z } (λ x → ind f mf ay x (SZ0 f mf ay ) ) (& A) | |
608
6655f03984f9
mutual tranfinite in zorn
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
607
diff
changeset
|
714 |
551 | 715 zorn00 : Maximal A |
716 zorn00 with is-o∅ ( & HasMaximal ) -- we have no Level (suc n) LEM | |
717 ... | no not = record { maximal = ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) ; A∋maximal = zorn01 ; ¬maximal<x = zorn02 } where | |
718 -- yes we have the maximal | |
719 zorn03 : odef HasMaximal ( & ( ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) ) ) | |
606 | 720 zorn03 = ODC.x∋minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) -- Axiom of choice |
551 | 721 zorn01 : A ∋ ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) |
722 zorn01 = proj1 zorn03 | |
723 zorn02 : {x : HOD} → A ∋ x → ¬ (ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) < x) | |
724 zorn02 {x} ax m<x = proj2 zorn03 (& x) ax (subst₂ (λ j k → j < k) (sym *iso) (sym *iso) m<x ) | |
674 | 725 ... | yes ¬Maximal = ⊥-elim ( z04 nmx zc0 zorn04 total ) where |
551 | 726 -- if we have no maximal, make ZChain, which contradict SUP condition |
727 nmx : ¬ Maximal A | |
728 nmx mx = ∅< {HasMaximal} zc5 ( ≡o∅→=od∅ ¬Maximal ) where | |
729 zc5 : odef A (& (Maximal.maximal mx)) ∧ (( y : Ordinal ) → odef A y → ¬ (* (& (Maximal.maximal mx)) < * y)) | |
730 zc5 = ⟪ Maximal.A∋maximal mx , (λ y ay mx<y → Maximal.¬maximal<x mx (subst (λ k → odef A k ) (sym &iso) ay) (subst (λ k → k < * y) *iso mx<y) ) ⟫ | |
664 | 731 zc0 : (x : Ordinal) → ZChain1 A (cf nmx) (cf-is-≤-monotonic nmx) as0 x |
732 zc0 x = TransFinite {λ z → ZChain1 A (cf nmx) (cf-is-≤-monotonic nmx) as0 z} (sind (cf nmx) (cf-is-≤-monotonic nmx) as0) x | |
674 | 733 zorn04 : ZChain A (cf nmx) (cf-is-≤-monotonic nmx) as0 zc0 (& A) |
653 | 734 zorn04 = SZ (cf nmx) (cf-is-≤-monotonic nmx) (subst (λ k → odef A k ) &iso as ) |
634 | 735 total : IsTotalOrderSet (ZChain.chain zorn04) |
654 | 736 total {a} {b} = zorn06 where |
737 zorn06 : odef (ZChain.chain zorn04) (& a) → odef (ZChain.chain zorn04) (& b) → Tri (a < b) (a ≡ b) (b < a) | |
738 zorn06 = ZChain.f-total (SZ (cf nmx) (cf-is-≤-monotonic nmx) (subst (λ k → odef A k ) &iso as) ) | |
551 | 739 |
516 | 740 -- usage (see filter.agda ) |
741 -- | |
497 | 742 -- _⊆'_ : ( A B : HOD ) → Set n |
743 -- _⊆'_ A B = (x : Ordinal ) → odef A x → odef B x | |
482 | 744 |
497 | 745 -- MaximumSubset : {L P : HOD} |
746 -- → o∅ o< & L → o∅ o< & P → P ⊆ L | |
747 -- → IsPartialOrderSet P _⊆'_ | |
748 -- → ( (B : HOD) → B ⊆ P → IsTotalOrderSet B _⊆'_ → SUP P B _⊆'_ ) | |
749 -- → Maximal P (_⊆'_) | |
750 -- MaximumSubset {L} {P} 0<L 0<P P⊆L PO SP = Zorn-lemma {P} {_⊆'_} 0<P PO SP |