-
Notifications
You must be signed in to change notification settings - Fork 251
Description
I propose the following two backwards compatible additions.
(1) To add to Function.Injection
InjectiveBy≡ : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → Set _
InjectiveBy≡ f = ∀ {x y} → f x ≡ f y → x ≡ y
To add to Function.Surjection
SurjectiveBy≡ : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → Set _
SurjectiveBy≡ {_} {_} {_} {B} f = (y : B) → ∃ (\x → f x ≡ y)
To add to Function.Bijection
BijectiveBy≡ : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → Set _
BijectiveBy≡ f = InjectiveBy≡ f × SurjectiveBy≡ f
(2) To reexport In(Sur,Bi)jective, In(Sur,Bi)jectiveBy≡
from Function
.
Motivation.
(2) is proposed because it is nicer to write a single ... import Function using (...)
instead of the four import decls:
Function, Function.Injection, Function.Surjection, Function.Bijection.
(1) is proposed because In(Sur,Bi)jectiveBy≡
have a wide application area and also are simple to perceive and to use, while the generic In(Sur,Bi)jective
are declared so that they are difficult to perceive and to use.
If the user really needs the general version, all right, let him study the general constructs given there by record
s.