Flexible Injectivity and Surjectivity #
We define what it means for a function to be injective or surjective restricted to a given domain and image, given as either a list or set. Intuitively, results involving the list versions most likely have an implicit requirement for domain and image being finite whereas results stated for the set version do not have this requirement. In this sense the set results can be seen as most general. The list and set definitions are also shown to be equivalent in cases where the domains and images can be converted between lists and sets.
We found the approach of stating domains and images explicitely more suitable than using Function.Injective and Function.Surjective
because this would require us to consider appropriate subtypes and also since
there barely seem to be theorems in the standard library (outside Mathlib).
A function is injective on a given domain set if for each two elements of the given domain, the mapping of both elements being the same implies the elements being the same.
Equations
Instances For
A function is surjective on a given domain set and image set if for each element of the image, there exists an element in the domain that maps to the desired image element.
Equations
Instances For
A function over a type is closed for a given domain if the image of every domain element is mapped to an element that is again in the domain.
Equations
- Function.closedSet f domain = ∀ (a : α), a ∈ domain → f a ∈ domain
Instances For
If a mapping is injective for a domain, then the same holds for any subset of the domain.
If a mapping is surjective for a domain and image, then the same holds for any superset of the domain.
If the composition of two mappings is injective, then the first one must be injective.
If the composition of two mappings is surjective for a domain and image, then the second one must be surjective on the same image and the domain that is the image of the first function.
Every mapping is always surjective on its own imageSet.
A mapping is surjective on a given domain and image if and only if the given image is contained in the actual image of the mapping.
A function is injective on a given domain list if for each two elements of the given domain, the mapping of both elements being the same implies the elements being the same.
Equations
Instances For
A function is surjective on a given domain list and image list if for each element of the image, there exists an element in the domain that maps to the desired image element.
Equations
Instances For
A function over a type is closed for a given domain if the image of every domain element is mapped to an element that is again in the domain.
Equations
- Function.closedList f domain = ∀ (a : α), a ∈ domain → f a ∈ domain
Instances For
The surjectivity definitions for set and list are interchangeable.
If a mapping is injective on a domain of the form hd::tl, then it is injective on tl.
If a mapping is surjective on a domain tl, then it is surjective on any domain hd::tl.
Every mapping is always surjective on its own imageList.
If a mapping is closed, then its image is fully contained in its domain.
Given a mapping and a domain list without duplicates, the mapping in injective on the domain if and only if the imageList contains the same number of elements as the domain.
A mapping is surjective on a given domain and image if and only if the given image is contained in the actual image of the mapping.
Given a single list without duplicates that represents both domain and image, if a mapping is surjective, then it is injective.
Given a single list without duplicates that represents both domain and image, if a mapping closed on the list, then the mapping is injective if and only if it is surjective.
Given a single list without duplicates that represents both domain and image, if a mapping both injective and surjective, then is must be closed on the list.