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