Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate src/zorn.agda @ 675:6a9a98904f7a
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 09 Jul 2022 16:34:04 +0900 |
parents | a48845e246e4 |
children | 9ab62416dbdd |
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 | |
258 ch-is-sup : {x z : Ordinal } ( ax : odef A x ) | |
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 |
673 | 263 psup : Ordinal |
264 p≤z : psup o≤ z | |
675 | 265 p≤a : psup o≤ & A |
674 | 266 chainf : {px : Ordinal} → px o≤ z → (w : Ordinal) → Chain A f mf ay px w |
673 | 267 |
268 ChainF : (A : HOD) → ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) | |
675 | 269 → (z : Ordinal) → ( ( x : Ordinal ) → ZChain1 A f mf ay x ) → HOD |
270 ChainF A f mf {y} ay z zc = record { od = record { def = λ x → odef A x ∧ Chain A f mf ay (ZChain1.psup (zc z) ) x } | |
271 ; odmax = & A ; <odmax = λ {y} sy → ∈∧P→o< sy } | |
655 | 272 |
674 | 273 record ZChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {init : Ordinal} (ay : odef A init) |
274 (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
|
275 chain : HOD |
675 | 276 chain = ChainF A f mf ay z zc0 |
568 | 277 field |
674 | 278 chain-mono : (px py : Ordinal) → (px≤py : px o≤ py ) (y≤x : py o≤ z ) → (w : Ordinal ) |
675 | 279 → ChainF A f mf ay px zc0 ⊆' ChainF A f mf ay py zc0 |
568 | 280 chain⊆A : chain ⊆' A |
653 | 281 chain∋init : odef chain init |
282 initial : {y : Ordinal } → odef chain y → * init ≤ * y | |
568 | 283 f-next : {a : Ordinal } → odef chain a → odef chain (f a) |
654 | 284 f-total : IsTotalOrderSet chain |
568 | 285 is-max : {a b : Ordinal } → (ca : odef chain a ) → b o< osuc z → (ab : odef A b) |
574 | 286 → HasPrev A chain ab f ∨ IsSup A chain ab |
568 | 287 → * a < * b → odef chain b |
653 | 288 |
568 | 289 record Maximal ( A : HOD ) : Set (Level.suc n) where |
290 field | |
291 maximal : HOD | |
292 A∋maximal : A ∋ maximal | |
293 ¬maximal<x : {x : HOD} → A ∋ x → ¬ maximal < x -- A is Partial, use negative | |
567 | 294 |
533 | 295 SupCond : ( A B : HOD) → (B⊆A : B ⊆ A) → IsTotalOrderSet B → Set (Level.suc n) |
296 SupCond A B _ _ = SUP A B | |
297 | |
497 | 298 Zorn-lemma : { A : HOD } |
464 | 299 → o∅ o< & A |
568 | 300 → ( ( B : HOD) → (B⊆A : B ⊆' A) → IsTotalOrderSet B → SUP A B ) -- SUP condition |
497 | 301 → Maximal A |
552 | 302 Zorn-lemma {A} 0<A supP = zorn00 where |
571 | 303 <-irr0 : {a b : HOD} → A ∋ a → A ∋ b → (a ≡ b ) ∨ (a < b ) → b < a → ⊥ |
304 <-irr0 {a} {b} A∋a A∋b = <-irr | |
537 | 305 z07 : {y : Ordinal} → {P : Set n} → odef A y ∧ P → y o< & A |
306 z07 {y} p = subst (λ k → k o< & A) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso ) (proj1 p ))) | |
530 | 307 s : HOD |
308 s = ODC.minimal O A (λ eq → ¬x<0 ( subst (λ k → o∅ o< k ) (=od∅→≡o∅ eq) 0<A )) | |
568 | 309 as : A ∋ * ( & s ) |
310 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
|
311 as0 : odef A (& s ) |
6655f03984f9
mutual tranfinite in zorn
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
607
diff
changeset
|
312 as0 = subst (λ k → odef A k ) &iso as |
547 | 313 s<A : & s o< & A |
568 | 314 s<A = c<→o< (subst (λ k → odef A (& k) ) *iso as ) |
530 | 315 HasMaximal : HOD |
537 | 316 HasMaximal = record { od = record { def = λ x → odef A x ∧ ( (m : Ordinal) → odef A m → ¬ (* x < * m)) } ; odmax = & A ; <odmax = z07 } |
317 no-maximum : HasMaximal =h= od∅ → (x : Ordinal) → odef A x ∧ ((m : Ordinal) → odef A m → odef A x ∧ (¬ (* x < * m) )) → ⊥ | |
318 no-maximum nomx x P = ¬x<0 (eq→ nomx {x} ⟪ proj1 P , (λ m ma p → proj2 ( proj2 P m ma ) p ) ⟫ ) | |
532 | 319 Gtx : { x : HOD} → A ∋ x → HOD |
537 | 320 Gtx {x} ax = record { od = record { def = λ y → odef A y ∧ (x < (* y)) } ; odmax = & A ; <odmax = z07 } |
321 z08 : ¬ Maximal A → HasMaximal =h= od∅ | |
322 z08 nmx = record { eq→ = λ {x} lt → ⊥-elim ( nmx record {maximal = * x ; A∋maximal = subst (λ k → odef A k) (sym &iso) (proj1 lt) | |
323 ; ¬maximal<x = λ {y} ay → subst (λ k → ¬ (* x < k)) *iso (proj2 lt (& y) ay) } ) ; eq← = λ {y} lt → ⊥-elim ( ¬x<0 lt )} | |
324 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)) | |
325 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 | |
326 ¬x<m : ¬ (* x < * m) | |
327 ¬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 | 328 |
560 | 329 -- Uncountable ascending chain by axiom of choice |
530 | 330 cf : ¬ Maximal A → Ordinal → Ordinal |
532 | 331 cf nmx x with ODC.∋-p O A (* x) |
332 ... | no _ = o∅ | |
333 ... | yes ax with is-o∅ (& ( Gtx ax )) | |
538 | 334 ... | yes nogt = -- no larger element, so it is maximal |
335 ⊥-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 | 336 ... | no not = & (ODC.minimal O (Gtx ax) (λ eq → not (=od∅→≡o∅ eq))) |
537 | 337 is-cf : (nmx : ¬ Maximal A ) → {x : Ordinal} → odef A x → odef A (cf nmx x) ∧ ( * x < * (cf nmx x) ) |
338 is-cf nmx {x} ax with ODC.∋-p O A (* x) | |
339 ... | no not = ⊥-elim ( not (subst (λ k → odef A k ) (sym &iso) ax )) | |
340 ... | yes ax with is-o∅ (& ( Gtx ax )) | |
341 ... | 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 ⟫ ) | |
342 ... | no not = ODC.x∋minimal O (Gtx ax) (λ eq → not (=od∅→≡o∅ eq)) | |
606 | 343 |
344 --- | |
345 --- infintie ascention sequence of f | |
346 --- | |
530 | 347 cf-is-<-monotonic : (nmx : ¬ Maximal A ) → (x : Ordinal) → odef A x → ( * x < * (cf nmx x) ) ∧ odef A (cf nmx x ) |
537 | 348 cf-is-<-monotonic nmx x ax = ⟪ proj2 (is-cf nmx ax ) , proj1 (is-cf nmx ax ) ⟫ |
530 | 349 cf-is-≤-monotonic : (nmx : ¬ Maximal A ) → ≤-monotonic-f A ( cf nmx ) |
532 | 350 cf-is-≤-monotonic nmx x ax = ⟪ case2 (proj1 ( cf-is-<-monotonic nmx x ax )) , proj2 ( cf-is-<-monotonic nmx x ax ) ⟫ |
543 | 351 |
674 | 352 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 | 353 (total : IsTotalOrderSet (ZChain.chain zc) ) → SUP A (ZChain.chain zc) |
354 sp0 f mf zc0 zc total = supP (ZChain.chain zc) (ZChain.chain⊆A zc) total | |
543 | 355 zc< : {x y z : Ordinal} → {P : Set n} → (x o< y → P) → x o< z → z o< y → P |
356 zc< {x} {y} {z} {P} prev x<z z<y = prev (ordtrans x<z z<y) | |
357 | |
358 --- | |
560 | 359 --- the maximum chain has fix point of any ≤-monotonic function |
543 | 360 --- |
674 | 361 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
|
362 → (total : IsTotalOrderSet (ZChain.chain zc) ) |
653 | 363 → f (& (SUP.sup (sp0 f mf zc0 zc total ))) ≡ & (SUP.sup (sp0 f mf zc0 zc total)) |
364 fixpoint f mf zc0 zc total = z14 where | |
538 | 365 chain = ZChain.chain zc |
653 | 366 sp1 = sp0 f mf zc0 zc total |
565 | 367 z10 : {a b : Ordinal } → (ca : odef chain a ) → b o< osuc (& A) → (ab : odef A b ) |
570 | 368 → HasPrev A chain ab f ∨ IsSup A chain {b} ab -- (supO chain (ZChain.chain⊆A zc) (ZChain.f-total zc) ≡ b ) |
538 | 369 → * a < * b → odef chain b |
370 z10 = ZChain.is-max zc | |
543 | 371 z11 : & (SUP.sup sp1) o< & A |
372 z11 = c<→o< ( SUP.A∋maximal sp1) | |
538 | 373 z12 : odef chain (& (SUP.sup sp1)) |
374 z12 with o≡? (& s) (& (SUP.sup sp1)) | |
653 | 375 ... | yes eq = subst (λ k → odef chain k) eq ( ZChain.chain∋init zc ) |
376 ... | no ne = z10 {& s} {& (SUP.sup sp1)} ( ZChain.chain∋init zc ) (ordtrans z11 <-osuc ) (SUP.A∋maximal sp1) | |
570 | 377 (case2 z19 ) z13 where |
538 | 378 z13 : * (& s) < * (& (SUP.sup sp1)) |
653 | 379 z13 with SUP.x<sup sp1 ( ZChain.chain∋init zc ) |
538 | 380 ... | case1 eq = ⊥-elim ( ne (cong (&) eq) ) |
381 ... | case2 lt = subst₂ (λ j k → j < k ) (sym *iso) (sym *iso) lt | |
570 | 382 z19 : IsSup A chain {& (SUP.sup sp1)} (SUP.A∋maximal sp1) |
571 | 383 z19 = record { x<sup = z20 } where |
384 z20 : {y : Ordinal} → odef chain y → (y ≡ & (SUP.sup sp1)) ∨ (y << & (SUP.sup sp1)) | |
385 z20 {y} zy with SUP.x<sup sp1 (subst (λ k → odef chain k ) (sym &iso) zy) | |
570 | 386 ... | case1 y=p = case1 (subst (λ k → k ≡ _ ) &iso ( cong (&) y=p )) |
387 ... | case2 y<p = case2 (subst (λ k → * y < k ) (sym *iso) y<p ) | |
388 -- λ {y} zy → subst (λ k → (y ≡ & k ) ∨ (y << & k)) ? (SUP.x<sup sp1 ? ) } | |
653 | 389 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
|
390 z14 with total (subst (λ k → odef chain k) (sym &iso) (ZChain.f-next zc z12 )) z12 |
631 | 391 ... | tri< a ¬b ¬c = ⊥-elim z16 where |
392 z16 : ⊥ | |
393 z16 with proj1 (mf (& ( SUP.sup sp1)) ( SUP.A∋maximal sp1 )) | |
394 ... | case1 eq = ⊥-elim (¬b (subst₂ (λ j k → j ≡ k ) refl *iso (sym eq) )) | |
395 ... | case2 lt = ⊥-elim (¬c (subst₂ (λ j k → k < j ) refl *iso lt )) | |
396 ... | tri≈ ¬a b ¬c = subst ( λ k → k ≡ & (SUP.sup sp1) ) &iso ( cong (&) b ) | |
397 ... | tri> ¬a ¬b c = ⊥-elim z17 where | |
398 z15 : (* (f ( & ( SUP.sup sp1 ))) ≡ SUP.sup sp1) ∨ (* (f ( & ( SUP.sup sp1 ))) < SUP.sup sp1) | |
399 z15 = SUP.x<sup sp1 (subst (λ k → odef chain k ) (sym &iso) (ZChain.f-next zc z12 )) | |
400 z17 : ⊥ | |
401 z17 with z15 | |
402 ... | case1 eq = ¬b eq | |
403 ... | case2 lt = ¬a lt | |
560 | 404 |
405 -- ZChain contradicts ¬ Maximal | |
406 -- | |
571 | 407 -- ZChain forces fix point on any ≤-monotonic function (fixpoint) |
560 | 408 -- ¬ Maximal create cf which is a <-monotonic function by axiom of choice. This contradicts fix point of ZChain |
409 -- | |
674 | 410 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 | 411 → IsTotalOrderSet (ZChain.chain zc) → ⊥ |
653 | 412 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 | 413 (subst (λ k → odef A (& k)) (sym *iso) (SUP.A∋maximal sp1) ) |
653 | 414 (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
|
415 (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
|
416 sp1 : SUP A (ZChain.chain zc) |
653 | 417 sp1 = sp0 (cf nmx) (cf-is-≤-monotonic nmx) zc0 zc total |
538 | 418 c = & (SUP.sup sp1) |
548 | 419 |
560 | 420 -- |
547 | 421 -- create all ZChains under o< x |
560 | 422 -- |
608
6655f03984f9
mutual tranfinite in zorn
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
607
diff
changeset
|
423 |
630 | 424 sind : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → (x : Ordinal) |
664 | 425 → ((z : Ordinal) → z o< x → ZChain1 A f mf ay z ) → ZChain1 A f mf ay x |
630 | 426 sind f mf {y} ay x prev with Oprev-p x |
427 ... | yes op = sc4 where | |
654 | 428 open ZChain1 |
630 | 429 px = Oprev.oprev op |
656 | 430 px<x : px o< x |
431 px<x = subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc | |
664 | 432 sc : ZChain1 A f mf ay px |
656 | 433 sc = prev px px<x |
675 | 434 pchain : HOD |
435 pchain = record { od = record { def = λ x → odef A x ∧ Chain A f mf ay (ZChain1.psup sc ) x } | |
436 ; odmax = & A ; <odmax = λ {y} sy → ∈∧P→o< sy } | |
437 | |
664 | 438 sc4 : ZChain1 A f mf ay x |
675 | 439 sc4 with o≤? x o∅ |
440 ... | yes x=0 = record { psup = o∅ ; p≤z = ? ; p≤a = ? ; chainf = ? } | |
441 ... | no 0<x with ODC.∋-p O A (* x) | |
442 ... | no noax = record { psup = ZChain1.psup sc ; p≤z = ? ; p≤a = ? ; chainf = ? } | |
443 ... | yes ax with ODC.p∨¬p O ( HasPrev A pchain ax f ) | |
444 ... | case1 pr = record { psup = ZChain1.psup sc ; p≤z = ? ; p≤a = ? ; chainf = ? } | |
445 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A pchain ax ) | |
446 ... | case1 is-sup = record { psup = x ; p≤z = ? ; p≤a = ? ; chainf = ? } where | |
630 | 447 schain : HOD |
673 | 448 schain = ? -- record { od = record { def = λ z → odef A z ∧ ( odef (ZChain1.chain sc ) z ∨ (FClosure A f x z)) } |
449 -- ; odmax = & A ; <odmax = λ {y} sy → ∈∧P→o< sy } | |
450 sc7 : ¬ HasPrev A ? (subst (λ k → odef A k) &iso ax) f | |
663 | 451 sc7 not = ¬fy<x record { y = HasPrev.y not ; ay = HasPrev.ay not ; x=fy = subst (λ k → k ≡ _) (sym &iso) (HasPrev.x=fy not ) } |
673 | 452 -- sc9 : Chain A f mf ay x schain |
453 -- sc9 = ? -- ch-is-sup op (subst (λ k → odef A k) &iso ax) (ZChain1.chain-uniq sc) sc7 | |
675 | 454 -- record { x<sup = λ {z} lt → subst (λ k → (z ≡ k ) ∨ (z << k )) &iso (IsSup.x<sup is-kjjkjjsup lt) } |
455 ... | case2 ¬x=sup = record { psup = ZChain1.psup sc ; p≤z = ? ; p≤a = ? ; chainf = ? } where | |
673 | 456 sc17 : ¬ HasPrev A ? (subst (λ k → odef A k) &iso ax) f |
663 | 457 sc17 not = ¬fy<x record { y = HasPrev.y not ; ay = HasPrev.ay not ; x=fy = subst (λ k → k ≡ _) (sym &iso) (HasPrev.x=fy not ) } |
673 | 458 sc10 : ¬ IsSup A ? (subst (λ k → odef A k) &iso ax) |
663 | 459 sc10 not = ¬x=sup ( record { x<sup = λ {z} lt → subst (λ k → (z ≡ k ) ∨ (z << k ) ) (sym &iso) ( IsSup.x<sup not lt ) } ) |
664 | 460 ... | no ¬ox = sc4 where |
663 | 461 chainf : (z : Ordinal) → z o< x → HOD |
673 | 462 chainf z z<x = ? -- Chain1.chain ( prev z z<x ) |
463 -- chainq : ( z : Ordinal ) → (z<x : z o< x ) → Chain A f mf ay z ( chainf z z<x ) | |
464 -- chainq z z<x = ? -- ZChain1.chain-uniq ( prev z z<x) | |
664 | 465 sc4 : ZChain1 A f mf ay x |
675 | 466 sc4 with o≤? x o∅ |
467 ... | yes x=0 = record { psup = o∅ ; p≤z = ? ; p≤a = ? ; chainf = ? } | |
468 ... | no 0<x with ODC.∋-p O A (* x) | |
469 ... | no noax = record { psup = ? ; p≤z = ? ; p≤a = ? ; chainf = ? } | |
663 | 470 ... | yes ax with ODC.p∨¬p O ( HasPrev A (UnionCF A x chainf) ax f ) |
675 | 471 ... | case1 pr = record { psup = ? ; p≤z = ? ; p≤a = ? ; chainf = ? } |
663 | 472 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A (UnionCF A x chainf) ax ) |
473 ... | case1 is-sup = ? | |
474 ... | case2 ¬x=sup = ? | |
630 | 475 |
674 | 476 ind : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → (x : Ordinal) |
477 → (zc0 : (x : Ordinal) → ZChain1 A f mf ay x) | |
664 | 478 → ((z : Ordinal) → z o< x → ZChain A f mf ay zc0 z) → ZChain A f mf ay zc0 x |
674 | 479 ind f mf {y} ay x zc0 prev = zc4 where |
480 zc : {z1 : Ordinal} → z1 o< x → ZChain A f mf ay zc0 z1 | |
481 zc z1 with Oprev-p x | |
482 ... | yes op = ? where | |
483 -- | |
484 -- we have previous ordinal to use induction | |
485 -- | |
486 px = Oprev.oprev op | |
487 supf : Ordinal → HOD | |
675 | 488 supf x = ChainF A f mf ay x zc0 |
674 | 489 -- zc : ZChain A f mf ay zc0 (Oprev.oprev op) |
490 -- zc = prev px (subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc ) | |
491 px<x : px o< x | |
492 px<x = subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc | |
493 ... | no ¬ox = ? where | |
494 supf : Ordinal → HOD | |
495 supf x = ? -- Z?Chain1.chain zc0 | |
496 uzc : {z : Ordinal} → (u : UChain x {!!} z) → ZChain A f mf ay zc0 (UChain.u u) | |
497 uzc {z} u = prev (UChain.u u) (UChain.u<x u) | |
498 Uz : HOD | |
499 Uz = record { od = record { def = λ z → odef A z ∧ ( UChain z {!!} x ∨ FClosure A f y z ) } ; odmax = & A ; <odmax = {!!} } | |
569 | 500 |
611 | 501 -- if previous chain satisfies maximality, we caan reuse it |
502 -- | |
675 | 503 no-extenion : ( {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain (zc z<x )) a → b o< osuc x → (ab : odef A b) → |
504 HasPrev A (ZChain.chain (zc z<x) ) ab f ∨ IsSup A (ZChain.chain (zc z<x) ) ab → | |
674 | 505 * a < * b → odef (ZChain.chain (zc ?) ) b ) → ZChain A f mf ay zc0 x |
506 no-extenion is-max with o≤? x (& A) | |
507 ... | no n = ? where | |
508 ... | yes x≤a with ZChain1.chainf (zc0 (& A)) x≤a x | |
509 ... | ch-init _ _ x=0 fc = ? | |
510 ... | ch-is-sup ax is-sup fc = ? where | |
511 -- = record { chain⊆A = {!!} -- subst (λ k → k ⊆' A ) {!!} (ZChain.chain⊆A zc) | |
512 -- ; initial = subst (λ k → {y₁ : Ordinal} → odef k y₁ → * y ≤ * y₁ ) {!!} (ZChain.initial zc) | |
513 -- ; f-next = subst (λ k → {a : Ordinal} → odef k a → odef k (f a) ) {!!} (ZChain.f-next zc) | |
514 -- ; f-total = {!!} | |
515 -- ; chain∋init = subst (λ k → odef k y ) {!!} (ZChain.chain∋init zc) | |
516 -- ; is-max = subst (λ k → {a b : Ordinal} → odef k a → b o< osuc x → (ab : odef A b) → | |
517 -- HasPrev A k ab f ∨ IsSup A k ab → * a < * b → odef k b ) {!!} is-max } where | |
624 | 518 supf0 : Ordinal → HOD |
610 | 519 supf0 z with trio< z x |
674 | 520 ... | tri< a ¬b ¬c = ? |
521 ... | tri≈ ¬a b ¬c = ZChain.chain (zc ?) | |
522 ... | tri> ¬a ¬b c = ZChain.chain (zc ?) | |
523 seq : ZChain.chain (zc ?) ≡ supf0 x | |
610 | 524 seq with trio< x x |
525 ... | tri< a ¬b ¬c = ⊥-elim ( ¬b refl ) | |
624 | 526 ... | tri≈ ¬a b ¬c = refl |
527 ... | tri> ¬a ¬b c = refl | |
674 | 528 seq<x : {b : Ordinal } → b o< x → ? -- supf b ≡ supf0 b |
611 | 529 seq<x {b} b<x with trio< b x |
530 ... | tri< a ¬b ¬c = refl | |
531 ... | tri≈ ¬a b₁ ¬c = ⊥-elim (¬a b<x ) | |
532 ... | tri> ¬a ¬b c = ⊥-elim (¬a b<x ) | |
610 | 533 |
664 | 534 zc4 : ZChain A f mf ay zc0 x |
675 | 535 zc4 with o≤? x o∅ |
536 ... | yes x=0 = ? | |
537 ... | no 0<x with ODC.∋-p O A (* x) | |
626 | 538 ... | no noax = no-extenion zc1 where -- ¬ A ∋ p, just skip |
675 | 539 zc1 : {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain (zc z<x) ) a → b o< osuc x → (ab : odef A b) → |
540 HasPrev A (ZChain.chain (zc ?) ) ab f ∨ IsSup A (ZChain.chain (zc z<x) ) ab → | |
541 * a < * b → odef (ZChain.chain (zc z<x) ) b | |
542 zc1 {a} {b} z<x za b<ox ab P a<b with osuc-≡< b<ox | |
568 | 543 ... | case1 eq = ⊥-elim ( noax (subst (λ k → odef A k) (trans eq (sym &iso)) ab ) ) |
675 | 544 ... | case2 lt = ZChain.is-max (zc z<x) za ? ab P a<b |
545 ... | yes ax with ODC.p∨¬p O ( HasPrev A (ZChain.chain (zc ? ) ) ax f ) | |
674 | 546 -- we have to check adding x preserve is-max ZChain A y f mf zc0 x |
626 | 547 ... | case1 pr = no-extenion zc7 where -- we have previous A ∋ z < x , f z ≡ x, so chain ∋ f z ≡ x because of f-next |
675 | 548 chain0 = ZChain.chain (zc ? ) |
549 zc7 : {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain (zc z<x) ) a → b o< osuc x → (ab : odef A b) → | |
550 HasPrev A (ZChain.chain (zc z<x) ) ab f ∨ IsSup A (ZChain.chain (zc z<x) ) ab → | |
551 * a < * b → odef (ZChain.chain (zc z<x) ) b | |
552 zc7 {a} {b} z<x za b<ox ab P a<b with osuc-≡< b<ox | |
553 ... | case2 lt = ZChain.is-max (zc z<x) za ? ab P a<b | |
554 ... | case1 b=x = ? -- subst (λ k → odef chain0 k ) (trans (sym (HasPrev.x=fy pr )) (trans &iso (sym b=x)) ) ( ZChain.f-next (zc z<x) (HasPrev.ay pr)) | |
674 | 555 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A (ZChain.chain (zc ?) ) ax ) |
556 ... | case1 is-sup = -- x is a sup of (zc ?) | |
654 | 557 record { chain⊆A = {!!} ; f-next = {!!} ; f-total = {!!} |
558 ; initial = {!!} ; chain∋init = {!!} ; is-max = {!!} } where | |
674 | 559 sup0 : SUP A (ZChain.chain (zc ?) ) |
571 | 560 sup0 = record { sup = * x ; A∋maximal = ax ; x<sup = x21 } where |
674 | 561 x21 : {y : HOD} → ZChain.chain (zc ?) ∋ y → (y ≡ * x) ∨ (y < * x) |
571 | 562 x21 {y} zy with IsSup.x<sup is-sup zy |
563 ... | case1 y=x = case1 ( subst₂ (λ j k → j ≡ * k ) *iso &iso ( cong (*) y=x) ) | |
564 ... | case2 y<x = case2 (subst₂ (λ j k → j < * k ) *iso &iso y<x ) | |
570 | 565 sp : HOD |
561 | 566 sp = SUP.sup sup0 |
570 | 567 x=sup : x ≡ & sp |
568 x=sup = sym &iso | |
674 | 569 chain0 = ZChain.chain (zc ?) |
604 | 570 sc<A : {y : Ordinal} → odef chain0 y ∨ FClosure A f (& sp) y → y o< & A |
674 | 571 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 | 572 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 | 573 schain : HOD |
604 | 574 schain = record { od = record { def = λ x → odef chain0 x ∨ (FClosure A f (& sp) x) } ; odmax = & A ; <odmax = λ {y} sy → sc<A {y} sy } |
631 | 575 supf0 : Ordinal → HOD |
576 supf0 z with trio< z x | |
674 | 577 ... | tri< a ¬b ¬c = ? -- supf z |
631 | 578 ... | tri≈ ¬a b ¬c = schain |
579 ... | tri> ¬a ¬b c = schain | |
561 | 580 A∋schain : {x : HOD } → schain ∋ x → A ∋ x |
674 | 581 A∋schain (case1 zx ) = ZChain.chain⊆A (zc ?) zx |
561 | 582 A∋schain {y} (case2 fx ) = A∋fc (& sp) f mf fx |
569 | 583 s⊆A : schain ⊆' A |
674 | 584 s⊆A {x} (case1 zx) = ZChain.chain⊆A (zc ?) zx |
569 | 585 s⊆A {x} (case2 fx) = A∋fc (& sp) f mf fx |
604 | 586 cmp : {a b : HOD} (za : odef chain0 (& a)) (fb : FClosure A f (& sp) (& b)) → Tri (a < b) (a ≡ b) (b < a ) |
561 | 587 cmp {a} {b} za fb with SUP.x<sup sup0 za | s≤fc (& sp) f mf fb |
588 ... | case1 sp=a | case1 sp=b = tri≈ (λ lt → <-irr (case1 (sym eq)) lt ) eq (λ lt → <-irr (case1 eq) lt ) where | |
589 eq : a ≡ b | |
590 eq = trans sp=a (subst₂ (λ j k → j ≡ k ) *iso *iso sp=b ) | |
591 ... | case1 sp=a | case2 sp<b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b) lt ) where | |
592 a<b : a < b | |
593 a<b = subst (λ k → k < b ) (sym sp=a) (subst₂ (λ j k → j < k ) *iso *iso sp<b ) | |
594 ... | case2 a<sp | case1 sp=b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b) lt ) where | |
595 a<b : a < b | |
596 a<b = subst (λ k → a < k ) (trans sp=b *iso ) (subst (λ k → a < k ) (sym *iso) a<sp ) | |
597 ... | case2 a<sp | case2 sp<b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b) lt ) where | |
598 a<b : a < b | |
599 a<b = ptrans (subst (λ k → a < k ) (sym *iso) a<sp ) ( subst₂ (λ j k → j < k ) refl *iso sp<b ) | |
600 scmp : {a b : HOD} → odef schain (& a) → odef schain (& b) → Tri (a < b) (a ≡ b) (b < a ) | |
674 | 601 scmp {a} {b} (case1 za) (case1 zb) = {!!} -- ZChain.f-total (zc ?) {px} {px} o≤-refl za zb |
561 | 602 scmp {a} {b} (case1 za) (case2 fb) = cmp za fb |
603 scmp (case2 fa) (case1 zb) with cmp zb fa | |
604 ... | tri< a ¬b ¬c = tri> ¬c (λ eq → ¬b (sym eq)) a | |
605 ... | tri≈ ¬a b ¬c = tri≈ ¬c (sym b) ¬a | |
606 ... | tri> ¬a ¬b c = tri< c (λ eq → ¬b (sym eq)) ¬a | |
607 scmp (case2 fa) (case2 fb) = subst₂ (λ a b → Tri (a < b) (a ≡ b) (b < a ) ) *iso *iso (fcn-cmp (& sp) f mf fa fb) | |
608 scnext : {a : Ordinal} → odef schain a → odef schain (f a) | |
674 | 609 scnext {x} (case1 zx) = case1 (ZChain.f-next (zc ?) zx) |
561 | 610 scnext {x} (case2 sx) = case2 ( fsuc x sx ) |
611 scinit : {x : Ordinal} → odef schain x → * y ≤ * x | |
674 | 612 scinit {x} (case1 zx) = ZChain.initial (zc ?) zx |
613 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 | 614 ... | case1 sp=x | case1 y=sp = case1 (trans y=sp (subst (λ k → k ≡ * x ) *iso sp=x ) ) |
615 ... | case1 sp=x | case2 y<sp = case2 (subst (λ k → * y < k ) (trans (sym *iso) sp=x) y<sp ) | |
616 ... | case2 sp<x | case1 y=sp = case2 (subst (λ k → k < * x ) (trans *iso (sym y=sp )) sp<x ) | |
617 ... | case2 sp<x | case2 y<sp = case2 (ptrans y<sp (subst (λ k → k < * x ) *iso sp<x) ) | |
604 | 618 A∋za : {a : Ordinal } → odef chain0 a → odef A a |
674 | 619 A∋za za = ZChain.chain⊆A (zc ?) za |
604 | 620 za<sup : {a : Ordinal } → odef chain0 a → ( * a ≡ sp ) ∨ ( * a < sp ) |
621 za<sup za = SUP.x<sup sup0 (subst (λ k → odef chain0 k ) (sym &iso) za ) | |
571 | 622 s-ismax : {a b : Ordinal} → odef schain a → b o< osuc x → (ab : odef A b) |
623 → HasPrev A schain ab f ∨ IsSup A schain ab | |
569 | 624 → * a < * b → odef schain b |
571 | 625 s-ismax {a} {b} sa b<ox ab p a<b with osuc-≡< b<ox -- b is x? |
600 | 626 ... | case1 b=x = case2 (subst (λ k → FClosure A f (& sp) k ) (sym (trans b=x x=sup )) (init (SUP.A∋maximal sup0) )) |
571 | 627 s-ismax {a} {b} (case1 za) b<ox ab (case1 p) a<b | case2 b<x = z21 p where -- has previous |
568 | 628 z21 : HasPrev A schain ab f → odef schain b |
567 | 629 z21 record { y = y ; ay = (case1 zy) ; x=fy = x=fy } = |
674 | 630 case1 (ZChain.is-max (zc ?) za ? ab (case1 record { y = y ; ay = zy ; x=fy = x=fy }) a<b ) |
567 | 631 z21 record { y = y ; ay = (case2 sy) ; x=fy = x=fy } = subst (λ k → odef schain k) (sym x=fy) (case2 (fsuc y sy) ) |
674 | 632 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 |
633 z22 : IsSup A (ZChain.chain (zc ?) ) ab | |
571 | 634 z22 = record { x<sup = λ {y} zy → IsSup.x<sup p (case1 zy ) } |
635 s-ismax {a} {b} (case2 sa) b<ox ab (case1 p) a<b | case2 b<x with HasPrev.ay p | |
674 | 636 ... | case1 zy = case1 (subst (λ k → odef chain0 k ) (sym (HasPrev.x=fy p)) (ZChain.f-next (zc ?) zy )) -- in previous closure of f |
571 | 637 ... | 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 | 638 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 |
674 | 639 z24 : IsSup A schain ab → IsSup A (ZChain.chain (zc ?) ) ab |
571 | 640 z24 p = record { x<sup = λ {y} zy → IsSup.x<sup p (case1 zy ) } |
604 | 641 z23 : odef chain0 b |
674 | 642 z23 with IsSup.x<sup (z24 p) ( ZChain.chain∋init (zc ?) ) |
643 ... | case1 y=b = subst (λ k → odef chain0 k ) y=b ( ZChain.chain∋init (zc ?) ) | |
644 ... | case2 y<b = ZChain.is-max (zc ?) (ZChain.chain∋init (zc ?) ) ? ab (case2 (z24 p)) y<b | |
624 | 645 seq : schain ≡ supf0 x |
611 | 646 seq with trio< x x |
647 ... | tri< a ¬b ¬c = ⊥-elim ( ¬b refl ) | |
624 | 648 ... | tri≈ ¬a b ¬c = refl |
649 ... | tri> ¬a ¬b c = refl | |
674 | 650 seq<x : {b : Ordinal } → b o< x → ? -- supf b ≡ supf0 b |
611 | 651 seq<x {b} b<x with trio< b x |
652 ... | tri< a ¬b ¬c = refl | |
653 ... | tri≈ ¬a b₁ ¬c = ⊥-elim (¬a b<x ) | |
654 ... | tri> ¬a ¬b c = ⊥-elim (¬a b<x ) | |
655 | |
656 ... | case2 ¬x=sup = no-extenion z18 where -- x is not f y' nor sup of former ZChain from y -- no extention | |
675 | 657 z18 : {a b z : Ordinal} → (z<x : z o< x) → odef (ZChain.chain (zc z<x) ) a → b o< osuc x → (ab : odef A b) → |
658 HasPrev A (ZChain.chain (zc ?) ) ab f ∨ IsSup A (ZChain.chain (zc z<x) ) ab → | |
659 * a < * b → odef (ZChain.chain (zc z<x) ) b | |
660 z18 {a} {b} z<x za b<x ab p a<b with osuc-≡< b<x | |
661 ... | case2 lt = ZChain.is-max (zc z<x) za ? ab p a<b | |
565 | 662 ... | case1 b=x with p |
675 | 663 ... | case1 pr = ⊥-elim ( ¬fy<x record {y = HasPrev.y pr ; ay = ? ; x=fy = trans (trans &iso (sym b=x) ) (HasPrev.x=fy pr ) } ) |
571 | 664 ... | case2 b=sup = ⊥-elim ( ¬x=sup record { |
675 | 665 x<sup = λ {y} zy → subst (λ k → (y ≡ k) ∨ (y << k)) (trans b=x (sym &iso)) (IsSup.x<sup b=sup ? ) } ) |
553 | 666 |
664 | 667 SZ0 : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) → {y : Ordinal} (ay : odef A y) → (x : Ordinal) → ZChain1 A f mf ay x |
668 SZ0 f mf ay x = TransFinite {λ z → ZChain1 A f mf ay z} (sind f mf ay ) x | |
629 | 669 |
674 | 670 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) |
671 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
|
672 |
551 | 673 zorn00 : Maximal A |
674 zorn00 with is-o∅ ( & HasMaximal ) -- we have no Level (suc n) LEM | |
675 ... | no not = record { maximal = ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) ; A∋maximal = zorn01 ; ¬maximal<x = zorn02 } where | |
676 -- yes we have the maximal | |
677 zorn03 : odef HasMaximal ( & ( ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) ) ) | |
606 | 678 zorn03 = ODC.x∋minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) -- Axiom of choice |
551 | 679 zorn01 : A ∋ ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) |
680 zorn01 = proj1 zorn03 | |
681 zorn02 : {x : HOD} → A ∋ x → ¬ (ODC.minimal O HasMaximal (λ eq → not (=od∅→≡o∅ eq)) < x) | |
682 zorn02 {x} ax m<x = proj2 zorn03 (& x) ax (subst₂ (λ j k → j < k) (sym *iso) (sym *iso) m<x ) | |
674 | 683 ... | yes ¬Maximal = ⊥-elim ( z04 nmx zc0 zorn04 total ) where |
551 | 684 -- if we have no maximal, make ZChain, which contradict SUP condition |
685 nmx : ¬ Maximal A | |
686 nmx mx = ∅< {HasMaximal} zc5 ( ≡o∅→=od∅ ¬Maximal ) where | |
687 zc5 : odef A (& (Maximal.maximal mx)) ∧ (( y : Ordinal ) → odef A y → ¬ (* (& (Maximal.maximal mx)) < * y)) | |
688 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 | 689 zc0 : (x : Ordinal) → ZChain1 A (cf nmx) (cf-is-≤-monotonic nmx) as0 x |
690 zc0 x = TransFinite {λ z → ZChain1 A (cf nmx) (cf-is-≤-monotonic nmx) as0 z} (sind (cf nmx) (cf-is-≤-monotonic nmx) as0) x | |
674 | 691 zorn04 : ZChain A (cf nmx) (cf-is-≤-monotonic nmx) as0 zc0 (& A) |
653 | 692 zorn04 = SZ (cf nmx) (cf-is-≤-monotonic nmx) (subst (λ k → odef A k ) &iso as ) |
634 | 693 total : IsTotalOrderSet (ZChain.chain zorn04) |
654 | 694 total {a} {b} = zorn06 where |
695 zorn06 : odef (ZChain.chain zorn04) (& a) → odef (ZChain.chain zorn04) (& b) → Tri (a < b) (a ≡ b) (b < a) | |
696 zorn06 = ZChain.f-total (SZ (cf nmx) (cf-is-≤-monotonic nmx) (subst (λ k → odef A k ) &iso as) ) | |
551 | 697 |
516 | 698 -- usage (see filter.agda ) |
699 -- | |
497 | 700 -- _⊆'_ : ( A B : HOD ) → Set n |
701 -- _⊆'_ A B = (x : Ordinal ) → odef A x → odef B x | |
482 | 702 |
497 | 703 -- MaximumSubset : {L P : HOD} |
704 -- → o∅ o< & L → o∅ o< & P → P ⊆ L | |
705 -- → IsPartialOrderSet P _⊆'_ | |
706 -- → ( (B : HOD) → B ⊆ P → IsTotalOrderSet B _⊆'_ → SUP P B _⊆'_ ) | |
707 -- → Maximal P (_⊆'_) | |
708 -- MaximumSubset {L} {P} 0<L 0<P P⊆L PO SP = Zorn-lemma {P} {_⊆'_} 0<P PO SP |