Skip to content

Commit

Permalink
feat(data/set/basic): a few lemmas (#4184)
Browse files Browse the repository at this point in the history
Co-authored-by: mzinkevi <41597957+mzinkevi@users.noreply.github.com>
  • Loading branch information
mzinkevi and mzinkevi committed Sep 19, 2020
1 parent 640ba6c commit 5b143ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/data/set/basic.lean
Expand Up @@ -901,6 +901,8 @@ by finish [ext_iff]
theorem inter_union_diff (s t : set α) : (s ∩ t) ∪ (s \ t) = s :=
by finish [ext_iff, iff_def]

theorem inter_union_compl (s t : set α) : (s ∩ t) ∪ (s ∩ tᶜ) = s := inter_union_diff _ _

theorem diff_subset (s t : set α) : s \ t ⊆ s :=
by finish [subset_def]

Expand Down Expand Up @@ -1491,6 +1493,10 @@ range_nonempty_iff_nonempty.2 h
@[simp] lemma range_eq_empty {f : ι → α} : range f = ∅ ↔ ¬ nonempty ι :=
not_nonempty_iff_eq_empty.symm.trans $ not_congr range_nonempty_iff_nonempty

@[simp] lemma image_union_image_compl_eq_range (f : α → β) :
(f '' s) ∪ (f '' sᶜ) = range f :=
by rw [← image_union, ← image_univ, ← union_compl_self]

theorem image_preimage_eq_inter_range {f : α → β} {t : set β} :
f '' (f ⁻¹' t) = t ∩ range f :=
ext $ assume x, ⟨assume ⟨x, hx, heq⟩, heq ▸ ⟨hx, mem_range_self _⟩,
Expand Down

0 comments on commit 5b143ff

Please sign in to comment.