Functions over sets #
Main definitions #
Predicate #
Set.EqOn f₁ f₂ s
: functionsf₁
andf₂
are equal at every point ofs
;Set.MapsTo f s t
:f
sends every point ofs
to a point oft
;Set.InjOn f s
: restriction off
tos
is injective;Set.SurjOn f s t
: every point ins
has a preimage ins
;Set.BijOn f s t
:f
is a bijection betweens
andt
;Set.LeftInvOn f' f s
: for everyx ∈ s
we havef' (f x) = x
;Set.RightInvOn f' f t
: for everyy ∈ t
we havef (f' y) = y
;Set.InvOn f' f s t
:f'
is a two-side inverse off
ons
andt
, i.e. we haveSet.LeftInvOn f' f s
andSet.RightInvOn f' f t
.
Functions #
Set.restrict f s
: restrict the domain off
to the sets
;Set.codRestrict f s h
: givenh : ∀ x, f x ∈ s
, restrict the codomain off
to the sets
;Set.MapsTo.restrict f s t h
: givenh : MapsTo f s t
, restrict the domain off
tos
and the codomain tot
.
Restrict #
Restrict domain of a function f
to a set s
. Same as Subtype.restrict
but this version
takes an argument ↥s
instead of Subtype s
.
Equations
- s.restrict f x = f ↑x
Instances For
If a function f
is restricted to a set t
, and s ⊆ t
, this is the restriction to s
.
Equations
- Set.restrict₂ hst f x = f ⟨↑x, ⋯⟩
Instances For
Restrict codomain of a function f
to a set s
. Same as Subtype.coind
but this version
has codomain ↥s
instead of Subtype s
.
Equations
- Set.codRestrict f s h x = ⟨f x, ⋯⟩
Instances For
Alias of the reverse direction of Set.injective_codRestrict
.
Equality on a set #
Variant of EqOn.image_eq
, for one function being the identity.
Restricting the domain and then the codomain is the same as MapsTo.restrict
.
Reverse of Set.codRestrict_restrict
.
If f
maps s
to t
and s
is non-empty, t
is non-empty.
Restriction onto preimage #
Alias of Set.restrictPreimage_injective
.
Alias of Set.restrictPreimage_surjective
.
Alias of Set.restrictPreimage_bijective
.
Injectivity on a set #
Alias of Set.injOn_of_injective
.
Alias of the forward direction of Set.injOn_iff_injective
.
Alias of the reverse direction of Set.graphOn_nonempty
.
Surjectivity on a set #
Bijectivity #
Alias of the forward direction of Set.bijective_iff_bijOn_univ
.
left inverse #
Right inverse #
Two-side inverses #
If functions f'
and f
are inverse on s
and t
, f
maps s
into t
, and f'
maps t
into s
, then f
is a bijection between s
and t
. The mapsTo
arguments can be deduced from
surjOn
statements using LeftInvOn.mapsTo
and RightInvOn.mapsTo
.
Construct the inverse for a function f
on domain s
. This function is a right inverse of f
on f '' s
. For a computable version, see Function.Embedding.invOfMemRange
.
Equations
- Function.invFunOn f s b = if h : ∃ a ∈ s, f a = b then Classical.choose h else Classical.choice inst✝
Instances For
This lemma is a special case of rightInvOn_invFunOn.image_image'
; it may make more sense
to use the other lemma directly in an application.
This lemma is a special case of rightInvOn_invFunOn.image_image
; it may make more sense
to use the other lemma directly in an application.
Alias of the forward direction of Set.surjOn_iff_exists_bijOn_subset
.
If f
maps s
bijectively to t
and a set t'
is contained in the image of some s₁ ⊇ s
,
then s₁
has a subset containing s
that f
maps bijectively to t'
.
If f
maps s
bijectively to t
, and t'
is a superset of t
contained in the range of f
,
then f
maps some superset of s
bijectively to t'
.
Piecewise defined function #
Alias of Set.piecewise_mono
.
Non-dependent version of Function.update_comp_eq_of_not_mem_range'
Equivalences, permutations #
Alias of the reverse direction of Equiv.bijOn_symm
.
Alias of the forward direction of Equiv.bijOn_symm
.
Vertical line test #
Vertical line test for functions.
Let f : α → β × γ
be a function to a product. Assume that f
is surjective on the first factor
and that the image of f
intersects every "vertical line" {(b, c) | c : γ}
at most once.
Then the image of f
is the graph of some monoid homomorphism f' : β → γ
.
Line test for equivalences.
Let f : α → β × γ
be a homomorphism to a product of monoids. Assume that f
is surjective on both
factors and that the image of f
intersects every "vertical line" {(b, c) | c : γ}
and every
"horizontal line" {(b, c) | b : β}
at most once. Then the image of f
is the graph of some
equivalence f' : β ≃ γ
.
Vertical line test for functions.
Let s : Set (β × γ)
be a set in a product. Assume that s
maps bijectively to the first factor.
Then s
is the graph of some function f : β → γ
.