@@ -80,6 +80,32 @@ notation `⋂` binders `, ` r:(scoped f, Inter f) := r
80
80
-- TODO: more rewrite rules wrt forall / existentials and logical connectives
81
81
-- TODO: also eliminate ∃i, ... ∧ i = t ∧ ...
82
82
83
+ lemma Union_prop (f : ι → set α) (p : ι → Prop ) (i : ι) [decidable $ p i] :
84
+ (⋃ (h : p i), f i) = if p i then f i else ∅ :=
85
+ begin
86
+ ext x,
87
+ rw mem_Union,
88
+ split_ifs ; tauto,
89
+ end
90
+
91
+ @[simp]
92
+ lemma Union_prop_pos {p : ι → Prop } {i : ι} (hi : p i) (f : ι → set α) :
93
+ (⋃ (h : p i), f i) = f i :=
94
+ begin
95
+ classical,
96
+ ext x,
97
+ rw [Union_prop, if_pos hi]
98
+ end
99
+
100
+ @[simp]
101
+ lemma Union_prop_neg {p : ι → Prop } {i : ι} (hi : ¬ p i) (f : ι → set α) :
102
+ (⋃ (h : p i), f i) = ∅ :=
103
+ begin
104
+ classical,
105
+ ext x,
106
+ rw [Union_prop, if_neg hi]
107
+ end
108
+
83
109
lemma exists_set_mem_of_union_eq_top {ι : Type *} (t : set ι) (s : ι → set β)
84
110
(w : (⋃ i ∈ t, s i) = ⊤) (x : β) :
85
111
∃ (i ∈ t), x ∈ s i :=
@@ -259,6 +285,10 @@ infi_option s
259
285
theorem mem_bUnion_iff {s : set α} {t : α → set β} {y : β} :
260
286
y ∈ (⋃ x ∈ s, t x) ↔ ∃ x ∈ s, y ∈ t x := by simp
261
287
288
+ lemma mem_bUnion_iff' {p : α → Prop } {t : α → set β} {y : β} :
289
+ y ∈ (⋃ i (h : p i), t i) ↔ ∃ i (h : p i), y ∈ t i :=
290
+ mem_bUnion_iff
291
+
262
292
theorem mem_bInter_iff {s : set α} {t : α → set β} {y : β} :
263
293
y ∈ (⋂ x ∈ s, t x) ↔ ∀ x ∈ s, y ∈ t x := by simp
264
294
@@ -370,6 +400,20 @@ theorem bInter_pair (a b : α) (s : α → set β) :
370
400
(⋂ x ∈ ({a, b} : set α), s x) = s a ∩ s b :=
371
401
by simp [inter_comm]
372
402
403
+ lemma bInter_inter {ι α : Type *} {s : set ι} (hs : s.nonempty) (f : ι → set α) (t : set α) :
404
+ (⋂ i ∈ s, f i ∩ t) = (⋂ i ∈ s, f i) ∩ t :=
405
+ begin
406
+ haveI : nonempty s := hs.to_subtype,
407
+ simp [bInter_eq_Inter, ← Inter_inter]
408
+ end
409
+
410
+ lemma inter_bInter {ι α : Type *} {s : set ι} (hs : s.nonempty) (f : ι → set α) (t : set α) :
411
+ (⋂ i ∈ s, t ∩ f i) = t ∩ ⋂ i ∈ s, f i :=
412
+ begin
413
+ rw [inter_comm, ← bInter_inter hs],
414
+ simp [inter_comm]
415
+ end
416
+
373
417
theorem bUnion_empty (s : α → set β) : (⋃ x ∈ (∅ : set α), s x) = ∅ :=
374
418
supr_emptyset
375
419
0 commit comments