Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate zf.agda @ 210:2c7d45734e3b
axiom of choice from exclusive middle done
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 01 Aug 2019 12:23:07 +0900 |
parents | e59e682ad120 |
children | 22d435172d1a |
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 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 | |
116 | 18 _⇔_ : {n m : Level } → ( A : Set n ) ( B : Set m ) → Set (n ⊔ m) |
77 | 19 _⇔_ A B = ( A → B ) ∧ ( B → A ) |
3 | 20 |
123 | 21 |
6 | 22 open import Relation.Nullary |
23 open import Relation.Binary | |
188
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
24 open import Data.Empty |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
25 |
6 | 26 |
138 | 27 contra-position : {n m : Level } {A : Set n} {B : Set m} → (A → B) → ¬ B → ¬ A |
28 contra-position {n} {m} {A} {B} f ¬b a = ¬b ( f a ) | |
103 | 29 |
166 | 30 double-neg : {n : Level } {A : Set n} → A → ¬ ¬ A |
31 double-neg A notnot = notnot A | |
32 | |
188
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
33 double-neg2 : {n : Level } {A : Set n} → ¬ ¬ ¬ A → ¬ A |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
34 double-neg2 notnot A = notnot ( double-neg A ) |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
35 |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
36 de-morgan : {n : Level } {A B : Set n} → A ∧ B → ¬ ( (¬ A ) ∨ (¬ B ) ) |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
37 de-morgan {n} {A} {B} and (case1 ¬A) = ⊥-elim ( ¬A ( _∧_.proj1 and )) |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
38 de-morgan {n} {A} {B} and (case2 ¬B) = ⊥-elim ( ¬B ( _∧_.proj2 and )) |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
39 |
208 | 40 dont-or : {n m : Level} {A : Set n} { B : Set m } → A ∨ B → ¬ A → B |
41 dont-or {A} {B} (case1 a) ¬A = ⊥-elim ( ¬A a ) | |
42 dont-or {A} {B} (case2 b) ¬A = b | |
43 | |
209 | 44 dont-orb : {n m : Level} {A : Set n} { B : Set m } → A ∨ B → ¬ B → A |
45 dont-orb {A} {B} (case2 b) ¬B = ⊥-elim ( ¬B b ) | |
46 dont-orb {A} {B} (case1 a) ¬B = a | |
47 | |
188
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
48 -- mid-ex-neg : {n : Level } {A : Set n} → ( ¬ ¬ A ) ∨ (¬ A) |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
49 -- mid-ex-neg {n} {A} = {!!} |
1f2c8b094908
axiom of choice → p ∨ ¬ p
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
186
diff
changeset
|
50 |
3 | 51 infixr 130 _∧_ |
52 infixr 140 _∨_ | |
53 infixr 150 _⇔_ | |
54 | |
6 | 55 record IsZF {n m : Level } |
56 (ZFSet : Set n) | |
57 (_∋_ : ( 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
|
58 (_≈_ : Rel ZFSet m) |
6 | 59 (∅ : ZFSet) |
18 | 60 (_,_ : ( A B : ZFSet ) → ZFSet) |
6 | 61 (Union : ( A : ZFSet ) → ZFSet) |
62 (Power : ( A : ZFSet ) → ZFSet) | |
115 | 63 (Select : (X : ZFSet ) → ( ψ : (x : ZFSet ) → Set m ) → ZFSet ) |
18 | 64 (Replace : ZFSet → ( ZFSet → ZFSet ) → ZFSet ) |
6 | 65 (infinite : ZFSet) |
66 : Set (suc (n ⊔ m)) where | |
3 | 67 field |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
23
diff
changeset
|
68 isEquivalence : IsEquivalence {n} {m} {ZFSet} _≈_ |
3 | 69 -- ∀ x ∀ y ∃ z(x ∈ z ∧ y ∈ z) |
18 | 70 pair : ( A B : ZFSet ) → ( (A , B) ∋ A ) ∧ ( (A , B) ∋ B ) |
69 | 71 -- ∀ x ∃ y ∀ z (z ∈ y ⇔ ∃ u ∈ x ∧ (z ∈ u)) |
73 | 72 union→ : ( X z u : ZFSet ) → ( X ∋ u ) ∧ (u ∋ z ) → Union X ∋ z |
159 | 73 union← : ( X z : ZFSet ) → (X∋z : Union X ∋ z ) → ¬ ( (u : ZFSet ) → ¬ ((X ∋ u) ∧ (u ∋ z ))) |
3 | 74 _∈_ : ( A B : ZFSet ) → Set m |
75 A ∈ B = B ∋ A | |
23 | 76 _⊆_ : ( A B : ZFSet ) → ∀{ x : ZFSet } → Set m |
77 _⊆_ A B {x} = A ∋ x → B ∋ x | |
3 | 78 _∩_ : ( A B : ZFSet ) → ZFSet |
115 | 79 A ∩ B = Select A ( λ x → ( A ∋ x ) ∧ ( B ∋ x ) ) |
3 | 80 _∪_ : ( A B : ZFSet ) → ZFSet |
103 | 81 A ∪ B = Union (A , B) -- Select A ( λ x → ( A ∋ x ) ∨ ( B ∋ x ) ) is easer |
78
9a7a64b2388c
infinite and replacement begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
77
diff
changeset
|
82 {_} : ZFSet → ZFSet |
9a7a64b2388c
infinite and replacement begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
77
diff
changeset
|
83 { x } = ( x , x ) |
3 | 84 infixr 200 _∈_ |
85 infixr 230 _∩_ _∪_ | |
86 infixr 220 _⊆_ | |
87 field | |
4 | 88 empty : ∀( x : ZFSet ) → ¬ ( ∅ ∋ x ) |
3 | 89 -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ t ⊆ X ) ) |
166 | 90 power→ : ∀( A t : ZFSet ) → Power A ∋ t → ∀ {x} → t ∋ x → ¬ ¬ ( A ∋ x ) -- _⊆_ t A {x} |
77 | 91 power← : ∀( A t : ZFSet ) → ( ∀ {x} → _⊆_ t A {x}) → Power A ∋ t |
65
164ad5a703d8
¬∅=→∅∈ : {n : Level} → { x : OD {suc n} } → ¬ ( x == od∅ {suc n} ) → x ∋ od∅ {suc n}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
54
diff
changeset
|
92 -- extensionality : ∀ z ( z ∈ x ⇔ z ∈ y ) ⇒ ∀ w ( x ∈ w ⇔ y ∈ w ) |
186 | 93 extensionality : { A B w : ZFSet } → ( (z : ZFSet) → ( A ∋ z ) ⇔ (B ∋ z) ) → ( A ∈ w ⇔ B ∈ w ) |
183 | 94 -- This form of regurality forces choice function |
3 | 95 -- regularity : ∀ x ( x ≠ ∅ → ∃ y ∈ x ( y ∩ x = ∅ ) ) |
183 | 96 -- minimul : (x : ZFSet ) → ¬ (x ≈ ∅) → ZFSet |
97 -- regularity : ∀( x : ZFSet ) → (not : ¬ (x ≈ ∅)) → ( minimul x not ∈ x ∧ ( minimul x not ∩ x ≈ ∅ ) ) | |
98 -- another form of regularity | |
99 ε-induction : { ψ : ZFSet → Set m} | |
100 → ( {x : ZFSet } → ({ y : ZFSet } → x ∋ y → ψ y ) → ψ x ) | |
101 → (x : ZFSet ) → ψ x | |
3 | 102 -- infinity : ∃ A ( ∅ ∈ A ∧ ∀ x ∈ A ( x ∪ { x } ∈ A ) ) |
103 infinity∅ : ∅ ∈ infinite | |
160 | 104 infinity : ∀( x : ZFSet ) → x ∈ infinite → ( x ∪ { x }) ∈ infinite |
140
312e27aa3cb5
remove otrans again. start over
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
138
diff
changeset
|
105 selection : { ψ : ZFSet → Set m } → ∀ { X y : ZFSet } → ( ( y ∈ X ) ∧ ψ y ) ⇔ (y ∈ Select X ψ ) |
3 | 106 -- replacement : ∀ x ∀ y ∀ z ( ( ψ ( x , y ) ∧ ψ ( x , z ) ) → y = z ) → ∀ X ∃ A ∀ y ( y ∈ A ↔ ∃ x ∈ X ψ ( x , y ) ) |
130 | 107 replacement← : {ψ : ZFSet → ZFSet} → ∀ ( X x : ZFSet ) → x ∈ X → ψ x ∈ Replace X ψ |
138 | 108 replacement→ : {ψ : ZFSet → ZFSet} → ∀ ( X x : ZFSet ) → ( lt : x ∈ Replace X ψ ) → ¬ ( ∀ (y : ZFSet) → ¬ ( x ≈ ψ y ) ) |
183 | 109 -- ∀ X [ ∅ ∉ X → (∃ f : X → ⋃ X ) → ∀ A ∈ X ( f ( A ) ∈ A ) ] |
110 choice-func : (X : ZFSet ) → {x : ZFSet } → ¬ ( x ≈ ∅ ) → ( X ∋ x ) → ZFSet | |
111 choice : (X : ZFSet ) → {A : ZFSet } → ( X∋A : X ∋ A ) → (not : ¬ ( A ≈ ∅ )) → A ∋ choice-func X not X∋A | |
3 | 112 |
6 | 113 record ZF {n m : Level } : Set (suc (n ⊔ m)) where |
18 | 114 infixr 210 _,_ |
6 | 115 infixl 200 _∋_ |
116 infixr 220 _≈_ | |
117 field | |
118 ZFSet : Set n | |
119 _∋_ : ( A x : ZFSet ) → Set m | |
120 _≈_ : ( A B : ZFSet ) → Set m | |
121 -- ZF Set constructor | |
122 ∅ : ZFSet | |
18 | 123 _,_ : ( A B : ZFSet ) → ZFSet |
6 | 124 Union : ( A : ZFSet ) → ZFSet |
125 Power : ( A : ZFSet ) → ZFSet | |
115 | 126 Select : (X : ZFSet ) → ( ψ : (x : ZFSet ) → Set m ) → ZFSet |
18 | 127 Replace : ZFSet → ( ZFSet → ZFSet ) → ZFSet |
6 | 128 infinite : ZFSet |
18 | 129 isZF : IsZF ZFSet _∋_ _≈_ ∅ _,_ Union Power Select Replace infinite |
6 | 130 |