annotate zf.agda @ 8:cb014a103467

fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 12 May 2019 11:08:17 +0900
parents 813f1b3b000b
children 5ed16e2d8eb7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 module zf where
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 open import Level
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 record _∧_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 field
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 proj1 : A
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 proj2 : B
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 open _∧_
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 data _∨_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 case1 : A → A ∨ B
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 case2 : B → A ∨ B
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
18 -- open import Relation.Binary.PropositionalEquality
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 _⇔_ : {n : Level } → ( A B : Set n ) → Set n
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 _⇔_ A B = ( A → B ) ∧ ( B → A )
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
23 open import Data.Empty
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
24 open import Relation.Nullary
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
25
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
26 open import Relation.Binary
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
27 open import Relation.Binary.Core
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
28
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 infixr 130 _∧_
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 infixr 140 _∨_
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 infixr 150 _⇔_
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
33 record IsZF {n m : Level }
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
34 (ZFSet : Set n)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
35 (_∋_ : ( A x : ZFSet ) → Set m)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
36 (_≈_ : ( A B : ZFSet ) → Set m)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
37 (∅ : ZFSet)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
38 (_×_ : ( A B : ZFSet ) → ZFSet)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
39 (Union : ( A : ZFSet ) → ZFSet)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
40 (Power : ( A : ZFSet ) → ZFSet)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
41 (Restrict : ( ZFSet → Set m ) → ZFSet)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
42 (infinite : ZFSet)
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
43 : Set (suc (n ⊔ m)) where
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 field
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
45 isEquivalence : {A B : ZFSet} → IsEquivalence {n} {m} {ZFSet} _≈_
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 -- ∀ x ∀ y ∃ z(x ∈ z ∧ y ∈ z)
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
47 pair : ( A B : ZFSet ) → ( (A × B) ∋ A ) ∧ ( (A × B) ∋ B )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 -- ∀ X ∃ A∀ t(t ∈ A ⇔ ∃ x ∈ X(t ∈ x))
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 union→ : ( X x y : ZFSet ) → X ∋ x → x ∋ y → Union X ∋ y
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 union← : ( X x y : ZFSet ) → Union X ∋ y → X ∋ x → x ∋ y
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 _∈_ : ( A B : ZFSet ) → Set m
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 A ∈ B = B ∋ A
7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
53 _⊆_ : ( A B : ZFSet ) → ∀{ x : ZFSet } → ∀{ A∋x : Set m } → Set m
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 _⊆_ A B {x} {A∋x} = B ∋ x
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 _∩_ : ( A B : ZFSet ) → ZFSet
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 A ∩ B = Restrict ( λ x → ( A ∋ x ) ∧ ( B ∋ x ) )
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 _∪_ : ( A B : ZFSet ) → ZFSet
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 A ∪ B = Restrict ( λ x → ( A ∋ x ) ∨ ( B ∋ x ) )
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 infixr 200 _∈_
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 infixr 230 _∩_ _∪_
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 infixr 220 _⊆_
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 field
4
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
63 empty : ∀( x : ZFSet ) → ¬ ( ∅ ∋ x )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ t ⊆ X ) )
8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
65 power→ : ∀( A t : ZFSet ) → Power A ∋ t → ∀ {x} {y} → _⊆_ t A {x} {y}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
66 power← : ∀( A t : ZFSet ) → ∀ {x} {y} → _⊆_ t A {x} {y} → Power A ∋ t
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 -- extentionality : ∀ z ( z ∈ x ⇔ z ∈ y ) ⇒ ∀ w ( x ∈ w ⇔ y ∈ w )
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
68 extentionality : ( A B z : ZFSet ) → (( A ∋ z ) ⇔ (B ∋ z) ) → A ≈ B
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 -- regularity : ∀ x ( x ≠ ∅ → ∃ y ∈ x ( y ∩ x = ∅ ) )
7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
70 smaller : ZFSet → ZFSet
8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
71 regularity : ∀( x : ZFSet ) → ¬ (x ≈ ∅) → ( smaller x ∈ x ∧ ( smaller x ∩ x ≈ ∅ ) )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 -- infinity : ∃ A ( ∅ ∈ A ∧ ∀ x ∈ A ( x ∪ { x } ∈ A ) )
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 infinity∅ : ∅ ∈ infinite
8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
74 infinity : ∀( x : ZFSet ) → x ∈ infinite → ( x ∪ Restrict ( λ y → x ≈ y )) ∈ infinite
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 -- replacement : ∀ x ∀ y ∀ z ( ( ψ ( x , y ) ∧ ψ ( x , z ) ) → y = z ) → ∀ X ∃ A ∀ y ( y ∈ A ↔ ∃ x ∈ X ψ ( x , y ) )
8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
76 -- this form looks like specification
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
77 replacement : ( ψ : ZFSet → Set m ) → ( x : ZFSet ) → x ∈ Restrict ψ → ψ x
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
79 record ZF {n m : Level } : Set (suc (n ⊔ m)) where
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
80 infixr 210 _×_
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
81 infixl 200 _∋_
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
82 infixr 220 _≈_
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
83 field
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
84 ZFSet : Set n
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
85 _∋_ : ( A x : ZFSet ) → Set m
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
86 _≈_ : ( A B : ZFSet ) → Set m
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
87 -- ZF Set constructor
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
88 ∅ : ZFSet
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
89 _×_ : ( A B : ZFSet ) → ZFSet
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
90 Union : ( A : ZFSet ) → ZFSet
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
91 Power : ( A : ZFSet ) → ZFSet
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
92 Restrict : ( ZFSet → Set m ) → ZFSet
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
93 infinite : ZFSet
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
94 isZF : IsZF ZFSet _∋_ _≈_ ∅ _×_ Union Power Restrict infinite
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
95
7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
96 module reguraliry-m {n m : Level } ( zf : ZF {m} {n} ) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
97
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
98 open import Relation.Nullary
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
99 open import Data.Empty
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
100 open import Relation.Binary.PropositionalEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
101
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
102 _≈_ = ZF._≈_ zf
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
103 ZFSet = ZF.ZFSet
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
104 Restrict = ZF.Restrict zf
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
105 ∅ = ZF.∅ zf
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
106 _∩_ = ( IsZF._∩_ ) (ZF.isZF zf)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
107 _∋_ = ZF._∋_ zf
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
108 replacement = IsZF.replacement ( ZF.isZF zf )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
109
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
110 russel : ( x : ZFSet zf ) → x ≈ Restrict ( λ x → ¬ ( x ∋ x ) ) → ⊥
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
111 russel x eq with x ∋ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
112 ... | x∋x with replacement ( λ x → ¬ ( x ∋ x )) x {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
113 ... | r1 = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
114
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
115
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
116
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
117
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
118 data Nat : Set zero where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
119 Zero : Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
120 Suc : Nat → Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
121
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
122 prev : Nat → Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
123 prev (Suc n) = n
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
124 prev Zero = Zero
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
125
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
126 open import Relation.Binary.PropositionalEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
127
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
128
8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
129 data Transtive {n : Level } : ( lv : Nat) → Set n where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
130 Φ : {lv : Nat} → lv ≡ Zero → Transtive lv
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
131 T-suc : {lv : Nat} → lv ≡ Zero → Transtive {n} lv → Transtive lv
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
132 ℵ : {lv : Nat} → Transtive {n} lv → Transtive (Suc lv)
7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
133
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
134
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
135
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
136