module univTypes.Model.ZF where open import Data.Empty using (⊥) open import Data.Product using (Σ; _×_) open import Data.Sum using (_⊎_) open import Relation.Binary.PropositionalEquality using (_≡_) open import Relation.Nullary using (¬_) open import Data.Nat using (ℕ; suc) open import univTypes.Model.SetTheory using (Stratum; fin; ω+) -- Zermelo–Fraenkel set theory with a chain of Grothendieck universes, as -- an interface, following con-leche's `SetTheory` class: the ZF axioms -- (extensionality, pairing, union, power set, replacement as a scheme over -- meta-level functions, regularity, infinity) and universes that are -- transitive and closed under the set-forming operations. As in con-leche, -- the empty set is not an axiom: it follows from regularity, applied to a -- nonempty transitive universe (Model/FromZF). -- -- Two differences to con-leche: -- * the universes are indexed by our strata (order type ω·2: Set k and -- Setω m), not by the natural numbers, since Setω 0 must contain every -- Set k. As in con-leche, each universe is a member of the next -- (univ-fin-suc, univ-ω-suc); Setω 0 has no predecessor, so one more -- axiom (univ-lim) places every Set k in it; -- * the meta-logic is constructive Agda, so classical logic is a field -- (em) — an assumption of the theorem, like the set theory itself, not -- a postulate. Con-leche gets it from Lean's classical logic. -- -- The intended model: V the sets of ZFC with ω·2 inaccessible cardinals -- κ₀ < κ₁ < … < κ_ω < …, univ (fin k) = V_{κ_k}, univ (ω+ m) = V_{κ_{ω+m}}. -- Model/FromZF derives the operations of Model/SetTheory from these axioms. record ZF : Set₁ where infix 4 _∈_ field V : Set _∈_ : V → V → Set -- Classical logic. em : (P : Set) → P ⊎ ¬ P -- Extensionality: sets with the same members are equal. ext : ∀ {x y} → (∀ z → z ∈ x → z ∈ y) → (∀ z → z ∈ y → z ∈ x) → x ≡ y -- Pairing: the unordered pair. upair : V → V → V upair-in : ∀ {z a b} → z ∈ upair a b → z ≡ a ⊎ z ≡ b upair-l : ∀ {a b} → a ∈ upair a b upair-r : ∀ {a b} → b ∈ upair a b -- Union: the union of the members. ⋃ : V → V ⋃-in : ∀ {z x} → z ∈ ⋃ x → Σ V λ y → y ∈ x × z ∈ y ⋃-intro : ∀ {z x y} → y ∈ x → z ∈ y → z ∈ ⋃ x -- Power set: the members are the subsets. 𝒫 : V → V 𝒫-in : ∀ {z x} → z ∈ 𝒫 x → ∀ w → w ∈ z → w ∈ x 𝒫-intro : ∀ {z x} → (∀ w → w ∈ z → w ∈ x) → z ∈ 𝒫 x -- Replacement, as a scheme over meta-level functions: the image of a set. image : (V → V) → V → V image-in : ∀ {f a z} → z ∈ image f a → Σ V λ w → w ∈ a × z ≡ f w image-intro : ∀ {f a w} → w ∈ a → f w ∈ image f a -- Regularity: every nonempty set has an ∈-minimal member. regularity : ∀ x → Σ V (λ y → y ∈ x) → Σ V λ y → y ∈ x × (∀ z → z ∈ y → z ∈ x → ⊥) -- Infinity: ω is the least set containing the empty set and closed -- under x ↦ x ∪ {x}. (Stated for any empty set e, since there is no -- empty-set constant; by extensionality there is only one.) ω : V ω-zero : ∀ {e} → (∀ z → z ∈ e → ⊥) → e ∈ ω ω-suc : ∀ {x} → x ∈ ω → ⋃ (upair x (upair x x)) ∈ ω ω-ind : (P : V → Set) → (∀ e → (∀ z → z ∈ e → ⊥) → P e) → (∀ x → x ∈ ω → P x → P (⋃ (upair x (upair x x)))) → ∀ x → x ∈ ω → P x -- Grothendieck universes: transitive, closed under the set-forming -- operations (replacement over its members), and each a member of the -- next; the first contains ω (so all do). univ : Stratum → V univ-trans : ∀ β {x y} → x ∈ univ β → y ∈ x → y ∈ univ β univ-upair : ∀ β {a b} → a ∈ univ β → b ∈ univ β → upair a b ∈ univ β univ-⋃ : ∀ β {x} → x ∈ univ β → ⋃ x ∈ univ β univ-𝒫 : ∀ β {x} → x ∈ univ β → 𝒫 x ∈ univ β univ-image : ∀ β {f x} → x ∈ univ β → (∀ w → w ∈ x → f w ∈ univ β) → image f x ∈ univ β univ-ω : ω ∈ univ (fin 0) univ-fin-suc : ∀ k → univ (fin k) ∈ univ (fin (suc k)) univ-ω-suc : ∀ m → univ (ω+ m) ∈ univ (ω+ (suc m)) univ-lim : ∀ k → univ (fin k) ∈ univ (ω+ 0)