The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V01. The language of Mathlib

Mathlib.Logic.Function.OfArity

10 declarations. Mathlib docs · Source

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 to b.

abbrev Function.OfArity E1 #

Type u → Type u → ℕ → Type u

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

theorem Function.ofArity_zero E0 #

∀ (α β : Type u), Function.OfArity α β 0 = β

theorem Function.ofArity_succ E0 #

∀ (α β : Type u) (n : ℕ), Function.OfArity α β n.succ = (α → Function.OfArity α β n)

def Function.OfArity.const E1 #

(α : Type u) → {β : Type u} → β → (n : ℕ) → Function.OfArity α β n

Constant n-ary function with value b.

theorem Function.OfArity.const_zero E0 #

∀ (α : Type u) {β : Type u} (b : β), Function.OfArity.const α b 0 = b

theorem Function.OfArity.const_succ E0 #

∀ (α : Type u) {β : Type u} (b : β) (n : ℕ), Function.OfArity.const α b n.succ = fun x ↦ Function.OfArity.const α b n

theorem Function.OfArity.const_succ_apply E0 #

∀ (α : Type u) {β : Type u} (b : β) (n : ℕ) (x : α), Function.OfArity.const α b n.succ x = Function.OfArity.const α b n

instance Function.OfArity.inhabited E0 #

{α β : Type u_1} → {n : ℕ} → [Inhabited β] → Inhabited (Function.OfArity α β n)

theorem Function.FromTypes.fromTypes_fin_const E1 #

∀ (α β : Type u) (n : ℕ), Function.FromTypes (fun x ↦ α) β = Function.OfArity α β n

def Function.FromTypes.fromTypes_fin_const_equiv E1 #

(α β : Type u) → (n : ℕ) → Function.FromTypes (fun x ↦ α) β ≃ Function.OfArity α β n

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