@[inline]
Transforms a function from pairs into an equivalent two-parameter function.
Examples:
Function.curry (fun (x, y) => x + y) 3 5 = 8Function.curry Prod.swap 3 "five" = ("five", 3)
Equations
Instances For
@[inline]
Transforms a two-parameter function into an equivalent function from pairs.
Examples:
Function.uncurry List.drop (1, ["a", "b", "c"]) = ["b", "c"][("orange", 2), ("android", 3) ].map (Function.uncurry String.take) = ["or", "and"]
Equations
Instances For
A function f : α → β is called injective if f x = f y implies x = y.
Equations
Instances For
A function f : α → β is called surjective if every b : β is equal to f a
for some a : α.
Equations
Instances For
theorem
Function.Surjective.comp
{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{g : β → γ}
{f : α → β}
(hg : Surjective g)
(hf : Surjective f)
:
Surjective (g ∘ f)
theorem
Function.LeftInverse.injective
{α : Sort u_1}
{β : Sort u_2}
{g : β → α}
{f : α → β}
:
LeftInverse g f → Injective f
theorem
Function.HasLeftInverse.injective
{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
:
HasLeftInverse f → Injective f
theorem
Function.rightInverse_of_injective_of_leftInverse
{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g : β → α}
(injf : Injective f)
(lfg : LeftInverse f g)
:
RightInverse f g
theorem
Function.RightInverse.surjective
{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g : β → α}
(h : RightInverse g f)
:
theorem
Function.HasRightInverse.surjective
{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
:
HasRightInverse f → Surjective f
theorem
Function.leftInverse_of_surjective_of_rightInverse
{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g : β → α}
(surjf : Surjective f)
(rfg : RightInverse f g)
:
LeftInverse f g
theorem
Function.LeftInverse.id
{α : Sort u_1}
{β : Sort u_2}
{g : β → α}
{f : α → β}
(h : LeftInverse g f)
:
theorem
Function.RightInverse.id
{α : Sort u_1}
{β : Sort u_2}
{g : β → α}
{f : α → β}
(h : RightInverse g f)
: