Skip to content

Commit

Permalink
feat(Data/Set/Function): add MapsTo.map_nonempty (#9093)
Browse files Browse the repository at this point in the history
Extracted from #8160.



Co-authored-by: grunweg <[email protected]>
  • Loading branch information
grunweg and grunweg committed Dec 19, 2023
1 parent 98fe17f commit a369b3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Mathlib/Data/Set/Function.lean
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ theorem mapsTo_empty (f : α → β) (t : Set β) : MapsTo f ∅ t :=
empty_subset _
#align set.maps_to_empty Set.mapsTo_empty

/-- If `f` maps `s` to `t` and `s` is non-empty, `t` is non-empty. -/
theorem MapsTo.nonempty (h : MapsTo f s t) (hs : s.Nonempty) : t.Nonempty :=
(hs.image f).mono (mapsTo'.mp h)

theorem MapsTo.image_subset (h : MapsTo f s t) : f '' s ⊆ t :=
mapsTo'.1 h
#align set.maps_to.image_subset Set.MapsTo.image_subset
Expand Down

0 comments on commit a369b3d

Please sign in to comment.