Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate constructible-set.agda @ 22:3da2c00bd24d
..
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 16 May 2019 17:20:45 +0900 |
parents | 6d9fdd1dfa79 |
children | 7293a151d949 |
rev | line source |
---|---|
16 | 1 open import Level |
2 module constructible-set (n : Level) where | |
3 | 3 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
4 open import zf |
3 | 5 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ) |
3 | 7 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
8 open import Relation.Binary.PropositionalEquality |
3 | 9 |
17 | 10 data OrdinalD : (lv : Nat) → Set n where |
11 Φ : {lv : Nat} → OrdinalD lv | |
12 OSuc : {lv : Nat} → OrdinalD lv → OrdinalD lv | |
13 ℵ_ : (lv : Nat) → OrdinalD (Suc lv) | |
3 | 14 |
16 | 15 record Ordinal : Set n where |
16 field | |
17 lv : Nat | |
17 | 18 ord : OrdinalD lv |
16 | 19 |
17 | 20 data _d<_ : {lx ly : Nat} → OrdinalD lx → OrdinalD ly → Set n where |
21 Φ< : {lx : Nat} → {x : OrdinalD lx} → Φ {lx} d< OSuc {lx} x | |
22 s< : {lx : Nat} → {x y : OrdinalD lx} → x d< y → OSuc {lx} x d< OSuc {lx} y | |
23 ℵΦ< : {lx : Nat} → {x : OrdinalD (Suc lx) } → Φ {Suc lx} d< (ℵ lx) | |
24 ℵ< : {lx : Nat} → {x : OrdinalD (Suc lx) } → OSuc {Suc lx} x d< (ℵ lx) | |
25 | |
26 open Ordinal | |
27 | |
28 _o<_ : ( x y : Ordinal ) → Set n | |
29 _o<_ x y = (lv x < lv y ) ∨ ( ord x d< ord y ) | |
3 | 30 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
31 open import Data.Nat.Properties |
6 | 32 open import Data.Empty |
33 open import Relation.Nullary | |
34 | |
35 open import Relation.Binary | |
36 open import Relation.Binary.Core | |
37 | |
21 | 38 o∅ : Ordinal |
39 o∅ = record { lv = Zero ; ord = Φ } | |
40 | |
41 | |
17 | 42 ≡→¬d< : {lv : Nat} → {x : OrdinalD lv } → x d< x → ⊥ |
43 ≡→¬d< {lx} {OSuc y} (s< t) = ≡→¬d< t | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
44 |
17 | 45 trio<> : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥ |
16 | 46 trio<> {lx} {.(OSuc _)} {.(OSuc _)} (s< s) (s< t) = |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
47 trio<> s t |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
48 |
17 | 49 trio<≡ : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → x ≡ y → x d< y → ⊥ |
50 trio<≡ refl = ≡→¬d< | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
51 |
17 | 52 trio>≡ : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥ |
53 trio>≡ refl = ≡→¬d< | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
54 |
17 | 55 triO : {lx ly : Nat} → OrdinalD lx → OrdinalD ly → Tri (lx < ly) ( lx ≡ ly ) ( lx > ly ) |
16 | 56 triO {lx} {ly} x y = <-cmp lx ly |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
57 |
17 | 58 triOrdd : {lx : Nat} → Trichotomous _≡_ ( _d<_ {lx} {lx} ) |
59 triOrdd {lv} Φ Φ = tri≈ ≡→¬d< refl ≡→¬d< | |
60 triOrdd {Suc lv} (ℵ lv) (ℵ lv) = tri≈ ≡→¬d< refl ≡→¬d< | |
61 triOrdd {lv} Φ (OSuc y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< ) | |
62 triOrdd {.(Suc lv)} Φ (ℵ lv) = tri< (ℵΦ< {lv} {Φ} ) (λ ()) ( λ lt → trio<> lt ((ℵΦ< {lv} {Φ} )) ) | |
63 triOrdd {Suc lv} (ℵ lv) Φ = tri> ( λ lt → trio<> lt (ℵΦ< {lv} {Φ} ) ) (λ ()) (ℵΦ< {lv} {Φ} ) | |
64 triOrdd {Suc lv} (ℵ lv) (OSuc y) = tri> ( λ lt → trio<> lt (ℵ< {lv} {y} ) ) (λ ()) (ℵ< {lv} {y} ) | |
65 triOrdd {lv} (OSuc x) Φ = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ< | |
66 triOrdd {.(Suc lv)} (OSuc x) (ℵ lv) = tri< ℵ< (λ ()) (λ lt → trio<> lt ℵ< ) | |
67 triOrdd {lv} (OSuc x) (OSuc y) with triOrdd x y | |
68 triOrdd {lv} (OSuc x) (OSuc y) | tri< a ¬b ¬c = tri< (s< a) (λ tx=ty → trio<≡ tx=ty (s< a) ) ( λ lt → trio<> lt (s< a) ) | |
69 triOrdd {lv} (OSuc x) (OSuc x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d< | |
70 triOrdd {lv} (OSuc x) (OSuc y) | tri> ¬a ¬b c = tri> ( λ lt → trio<> lt (s< c) ) (λ tx=ty → trio>≡ tx=ty (s< c) ) (s< c) | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
71 |
17 | 72 d<→lv : {x y : Ordinal } → ord x d< ord y → lv x ≡ lv y |
73 d<→lv Φ< = refl | |
74 d<→lv (s< lt) = refl | |
75 d<→lv ℵΦ< = refl | |
76 d<→lv ℵ< = refl | |
16 | 77 |
17 | 78 orddtrans : {lx : Nat} {x y z : OrdinalD lx } → x d< y → y d< z → x d< z |
79 orddtrans {lx} {.Φ} {.(OSuc _)} {.(OSuc _)} Φ< (s< y<z) = Φ< | |
80 orddtrans {Suc lx} {Φ {Suc lx}} {OSuc y} {ℵ lx} Φ< ℵ< = ℵΦ< {lx} {y} | |
81 orddtrans {lx} {.(OSuc _)} {.(OSuc _)} {.(OSuc _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z ) | |
82 orddtrans {.(Suc _)} {.(OSuc _)} {.(OSuc _)} {.(ℵ _)} (s< x<y) ℵ< = ℵ< | |
83 orddtrans {.(Suc _)} {.Φ} {.(ℵ _)} {z} ℵΦ< () | |
84 orddtrans {.(Suc _)} {.(OSuc _)} {.(ℵ _)} {z} ℵ< () | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
85 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
86 max : (x y : Nat) → Nat |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
87 max Zero Zero = Zero |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
88 max Zero (Suc x) = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
89 max (Suc x) Zero = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
90 max (Suc x) (Suc y) = Suc ( max x y ) |
3 | 91 |
17 | 92 maxαd : { lx : Nat } → OrdinalD lx → OrdinalD lx → OrdinalD lx |
93 maxαd x y with triOrdd x y | |
94 maxαd x y | tri< a ¬b ¬c = y | |
95 maxαd x y | tri≈ ¬a b ¬c = x | |
96 maxαd x y | tri> ¬a ¬b c = x | |
6 | 97 |
17 | 98 maxα : Ordinal → Ordinal → Ordinal |
99 maxα x y with <-cmp (lv x) (lv y) | |
100 maxα x y | tri< a ¬b ¬c = x | |
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) } | |
7 | 103 |
17 | 104 OrdTrans : Transitive (λ ( a b : Ordinal ) → (a ≡ b) ∨ (Ordinal.lv a < Ordinal.lv b) ∨ (Ordinal.ord a d< Ordinal.ord b) ) |
16 | 105 OrdTrans (case1 refl) (case1 refl) = case1 refl |
106 OrdTrans (case1 refl) (case2 lt2) = case2 lt2 | |
107 OrdTrans (case2 lt1) (case1 refl) = case2 lt1 | |
17 | 108 OrdTrans (case2 (case1 x)) (case2 (case1 y)) = case2 (case1 ( <-trans x y ) ) |
109 OrdTrans (case2 (case1 x)) (case2 (case2 y)) with d<→lv y | |
110 OrdTrans (case2 (case1 x)) (case2 (case2 y)) | refl = case2 (case1 x ) | |
111 OrdTrans (case2 (case2 x)) (case2 (case1 y)) with d<→lv x | |
112 OrdTrans (case2 (case2 x)) (case2 (case1 y)) | refl = case2 (case1 y) | |
113 OrdTrans (case2 (case2 x)) (case2 (case2 y)) with d<→lv x | d<→lv y | |
114 OrdTrans (case2 (case2 x)) (case2 (case2 y)) | refl | refl = case2 (case2 (orddtrans x y )) | |
16 | 115 |
116 OrdPreorder : Preorder n n n | |
117 OrdPreorder = record { Carrier = Ordinal | |
118 ; _≈_ = _≡_ | |
17 | 119 ; _∼_ = λ a b → (a ≡ b) ∨ ( a o< b ) |
16 | 120 ; isPreorder = record { |
121 isEquivalence = record { refl = refl ; sym = sym ; trans = trans } | |
122 ; reflexive = case1 | |
123 ; trans = OrdTrans | |
124 } | |
125 } | |
126 | |
22 | 127 TransFinite : ( ψ : Ordinal → Set n ) |
128 → ( ∀ (lx : Nat ) → ψ ( record { lv = Suc lx ; ord = ℵ lx } )) | |
129 → ( ∀ (lx : Nat ) → ψ ( record { lv = lx ; ord = Φ } ) ) | |
130 → ( ∀ (lx : Nat ) → (x : OrdinalD lx ) → ψ ( record { lv = lx ; ord = x } ) → ψ ( record { lv = lx ; ord = OSuc x } ) ) | |
131 → ∀ (x : Ordinal) → ψ x | |
132 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = Φ } = caseΦ lv | |
133 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = OSuc ord₁ } = caseOSuc lv ord₁ | |
134 ( TransFinite ψ caseℵ caseΦ caseOSuc (record { lv = lv ; ord = ord₁ } )) | |
135 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = Suc lv₁ ; ord = ℵ lv₁ } = caseℵ lv₁ | |
136 | |
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 | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
148 -- X' = { x ∈ X | ψ x } ∪ X , Mα = ( ∪ (β < α) Mβ ) ' |
7 | 149 |
19 | 150 record ConstructibleSet : Set (suc (suc n)) where |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
151 field |
17 | 152 α : Ordinal |
19 | 153 constructible : Ordinal → Set (suc n) |
11 | 154 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
155 open ConstructibleSet |
11 | 156 |
20 | 157 _∋_ : (ConstructibleSet ) → (ConstructibleSet ) → Set (suc n) |
158 a ∋ x = ((α a ≡ α x) ∨ ( α x o< α a )) | |
159 ∧ constructible a ( α x ) | |
160 | |
11 | 161 |
17 | 162 -- 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 | |
164 -- ... | t1 | t2 = {!!} | |
15 | 165 |
20 | 166 open import Data.Unit |
167 | |
19 | 168 ConstructibleSet→ZF : ZF {suc (suc n)} {suc (suc n)} |
16 | 169 ConstructibleSet→ZF = record { |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
170 ZFSet = ConstructibleSet |
19 | 171 ; _∋_ = λ a b → Lift (suc (suc n)) ( a ∋ b ) |
18 | 172 ; _≈_ = _≡_ |
21 | 173 ; ∅ = record {α = o∅ ; constructible = λ x → Lift (suc n) ⊥ } |
18 | 174 ; _,_ = _,_ |
175 ; Union = Union | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
176 ; Power = {!!} |
20 | 177 ; Select = Select |
178 ; Replace = Replace | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
179 ; infinite = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
180 ; isZF = {!!} |
18 | 181 } where |
20 | 182 conv : (ConstructibleSet → Set (suc (suc n))) → ConstructibleSet → Set (suc n) |
183 conv ψ x with ψ x | |
184 ... | t = Lift ( suc n ) ⊤ | |
185 Select : (X : ConstructibleSet) → (ConstructibleSet → Set (suc (suc n))) → ConstructibleSet | |
186 Select X ψ = record { α = α X ; constructible = λ x → (conv ψ) (record { α = x ; constructible = λ x → constructible X x } ) } | |
187 Replace : (X : ConstructibleSet) → (ConstructibleSet → ConstructibleSet) → ConstructibleSet | |
188 Replace X ψ = record { α = α X ; constructible = λ x → {!!} } | |
18 | 189 _,_ : ConstructibleSet → ConstructibleSet → ConstructibleSet |
20 | 190 a , b = record { α = maxα (α a) (α b) ; constructible = λ x → {!!} } |
18 | 191 Union : ConstructibleSet → ConstructibleSet |
192 Union a = {!!} |