Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate zf.agda @ 10:8022e14fce74
add constructible set
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 13 May 2019 18:25:38 +0900 |
parents | 5ed16e2d8eb7 |
children | 2df90eb0896c |
rev | line source |
---|---|
3 | 1 module zf where |
2 | |
3 open import Level | |
4 | |
5 | |
6 record _∧_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where | |
7 field | |
8 proj1 : A | |
9 proj2 : B | |
10 | |
11 open _∧_ | |
12 | |
13 | |
14 data _∨_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where | |
15 case1 : A → A ∨ B | |
16 case2 : B → A ∨ B | |
17 | |
6 | 18 -- open import Relation.Binary.PropositionalEquality |
3 | 19 |
20 _⇔_ : {n : Level } → ( A B : Set n ) → Set n | |
21 _⇔_ A B = ( A → B ) ∧ ( B → A ) | |
22 | |
6 | 23 open import Data.Empty |
24 open import Relation.Nullary | |
25 | |
26 open import Relation.Binary | |
27 open import Relation.Binary.Core | |
28 | |
3 | 29 infixr 130 _∧_ |
30 infixr 140 _∨_ | |
31 infixr 150 _⇔_ | |
32 | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
33 record Func {n m : Level } (ZFSet : Set n) (_≈_ : Rel ZFSet m) : Set (n ⊔ suc m) where |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
34 field |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
35 rel : Rel ZFSet m |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
36 dom : ( y : ZFSet ) → ∀ { x : ZFSet } → rel x y |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
37 fun-eq : { x y z : ZFSet } → ( rel x y ∧ rel x z ) → y ≈ z |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
38 |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
39 open Func |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
40 |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
41 |
6 | 42 record IsZF {n m : Level } |
43 (ZFSet : Set n) | |
44 (_∋_ : ( A x : ZFSet ) → Set m) | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
45 (_≈_ : Rel ZFSet m) |
6 | 46 (∅ : ZFSet) |
47 (_×_ : ( A B : ZFSet ) → ZFSet) | |
48 (Union : ( A : ZFSet ) → ZFSet) | |
49 (Power : ( A : ZFSet ) → ZFSet) | |
10 | 50 (Select : ( ZFSet → Set m ) → ZFSet ) |
51 (Replace : ( ZFSet → ZFSet ) → ZFSet ) | |
6 | 52 (infinite : ZFSet) |
53 : Set (suc (n ⊔ m)) where | |
3 | 54 field |
6 | 55 isEquivalence : {A B : ZFSet} → IsEquivalence {n} {m} {ZFSet} _≈_ |
3 | 56 -- ∀ x ∀ y ∃ z(x ∈ z ∧ y ∈ z) |
6 | 57 pair : ( A B : ZFSet ) → ( (A × B) ∋ A ) ∧ ( (A × B) ∋ B ) |
3 | 58 -- ∀ X ∃ A∀ t(t ∈ A ⇔ ∃ x ∈ X(t ∈ x)) |
59 union→ : ( X x y : ZFSet ) → X ∋ x → x ∋ y → Union X ∋ y | |
60 union← : ( X x y : ZFSet ) → Union X ∋ y → X ∋ x → x ∋ y | |
61 _∈_ : ( A B : ZFSet ) → Set m | |
62 A ∈ B = B ∋ A | |
7 | 63 _⊆_ : ( A B : ZFSet ) → ∀{ x : ZFSet } → ∀{ A∋x : Set m } → Set m |
3 | 64 _⊆_ A B {x} {A∋x} = B ∋ x |
65 _∩_ : ( A B : ZFSet ) → ZFSet | |
10 | 66 A ∩ B = Select ( λ x → ( A ∋ x ) ∧ ( B ∋ x ) ) |
3 | 67 _∪_ : ( A B : ZFSet ) → ZFSet |
10 | 68 A ∪ B = Select ( λ x → ( A ∋ x ) ∨ ( B ∋ x ) ) |
3 | 69 infixr 200 _∈_ |
70 infixr 230 _∩_ _∪_ | |
71 infixr 220 _⊆_ | |
72 field | |
4 | 73 empty : ∀( x : ZFSet ) → ¬ ( ∅ ∋ x ) |
3 | 74 -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ t ⊆ X ) ) |
8 | 75 power→ : ∀( A t : ZFSet ) → Power A ∋ t → ∀ {x} {y} → _⊆_ t A {x} {y} |
76 power← : ∀( A t : ZFSet ) → ∀ {x} {y} → _⊆_ t A {x} {y} → Power A ∋ t | |
3 | 77 -- extentionality : ∀ z ( z ∈ x ⇔ z ∈ y ) ⇒ ∀ w ( x ∈ w ⇔ y ∈ w ) |
6 | 78 extentionality : ( A B z : ZFSet ) → (( A ∋ z ) ⇔ (B ∋ z) ) → A ≈ B |
3 | 79 -- regularity : ∀ x ( x ≠ ∅ → ∃ y ∈ x ( y ∩ x = ∅ ) ) |
10 | 80 minimul : ZFSet → ZFSet |
81 regularity : ∀( x : ZFSet ) → ¬ (x ≈ ∅) → ( minimul x ∈ x ∧ ( minimul x ∩ x ≈ ∅ ) ) | |
3 | 82 -- infinity : ∃ A ( ∅ ∈ A ∧ ∀ x ∈ A ( x ∪ { x } ∈ A ) ) |
83 infinity∅ : ∅ ∈ infinite | |
10 | 84 infinity : ∀( x : ZFSet ) → x ∈ infinite → ( x ∪ Select ( λ y → x ≈ y )) ∈ infinite |
85 selection : { ψ : ZFSet → Set m } → ∀ ( y : ZFSet ) → ( y ∈ Select ψ ) → ψ y | |
3 | 86 -- replacement : ∀ x ∀ y ∀ z ( ( ψ ( x , y ) ∧ ψ ( x , z ) ) → y = z ) → ∀ X ∃ A ∀ y ( y ∈ A ↔ ∃ x ∈ X ψ ( x , y ) ) |
10 | 87 replacement : {ψ : ZFSet → ZFSet} → ∀ ( x : ZFSet ) → ( ψ x ∈ Replace ψ ) |
3 | 88 |
6 | 89 record ZF {n m : Level } : Set (suc (n ⊔ m)) where |
90 infixr 210 _×_ | |
91 infixl 200 _∋_ | |
92 infixr 220 _≈_ | |
93 field | |
94 ZFSet : Set n | |
95 _∋_ : ( A x : ZFSet ) → Set m | |
96 _≈_ : ( A B : ZFSet ) → Set m | |
97 -- ZF Set constructor | |
98 ∅ : ZFSet | |
99 _×_ : ( A B : ZFSet ) → ZFSet | |
100 Union : ( A : ZFSet ) → ZFSet | |
101 Power : ( A : ZFSet ) → ZFSet | |
10 | 102 Select : ( ZFSet → Set m ) → ZFSet |
103 Replace : ( ZFSet → ZFSet ) → ZFSet | |
6 | 104 infinite : ZFSet |
10 | 105 isZF : IsZF ZFSet _∋_ _≈_ ∅ _×_ Union Power Select Replace infinite |
6 | 106 |
10 | 107 module zf-exapmle {n m : Level } ( zf : ZF {m} {n} ) where |
7 | 108 |
10 | 109 _≈_ = ZF._≈_ zf |
110 ZFSet = ZF.ZFSet zf | |
111 Select = ZF.Select zf | |
112 ∅ = ZF.∅ zf | |
113 _∩_ = ( IsZF._∩_ ) (ZF.isZF zf) | |
114 _∋_ = ZF._∋_ zf | |
115 replacement = IsZF.replacement ( ZF.isZF zf ) | |
116 selection = IsZF.selection ( ZF.isZF zf ) | |
117 minimul = IsZF.minimul ( ZF.isZF zf ) | |
118 regularity = IsZF.regularity ( ZF.isZF zf ) | |
7 | 119 |
10 | 120 russel : Select ( λ x → x ∋ x ) ≈ ∅ |
121 russel with Select ( λ x → x ∋ x ) | |
122 ... | s = {!!} | |
7 | 123 |
10 | 124 module constructible-set where |
7 | 125 |
10 | 126 data Nat : Set zero where |
127 Zero : Nat | |
128 Suc : Nat → Nat | |
129 | |
130 prev : Nat → Nat | |
131 prev (Suc n) = n | |
132 prev Zero = Zero | |
133 | |
134 open import Relation.Binary.PropositionalEquality | |
135 | |
136 data Transtive {n : Level } : ( lv : Nat) → Set n where | |
137 Φ : {lv : Nat} → Transtive {n} lv | |
138 T-suc : {lv : Nat} → Transtive {n} lv → Transtive lv | |
139 ℵ_ : (lv : Nat) → Transtive (Suc lv) | |
140 | |
141 data Constructible {n : Level } {lv : Nat} ( α : Transtive {n} lv ) : Set (suc n) where | |
142 fsub : ( ψ : Transtive {n} lv → Set n ) → Constructible α | |
143 xself : Transtive {n} lv → Constructible α | |
144 | |
145 record ConstructibleSet {n : Level } : Set (suc n) where | |
146 field | |
147 level : Nat | |
148 α : Transtive {n} level | |
149 constructible : Constructible α | |
150 | |
151 open ConstructibleSet | |
152 | |
153 data _c∋_ {n : Level } {lv lv' : Nat} {α : Transtive {n} lv } {α' : Transtive {n} lv' } : | |
154 Constructible {n} {lv} α → Constructible {n} {lv'} α' → Set n where | |
155 xself-fsub : (ta : Transtive {n} lv ) ( ψ : Transtive {n} lv' → Set n ) → (xself ta ) t∋ ( fsub ψ) | |
156 xself-xself : (ta : Transtive {n} lv ) (tx : Transtive {n} lv' ) → (xself ta ) t∋ ( xself tx) | |
157 fsub-fsub : ( ψ : Transtive {n} lv → Set n ) ( ψ₁ : Transtive {n} lv' → Set n ) →( fsub ψ ) t∋ ( fsub ψ₁) | |
158 fsub-xself : ( ψ : Transtive {n} lv → Set n ) (tx : Transtive {n} lv' ) → (fsub ψ ) t∋ ( xself tx) | |
7 | 159 |
10 | 160 _∋_ : {n m : Level} → (ConstructibleSet {n}) → (ConstructibleSet {n} ) → Set m |
161 _∋_ = {!!} | |
162 | |
163 | |
164 Transtive→ZF : {n m : Level } → ZF {suc n} {m} | |
165 Transtive→ZF {n} {m} = record { | |
166 ZFSet = ConstructibleSet | |
167 ; _∋_ = _∋_ | |
168 ; _≈_ = {!!} | |
169 ; ∅ = record { level = Zero ; α = Φ ; constructible = xself Φ } | |
170 ; _×_ = {!!} | |
171 ; Union = {!!} | |
172 ; Power = {!!} | |
173 ; Select = {!!} | |
174 ; Replace = {!!} | |
175 ; infinite = {!!} | |
176 ; isZF = {!!} | |
177 } where |