Lemmas about Array.zip
, Array.zipWith
, Array.zipWithAll
, and Array.unzip
. #
Zippers #
zipWith #
theorem
Array.getElem?_zipWith
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{as : Array α}
{bs : Array β}
{f : α → β → γ}
{i : Nat}
:
See also getElem?_zipWith'
for a variant
using Option.map
and Option.bind
rather than a match
.
theorem
Array.getElem?_zipWith'
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l₁ : Array α}
{l₂ : Array β}
{f : α → β → γ}
{i : Nat}
:
Variant of getElem?_zipWith
using Option.map
and Option.bind
rather than a match
.
zip #
zipWithAll #
theorem
Array.zipWithAll_map
{γ : Type u_1}
{δ : Type u_2}
{α : Type u_1}
{β : Type u_2}
{μ : Type u_3}
(f : Option γ → Option δ → μ)
(g : α → γ)
(h : β → δ)
(l₁ : Array α)
(l₂ : Array β)
:
zipWithAll f (map g l₁) (map h l₂) = zipWithAll (fun (a : Option α) (b : Option β) => f (g <$> a) (h <$> b)) l₁ l₂