@@ -1005,73 +1005,100 @@ end set
1005
1005
1006
1006
/- disjoint sets -/
1007
1007
1008
+ section disjoint
1009
+
1010
+ variables {s t u : set α}
1011
+
1012
+ namespace disjoint
1013
+
1014
+ /-! We define some lemmas in the `disjoint` namespace to be able to use projection notation. -/
1015
+
1016
+ theorem union_left (hs : disjoint s u) (ht : disjoint t u) : disjoint (s ∪ t) u :=
1017
+ hs.sup_left ht
1018
+
1019
+ theorem union_right (ht : disjoint s t) (hu : disjoint s u) : disjoint s (t ∪ u) :=
1020
+ ht.sup_right hu
1021
+
1022
+ lemma preimage {α β} (f : α → β) {s t : set β} (h : disjoint s t) : disjoint (f ⁻¹' s) (f ⁻¹' t) :=
1023
+ λ x hx, h hx
1024
+
1025
+ end disjoint
1026
+
1008
1027
namespace set
1009
1028
1010
- protected theorem disjoint_iff {s t : set α} : disjoint s t ↔ s ∩ t ⊆ ∅ := iff.rfl
1029
+ protected theorem disjoint_iff : disjoint s t ↔ s ∩ t ⊆ ∅ := iff.rfl
1011
1030
1012
- theorem disjoint_iff_inter_eq_empty {s t : set α} : disjoint s t ↔ s ∩ t = ∅ :=
1031
+ theorem disjoint_iff_inter_eq_empty : disjoint s t ↔ s ∩ t = ∅ :=
1013
1032
disjoint_iff
1014
1033
1015
- lemma not_disjoint_iff {s t : set α} : ¬disjoint s t ↔ ∃x, x ∈ s ∧ x ∈ t :=
1034
+ lemma not_disjoint_iff : ¬disjoint s t ↔ ∃x, x ∈ s ∧ x ∈ t :=
1016
1035
not_forall.trans $ exists_congr $ λ x, not_not
1017
1036
1018
- lemma disjoint_left {s t : set α} : disjoint s t ↔ ∀ {a}, a ∈ s → a ∉ t :=
1037
+ lemma disjoint_left : disjoint s t ↔ ∀ {a}, a ∈ s → a ∉ t :=
1019
1038
show (∀ x, ¬(x ∈ s ∩ t)) ↔ _, from ⟨λ h a, not_and.1 $ h a, λ h a, not_and.2 $ h a⟩
1020
1039
1021
- theorem disjoint_right {s t : set α} : disjoint s t ↔ ∀ {a}, a ∈ t → a ∉ s :=
1040
+ theorem disjoint_right : disjoint s t ↔ ∀ {a}, a ∈ t → a ∉ s :=
1022
1041
by rw [disjoint.comm, disjoint_left]
1023
1042
1024
- theorem disjoint_of_subset_left {s t u : set α} (h : s ⊆ u) (d : disjoint u t) : disjoint s t :=
1043
+ theorem disjoint_of_subset_left (h : s ⊆ u) (d : disjoint u t) : disjoint s t :=
1025
1044
d.mono_left h
1026
1045
1027
- theorem disjoint_of_subset_right {s t u : set α} (h : t ⊆ u) (d : disjoint s u) : disjoint s t :=
1046
+ theorem disjoint_of_subset_right (h : t ⊆ u) (d : disjoint s u) : disjoint s t :=
1028
1047
d.mono_right h
1029
1048
1030
1049
theorem disjoint_of_subset {s t u v : set α} (h1 : s ⊆ u) (h2 : t ⊆ v) (d : disjoint u v) :
1031
1050
disjoint s t :=
1032
1051
d.mono h1 h2
1033
1052
1034
- @[simp] theorem disjoint_union_left {s t u : set α} :
1053
+ @[simp] theorem disjoint_union_left :
1035
1054
disjoint (s ∪ t) u ↔ disjoint s u ∧ disjoint t u :=
1036
1055
disjoint_sup_left
1037
1056
1038
- theorem disjoint.union_left {s t u : set α} (hs : disjoint s u) (ht : disjoint t u) :
1039
- disjoint (s ∪ t) u :=
1040
- hs.sup_left ht
1041
-
1042
- @[simp] theorem disjoint_union_right {s t u : set α} :
1057
+ @[simp] theorem disjoint_union_right :
1043
1058
disjoint s (t ∪ u) ↔ disjoint s t ∧ disjoint s u :=
1044
1059
disjoint_sup_right
1045
1060
1046
- theorem disjoint.union_right {s t u : set α} (ht : disjoint s t) (hu : disjoint s u) :
1047
- disjoint s (t ∪ u) :=
1048
- ht.sup_right hu
1049
-
1050
1061
theorem disjoint_diff {a b : set α} : disjoint a (b \ a) :=
1051
1062
disjoint_iff.2 (inter_diff_self _ _)
1052
1063
1053
1064
theorem disjoint_compl_left (s : set α) : disjoint sᶜ s := assume a ⟨h₁, h₂⟩, h₁ h₂
1054
1065
1055
1066
theorem disjoint_compl_right (s : set α) : disjoint s sᶜ := assume a ⟨h₁, h₂⟩, h₂ h₁
1056
1067
1057
- theorem disjoint_singleton_left {a : α} {s : set α} : disjoint {a} s ↔ a ∉ s :=
1068
+ @[simp] lemma univ_disjoint {s : set α}: disjoint univ s ↔ s = ∅ :=
1069
+ by simp [set.disjoint_iff_inter_eq_empty]
1070
+
1071
+ @[simp] lemma disjoint_univ {s : set α} : disjoint s univ ↔ s = ∅ :=
1072
+ by simp [set.disjoint_iff_inter_eq_empty]
1073
+
1074
+ @[simp] theorem disjoint_singleton_left {a : α} {s : set α} : disjoint {a} s ↔ a ∉ s :=
1058
1075
by simp [set.disjoint_iff, subset_def]; exact iff.rfl
1059
1076
1060
- theorem disjoint_singleton_right {a : α} {s : set α} : disjoint s {a} ↔ a ∉ s :=
1077
+ @[simp] theorem disjoint_singleton_right {a : α} {s : set α} : disjoint s {a} ↔ a ∉ s :=
1061
1078
by rw [disjoint.comm]; exact disjoint_singleton_left
1062
1079
1063
1080
theorem disjoint_image_image {f : β → α} {g : γ → α} {s : set β} {t : set γ}
1064
1081
(h : ∀b∈s, ∀c∈t, f b ≠ g c) : disjoint (f '' s) (g '' t) :=
1065
1082
by rintros a ⟨⟨b, hb, eq⟩, ⟨c, hc, rfl⟩⟩; exact h b hb c hc eq
1066
1083
1067
- lemma disjoint.preimage {α β} (f : α → β) {s t : set β} (h : disjoint s t) :
1068
- disjoint (f ⁻¹' s) (f ⁻¹' t) :=
1069
- λ x hx, h hx
1070
-
1071
1084
theorem pairwise_on_disjoint_fiber (f : α → β) (s : set β) :
1072
1085
pairwise_on s (disjoint on (λ y, f ⁻¹' {y})) :=
1073
1086
λ y₁ _ y₂ _ hy x ⟨hx₁, hx₂⟩, hy (eq.trans (eq.symm hx₁) hx₂)
1074
1087
1088
+ lemma preimage_eq_empty {f : α → β} {s : set β} (h : disjoint s (range f)) :
1089
+ f ⁻¹' s = ∅ :=
1090
+ by simpa using h.preimage f
1091
+
1092
+ lemma preimage_eq_empty_iff {f : α → β} {s : set β} : disjoint s (range f) ↔ f ⁻¹' s = ∅ :=
1093
+ ⟨preimage_eq_empty,
1094
+ λ h, by { simp [eq_empty_iff_forall_not_mem, set.disjoint_iff_inter_eq_empty] at h ⊢, finish }⟩
1095
+
1096
+ end set
1097
+
1098
+ end disjoint
1099
+
1100
+ namespace set
1101
+
1075
1102
/-- A collection of sets is `pairwise_disjoint`, if any two different sets in this collection
1076
1103
are disjoint. -/
1077
1104
def pairwise_disjoint (s : set (set α)) : Prop :=
@@ -1088,7 +1115,7 @@ begin
1088
1115
intro h, apply hxy, apply congr_arg f, exact subtype.eq h
1089
1116
end
1090
1117
1091
- /- warning: classical -/
1118
+ /- classical -/
1092
1119
lemma pairwise_disjoint.elim {s : set (set α)} (h : pairwise_disjoint s) {x y : set α}
1093
1120
(hx : x ∈ s) (hy : y ∈ s) (z : α) (hzx : z ∈ x) (hzy : z ∈ y) : x = y :=
1094
1121
not_not.1 $ λ h', h x hx y hy h' ⟨hzx, hzy⟩
0 commit comments