Skip to content

Commit

Permalink
feat(set_theory/zfc): ZFC sets are small types (#15320)
Browse files Browse the repository at this point in the history
  • Loading branch information
vihdzp authored and joelriou committed Jul 23, 2022
1 parent 47f78c5 commit 5ceb6c0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/set_theory/zfc/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import data.set.lattice
import logic.small
import order.well_founded

/-!
Expand Down Expand Up @@ -173,6 +174,9 @@ instance : has_mem pSet pSet := ⟨pSet.mem⟩
theorem mem.mk {α : Type u} (A : α → pSet) (a : α) : A a ∈ mk α A :=
⟨a, equiv.refl (A a)⟩

theorem func_mem (x : pSet) (i : x.type) : x.func i ∈ x :=
by { cases x, apply mem.mk }

theorem mem.ext : Π {x y : pSet.{u}}, (∀ w : pSet.{u}, w ∈ x ↔ w ∈ y) → equiv x y
| ⟨α, A⟩ ⟨β, B⟩ h := ⟨λ a, (h (A a)).1 (mem.mk A a),
λ b, let ⟨a, ha⟩ := (h (B b)).2 (mem.mk B b) in ⟨a, ha.symm⟩⟩
Expand Down Expand Up @@ -431,6 +435,17 @@ instance : has_mem Set Set := ⟨Set.mem⟩
/-- Convert a ZFC set into a `set` of ZFC sets -/
def to_set (u : Set.{u}) : set Set.{u} := {x | x ∈ u}

instance small_to_set (x : Set.{u}) : small.{u} x.to_set :=
quotient.induction_on x $ λ a, begin
let f : a.type → (mk a).to_set := λ i, ⟨mk $ a.func i, func_mem a i⟩,
suffices : function.surjective f,
{ exact small_of_surjective this },
rintro ⟨y, hb⟩,
induction y using quotient.induction_on,
cases hb with i h,
exact ⟨i, subtype.coe_injective (quotient.sound h.symm)⟩
end

/-- `x ⊆ y` as ZFC sets means that all members of `x` are members of `y`. -/
protected def subset (x y : Set.{u}) :=
∀ ⦃z⦄, z ∈ x → z ∈ y
Expand Down

0 comments on commit 5ceb6c0

Please sign in to comment.