Documentation

Mathlib.Init.Function

General operations on functions #

def Function.comp_right {α : Sort u₁} {β : Sort u₂} (f : βββ) (g : αβ) :
βαβ
Equations
def Function.comp_left {α : Sort u₁} {β : Sort u₂} (f : βββ) (g : αβ) :
αββ
Equations
def Function.onFun {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} (f : ββφ) (g : αβ) :
ααφ

Given functions f : β → β → φ→ β → φ→ φ and g : α → β→ β, produce a function α → α → φ→ α → φ→ φ that evaluates g on each argument, then applies f to the results. Can be used, e.g., to transfer a relation from β to α.

Equations
  • (f on g) x y = f (g x) (g y)
def Function.combine {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {δ : Sort u₄} {ζ : Sort u₁} (f : αβφ) (op : φδζ) (g : αβδ) :
αβζ

Given functions f : α → β → φ→ β → φ→ φ, g : α → β → δ→ β → δ→ δ and a binary operator op : φ → δ → ζ→ δ → ζ→ ζ, produce a function α → β → ζ→ β → ζ→ ζ that applies f and g on each argument and then applies op to the results.

Equations
def Function.swap {α : Sort u₁} {β : Sort u₂} {φ : αβSort u₃} (f : (x : α) → (y : β) → φ x y) (y : β) (x : α) :
φ x y
Equations
def Function.app {α : Sort u₁} {β : αSort u₂} (f : (x : α) → β x) (x : α) :
β x
Equations

Given functions f : β → β → φ→ β → φ→ φ and g : α → β→ β, produce a function α → α → φ→ α → φ→ φ that evaluates g on each argument, then applies f to the results. Can be used, e.g., to transfer a relation from β to α.

Equations
theorem Function.left_id {α : Sort u₁} {β : Sort u₂} (f : αβ) :
id f = f
theorem Function.right_id {α : Sort u₁} {β : Sort u₂} (f : αβ) :
f id = f
theorem Function.comp.assoc {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {δ : Sort u₄} (f : φδ) (g : βφ) (h : αβ) :
(f g) h = f g h
@[simp]
theorem Function.comp.left_id {α : Sort u₁} {β : Sort u₂} (f : αβ) :
id f = f
@[simp]
theorem Function.comp.right_id {α : Sort u₁} {β : Sort u₂} (f : αβ) :
f id = f
theorem Function.comp_const_right {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} (f : βφ) (b : β) :
def Function.Injective {α : Sort u₁} {β : Sort u₂} (f : αβ) :

A function f : α → β→ β is called injective if f x = f y implies x = y.

Equations
theorem Function.Injective.comp {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {g : βφ} {f : αβ} (hg : Function.Injective g) (hf : Function.Injective f) :
def Function.Surjective {α : Sort u₁} {β : Sort u₂} (f : αβ) :

A function f : α → β→ β is called surjective if every b : β is equal to f a for some a : α.

Equations
theorem Function.Surjective.comp {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {g : βφ} {f : αβ} (hg : Function.Surjective g) (hf : Function.Surjective f) :
def Function.Bijective {α : Sort u₁} {β : Sort u₂} (f : αβ) :

A function is called bijective if it is both injective and surjective.

Equations
theorem Function.Bijective.comp {α : Sort u₁} {β : Sort u₂} {φ : Sort u₃} {g : βφ} {f : αβ} :
def Function.LeftInverse {α : Sort u₁} {β : Sort u₂} (g : βα) (f : αβ) :

LeftInverse g f means that g is a left inverse to f. That is, g ∘ f = id∘ f = id.

Equations
def Function.HasLeftInverse {α : Sort u₁} {β : Sort u₂} (f : αβ) :

HasLeftInverse f means that f has an unspecified left inverse.

Equations
def Function.RightInverse {α : Sort u₁} {β : Sort u₂} (g : βα) (f : αβ) :

RightInverse g f means that g is a right inverse to f. That is, f ∘ g = id∘ g = id.

Equations
def Function.HasRightInverse {α : Sort u₁} {β : Sort u₂} (f : αβ) :

hasRightInverse f means that f has an unspecified right inverse.

Equations
theorem Function.LeftInverse.injective {α : Sort u₁} {β : Sort u₂} {g : βα} {f : αβ} :
theorem Function.HasLeftInverse.injective {α : Sort u₁} {β : Sort u₂} {f : αβ} :
theorem Function.rightInverse_of_injective_of_leftInverse {α : Sort u₁} {β : Sort u₂} {f : αβ} {g : βα} (injf : Function.Injective f) (lfg : Function.LeftInverse f g) :
theorem Function.RightInverse.surjective {α : Sort u₁} {β : Sort u₂} {f : αβ} {g : βα} (h : Function.RightInverse g f) :
theorem Function.leftInverse_of_surjective_of_rightInverse {α : Sort u₁} {β : Sort u₂} {f : αβ} {g : βα} (surjf : Function.Surjective f) (rfg : Function.RightInverse f g) :
@[inline]
def Function.curry {α : Type u₁} {β : Type u₂} {φ : Type u₃} :
(α × βφ) → αβφ

Interpret a function on α × β× β as a function with two arguments.

Equations
@[inline]
def Function.uncurry {α : Type u₁} {β : Type u₂} {φ : Type u₃} :
(αβφ) → α × βφ

Interpret a function with two arguments as a function on α × β× β

Equations
@[simp]
theorem Function.curry_uncurry {α : Type u₁} {β : Type u₂} {φ : Type u₃} (f : αβφ) :
@[simp]
theorem Function.uncurry_curry {α : Type u₁} {β : Type u₂} {φ : Type u₃} (f : α × βφ) :
theorem Function.LeftInverse.id {α : Type u₁} {β : Type u₂} {g : βα} {f : αβ} (h : Function.LeftInverse g f) :
g f = id
theorem Function.RightInverse.id {α : Type u₁} {β : Type u₂} {g : βα} {f : αβ} (h : Function.RightInverse g f) :
f g = id