# HG changeset patch # User Shinji KONO # Date 1557539243 -32400 # Node ID e7990ff544bfa143a2e1b9783bf1051693052e87 # Parent 5c819f8377215cd23097512313cb8705a8754c08 reocrd ZF diff -r 5c819f837721 -r e7990ff544bf set-of-agda.agda --- a/set-of-agda.agda Thu May 09 00:59:19 2019 +0900 +++ b/set-of-agda.agda Sat May 11 10:47:23 2019 +0900 @@ -19,12 +19,12 @@ -- case1 : A → A ∨ B -- case2 : B → A ∨ B -data ZFSet {n : Level} : Set (suc n) where +data ZFSet {n : Level} : Set (suc (suc n)) where elem : { A : Set n } ( a : A ) → ZFSet ∅ : ZFSet {n} pair : {A B : Set n} (a : A ) (b : B ) → ZFSet - union : (A : ZFSet {n}) → ZFSet - repl : { A B : Set n} → ( ψ : A → B ) → ZFSet + union : (A : Set (suc n) ) → ZFSet + -- repl : ( ψ : ZFSet {n} → Set zero ) → ZFSet infinite : ZFSet power : (A : ZFSet {n}) → ZFSet @@ -36,11 +36,11 @@ ∈-elm : {A : Set n } {a : A} → a ∈ (elem a) ∈-pair-1 : {A : Set n } {B : Set n} {b : B} {a : A} → a ∈ (pair a b) ∈-pair-2 : {A : Set n } {B : Set n} {b : A} {a : B} → b ∈ (pair a b) --- ∈-union : {Z : ZFSet {n}} {A : Set n} → { b : ZFSet {n} } → {!!} → a ∈ (union Z) - ∈-repl : {A : Set n } { B : Set n} → { ψ : B → A } → { b : B } → ψ b ∈ (repl ψ) +-- ∈-union : {Z : Set (suc n)} {A : Z } → {a : {!!} } → a ∈ (union Z) +-- ∈-repl : {A : Set n } { B : Set n} → { ψ : B → A } → { b : B } → ψ b ∈ {!!} -- (repl {!!}) -- ∈-infinite-1 : ∅ ∈ infinite -- ∈-infinite : {A : Set n} {a : A} → _∈_ infinite {A} a - ∈-power : {A : Set n} {Z : ZFSet {n}} {a : A → B } → a ∈ (power Z) + ∈-power : {A B : Set n} {Z : ZFSet {n}} {a : A → B } → a ∈ (power Z) -- _∈_ : {n : Level} { A : ZFSet {n} } → {B : Set n} → (a : B ) → Set n → Bool -- _∈_ {_} {A} a _ = A ∋ a diff -r 5c819f837721 -r e7990ff544bf zf.agda --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zf.agda Sat May 11 10:47:23 2019 +0900 @@ -0,0 +1,78 @@ +module zf where + +open import Level + + +record _∧_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where + field + proj1 : A + proj2 : B + +open _∧_ + + +data _∨_ {n m : Level} (A : Set n) ( B : Set m ) : Set (n ⊔ m) where + case1 : A → A ∨ B + case2 : B → A ∨ B + +open import Relation.Binary.PropositionalEquality + +_⇔_ : {n : Level } → ( A B : Set n ) → Set n +_⇔_ A B = ( A → B ) ∧ ( B → A ) + +infixr 130 _∧_ +infixr 140 _∨_ +infixr 150 _⇔_ + +open import Data.Empty +open import Relation.Nullary + +record ZF (n m : Level ) : Set (suc (n ⊔ m)) where + coinductive + field + ZFSet : Set n + _∋_ : ( A x : ZFSet ) → Set m + _≈_ : ( A B : ZFSet ) → Set m + -- ZF Set constructor + ∅ : ZFSet + _×_ : ( A B : ZFSet ) → ZFSet + Union : ( A : ZFSet ) → ZFSet + Power : ( A : ZFSet ) → ZFSet + Restrict : ( ZFSet → Set m ) → ZFSet + infixl 200 _∋_ + infixr 210 _×_ + infixr 220 _≈_ + field + -- ∀ x ∀ y ∃ z(x ∈ z ∧ y ∈ z) + pair : ( A B : ZFSet ) → A × B ∋ A ∧ A × B ∋ B + -- ∀ X ∃ A∀ t(t ∈ A ⇔ ∃ x ∈ X(t ∈ x)) + union→ : ( X x y : ZFSet ) → X ∋ x → x ∋ y → Union X ∋ y + union← : ( X x y : ZFSet ) → Union X ∋ y → X ∋ x → x ∋ y + _∈_ : ( A B : ZFSet ) → Set m + A ∈ B = B ∋ A + _⊆_ : ( A B : ZFSet ) → { x : ZFSet } → { A∋x : Set m } → Set m + _⊆_ A B {x} {A∋x} = B ∋ x + _∩_ : ( A B : ZFSet ) → ZFSet + A ∩ B = Restrict ( λ x → ( A ∋ x ) ∧ ( B ∋ x ) ) + _∪_ : ( A B : ZFSet ) → ZFSet + A ∪ B = Restrict ( λ x → ( A ∋ x ) ∨ ( B ∋ x ) ) + infixr 200 _∈_ + infixr 230 _∩_ _∪_ + infixr 220 _⊆_ + field + empty : ( x : ZFSet ) → ¬ ( ∅ ∋ x ) + -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ t ⊆ X ) ) + power→ : ( A X t : ZFSet ) → A ∋ t → ∀ {x} {y} → _⊆_ t X {x} {y} + power← : ( A X t : ZFSet ) → ∀ {x} {y} → _⊆_ t X {x} {y} → A ∋ t + -- extentionality : ∀ z ( z ∈ x ⇔ z ∈ y ) ⇒ ∀ w ( x ∈ w ⇔ y ∈ w ) + extentionality : ( A B z : ZFSet ) → A ∋ z ⇔ B ∋ z → A ≈ B + -- regularity : ∀ x ( x ≠ ∅ → ∃ y ∈ x ( y ∩ x = ∅ ) ) + smaller : ZFSet → ZFSet + regularity : ( x : ZFSet ) → ¬ (x ≈ ∅) → smaller x ∩ x ≈ ∅ + -- infinity : ∃ A ( ∅ ∈ A ∧ ∀ x ∈ A ( x ∪ { x } ∈ A ) ) + infinite : ZFSet + infinity∅ : ∅ ∈ infinite + infinity : ( x : ZFSet ) → x ∈ infinite → ( x ∪ Restrict ( λ y → x ≈ y )) ∈ infinite + -- replacement : ∀ x ∀ y ∀ z ( ( ψ ( x , y ) ∧ ψ ( x , z ) ) → y = z ) → ∀ X ∃ A ∀ y ( y ∈ A ↔ ∃ x ∈ X ψ ( x , y ) ) + replacement : ( ψ : ZFSet → Set m ) → ( y : ZFSet ) → y ∈ Restrict ψ → ψ y +