Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate constructible-set.agda @ 17:6a668c6086a5
clean up
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 14 May 2019 13:52:19 +0900 |
parents | ac362cc8b10f |
children | 627a79e61116 |
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 | |
17 | 38 ≡→¬d< : {lv : Nat} → {x : OrdinalD lv } → x d< x → ⊥ |
39 ≡→¬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
|
40 |
17 | 41 trio<> : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥ |
16 | 42 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
|
43 trio<> s t |
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 } → x ≡ y → x d< y → ⊥ |
46 trio<≡ refl = ≡→¬d< | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
47 |
17 | 48 trio>≡ : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥ |
49 trio>≡ refl = ≡→¬d< | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
50 |
17 | 51 triO : {lx ly : Nat} → OrdinalD lx → OrdinalD ly → Tri (lx < ly) ( lx ≡ ly ) ( lx > ly ) |
16 | 52 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
|
53 |
17 | 54 triOrdd : {lx : Nat} → Trichotomous _≡_ ( _d<_ {lx} {lx} ) |
55 triOrdd {lv} Φ Φ = tri≈ ≡→¬d< refl ≡→¬d< | |
56 triOrdd {Suc lv} (ℵ lv) (ℵ lv) = tri≈ ≡→¬d< refl ≡→¬d< | |
57 triOrdd {lv} Φ (OSuc y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< ) | |
58 triOrdd {.(Suc lv)} Φ (ℵ lv) = tri< (ℵΦ< {lv} {Φ} ) (λ ()) ( λ lt → trio<> lt ((ℵΦ< {lv} {Φ} )) ) | |
59 triOrdd {Suc lv} (ℵ lv) Φ = tri> ( λ lt → trio<> lt (ℵΦ< {lv} {Φ} ) ) (λ ()) (ℵΦ< {lv} {Φ} ) | |
60 triOrdd {Suc lv} (ℵ lv) (OSuc y) = tri> ( λ lt → trio<> lt (ℵ< {lv} {y} ) ) (λ ()) (ℵ< {lv} {y} ) | |
61 triOrdd {lv} (OSuc x) Φ = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ< | |
62 triOrdd {.(Suc lv)} (OSuc x) (ℵ lv) = tri< ℵ< (λ ()) (λ lt → trio<> lt ℵ< ) | |
63 triOrdd {lv} (OSuc x) (OSuc y) with triOrdd x y | |
64 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) ) | |
65 triOrdd {lv} (OSuc x) (OSuc x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d< | |
66 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
|
67 |
17 | 68 d<→lv : {x y : Ordinal } → ord x d< ord y → lv x ≡ lv y |
69 d<→lv Φ< = refl | |
70 d<→lv (s< lt) = refl | |
71 d<→lv ℵΦ< = refl | |
72 d<→lv ℵ< = refl | |
16 | 73 |
17 | 74 orddtrans : {lx : Nat} {x y z : OrdinalD lx } → x d< y → y d< z → x d< z |
75 orddtrans {lx} {.Φ} {.(OSuc _)} {.(OSuc _)} Φ< (s< y<z) = Φ< | |
76 orddtrans {Suc lx} {Φ {Suc lx}} {OSuc y} {ℵ lx} Φ< ℵ< = ℵΦ< {lx} {y} | |
77 orddtrans {lx} {.(OSuc _)} {.(OSuc _)} {.(OSuc _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z ) | |
78 orddtrans {.(Suc _)} {.(OSuc _)} {.(OSuc _)} {.(ℵ _)} (s< x<y) ℵ< = ℵ< | |
79 orddtrans {.(Suc _)} {.Φ} {.(ℵ _)} {z} ℵΦ< () | |
80 orddtrans {.(Suc _)} {.(OSuc _)} {.(ℵ _)} {z} ℵ< () | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
81 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
82 max : (x y : Nat) → Nat |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
83 max Zero Zero = Zero |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
84 max Zero (Suc x) = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
85 max (Suc x) Zero = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
86 max (Suc x) (Suc y) = Suc ( max x y ) |
3 | 87 |
17 | 88 maxαd : { lx : Nat } → OrdinalD lx → OrdinalD lx → OrdinalD lx |
89 maxαd x y with triOrdd x y | |
90 maxαd x y | tri< a ¬b ¬c = y | |
91 maxαd x y | tri≈ ¬a b ¬c = x | |
92 maxαd x y | tri> ¬a ¬b c = x | |
6 | 93 |
17 | 94 maxα : Ordinal → Ordinal → Ordinal |
95 maxα x y with <-cmp (lv x) (lv y) | |
96 maxα x y | tri< a ¬b ¬c = x | |
97 maxα x y | tri> ¬a ¬b c = y | |
98 maxα x y | tri≈ ¬a refl ¬c = record { lv = lv x ; ord = maxαd (ord x) (ord y) } | |
7 | 99 |
17 | 100 OrdTrans : Transitive (λ ( a b : Ordinal ) → (a ≡ b) ∨ (Ordinal.lv a < Ordinal.lv b) ∨ (Ordinal.ord a d< Ordinal.ord b) ) |
16 | 101 OrdTrans (case1 refl) (case1 refl) = case1 refl |
102 OrdTrans (case1 refl) (case2 lt2) = case2 lt2 | |
103 OrdTrans (case2 lt1) (case1 refl) = case2 lt1 | |
17 | 104 OrdTrans (case2 (case1 x)) (case2 (case1 y)) = case2 (case1 ( <-trans x y ) ) |
105 OrdTrans (case2 (case1 x)) (case2 (case2 y)) with d<→lv y | |
106 OrdTrans (case2 (case1 x)) (case2 (case2 y)) | refl = case2 (case1 x ) | |
107 OrdTrans (case2 (case2 x)) (case2 (case1 y)) with d<→lv x | |
108 OrdTrans (case2 (case2 x)) (case2 (case1 y)) | refl = case2 (case1 y) | |
109 OrdTrans (case2 (case2 x)) (case2 (case2 y)) with d<→lv x | d<→lv y | |
110 OrdTrans (case2 (case2 x)) (case2 (case2 y)) | refl | refl = case2 (case2 (orddtrans x y )) | |
16 | 111 |
112 OrdPreorder : Preorder n n n | |
113 OrdPreorder = record { Carrier = Ordinal | |
114 ; _≈_ = _≡_ | |
17 | 115 ; _∼_ = λ a b → (a ≡ b) ∨ ( a o< b ) |
16 | 116 ; isPreorder = record { |
117 isEquivalence = record { refl = refl ; sym = sym ; trans = trans } | |
118 ; reflexive = case1 | |
119 ; trans = OrdTrans | |
120 } | |
121 } | |
122 | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
123 -- X' = { x ∈ X | ψ x } ∪ X , Mα = ( ∪ (β < α) Mβ ) ' |
7 | 124 |
17 | 125 data Constructible ( α : Ordinal ) : Set (suc n) where |
126 fsub : ( ψ : Ordinal → Set n ) → Constructible α | |
127 xself : Ordinal → Constructible α | |
11 | 128 |
16 | 129 record ConstructibleSet : Set (suc n) where |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
130 field |
17 | 131 α : Ordinal |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
132 constructible : Constructible α |
11 | 133 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
134 open ConstructibleSet |
11 | 135 |
17 | 136 data _c∋_ : {α α' : Ordinal } → |
137 Constructible α → Constructible α' → Set n where | |
138 c> : {α α' : Ordinal } | |
139 (ta : Constructible α ) ( tx : Constructible α' ) → α' o< α → ta c∋ tx | |
140 xself-fsub : {α : Ordinal } | |
141 (ta : Ordinal ) ( ψ : Ordinal → Set n ) → _c∋_ {α} {α} (xself ta ) ( fsub ψ) | |
142 fsub-fsub : {α : Ordinal } | |
143 ( ψ : Ordinal → Set n ) ( ψ₁ : Ordinal → Set n ) → | |
144 ( ∀ ( x : Ordinal ) → ψ x → ψ₁ x ) → _c∋_ {α} {α} ( fsub ψ ) ( fsub ψ₁) | |
7 | 145 |
16 | 146 _∋_ : (ConstructibleSet ) → (ConstructibleSet ) → Set n |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
147 a ∋ x = constructible a c∋ constructible x |
11 | 148 |
17 | 149 -- transitiveness : (a b c : ConstructibleSet ) → a ∋ b → b ∋ c → a ∋ c |
150 -- transitiveness a b c a∋b b∋c with constructible a c∋ constructible b | constructible b c∋ constructible c | |
151 -- ... | t1 | t2 = {!!} | |
15 | 152 |
17 | 153 data _c≈_ : {α α' : Ordinal} → |
154 Constructible α → Constructible α' → Set n where | |
155 crefl : {α : Ordinal } → _c≈_ {α} {α} (xself α ) (xself α ) | |
156 feq : {lv : Nat} {α : Ordinal } | |
157 → ( ψ : Ordinal → Set n ) ( ψ₁ : Ordinal → Set n ) | |
158 → (∀ ( x : Ordinal ) → ψ x ⇔ ψ₁ x ) → _c≈_ {α} {α} ( fsub ψ ) ( fsub ψ₁) | |
11 | 159 |
16 | 160 _≈_ : (ConstructibleSet ) → (ConstructibleSet ) → Set n |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
161 a ≈ x = constructible a c≈ constructible x |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
162 |
16 | 163 ConstructibleSet→ZF : ZF {suc n} |
164 ConstructibleSet→ZF = record { | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
165 ZFSet = ConstructibleSet |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
166 ; _∋_ = _∋_ |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
167 ; _≈_ = _≈_ |
17 | 168 ; ∅ = record { α = record {lv = Zero ; ord = Φ } ; constructible = xself ( record {lv = Zero ; ord = Φ }) } |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
169 ; _×_ = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
170 ; Union = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
171 ; Power = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
172 ; Select = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
173 ; Replace = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
174 ; infinite = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
175 ; isZF = {!!} |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
176 } |