module univTypes.Model.Grothendieck 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 (¬_) -- ZFC with Grothendieck's universe axiom (M. Artin, A. Grothendieck, -- J.-L. Verdier, SGA 4, Exposé I, appendix by N. Bourbaki, 1972): every -- set is a member of a universe, where a (Grothendieck) universe U is -- (i) transitive: x ∈ U, y ∈ x ⇒ y ∈ U -- (ii) closed under pairing: x, y ∈ U ⇒ {x, y} ∈ U -- (iii) closed under power set: x ∈ U ⇒ 𝒫 x ∈ U -- (iv) closed under unions of families: I ∈ U, x_i ∈ U for i ∈ I -- ⇒ ⋃_{i ∈ I} x_i ∈ U. -- Schemes (replacement, induction over ω) quantify over Agda functions and -- predicates, and classical logic is a field, as in Model/ZF. Choice is -- not needed. Model/FromGrothendieck derives our ZF record from this. -- The ZF axioms (without universes). record ZFBase : Set₁ where infix 4 _∈_ field V : Set _∈_ : V → V → Set em : (P : Set) → P ⊎ ¬ P ext : ∀ {x y} → (∀ z → z ∈ x → z ∈ y) → (∀ z → z ∈ y → z ∈ x) → x ≡ y 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 ⋃ : V → V ⋃-in : ∀ {z x} → z ∈ ⋃ x → Σ V λ y → y ∈ x × z ∈ y ⋃-intro : ∀ {z x y} → y ∈ x → z ∈ y → z ∈ ⋃ x 𝒫 : V → V 𝒫-in : ∀ {z x} → z ∈ 𝒫 x → ∀ w → w ∈ z → w ∈ x 𝒫-intro : ∀ {z x} → (∀ w → w ∈ z → w ∈ x) → z ∈ 𝒫 x 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 : ∀ x → Σ V (λ y → y ∈ x) → Σ V λ y → y ∈ x × (∀ z → z ∈ y → z ∈ x → ⊥) ω : 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 module _ (B : ZFBase) where open ZFBase B -- A Grothendieck universe (SGA 4, Exp. I, Déf. 1). record IsUniverse (U : V) : Set where field trans : ∀ {x y} → x ∈ U → y ∈ x → y ∈ U pair : ∀ {x y} → x ∈ U → y ∈ U → upair x y ∈ U power : ∀ {x} → x ∈ U → 𝒫 x ∈ U family : ∀ {I f} → I ∈ U → (∀ i → i ∈ I → f i ∈ U) → ⋃ (image f I) ∈ U -- The universe axiom: every set is a member of a universe. record UniverseAxiom : Set where field 𝕌 : V → V 𝕌-∋ : ∀ x → x ∈ 𝕌 x 𝕌-is : ∀ x → IsUniverse (𝕌 x) -- ZFC + (UA). record ZFCU : Set₁ where field base : ZFBase ua : UniverseAxiom base