@@ -167,32 +167,30 @@ theorem sound {x y : PSet} (h : PSet.Equiv x y) : mk x = mk y :=
167167theorem exact {x y : PSet} : mk x = mk y → PSet.Equiv x y :=
168168 Quotient.exact
169169
170- /-- The membership relation for ZFC sets is inherited from the membership relation for pre-sets. -/
171- protected def Mem : ZFSet → ZFSet → Prop :=
172- Quotient.lift₂ (· ∈ ·) fun _ _ _ _ hx hy =>
173- propext ((Mem.congr_left hx).trans (Mem.congr_right hy))
170+ /-- Convert a ZFC set into a `Set` of ZFC sets -/
171+ def toSet (x : ZFSet) : Set ZFSet :=
172+ {y | Quotient.lift₂ (· ∈ ·) (fun _ _ _ _ hx hy =>
173+ propext ((Mem.congr_left hx).trans (Mem.congr_right hy))) y x}
174+
175+ private lemma ext_aux : (∀ z : ZFSet.{u}, z ∈ x.toSet ↔ z ∈ y.toSet) → x = y :=
176+ Quotient.inductionOn₂ x y fun _ _ h => Quotient.sound (Mem.ext fun w => h ⟦w⟧)
177+
178+ instance : SetLike ZFSet.{u} ZFSet.{u} where
179+ coe := toSet
180+ coe_injective' x y hxy := by apply ext_aux; intro z; exact congr(z ∈ $hxy)
174181
175- instance : Membership ZFSet ZFSet where
176- mem t s := ZFSet.Mem s t
182+ /-- The membership relation for ZFC sets is inherited from the membership relation for pre-sets. -/
183+ @ [deprecated "use `∈` notation" (since := "2026-03-16" )]
184+ protected def Mem : ZFSet → ZFSet → Prop := (· ∈ ·)
177185
178186@[simp]
179187theorem mk_mem_iff {x y : PSet} : mk x ∈ mk y ↔ x ∈ y :=
180188 Iff.rfl
181189
182- @[ext] lemma ext : (∀ z : ZFSet.{u}, z ∈ x ↔ z ∈ y) → x = y :=
183- Quotient.inductionOn₂ x y fun _ _ h => Quotient.sound (Mem.ext fun w => h ⟦w⟧)
184-
185- instance : SetLike ZFSet.{u} ZFSet.{u} where
186- coe x := {y | y ∈ x}
187- coe_injective' x y hxy := by ext z; exact congr(z ∈ $hxy)
190+ @[ext] lemma ext : (∀ z : ZFSet.{u}, z ∈ x ↔ z ∈ y) → x = y := ext_aux
188191
189192instance : PartialOrder ZFSet.{u} := .ofSetLike ZFSet.{u} ZFSet.{u}
190193
191- /-- Convert a ZFC set into a `Set` of ZFC sets -/
192- @ [deprecated SetLike.coe (since := "2025-11-05" )]
193- def toSet (u : ZFSet.{u}) : Set ZFSet.{u} :=
194- { x | x ∈ u }
195-
196194@ [deprecated SetLike.mem_coe (since := "2025-11-05" )]
197195theorem mem_toSet (a u : ZFSet.{u}) : a ∈ (u : Set ZFSet.{u}) ↔ a ∈ u :=
198196 Iff.rfl
@@ -279,7 +277,6 @@ instance : Inhabited ZFSet :=
279277theorem notMem_empty (x) : x ∉ (∅ : ZFSet.{u}) :=
280278 Quotient.inductionOn x PSet.notMem_empty
281279
282- set_option backward.isDefEq.respectTransparency false in
283280@ [simp, norm_cast] lemma coe_empty : ((∅ : ZFSet.{u}) : Set ZFSet.{u}) = ∅ := by ext; simp
284281
285282@ [deprecated (since := "2025-11-05" )] alias toSet_empty := coe_empty
@@ -341,7 +338,6 @@ theorem mem_insert (x y : ZFSet) : x ∈ insert x y :=
341338theorem mem_insert_of_mem {y z : ZFSet} (x) (h : z ∈ y) : z ∈ insert x y :=
342339 mem_insert_iff.2 <| Or.inr h
343340
344- set_option backward.isDefEq.respectTransparency false in
345341@ [simp, norm_cast]
346342lemma coe_insert (x y : ZFSet) : ↑(insert x y) = (insert x ↑y : Set ZFSet) := by ext; simp
347343
@@ -354,7 +350,6 @@ theorem mem_singleton {x y : ZFSet.{u}} : x ∈ ({y} : ZFSet.{u}) ↔ x = y :=
354350theorem notMem_singleton {x y : ZFSet.{u}} : x ∉ ({y} : ZFSet.{u}) ↔ x ≠ y :=
355351 mem_singleton.not
356352
357- set_option backward.isDefEq.respectTransparency false in
358353@ [simp, norm_cast]
359354lemma coe_singleton (x : ZFSet) : (({x} : ZFSet) : Set ZFSet) = {x} := by ext; simp
360355
@@ -432,7 +427,6 @@ theorem sep_empty (p : ZFSet → Prop) : (∅ : ZFSet).sep p = ∅ :=
432427theorem sep_subset {x p} : ZFSet.sep p x ⊆ x :=
433428 fun _ h => (mem_sep.1 h).1
434429
435- set_option backward.isDefEq.respectTransparency false in
436430@ [simp, norm_cast]
437431lemma coe_sep (a : ZFSet) (p : ZFSet → Prop ) : (ZFSet.sep p a : Set ZFSet) = {x ∈ a | p x} := by
438432 ext
@@ -534,15 +528,13 @@ theorem sUnion_singleton {x : ZFSet.{u}} : ⋃₀ ({x} : ZFSet) = x :=
534528theorem sInter_singleton {x : ZFSet.{u}} : ⋂₀ ({x} : ZFSet) = x :=
535529 ext fun y => by simp_rw [mem_sInter (singleton_nonempty x), mem_singleton, forall_eq]
536530
537- set_option backward.isDefEq.respectTransparency false in
538531@ [simp, norm_cast]
539532lemma coe_sUnion (x : ZFSet.{u}) : (⋃₀ x : Set ZFSet) = ⋃₀ (SetLike.coe '' (x : Set ZFSet)) := by
540533 ext
541534 simp
542535
543536@ [deprecated (since := "2025-11-05" )] alias toSet_sUnion := coe_sUnion
544537
545- set_option backward.isDefEq.respectTransparency false in
546538@ [simp, norm_cast]
547539lemma coe_sInter (h : x.Nonempty) : (⋂₀ x : Set ZFSet) = ⋂₀ (SetLike.coe '' (x : Set ZFSet)) := by
548540 ext
@@ -590,19 +582,16 @@ instance : SDiff ZFSet :=
590582
591583@ [deprecated (since := "2025-11-06" )] alias mem_diff := mem_sdiff
592584
593- set_option backward.isDefEq.respectTransparency false in
594585@ [simp, norm_cast]
595586lemma coe_union (x y : ZFSet.{u}) : ↑(x ∪ y) = (↑x ∪ ↑y : Set ZFSet) := by ext; simp
596587
597588@ [deprecated (since := "2025-11-05" )] alias toSet_union := coe_union
598589
599- set_option backward.isDefEq.respectTransparency false in
600590@ [simp, norm_cast]
601591lemma coe_inter (x y : ZFSet.{u}) : ↑(x ∩ y) = (↑x ∩ ↑y : Set ZFSet) := by ext; simp
602592
603593@ [deprecated (since := "2025-11-05" )] alias toSet_inter := coe_inter
604594
605- set_option backward.isDefEq.respectTransparency false in
606595@ [simp, norm_cast]
607596lemma coe_sdiff (x y : ZFSet.{u}) : ↑(x \ y) = (↑x \ ↑y : Set ZFSet) := by ext; simp
608597
@@ -611,7 +600,6 @@ lemma coe_sdiff (x y : ZFSet.{u}) : ↑(x \ y) = (↑x \ ↑y : Set ZFSet) := by
611600@[simp] lemma inter_eq_left_of_subset (hxy : x ⊆ y) : x ∩ y = x := by ext; simpa using @hxy _
612601@[simp] lemma inter_eq_right_of_subset (hyx : y ⊆ x) : x ∩ y = y := by ext; simpa using @hyx _
613602
614- set_option backward.isDefEq.respectTransparency false in
615603/-- `ZFSet.powerset` is equivalent to `Set.powerset`. -/
616604def powersetEquiv (x : ZFSet.{u}) : x.powerset ≃ 𝒫 (x : Set ZFSet) where
617605 toFun y := ⟨y.1 , Set.mem_powerset (mem_powerset.1 y.2 )⟩
@@ -681,7 +669,6 @@ theorem mem_image {f : ZFSet.{u} → ZFSet.{u}} [Definable₁ f] {x y : ZFSet.{u
681669 ⟨fun ⟨a, ya⟩ => ⟨⟦A a⟧, Mem.mk A a, ((Quotient.sound ya).trans Definable₁.mk_out).symm⟩,
682670 fun ⟨_, hz, e⟩ => e ▸ image.mk _ _ hz⟩
683671
684- set_option backward.isDefEq.respectTransparency false in
685672@ [simp, norm_cast]
686673lemma coe_image (f : ZFSet → ZFSet) [Definable₁ f] (x : ZFSet) :
687674 (image f x : Set ZFSet) = f '' x := by ext; simp
@@ -706,7 +693,6 @@ theorem mem_range {f : α → ZFSet.{u}} {x : ZFSet.{u}} : x ∈ range f ↔ ∃
706693 use equivShrink α z
707694 simpa [hz] using PSet.Equiv.symm (Quotient.mk_out y)
708695
709- set_option backward.isDefEq.respectTransparency false in
710696@ [simp, norm_cast]
711697lemma coe_range (f : α → ZFSet.{u}) : (range f : Set ZFSet) = .range f := by ext; simp
712698
@@ -724,7 +710,6 @@ noncomputable def iUnion (f : α → ZFSet.{u}) : ZFSet.{u} :=
724710theorem mem_iUnion {f : α → ZFSet.{u}} {x : ZFSet.{u}} : x ∈ ⋃ i, f i ↔ ∃ i, x ∈ f i := by
725711 simp [iUnion]
726712
727- set_option backward.isDefEq.respectTransparency false in
728713@ [simp, norm_cast]
729714lemma coe_iUnion (f : α → ZFSet.{u}) : ↑(⋃ i, f i) = ⋃ i, (f i : Set ZFSet) := by
730715 ext
0 commit comments