Function types of a given arity #
This provides Function.OfArity, such that OfArity α β 2 = α → α → β.
Note that it is often preferable to use (Fin n → α) → β in place of OfArity n α β.
Main definitions #
Function.OfArity α β n:n-ary functionα → α → ... → β. Defined inductively.Function.OfArity.const α b n:n-ary constant function equal tob.
@[reducible, inline]
The type of n-ary functions α → α → ... → β.
Note that this is not universe polymorphic, as this would require that when n=0 we produce either
Unit → β or ULift β.
Instances For
@[simp]
Constant n-ary function with value b.
Instances For
@[simp]
@[simp]
theorem
Function.OfArity.const_succ
(α : Type u)
{β : Type u}
(b : β)
(n : ℕ)
:
const α b n.succ = fun (x : Matrix.vecHead fun (x : Fin n.succ) => α) => const α b n
@[implicit_reducible]
instance
Function.OfArity.inhabited
{α β : Type u_1}
{n : ℕ}
[Inhabited β]
:
Inhabited (OfArity α β n)
The definitional equality between heterogeneous functions with constant
domain and n-ary functions with that domain.