The zip_with
operation on vectors. #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Apply the function f : α → β → γ
to each corresponding pair of elements from two vectors.
Equations
- vector.zip_with f = λ (x : vector α n) (y : vector β n), ⟨list.zip_with f x.val y.val, _⟩
theorem
vector.prod_mul_prod_eq_prod_zip_with
{α : Type u_1}
{n : ℕ}
[comm_monoid α]
(x y : vector α n) :
x.to_list.prod * y.to_list.prod = (vector.zip_with has_mul.mul x y).to_list.prod
theorem
vector.sum_add_sum_eq_sum_zip_with
{α : Type u_1}
{n : ℕ}
[add_comm_monoid α]
(x y : vector α n) :
x.to_list.sum + y.to_list.sum = (vector.zip_with has_add.add x y).to_list.sum