Mercurial > hg > Members > kono > Proof > ZF-in-agda
comparison constructible-set.agda @ 23:7293a151d949
Sup
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 18 May 2019 08:29:08 +0900 |
parents | 3da2c00bd24d |
children | 3186bbee99dd |
comparison
equal
deleted
inserted
replaced
22:3da2c00bd24d | 23:7293a151d949 |
---|---|
1 open import Level | 1 open import Level |
2 module constructible-set (n : Level) where | 2 module constructible-set (n : Level) where |
3 | 3 |
4 open import zf | 4 open import zf |
5 | 5 |
6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ) | 6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) |
7 | 7 |
8 open import Relation.Binary.PropositionalEquality | 8 open import Relation.Binary.PropositionalEquality |
9 | 9 |
10 data OrdinalD : (lv : Nat) → Set n where | 10 data OrdinalD : (lv : Nat) → Set n where |
11 Φ : {lv : Nat} → OrdinalD lv | 11 Φ : {lv : Nat} → OrdinalD lv |
99 maxα x y with <-cmp (lv x) (lv y) | 99 maxα x y with <-cmp (lv x) (lv y) |
100 maxα x y | tri< a ¬b ¬c = x | 100 maxα x y | tri< a ¬b ¬c = x |
101 maxα x y | tri> ¬a ¬b c = y | 101 maxα x y | tri> ¬a ¬b c = y |
102 maxα x y | tri≈ ¬a refl ¬c = record { lv = lv x ; ord = maxαd (ord x) (ord y) } | 102 maxα x y | tri≈ ¬a refl ¬c = record { lv = lv x ; ord = maxαd (ord x) (ord y) } |
103 | 103 |
104 OrdTrans : Transitive (λ ( a b : Ordinal ) → (a ≡ b) ∨ (Ordinal.lv a < Ordinal.lv b) ∨ (Ordinal.ord a d< Ordinal.ord b) ) | 104 _o≤_ : Ordinal → Ordinal → Set n |
105 a o≤ b = (a ≡ b) ∨ ( a o< b ) | |
106 | |
107 trio< : Trichotomous _≡_ _o<_ | |
108 trio< a b with <-cmp (lv a) (lv b) | |
109 trio< a b | tri< a₁ ¬b ¬c = tri< (case1 a₁) (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) {!!} | |
110 trio< a b | tri> ¬a ¬b c = tri> {!!} (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) (case1 c) | |
111 trio< a b | tri≈ ¬a refl ¬c with triOrdd ( ord a ) ( ord b ) | |
112 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri< a ¬b ¬c₁ = tri< (case2 a) (λ refl → ¬b {!!} ) {!!} | |
113 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri≈ ¬a₁ refl ¬c₁ = tri≈ {!!} refl {!!} | |
114 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri> ¬a₁ ¬b c = tri> {!!} {!!} (case2 c) | |
115 | |
116 OrdTrans : Transitive _o≤_ | |
105 OrdTrans (case1 refl) (case1 refl) = case1 refl | 117 OrdTrans (case1 refl) (case1 refl) = case1 refl |
106 OrdTrans (case1 refl) (case2 lt2) = case2 lt2 | 118 OrdTrans (case1 refl) (case2 lt2) = case2 lt2 |
107 OrdTrans (case2 lt1) (case1 refl) = case2 lt1 | 119 OrdTrans (case2 lt1) (case1 refl) = case2 lt1 |
108 OrdTrans (case2 (case1 x)) (case2 (case1 y)) = case2 (case1 ( <-trans x y ) ) | 120 OrdTrans (case2 (case1 x)) (case2 (case1 y)) = case2 (case1 ( <-trans x y ) ) |
109 OrdTrans (case2 (case1 x)) (case2 (case2 y)) with d<→lv y | 121 OrdTrans (case2 (case1 x)) (case2 (case2 y)) with d<→lv y |
114 OrdTrans (case2 (case2 x)) (case2 (case2 y)) | refl | refl = case2 (case2 (orddtrans x y )) | 126 OrdTrans (case2 (case2 x)) (case2 (case2 y)) | refl | refl = case2 (case2 (orddtrans x y )) |
115 | 127 |
116 OrdPreorder : Preorder n n n | 128 OrdPreorder : Preorder n n n |
117 OrdPreorder = record { Carrier = Ordinal | 129 OrdPreorder = record { Carrier = Ordinal |
118 ; _≈_ = _≡_ | 130 ; _≈_ = _≡_ |
119 ; _∼_ = λ a b → (a ≡ b) ∨ ( a o< b ) | 131 ; _∼_ = _o≤_ |
120 ; isPreorder = record { | 132 ; isPreorder = record { |
121 isEquivalence = record { refl = refl ; sym = sym ; trans = trans } | 133 isEquivalence = record { refl = refl ; sym = sym ; trans = trans } |
122 ; reflexive = case1 | 134 ; reflexive = case1 |
123 ; trans = OrdTrans | 135 ; trans = OrdTrans |
124 } | 136 } |
132 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = Φ } = caseΦ lv | 144 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = Φ } = caseΦ lv |
133 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = OSuc ord₁ } = caseOSuc lv ord₁ | 145 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = OSuc ord₁ } = caseOSuc lv ord₁ |
134 ( TransFinite ψ caseℵ caseΦ caseOSuc (record { lv = lv ; ord = ord₁ } )) | 146 ( TransFinite ψ caseℵ caseΦ caseOSuc (record { lv = lv ; ord = ord₁ } )) |
135 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = Suc lv₁ ; ord = ℵ lv₁ } = caseℵ lv₁ | 147 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = Suc lv₁ ; ord = ℵ lv₁ } = caseℵ lv₁ |
136 | 148 |
137 record SupR (ψ : Ordinal → Ordinal ) : Set n where | |
138 field | |
139 sup : Ordinal | |
140 smax : { x : Ordinal } → ψ x o< sup | |
141 | |
142 open SupR | |
143 | |
144 Sup : (ψ : Ordinal → Ordinal ) → SupR ψ | |
145 sup (Sup ψ) = {!!} | |
146 smax (Sup ψ) = {!!} | |
147 | |
148 -- X' = { x ∈ X | ψ x } ∪ X , Mα = ( ∪ (β < α) Mβ ) ' | 149 -- X' = { x ∈ X | ψ x } ∪ X , Mα = ( ∪ (β < α) Mβ ) ' |
149 | 150 |
150 record ConstructibleSet : Set (suc (suc n)) where | 151 record ConstructibleSet : Set (suc (suc n)) where |
151 field | 152 field |
152 α : Ordinal | 153 α : Ordinal |
153 constructible : Ordinal → Set (suc n) | 154 constructible : Ordinal → Set (suc n) |
154 | 155 |
155 open ConstructibleSet | 156 open ConstructibleSet |
156 | 157 |
157 _∋_ : (ConstructibleSet ) → (ConstructibleSet ) → Set (suc n) | 158 _∋_ : (ConstructibleSet ) → (ConstructibleSet ) → Set (suc n) |
158 a ∋ x = ((α a ≡ α x) ∨ ( α x o< α a )) | 159 a ∋ x = ( α x o< α a ) ∧ constructible a ( α x ) |
159 ∧ constructible a ( α x ) | 160 |
160 | 161 c∅ : ConstructibleSet |
162 c∅ = record {α = o∅ ; constructible = λ x → Lift (suc n) ⊥ } | |
163 | |
164 record SupR {n m : Level} {S : Set n} ( _≤_ : S → S → Set m ) (ψ : S → S ) (X : S) : Set (n ⊔ m) where | |
165 field | |
166 sup : S | |
167 smax : ∀ { x : S } → x ≤ X → ψ x ≤ sup | |
168 suniq : {max : S} → ( ∀ { x : S } → x ≤ X → ψ x ≤ max ) → max ≤ sup | |
169 | |
170 open SupR | |
171 | |
172 _⊆_ : ( A B : ConstructibleSet ) → ∀{ x : ConstructibleSet } → Set (suc n) | |
173 _⊆_ A B {x} = A ∋ x → B ∋ x | |
174 | |
175 suptraverse : (X : ConstructibleSet ) ( max : ConstructibleSet) ( ψ : ConstructibleSet → ConstructibleSet ) → ConstructibleSet | |
176 suptraverse X max ψ = {!!} | |
177 | |
178 Sup : (ψ : ConstructibleSet → ConstructibleSet ) → (X : ConstructibleSet) → SupR (λ x a → (α a ≡ α x) ∨ (a ∋ x)) ψ X | |
179 sup (Sup ψ X ) = suptraverse X c∅ ψ | |
180 smax (Sup ψ X ) = {!!} -- TransFinite {!!} {!!} {!!} {!!} {!!} | |
181 suniq (Sup ψ X ) = {!!} | |
182 | |
161 | 183 |
162 -- transitiveness : (a b c : ConstructibleSet ) → a ∋ b → b ∋ c → a ∋ c | 184 -- transitiveness : (a b c : ConstructibleSet ) → a ∋ b → b ∋ c → a ∋ c |
163 -- transitiveness a b c a∋b b∋c with constructible a c∋ constructible b | constructible b c∋ constructible c | 185 -- transitiveness a b c a∋b b∋c with constructible a c∋ constructible b | constructible b c∋ constructible c |
164 -- ... | t1 | t2 = {!!} | 186 -- ... | t1 | t2 = {!!} |
165 | 187 |
166 open import Data.Unit | 188 open import Data.Unit |
189 open SupR | |
167 | 190 |
168 ConstructibleSet→ZF : ZF {suc (suc n)} {suc (suc n)} | 191 ConstructibleSet→ZF : ZF {suc (suc n)} {suc (suc n)} |
169 ConstructibleSet→ZF = record { | 192 ConstructibleSet→ZF = record { |
170 ZFSet = ConstructibleSet | 193 ZFSet = ConstructibleSet |
171 ; _∋_ = λ a b → Lift (suc (suc n)) ( a ∋ b ) | 194 ; _∋_ = λ a b → Lift (suc (suc n)) ( a ∋ b ) |
172 ; _≈_ = _≡_ | 195 ; _≈_ = _≡_ |
173 ; ∅ = record {α = o∅ ; constructible = λ x → Lift (suc n) ⊥ } | 196 ; ∅ = c∅ |
174 ; _,_ = _,_ | 197 ; _,_ = _,_ |
175 ; Union = Union | 198 ; Union = Union |
176 ; Power = {!!} | 199 ; Power = {!!} |
177 ; Select = Select | 200 ; Select = Select |
178 ; Replace = Replace | 201 ; Replace = Replace |
183 conv ψ x with ψ x | 206 conv ψ x with ψ x |
184 ... | t = Lift ( suc n ) ⊤ | 207 ... | t = Lift ( suc n ) ⊤ |
185 Select : (X : ConstructibleSet) → (ConstructibleSet → Set (suc (suc n))) → ConstructibleSet | 208 Select : (X : ConstructibleSet) → (ConstructibleSet → Set (suc (suc n))) → ConstructibleSet |
186 Select X ψ = record { α = α X ; constructible = λ x → (conv ψ) (record { α = x ; constructible = λ x → constructible X x } ) } | 209 Select X ψ = record { α = α X ; constructible = λ x → (conv ψ) (record { α = x ; constructible = λ x → constructible X x } ) } |
187 Replace : (X : ConstructibleSet) → (ConstructibleSet → ConstructibleSet) → ConstructibleSet | 210 Replace : (X : ConstructibleSet) → (ConstructibleSet → ConstructibleSet) → ConstructibleSet |
188 Replace X ψ = record { α = α X ; constructible = λ x → {!!} } | 211 Replace X ψ = record { α = α (sup (Sup ψ X)) ; constructible = λ x → {!!} } |
189 _,_ : ConstructibleSet → ConstructibleSet → ConstructibleSet | 212 _,_ : ConstructibleSet → ConstructibleSet → ConstructibleSet |
190 a , b = record { α = maxα (α a) (α b) ; constructible = λ x → {!!} } | 213 a , b = record { α = maxα (α a) (α b) ; constructible = λ x → {!!} } |
191 Union : ConstructibleSet → ConstructibleSet | 214 Union : ConstructibleSet → ConstructibleSet |
192 Union a = {!!} | 215 Union a = {!!} |