comparison cardinal.agda @ 331:12071f79f3cf

HOD done
author Shinji KONO Sun, 05 Jul 2020 16:56:21 +0900 d9d3654baee1 6c72bee25653
comparison
equal inserted replaced
330:0faa7120e4b5 331:12071f79f3cf
27 open _==_ 27 open _==_
28 28
29 -- we have to work on Ordinal to keep OD Level n 29 -- we have to work on Ordinal to keep OD Level n
30 -- since we use p∨¬p which works only on Level n 30 -- since we use p∨¬p which works only on Level n
31 31
32 32 ∋-p : (A x : HOD ) → Dec ( A ∋ x )
33 ∋-p : (A x : OD ) → Dec ( A ∋ x )
34 ∋-p A x with ODC.p∨¬p O ( A ∋ x ) 33 ∋-p A x with ODC.p∨¬p O ( A ∋ x )
35 ∋-p A x | case1 t = yes t 34 ∋-p A x | case1 t = yes t
36 ∋-p A x | case2 t = no t 35 ∋-p A x | case2 t = no t
37 36
38 _⊗_ : (A B : OD) → OD 37 _⊗_ : (A B : HOD) → HOD
39 A ⊗ B = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkAB p ) } where 38 A ⊗ B = record { od = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkAB p ) } } where
40 checkAB : { p : Ordinal } → def ZFProduct p → Set n 39 checkAB : { p : Ordinal } → def ZFProduct p → Set n
41 checkAB (pair x y) = def A x ∧ def B y 40 checkAB (pair x y) = odef A x ∧ odef B y
42 41
43 func→od0 : (f : Ordinal → Ordinal ) → OD 42 func→od0 : (f : Ordinal → Ordinal ) → HOD
44 func→od0 f = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkfunc p ) } where 43 func→od0 f = record { od = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkfunc p ) }} where
45 checkfunc : { p : Ordinal } → def ZFProduct p → Set n 44 checkfunc : { p : Ordinal } → def ZFProduct p → Set n
46 checkfunc (pair x y) = f x ≡ y 45 checkfunc (pair x y) = f x ≡ y
47 46
48 -- Power (Power ( A ∪ B )) ∋ ( A ⊗ B ) 47 -- Power (Power ( A ∪ B )) ∋ ( A ⊗ B )
49 48
50 Func : ( A B : OD ) → OD 49 Func : ( A B : HOD ) → HOD
51 Func A B = record { def = λ x → def (Power (A ⊗ B)) x } 50 Func A B = record { od = record { def = λ x → odef (Power (A ⊗ B)) x } }
52 51
53 -- power→ : ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x) 52 -- power→ : ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x)
54 53
55 func→od : (f : Ordinal → Ordinal ) → ( dom : OD ) → OD 54 func→od : (f : Ordinal → Ordinal ) → ( dom : HOD ) → HOD
56 func→od f dom = Replace dom ( λ x → < x , ord→od (f (od→ord x)) > ) 55 func→od f dom = Replace dom ( λ x → < x , ord→od (f (od→ord x)) > )
57 56
58 record Func←cd { dom cod : OD } {f : Ordinal } : Set n where 57 record Func←cd { dom cod : HOD } {f : Ordinal } : Set n where
59 field 58 field
60 func-1 : Ordinal → Ordinal 59 func-1 : Ordinal → Ordinal
61 func→od∈Func-1 : Func dom cod ∋ func→od func-1 dom 60 func→od∈Func-1 : Func dom cod ∋ func→od func-1 dom
62 61
63 od→func : { dom cod : OD } → {f : Ordinal } → def (Func dom cod ) f → Func←cd {dom} {cod} {f} 62 od→func : { dom cod : HOD } → {f : Ordinal } → odef (Func dom cod ) f → Func←cd {dom} {cod} {f}
64 od→func {dom} {cod} {f} lt = record { func-1 = λ x → sup-o ( λ y → lemma x {!!} ) ; func→od∈Func-1 = record { proj1 = {!!} ; proj2 = {!!} } } where 63 od→func {dom} {cod} {f} lt = record { func-1 = λ x → sup-o {!!} ( λ y lt → lemma x {!!} ) ; func→od∈Func-1 = record { proj1 = {!!} ; proj2 = {!!} } } where
65 lemma : Ordinal → Ordinal → Ordinal 64 lemma : Ordinal → Ordinal → Ordinal
66 lemma x y with IsZF.power→ isZF (dom ⊗ cod) (ord→od f) (subst (λ k → def (Power (dom ⊗ cod)) k ) (sym diso) lt ) | ∋-p (ord→od f) (ord→od y) 65 lemma x y with IsZF.power→ isZF (dom ⊗ cod) (ord→od f) (subst (λ k → odef (Power (dom ⊗ cod)) k ) (sym diso) lt ) | ∋-p (ord→od f) (ord→od y)
67 lemma x y | p | no n = o∅ 66 lemma x y | p | no n = o∅
68 lemma x y | p | yes f∋y = lemma2 (proj1 (ODC.double-neg-eilm O ( p {ord→od y} f∋y ))) where -- p : {y : OD} → f ∋ y → ¬ ¬ (dom ⊗ cod ∋ y) 67 lemma x y | p | yes f∋y = lemma2 (proj1 (ODC.double-neg-eilm O ( p {ord→od y} f∋y ))) where -- p : {y : OD} → f ∋ y → ¬ ¬ (dom ⊗ cod ∋ y)
69 lemma2 : {p : Ordinal} → ord-pair p → Ordinal 68 lemma2 : {p : Ordinal} → ord-pair p → Ordinal
70 lemma2 (pair x1 y1) with ODC.decp O ( x1 ≡ x) 69 lemma2 (pair x1 y1) with ODC.decp O ( x1 ≡ x)
71 lemma2 (pair x1 y1) | yes p = y1 70 lemma2 (pair x1 y1) | yes p = y1
72 lemma2 (pair x1 y1) | no ¬p = o∅ 71 lemma2 (pair x1 y1) | no ¬p = o∅
73 fod : OD 72 fod : HOD
74 fod = Replace dom ( λ x → < x , ord→od (sup-o ( λ y → lemma (od→ord x) {!!} )) > ) 73 fod = Replace dom ( λ x → < x , ord→od (sup-o {!!} ( λ y lt → lemma (od→ord x) {!!} )) > )
75 74
76 75
77 open Func←cd 76 open Func←cd
78 77
79 -- contra position of sup-o< 78 -- contra position of sup-o<
89 -- Onto map 88 -- Onto map
90 -- def X x -> xmap 89 -- def X x -> xmap
91 -- X ---------------------------> Y 90 -- X ---------------------------> Y
92 -- ymap <- def Y y 91 -- ymap <- def Y y
93 -- 92 --
94 record Onto (X Y : OD ) : Set n where 93 record Onto (X Y : HOD ) : Set n where
95 field 94 field
96 xmap : Ordinal 95 xmap : Ordinal
97 ymap : Ordinal 96 ymap : Ordinal
98 xfunc : def (Func X Y) xmap 97 xfunc : odef (Func X Y) xmap
99 yfunc : def (Func Y X) ymap 98 yfunc : odef (Func Y X) ymap
100 onto-iso : {y : Ordinal } → (lty : def Y y ) → 99 onto-iso : {y : Ordinal } → (lty : odef Y y ) →
101 func-1 ( od→func {X} {Y} {xmap} xfunc ) ( func-1 (od→func yfunc) y ) ≡ y 100 func-1 ( od→func {X} {Y} {xmap} xfunc ) ( func-1 (od→func yfunc) y ) ≡ y
102 101
103 open Onto 102 open Onto
104 103
105 onto-restrict : {X Y Z : OD} → Onto X Y → Z ⊆ Y → Onto X Z 104 onto-restrict : {X Y Z : HOD} → Onto X Y → Z ⊆ Y → Onto X Z
106 onto-restrict {X} {Y} {Z} onto Z⊆Y = record { 105 onto-restrict {X} {Y} {Z} onto Z⊆Y = record {
107 xmap = xmap1 106 xmap = xmap1
108 ; ymap = zmap 107 ; ymap = zmap
109 ; xfunc = xfunc1 108 ; xfunc = xfunc1
110 ; yfunc = zfunc 109 ; yfunc = zfunc
112 } where 111 } where
113 xmap1 : Ordinal 112 xmap1 : Ordinal
114 xmap1 = od→ord (Select (ord→od (xmap onto)) {!!} ) 113 xmap1 = od→ord (Select (ord→od (xmap onto)) {!!} )
115 zmap : Ordinal 114 zmap : Ordinal
116 zmap = {!!} 115 zmap = {!!}
117 xfunc1 : def (Func X Z) xmap1 116 xfunc1 : odef (Func X Z) xmap1
118 xfunc1 = {!!} 117 xfunc1 = {!!}
119 zfunc : def (Func Z X) zmap 118 zfunc : odef (Func Z X) zmap
120 zfunc = {!!} 119 zfunc = {!!}
121 onto-iso1 : {z : Ordinal } → (ltz : def Z z ) → func-1 (od→func xfunc1 ) (func-1 (od→func zfunc ) z ) ≡ z 120 onto-iso1 : {z : Ordinal } → (ltz : odef Z z ) → func-1 (od→func xfunc1 ) (func-1 (od→func zfunc ) z ) ≡ z
122 onto-iso1 = {!!} 121 onto-iso1 = {!!}
123 122
124 123
125 record Cardinal (X : OD ) : Set n where 124 record Cardinal (X : HOD ) : Set n where
126 field 125 field
127 cardinal : Ordinal 126 cardinal : Ordinal
128 conto : Onto X (Ord cardinal) 127 conto : Onto X (Ord cardinal)
129 cmax : ( y : Ordinal ) → cardinal o< y → ¬ Onto X (Ord y) 128 cmax : ( y : Ordinal ) → cardinal o< y → ¬ Onto X (Ord y)
130 129
131 cardinal : (X : OD ) → Cardinal X 130 cardinal : (X : HOD ) → Cardinal X
132 cardinal X = record { 131 cardinal X = record {
133 cardinal = sup-o ( λ x → proj1 ( cardinal-p {!!}) ) 132 cardinal = sup-o {!!} ( λ x lt → proj1 ( cardinal-p {!!}) )
134 ; conto = onto 133 ; conto = onto
135 ; cmax = cmax 134 ; cmax = cmax
136 } where 135 } where
137 cardinal-p : (x : Ordinal ) → ( Ordinal ∧ Dec (Onto X (Ord x) ) ) 136 cardinal-p : (x : Ordinal ) → ( Ordinal ∧ Dec (Onto X (Ord x) ) )
138 cardinal-p x with ODC.p∨¬p O ( Onto X (Ord x) ) 137 cardinal-p x with ODC.p∨¬p O ( Onto X (Ord x) )
139 cardinal-p x | case1 True = record { proj1 = x ; proj2 = yes True } 138 cardinal-p x | case1 True = record { proj1 = x ; proj2 = yes True }
140 cardinal-p x | case2 False = record { proj1 = o∅ ; proj2 = no False } 139 cardinal-p x | case2 False = record { proj1 = o∅ ; proj2 = no False }
141 S = sup-o (λ x → proj1 (cardinal-p {!!})) 140 S = sup-o {!!} (λ x lt → proj1 (cardinal-p {!!}))
142 lemma1 : (x : Ordinal) → ((y : Ordinal) → y o< x → Lift (suc n) (y o< (osuc S) → Onto X (Ord y))) → 141 lemma1 : (x : Ordinal) → ((y : Ordinal) → y o< x → (y o< (osuc S) → Onto X (Ord y))) →
143 Lift (suc n) (x o< (osuc S) → Onto X (Ord x) ) 142 (x o< (osuc S) → Onto X (Ord x) )
144 lemma1 x prev with trio< x (osuc S) 143 lemma1 x prev with trio< x (osuc S)
145 lemma1 x prev | tri< a ¬b ¬c with osuc-≡< a 144 lemma1 x prev | tri< a ¬b ¬c with osuc-≡< a
146 lemma1 x prev | tri< a ¬b ¬c | case1 x=S = lift ( λ lt → {!!} ) 145 lemma1 x prev | tri< a ¬b ¬c | case1 x=S = ( λ lt → {!!} )
147 lemma1 x prev | tri< a ¬b ¬c | case2 x<S = lift ( λ lt → lemma2 ) where 146 lemma1 x prev | tri< a ¬b ¬c | case2 x<S = ( λ lt → lemma2 ) where
148 lemma2 : Onto X (Ord x) 147 lemma2 : Onto X (Ord x)
149 lemma2 with prev {!!} {!!} 148 lemma2 with prev {!!} {!!}
150 ... | lift t = t {!!} 149 ... | t = {!!}
151 lemma1 x prev | tri≈ ¬a b ¬c = lift ( λ lt → ⊥-elim ( o<¬≡ b lt )) 150 lemma1 x prev | tri≈ ¬a b ¬c = ( λ lt → ⊥-elim ( o<¬≡ b lt ))
152 lemma1 x prev | tri> ¬a ¬b c = lift ( λ lt → ⊥-elim ( o<> c lt )) 151 lemma1 x prev | tri> ¬a ¬b c = ( λ lt → ⊥-elim ( o<> c lt ))
153 onto : Onto X (Ord S) 152 onto : Onto X (Ord S)
154 onto with TransFinite {λ x → Lift (suc n) ( x o< osuc S → Onto X (Ord x) ) } lemma1 S 153 onto with TransFinite {λ x → ( x o< osuc S → Onto X (Ord x) ) } lemma1 S
155 ... | lift t = t <-osuc 154 ... | t = t <-osuc
156 cmax : (y : Ordinal) → S o< y → ¬ Onto X (Ord y) 155 cmax : (y : Ordinal) → S o< y → ¬ Onto X (Ord y)
157 cmax y lt ontoy = o<> lt (o<-subst {_} {_} {y} {S} 156 cmax y lt ontoy = o<> lt (o<-subst {_} {_} {y} {S} {!!} lemma refl ) where
158 (sup-o< {λ x → proj1 ( cardinal-p {!!})}{{!!}} ) lemma refl ) where 157 -- (sup-o< ? {λ x lt → proj1 ( cardinal-p {!!})}{{!!}} ) lemma refl ) where
159 lemma : proj1 (cardinal-p y) ≡ y 158 lemma : proj1 (cardinal-p y) ≡ y
160 lemma with ODC.p∨¬p O ( Onto X (Ord y) ) 159 lemma with ODC.p∨¬p O ( Onto X (Ord y) )
161 lemma | case1 x = refl 160 lemma | case1 x = refl
162 lemma | case2 not = ⊥-elim ( not ontoy ) 161 lemma | case2 not = ⊥-elim ( not ontoy )
163 162