Note about Mathlib/Init/
#
The files in Mathlib/Init
are leftovers from the port from Mathlib3.
(They contain content moved from lean3 itself that Mathlib needed but was not moved to lean4.)
We intend to move all the content of these files out into the main Mathlib
directory structure.
Contributions assisting with this are appreciated.
#align
statements without corresponding declarations
(i.e. because the declaration is in Batteries or Lean) can be left here.
These will be deleted soon so will not significantly delay deleting otherwise empty Init
files.
General operations on functions #
Composition of dependent functions: (f ∘' g) x = f (g x)
, where type of g x
depends on x
and type of f (g x)
depends on x
and g x
.
Instances For
Equations
- Function.«term_∘'_» = Lean.ParserDescr.trailingNode `Function.term_∘'_ 80 81 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ∘' ") (Lean.ParserDescr.cat `term 80))
Instances For
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 α
.
Instances For
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
- Function.term_On_ = Lean.ParserDescr.trailingNode `Function.term_On_ 2 2 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " on ") (Lean.ParserDescr.cat `term 3))
Instances For
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
- Function.combine f op g x y = op (f x y) (g x y)
Instances For
Equations
- Function.swap f y x = f x y
Instances For
Alias of Function.id_comp
.
Alias of Function.id_comp
.
Alias of Function.comp_id
.
Alias of Function.comp_id
.
Alias of Function.comp_const
.
A function f : α → β
is called injective if f x = f y
implies x = y
.
Equations
- Function.Injective f = ∀ ⦃a₁ a₂ : α⦄, f a₁ = f a₂ → a₁ = a₂
Instances For
A function f : α → β
is called surjective if every b : β
is equal to f a
for some a : α
.
Equations
- Function.Surjective f = ∀ (b : β), ∃ (a : α), f a = b
Instances For
A function is called bijective if it is both injective and surjective.
Equations
Instances For
LeftInverse g f
means that g is a left inverse to f. That is, g ∘ f = id
.
Equations
- Function.LeftInverse g f = ∀ (x : α), g (f x) = x
Instances For
HasLeftInverse f
means that f
has an unspecified left inverse.
Equations
- Function.HasLeftInverse f = ∃ (finv : β → α), Function.LeftInverse finv f
Instances For
HasRightInverse f
means that f
has an unspecified right inverse.
Equations
- Function.HasRightInverse f = ∃ (finv : β → α), Function.RightInverse finv f
Instances For
Interpret a function on α × β
as a function with two arguments.
Equations
- Function.curry f a b = f (a, b)
Instances For
Interpret a function with two arguments as a function on α × β
Equations
- Function.uncurry f a = f a.fst a.snd