Function types of a given heterogeneous arity #
This provides Function.FromTypes, such that FromTypes ![α, β] τ = α → β → τ.
Note that it is often preferable to use ((i : Fin n) → p i) → τ in place of FromTypes p τ.
Main definitions #
Function.FromTypes p τ:n-ary functionp 0 → p 1 → ... → p (n - 1) → β.
The type of n-ary functions p 0 → p 1 → ... → p (n - 1) → τ.
Equations
- Function.FromTypes x_3 x✝ = x✝
- Function.FromTypes p x✝ = (Matrix.vecHead p → Function.FromTypes (Matrix.vecTail p) x✝)
Instances For
The definitional equality between 0-ary heterogeneous functions into τ and τ.
Equations
Instances For
@[simp]
theorem
Function.fromTypes_zero_equiv_symm_apply
(p : Fin 0 → Type u)
(τ : Type u)
(a : FromTypes p τ)
:
@[simp]
The definitional equality between ![]-ary heterogeneous functions into τ and τ.
Equations
Instances For
@[simp]
@[simp]
@[simp]
theorem
Function.fromTypes_cons_equiv_apply
{n : ℕ}
(α : Type u)
(p : Fin n → Type u)
(τ : Type u)
(a : FromTypes (Matrix.vecCons α p) τ)
:
@[simp]
theorem
Function.fromTypes_cons_equiv_symm_apply
{n : ℕ}
(α : Type u)
(p : Fin n → Type u)
(τ : Type u)
(a : FromTypes (Matrix.vecCons α p) τ)
:
Constant n-ary function with value t.
Equations
- Function.FromTypes.const x_4 x✝ = x✝
- Function.FromTypes.const p x✝ = fun (x : Matrix.vecHead p) => Function.FromTypes.const (Matrix.vecTail p) x✝
Instances For
Equations
- Function.FromTypes.inhabited = { default := Function.FromTypes.const p default }