@@ -921,6 +921,10 @@ def Class := set Set
921
921
922
922
namespace Class
923
923
924
+ @[ext] theorem ext {x y : Class.{u}} : (∀ z : Set.{u}, x z ↔ y z) → x = y := set.ext
925
+
926
+ theorem ext_iff {x y : Class.{u}} : x = y ↔ ∀ z, x z ↔ y z := set.ext_iff
927
+
924
928
/-- Coerce a ZFC set into a class -/
925
929
def of_Set (x : Set.{u}) : Class.{u} := {y | y ∈ x}
926
930
instance : has_coe Set Class := ⟨of_Set⟩
@@ -1007,26 +1011,26 @@ to_Set_of_Set _ _
1007
1011
1008
1012
@[simp, norm_cast] theorem coe_sep (p : Class.{u}) (x : Set.{u}) :
1009
1013
(↑{y ∈ x | p y} : Class.{u}) = {y ∈ x | p y} :=
1010
- set. ext $ λ y, Set.mem_sep
1014
+ ext $ λ y, Set.mem_sep
1011
1015
1012
1016
@[simp, norm_cast] theorem coe_empty : ↑(∅ : Set.{u}) = (∅ : Class.{u}) :=
1013
- set. ext $ λ y, (iff_false _).2 $ Set.not_mem_empty y
1017
+ ext $ λ y, (iff_false _).2 $ Set.not_mem_empty y
1014
1018
1015
1019
@[simp, norm_cast] theorem coe_insert (x y : Set.{u}) :
1016
1020
↑(insert x y) = @insert Set.{u} Class.{u} _ x y :=
1017
- set. ext $ λ z, Set.mem_insert_iff
1021
+ ext $ λ z, Set.mem_insert_iff
1018
1022
1019
1023
@[simp, norm_cast] theorem coe_union (x y : Set.{u}) : ↑(x ∪ y) = (x : Class.{u}) ∪ y :=
1020
- set. ext $ λ z, Set.mem_union
1024
+ ext $ λ z, Set.mem_union
1021
1025
1022
1026
@[simp, norm_cast] theorem coe_inter (x y : Set.{u}) : ↑(x ∩ y) = (x : Class.{u}) ∩ y :=
1023
- set. ext $ λ z, Set.mem_inter
1027
+ ext $ λ z, Set.mem_inter
1024
1028
1025
1029
@[simp, norm_cast] theorem coe_diff (x y : Set.{u}) : ↑(x \ y) = (x : Class.{u}) \ y :=
1026
- set. ext $ λ z, Set.mem_diff
1030
+ ext $ λ z, Set.mem_diff
1027
1031
1028
1032
@[simp, norm_cast] theorem coe_powerset (x : Set.{u}) : ↑x.powerset = powerset.{u} x :=
1029
- set. ext $ λ z, Set.mem_powerset
1033
+ ext $ λ z, Set.mem_powerset
1030
1034
1031
1035
@[simp] theorem powerset_apply {A : Class.{u}} {x : Set.{u}} : powerset A x ↔ ↑x ⊆ A := iff.rfl
1032
1036
@@ -1039,18 +1043,7 @@ begin
1039
1043
end
1040
1044
1041
1045
@[simp, norm_cast] theorem coe_sUnion (x : Set.{u}) : ↑(⋃₀ x) = ⋃₀ (x : Class.{u}) :=
1042
- set.ext $ λ y, Set.mem_sUnion.trans (sUnion_apply.trans $ by simp_rw [coe_apply, exists_prop]).symm
1043
-
1044
- @[ext] theorem ext {x y : Class.{u}} : (∀ z : Class.{u}, z ∈ x ↔ z ∈ y) → x = y :=
1045
- begin
1046
- refine λ h, set.ext (λ z, _),
1047
- change x z ↔ y z,
1048
- rw [←@coe_mem z x, ←@coe_mem z y],
1049
- exact h z
1050
- end
1051
-
1052
- theorem ext_iff {x y : Class.{u}} : x = y ↔ (∀ z : Class.{u}, z ∈ x ↔ z ∈ y) :=
1053
- ⟨λ h, by simp [h], ext⟩
1046
+ ext $ λ y, Set.mem_sUnion.trans (sUnion_apply.trans $ by simp_rw [coe_apply, exists_prop]).symm
1054
1047
1055
1048
@[simp] theorem mem_sUnion {x y : Class.{u}} : y ∈ ⋃₀ x ↔ ∃ z, z ∈ x ∧ y ∈ z :=
1056
1049
begin
@@ -1077,7 +1070,7 @@ end
1077
1070
def iota (A : Class) : Class := ⋃₀ {x | ∀ y, A y ↔ y = x}
1078
1071
1079
1072
theorem iota_val (A : Class) (x : Set) (H : ∀ y, A y ↔ y = x) : iota A = ↑x :=
1080
- set. ext $ λ y, ⟨λ ⟨._, ⟨x', rfl, h⟩, yx'⟩, by rwa ←((H x').1 $ (h x').2 rfl),
1073
+ ext $ λ y, ⟨λ ⟨._, ⟨x', rfl, h⟩, yx'⟩, by rwa ←((H x').1 $ (h x').2 rfl),
1081
1074
λ yx, ⟨_, ⟨x, rfl, H⟩, yx⟩⟩
1082
1075
1083
1076
/-- Unlike the other set constructors, the `iota` definite descriptor
@@ -1086,7 +1079,7 @@ set.ext $ λ y, ⟨λ ⟨._, ⟨x', rfl, h⟩, yx'⟩, by rwa ←((H x').1 $ (h
1086
1079
theorem iota_ex (A) : iota.{u} A ∈ univ.{u} :=
1087
1080
mem_univ.2 $ or.elim (classical.em $ ∃ x, ∀ y, A y ↔ y = x)
1088
1081
(λ ⟨x, h⟩, ⟨x, eq.symm $ iota_val A x h⟩)
1089
- (λ hn, ⟨∅, set. ext (λ z, coe_empty.symm ▸ ⟨false.rec _, λ ⟨._, ⟨x, rfl, H⟩, zA⟩, hn ⟨x, H⟩⟩)⟩)
1082
+ (λ hn, ⟨∅, ext (λ z, coe_empty.symm ▸ ⟨false.rec _, λ ⟨._, ⟨x, rfl, H⟩, zA⟩, hn ⟨x, H⟩⟩)⟩)
1090
1083
1091
1084
/-- Function value -/
1092
1085
def fval (F A : Class.{u}) : Class.{u} := iota (λ y, to_Set (λ x, F (Set.pair x y)) A)
0 commit comments