Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate zf.agda @ 23:7293a151d949
Sup
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 18 May 2019 08:29:08 +0900 |
parents | 627a79e61116 |
children | fce60b99dc55 |
rev | line source |
---|---|
3 | 1 module zf where |
2 | |
3 open import Level | |
4 | |
23 | 5 data Bool : Set where |
6 true : Bool | |
7 false : Bool | |
3 | 8 |
9 record _∧_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where | |
10 field | |
11 proj1 : A | |
12 proj2 : B | |
13 | |
14 open _∧_ | |
15 | |
16 | |
17 data _∨_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where | |
18 case1 : A → A ∨ B | |
19 case2 : B → A ∨ B | |
20 | |
6 | 21 -- open import Relation.Binary.PropositionalEquality |
3 | 22 |
23 _⇔_ : {n : Level } → ( A B : Set n ) → Set n | |
24 _⇔_ A B = ( A → B ) ∧ ( B → A ) | |
25 | |
6 | 26 open import Data.Empty |
27 open import Relation.Nullary | |
28 | |
29 open import Relation.Binary | |
30 open import Relation.Binary.Core | |
31 | |
3 | 32 infixr 130 _∧_ |
33 infixr 140 _∨_ | |
34 infixr 150 _⇔_ | |
35 | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
36 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
|
37 field |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
38 rel : Rel ZFSet m |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
39 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
|
40 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
|
41 |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
42 open Func |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
43 |
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
44 |
6 | 45 record IsZF {n m : Level } |
46 (ZFSet : Set n) | |
47 (_∋_ : ( 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
|
48 (_≈_ : Rel ZFSet m) |
6 | 49 (∅ : ZFSet) |
18 | 50 (_,_ : ( A B : ZFSet ) → ZFSet) |
6 | 51 (Union : ( A : ZFSet ) → ZFSet) |
52 (Power : ( A : ZFSet ) → ZFSet) | |
18 | 53 (Select : ZFSet → ( ZFSet → Set m ) → ZFSet ) |
54 (Replace : ZFSet → ( ZFSet → ZFSet ) → ZFSet ) | |
6 | 55 (infinite : ZFSet) |
56 : Set (suc (n ⊔ m)) where | |
3 | 57 field |
6 | 58 isEquivalence : {A B : ZFSet} → IsEquivalence {n} {m} {ZFSet} _≈_ |
3 | 59 -- ∀ x ∀ y ∃ z(x ∈ z ∧ y ∈ z) |
18 | 60 pair : ( A B : ZFSet ) → ( (A , B) ∋ A ) ∧ ( (A , B) ∋ B ) |
3 | 61 -- ∀ X ∃ A∀ t(t ∈ A ⇔ ∃ x ∈ X(t ∈ x)) |
62 union→ : ( X x y : ZFSet ) → X ∋ x → x ∋ y → Union X ∋ y | |
63 union← : ( X x y : ZFSet ) → Union X ∋ y → X ∋ x → x ∋ y | |
64 _∈_ : ( A B : ZFSet ) → Set m | |
65 A ∈ B = B ∋ A | |
23 | 66 _⊆_ : ( A B : ZFSet ) → ∀{ x : ZFSet } → Set m |
67 _⊆_ A B {x} = A ∋ x → B ∋ x | |
3 | 68 _∩_ : ( A B : ZFSet ) → ZFSet |
18 | 69 A ∩ B = Select (A , B) ( λ x → ( A ∋ x ) ∧ ( B ∋ x ) ) |
3 | 70 _∪_ : ( A B : ZFSet ) → ZFSet |
18 | 71 A ∪ B = Select (A , B) ( λ x → ( A ∋ x ) ∨ ( B ∋ x ) ) |
3 | 72 infixr 200 _∈_ |
73 infixr 230 _∩_ _∪_ | |
74 infixr 220 _⊆_ | |
75 field | |
4 | 76 empty : ∀( x : ZFSet ) → ¬ ( ∅ ∋ x ) |
3 | 77 -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ t ⊆ X ) ) |
23 | 78 power→ : ∀( A t : ZFSet ) → Power A ∋ t → ∀ {x} → _⊆_ t A {x} |
79 power← : ∀( A t : ZFSet ) → ∀ {x} → _⊆_ t A {x} → Power A ∋ t | |
3 | 80 -- extentionality : ∀ z ( z ∈ x ⇔ z ∈ y ) ⇒ ∀ w ( x ∈ w ⇔ y ∈ w ) |
6 | 81 extentionality : ( A B z : ZFSet ) → (( A ∋ z ) ⇔ (B ∋ z) ) → A ≈ B |
3 | 82 -- regularity : ∀ x ( x ≠ ∅ → ∃ y ∈ x ( y ∩ x = ∅ ) ) |
10 | 83 minimul : ZFSet → ZFSet |
84 regularity : ∀( x : ZFSet ) → ¬ (x ≈ ∅) → ( minimul x ∈ x ∧ ( minimul x ∩ x ≈ ∅ ) ) | |
3 | 85 -- infinity : ∃ A ( ∅ ∈ A ∧ ∀ x ∈ A ( x ∪ { x } ∈ A ) ) |
86 infinity∅ : ∅ ∈ infinite | |
18 | 87 infinity : ∀( X x : ZFSet ) → x ∈ infinite → ( x ∪ Select X ( λ y → x ≈ y )) ∈ infinite |
88 selection : { ψ : ZFSet → Set m } → ∀ ( X y : ZFSet ) → ( y ∈ Select X ψ ) → ψ y | |
3 | 89 -- replacement : ∀ x ∀ y ∀ z ( ( ψ ( x , y ) ∧ ψ ( x , z ) ) → y = z ) → ∀ X ∃ A ∀ y ( y ∈ A ↔ ∃ x ∈ X ψ ( x , y ) ) |
18 | 90 replacement : {ψ : ZFSet → ZFSet} → ∀ ( X x : ZFSet ) → ( ψ x ∈ Replace X ψ ) |
3 | 91 |
6 | 92 record ZF {n m : Level } : Set (suc (n ⊔ m)) where |
18 | 93 infixr 210 _,_ |
6 | 94 infixl 200 _∋_ |
95 infixr 220 _≈_ | |
96 field | |
97 ZFSet : Set n | |
98 _∋_ : ( A x : ZFSet ) → Set m | |
99 _≈_ : ( A B : ZFSet ) → Set m | |
100 -- ZF Set constructor | |
101 ∅ : ZFSet | |
18 | 102 _,_ : ( A B : ZFSet ) → ZFSet |
6 | 103 Union : ( A : ZFSet ) → ZFSet |
104 Power : ( A : ZFSet ) → ZFSet | |
18 | 105 Select : ZFSet → ( ZFSet → Set m ) → ZFSet |
106 Replace : ZFSet → ( ZFSet → ZFSet ) → ZFSet | |
6 | 107 infinite : ZFSet |
18 | 108 isZF : IsZF ZFSet _∋_ _≈_ ∅ _,_ Union Power Select Replace infinite |
6 | 109 |
10 | 110 module zf-exapmle {n m : Level } ( zf : ZF {m} {n} ) where |
7 | 111 |
10 | 112 _≈_ = ZF._≈_ zf |
113 ZFSet = ZF.ZFSet zf | |
114 Select = ZF.Select zf | |
115 ∅ = ZF.∅ zf | |
116 _∩_ = ( IsZF._∩_ ) (ZF.isZF zf) | |
117 _∋_ = ZF._∋_ zf | |
118 replacement = IsZF.replacement ( ZF.isZF zf ) | |
119 selection = IsZF.selection ( ZF.isZF zf ) | |
120 minimul = IsZF.minimul ( ZF.isZF zf ) | |
121 regularity = IsZF.regularity ( ZF.isZF zf ) | |
7 | 122 |
11 | 123 -- russel : Select ( λ x → x ∋ x ) ≈ ∅ |
124 -- russel with Select ( λ x → x ∋ x ) | |
125 -- ... | s = {!!} | |
7 | 126 |