Equivalences involving array #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
We keep this separate from the file containing list-like equivalences as those have no future
in mathlib4.
The natural equivalence between length-n heterogeneous arrays
and dependent functions from fin n.
Equations
- equiv.d_array_equiv_fin α = {to_fun := d_array.read α, inv_fun := d_array.mk (λ (i : fin n), α i), left_inv := _, right_inv := _}
The natural equivalence between length-n arrays and functions from fin n.
Equations
- equiv.array_equiv_fin n α = equiv.d_array_equiv_fin (λ (_x : fin n), α)
The natural equivalence between length-n vectors and length-n arrays.
Equations
- equiv.vector_equiv_array α n = (equiv.vector_equiv_fin α n).trans (equiv.array_equiv_fin n α).symm
@[protected, instance]
Equations
- array.traversable = equiv.traversable (λ (α : Type u_1), equiv.vector_equiv_array α n)
@[protected, instance]
Equations
- array.is_lawful_traversable = equiv.is_lawful_traversable (λ (α : Type u_1), equiv.vector_equiv_array α n)
@[protected, instance]
If α is encodable, then so is array n α.
Equations
- array.encodable = encodable.of_equiv (fin n → α) (equiv.array_equiv_fin n α)