Documentation

Mathlib.Logic.Function.OfArity

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 #

@[reducible, inline]
abbrev Function.OfArity (α : Type u) (β : Type u) (n : ) :

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 β.

Equations
Instances For
    @[simp]
    theorem Function.ofArity_zero (α : Type u) (β : Type u) :
    Function.OfArity α β 0 = β
    @[simp]
    theorem Function.ofArity_succ (α : Type u) (β : Type u) (n : ) :
    Function.OfArity α β n.succ = (αFunction.OfArity α β n)
    def Function.OfArity.const (α : Type u) {β : Type u} (b : β) (n : ) :

    Constant n-ary function with value b.

    Equations
    Instances For
      @[simp]
      theorem Function.OfArity.const_zero (α : Type u) {β : Type u} (b : β) :
      @[simp]
      theorem Function.OfArity.const_succ (α : Type u) {β : Type u} (b : β) (n : ) :
      Function.OfArity.const α b n.succ = fun (x : Matrix.vecHead fun (x : Fin n.succ) => α) => Function.OfArity.const α b n
      theorem Function.OfArity.const_succ_apply (α : Type u) {β : Type u} (b : β) (n : ) (x : α) :
      instance Function.OfArity.inhabited {α : Type u_1} {β : Type u_1} {n : } [Inhabited β] :
      Equations
      theorem Function.FromTypes.fromTypes_fin_const (α : Type u) (β : Type u) (n : ) :
      Function.FromTypes (fun (x : Fin n) => α) β = Function.OfArity α β n
      def Function.FromTypes.fromTypes_fin_const_equiv (α : Type u) (β : Type u) (n : ) :
      Function.FromTypes (fun (x : Fin n) => α) β Function.OfArity α β n

      The definitional equality between heterogeneous functions with constant domain and n-ary functions with that domain.

      Equations
      Instances For