core / init.data.array.basic - mathlib3 docs
- data : Π (i : fin n), α i
In the VM, d_array is implemented as a persistent array.
Instances for d_array
The empty array.
Equations
read a i reads the ith member of a. Has builtin VM implementation.
Equations
write a i v sets the ith member of a to be v. Has builtin VM implementation.
Equations
Fold over the elements of the given array in ascending order. Has builtin VM implementation.
Equations
Map the array. Has builtin VM implementation.
Equations
@[protected]
Boolean element-wise equality check.
Equations
@[protected, instance]
Equations
A non-dependent array (see d_array). Implemented in the VM as a persistent array.
Equations
Instances for array
mk_array n v creates a new array of length n where each element is v. Has builtin VM implementation.
Equations
Fold array starting from 0, folder function includes an index argument.
Equations
Map each element of the given array with an index argument.
Equations
push_back a v pushes value v to the end of the array. Has builtin VM implementation.
Equations
- a.push_back v = {data := λ (_x : fin (n + 1)), array.push_back._match_1 a v _x}
- array.push_back._match_1 a v ⟨j, h₁⟩ = dite (j = n) (λ (h₂ : j = n), v) (λ (h₂ : ¬j = n), a.read ⟨j, _⟩)
Discard last element in the array. Has builtin VM implementation.
Equations
Auxilliary function for monadically mapping a function over an array.
Equations
Monadically map a function over the array.
Equations
Map a function over the array.
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations