Skip to content

Commit

Permalink
feat(data/set/basic): range_unique (#3582)
Browse files Browse the repository at this point in the history
Add a lemma on the `range` of a function from a `unique` type.
  • Loading branch information
jsm28 committed Jul 28, 2020
1 parent 23bd09a commit 7cd1e26
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/data/set/basic.lean
Expand Up @@ -1552,6 +1552,19 @@ end
@[simp] lemma preimage_range (f : α → β) : f ⁻¹' (range f) = univ :=
eq_univ_of_forall mem_range_self

/-- The range of a function from a `unique` type contains just the
function applied to its single value. -/
lemma range_unique [h : unique ι] : range f = {f $ default ι} :=
begin
ext x,
rw mem_range,
split,
{ rintros ⟨i, hi⟩,
rw h.uniq i at hi,
exact hi ▸ mem_singleton _ },
{ exact λ h, ⟨default ι, h.symm⟩ }
end

end range

/-- The set `s` is pairwise `r` if `r x y` for all *distinct* `x y ∈ s`. -/
Expand Down

0 comments on commit 7cd1e26

Please sign in to comment.