File: Mathlib/Data/Vector/MapLemmas.lean

full_name: Mathlib.Vector.mapAccumr_mapAccumr
code: @[simp]
theorem mapAccumr_mapAccumr :
    mapAccumr f₁ (mapAccumr f₂ xs s₂).snd s₁
    = let m := (mapAccumr (fun x s =>
        let r₂ := f₂ x s.snd
        let r₁ := f₁ r₂.snd s.fst
        ((r₁.fst, r₂.fst), r₁.snd)
      ) xs (s₁, s₂))
      (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr f₁ (Mathlib.Vector.mapAccumr f₂ xs s₂).2 s₁ =
  let m :=
    Mathlib.Vector.mapAccumr
      (fun x s =>
        let r₂ := f₂ x s.2;
        let r₁ := f₁ r₂.2 s.1;
        ((r₁.1, r₂.1), r₁.2))
      xs (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.mapAccumr_map
code: @[simp]
theorem mapAccumr_map (f₂ : α → β) :
    (mapAccumr f₁ (map f₂ xs) s) = (mapAccumr (fun x s => f₁ (f₂ x) s) xs s) 
goal: Mathlib.Vector.mapAccumr f₁ (Mathlib.Vector.map f₂ xs) s = Mathlib.Vector.mapAccumr (fun x s => f₁ (f₂ x) s) xs s

full_name: Mathlib.Vector.map_mapAccumr
code: @[simp]
theorem map_mapAccumr (f₁ : β → γ) :
    (map f₁ (mapAccumr f₂ xs s).snd) = (mapAccumr (fun x s =>
        let r := (f₂ x s); (r.fst, f₁ r.snd)
      ) xs s).snd 
goal: Mathlib.Vector.map f₁ (Mathlib.Vector.mapAccumr f₂ xs s).2 =
  (Mathlib.Vector.mapAccumr
      (fun x s =>
        let r := f₂ x s;
        (r.1, f₁ r.2))
      xs s).2

full_name: Mathlib.Vector.map_map
code: @[simp]
theorem map_map (f₁ : β → γ) (f₂ : α → β) :
    map f₁ (map f₂ xs) = map (fun x => f₁ <| f₂ x) xs 
goal: Mathlib.Vector.map f₁ (Mathlib.Vector.map f₂ xs) = Mathlib.Vector.map (fun x => f₁ (f₂ x)) xs

full_name: Mathlib.Vector.mapAccumr₂_mapAccumr_left
code: @[simp]
theorem mapAccumr₂_mapAccumr_left (f₁ : γ → β → σ₁ → σ₁ × ζ) (f₂ : α → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ (mapAccumr f₂ xs s₂).snd ys s₁)
    = let m := (mapAccumr₂ (fun x y s =>
          let r₂ := f₂ x s.snd
          let r₁ := f₁ r₂.snd y s.fst
          ((r₁.fst, r₂.fst), r₁.snd)
        ) xs ys (s₁, s₂))
      (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr₂ f₁ (Mathlib.Vector.mapAccumr f₂ xs s₂).2 ys s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y s =>
        let r₂ := f₂ x s.2;
        let r₁ := f₁ r₂.2 y s.1;
        ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.map₂_map_left
code: @[simp]
theorem map₂_map_left (f₁ : γ → β → ζ) (f₂ : α → γ) :
    map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys 
goal: Mathlib.Vector.map₂ f₁ (Mathlib.Vector.map f₂ xs) ys = Mathlib.Vector.map₂ (fun x y => f₁ (f₂ x) y) xs ys

full_name: Mathlib.Vector.mapAccumr₂_mapAccumr_right
code: @[simp]
theorem mapAccumr₂_mapAccumr_right (f₁ : α → γ → σ₁ → σ₁ × ζ) (f₂ : β → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ xs (mapAccumr f₂ ys s₂).snd s₁)
    = let m := (mapAccumr₂ (fun x y s =>
          let r₂ := f₂ y s.snd
          let r₁ := f₁ x r₂.snd s.fst
          ((r₁.fst, r₂.fst), r₁.snd)
        ) xs ys (s₁, s₂))
      (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr₂ f₁ xs (Mathlib.Vector.mapAccumr f₂ ys s₂).2 s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y s =>
        let r₂ := f₂ y s.2;
        let r₁ := f₁ x r₂.2 s.1;
        ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.map₂_map_right
code: @[simp]
theorem map₂_map_right (f₁ : α → γ → ζ) (f₂ : β → γ) :
    map₂ f₁ xs (map f₂ ys) = map₂ (fun x y => f₁ x (f₂ y)) xs ys 
goal: Mathlib.Vector.map₂ f₁ xs (Mathlib.Vector.map f₂ ys) = Mathlib.Vector.map₂ (fun x y => f₁ x (f₂ y)) xs ys

full_name: Mathlib.Vector.mapAccumr_mapAccumr₂
code: @[simp]
theorem mapAccumr_mapAccumr₂ (f₁ : γ → σ₁ → σ₁ × ζ) (f₂ : α → β → σ₂ → σ₂ × γ) :
    (mapAccumr f₁ (mapAccumr₂ f₂ xs ys s₂).snd s₁)
    = let m := mapAccumr₂ (fun x y s =>
          let r₂ := f₂ x y s.snd
          let r₁ := f₁ r₂.snd s.fst
          ((r₁.fst, r₂.fst), r₁.snd)
        ) xs ys (s₁, s₂)
      (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr f₁ (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2 s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y s =>
        let r₂ := f₂ x y s.2;
        let r₁ := f₁ r₂.2 s.1;
        ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.map_map₂
code: @[simp]
theorem map_map₂ (f₁ : γ → ζ) (f₂ : α → β → γ) :
    map f₁ (map₂ f₂ xs ys) = map₂ (fun x y => f₁ <| f₂ x y) xs ys 
goal: Mathlib.Vector.map f₁ (Mathlib.Vector.map₂ f₂ xs ys) = Mathlib.Vector.map₂ (fun x y => f₁ (f₂ x y)) xs ys

full_name: Mathlib.Vector.mapAccumr₂_mapAccumr₂_left_left
code: @[simp]
theorem mapAccumr₂_mapAccumr₂_left_left (f₁ : γ → α → σ₁ → σ₁ × φ) (f₂ : α → β → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ (mapAccumr₂ f₂ xs ys s₂).snd xs s₁)
    = let m := mapAccumr₂ (fun x y (s₁, s₂) =>
                let r₂ := f₂ x y s₂
                let r₁ := f₁ r₂.snd x s₁
                ((r₁.fst, r₂.fst), r₁.snd)
              )
            xs ys (s₁, s₂)
    (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr₂ f₁ (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2 xs s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y x_1 =>
        match x_1 with
        | (s₁, s₂) =>
          let r₂ := f₂ x y s₂;
          let r₁ := f₁ r₂.2 x s₁;
          ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.mapAccumr₂_mapAccumr₂_left_right
code: @[simp]
theorem mapAccumr₂_mapAccumr₂_left_right
    (f₁ : γ → β → σ₁ → σ₁ × φ) (f₂ : α → β → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ (mapAccumr₂ f₂ xs ys s₂).snd ys s₁)
    = let m := mapAccumr₂ (fun x y (s₁, s₂) =>
                let r₂ := f₂ x y s₂
                let r₁ := f₁ r₂.snd y s₁
                ((r₁.fst, r₂.fst), r₁.snd)
              )
            xs ys (s₁, s₂)
    (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr₂ f₁ (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2 ys s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y x_1 =>
        match x_1 with
        | (s₁, s₂) =>
          let r₂ := f₂ x y s₂;
          let r₁ := f₁ r₂.2 y s₁;
          ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.mapAccumr₂_mapAccumr₂_right_left
code: @[simp]
theorem mapAccumr₂_mapAccumr₂_right_left (f₁ : α → γ → σ₁ → σ₁ × φ) (f₂ : α → β → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ xs (mapAccumr₂ f₂ xs ys s₂).snd s₁)
    = let m := mapAccumr₂ (fun x y (s₁, s₂) =>
                let r₂ := f₂ x y s₂
                let r₁ := f₁ x r₂.snd s₁
                ((r₁.fst, r₂.fst), r₁.snd)
              )
            xs ys (s₁, s₂)
    (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr₂ f₁ xs (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2 s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y x_1 =>
        match x_1 with
        | (s₁, s₂) =>
          let r₂ := f₂ x y s₂;
          let r₁ := f₁ x r₂.2 s₁;
          ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.mapAccumr₂_mapAccumr₂_right_right
code: @[simp]
theorem mapAccumr₂_mapAccumr₂_right_right (f₁ : β → γ → σ₁ → σ₁ × φ) (f₂ : α → β → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ ys (mapAccumr₂ f₂ xs ys s₂).snd s₁)
    = let m := mapAccumr₂ (fun x y (s₁, s₂) =>
                let r₂ := f₂ x y s₂
                let r₁ := f₁ y r₂.snd s₁
                ((r₁.fst, r₂.fst), r₁.snd)
              )
            xs ys (s₁, s₂)
    (m.fst.fst, m.snd) 
goal: Mathlib.Vector.mapAccumr₂ f₁ ys (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2 s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y x_1 =>
        match x_1 with
        | (s₁, s₂) =>
          let r₂ := f₂ x y s₂;
          let r₁ := f₁ y r₂.2 s₁;
          ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)

full_name: Mathlib.Vector.mapAccumr_bisim
code: theorem mapAccumr_bisim {f₁ : α → σ₁ → σ₁ × β} {f₂ : α → σ₂ → σ₂ × β} {s₁ : σ₁} {s₂ : σ₂}
    (R : σ₁ → σ₂ → Prop) (h₀ : R s₁ s₂)
    (hR : ∀ {s q} a, R s q → R (f₁ a s).1 (f₂ a q).1 ∧ (f₁ a s).2 = (f₂ a q).2) :
    R (mapAccumr f₁ xs s₁).fst (mapAccumr f₂ xs s₂).fst
    ∧ (mapAccumr f₁ xs s₁).snd = (mapAccumr f₂ xs s₂).snd 
goal: R (Mathlib.Vector.mapAccumr f₁ xs s₁).1 (Mathlib.Vector.mapAccumr f₂ xs s₂).1 ∧
  (Mathlib.Vector.mapAccumr f₁ xs s₁).2 = (Mathlib.Vector.mapAccumr f₂ xs s₂).2

full_name: Mathlib.Vector.mapAccumr_bisim_tail
code: theorem mapAccumr_bisim_tail {f₁ : α → σ₁ → σ₁ × β} {f₂ : α → σ₂ → σ₂ × β} {s₁ : σ₁} {s₂ : σ₂}
    (h : ∃ R : σ₁ → σ₂ → Prop, R s₁ s₂ ∧
      ∀ {s q} a, R s q → R (f₁ a s).1 (f₂ a q).1 ∧ (f₁ a s).2 = (f₂ a q).2) :
    (mapAccumr f₁ xs s₁).snd = (mapAccumr f₂ xs s₂).snd 
goal: (Mathlib.Vector.mapAccumr f₁ xs s₁).2 = (Mathlib.Vector.mapAccumr f₂ xs s₂).2

full_name: Mathlib.Vector.mapAccumr₂_bisim
code: theorem mapAccumr₂_bisim {ys : Vector β n} {f₁ : α → β → σ₁ → σ₁ × γ}
    {f₂ : α → β → σ₂ → σ₂ × γ} {s₁ : σ₁} {s₂ : σ₂}
    (R : σ₁ → σ₂ → Prop) (h₀ : R s₁ s₂)
    (hR :  ∀ {s q} a b, R s q → R (f₁ a b s).1 (f₂ a b q).1 ∧ (f₁ a b s).2 = (f₂ a b q).2) :
    R (mapAccumr₂ f₁ xs ys s₁).1 (mapAccumr₂ f₂ xs ys s₂).1
    ∧ (mapAccumr₂ f₁ xs ys s₁).2 = (mapAccumr₂ f₂ xs ys s₂).2 
goal: R (Mathlib.Vector.mapAccumr₂ f₁ xs ys s₁).1 (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).1 ∧
  (Mathlib.Vector.mapAccumr₂ f₁ xs ys s₁).2 = (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2

full_name: Mathlib.Vector.mapAccumr₂_bisim_tail
code: theorem mapAccumr₂_bisim_tail {ys : Vector β n} {f₁ : α → β → σ₁ → σ₁ × γ}
    {f₂ : α → β → σ₂ → σ₂ × γ} {s₁ : σ₁} {s₂ : σ₂}
    (h : ∃ R : σ₁ → σ₂ → Prop, R s₁ s₂ ∧
      ∀ {s q} a b, R s q → R (f₁ a b s).1 (f₂ a b q).1 ∧ (f₁ a b s).2 = (f₂ a b q).2) :
    (mapAccumr₂ f₁ xs ys s₁).2 = (mapAccumr₂ f₂ xs ys s₂).2 
goal: (Mathlib.Vector.mapAccumr₂ f₁ xs ys s₁).2 = (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2

full_name: Mathlib.Vector.map_eq_mapAccumr
code: protected theorem map_eq_mapAccumr :
    map f xs = (mapAccumr (fun x (_ : Unit) ↦ ((), f x)) xs ()).snd 
goal: ∀ {α_1 : Type u_1} {f : α → α_1}, Mathlib.Vector.map f xs = (Mathlib.Vector.mapAccumr (fun x x_1 => ((), f x)) xs ()).2

full_name: Mathlib.Vector.mapAccumr_eq_map
code: /--
  If there is a set of states that is closed under `f`, and such that `f` produces that same output
  for all states in this set, then the state is not actually needed.
  Hence, then we can rewrite `mapAccumr` into just `map`
-/
theorem mapAccumr_eq_map {f : α → σ → σ × β} {s₀ : σ} (S : Set σ) (h₀ : s₀ ∈ S)
    (closure : ∀ a s, s ∈ S → (f a s).1 ∈ S)
    (out : ∀ a s s', s ∈ S → s' ∈ S → (f a s).2 = (f a s').2) :
    (mapAccumr f xs s₀).snd = map (f · s₀ |>.snd) xs 
goal: (Mathlib.Vector.mapAccumr f xs s₀).2 = Mathlib.Vector.map (fun x => (f x s₀).2) xs

full_name: Mathlib.Vector.map₂_eq_mapAccumr₂
code: protected theorem map₂_eq_mapAccumr₂ :
    map₂ f xs ys = (mapAccumr₂ (fun x y (_ : Unit) ↦ ((), f x y)) xs ys ()).snd 
goal: ∀ {α_1 : Type} {f : α → β → α_1},
  Mathlib.Vector.map₂ f xs ys = (Mathlib.Vector.mapAccumr₂ (fun x y x_1 => ((), f x y)) xs ys ()).2

full_name: Mathlib.Vector.mapAccumr₂_eq_map₂
code: /--
  If there is a set of states that is closed under `f`, and such that `f` produces that same output
  for all states in this set, then the state is not actually needed.
  Hence, then we can rewrite `mapAccumr₂` into just `map₂`
-/
theorem mapAccumr₂_eq_map₂ {f : α → β → σ → σ × γ} {s₀ : σ} (S : Set σ) (h₀ : s₀ ∈ S)
    (closure : ∀ a b s, s ∈ S → (f a b s).1 ∈ S)
    (out : ∀ a b s s', s ∈ S → s' ∈ S → (f a b s).2 = (f a b s').2) :
    (mapAccumr₂ f xs ys s₀).snd = map₂ (f · · s₀ |>.snd) xs ys 
goal: (Mathlib.Vector.mapAccumr₂ f xs ys s₀).2 = Mathlib.Vector.map₂ (fun x x_1 => (f x x_1 s₀).2) xs ys

full_name: Mathlib.Vector.mapAccumr_eq_map_of_constant_state
code: /--
  If an accumulation function `f`, given an initial state `s`, produces `s` as its output state
  for all possible input bits, then the state is redundant and can be optimized out
-/
@[simp]
theorem mapAccumr_eq_map_of_constant_state (f : α → σ → σ × β) (s : σ) (h : ∀ a, (f a s).fst = s) :
    mapAccumr f xs s = (s, (map (fun x => (f x s).snd) xs)) 
goal: Mathlib.Vector.mapAccumr f xs s = (s, Mathlib.Vector.map (fun x => (f x s).2) xs)

full_name: Mathlib.Vector.mapAccumr₂_eq_map₂_of_constant_state
code: /--
  If an accumulation function `f`, given an initial state `s`, produces `s` as its output state
  for all possible input bits, then the state is redundant and can be optimized out
-/
@[simp]
theorem mapAccumr₂_eq_map₂_of_constant_state (f : α → β → σ → σ × γ) (s : σ)
    (h : ∀ a b, (f a b s).fst = s) :
    mapAccumr₂ f xs ys s = (s, (map₂ (fun x y => (f x y s).snd) xs ys)) 
goal: Mathlib.Vector.mapAccumr₂ f xs ys s = (s, Mathlib.Vector.map₂ (fun x y => (f x y s).2) xs ys)

full_name: Mathlib.Vector.mapAccumr_eq_map_of_unused_state
code: /--
  If an accumulation function `f`, produces the same output bits regardless of accumulation state,
  then the state is redundant and can be optimized out
-/
@[simp]
theorem mapAccumr_eq_map_of_unused_state (f : α → σ → σ × β) (s : σ)
    (h : ∀ a s s', (f a s).snd = (f a s').snd) :
    (mapAccumr f xs s).snd = (map (fun x => (f x s).snd) xs) 
goal: (Mathlib.Vector.mapAccumr f xs s).2 = Mathlib.Vector.map (fun x => (f x s).2) xs

full_name: Mathlib.Vector.mapAccumr₂_eq_map₂_of_unused_state
code: /--
  If an accumulation function `f`, produces the same output bits regardless of accumulation state,
  then the state is redundant and can be optimized out
-/
@[simp]
theorem mapAccumr₂_eq_map₂_of_unused_state (f : α → β → σ → σ × γ) (s : σ)
    (h : ∀ a b s s', (f a b s).snd = (f a b s').snd) :
    (mapAccumr₂ f xs ys s).snd = (map₂ (fun x y => (f x y s).snd) xs ys) 
goal: (Mathlib.Vector.mapAccumr₂ f xs ys s).2 = Mathlib.Vector.map₂ (fun x y => (f x y s).2) xs ys

full_name: Mathlib.Vector.mapAccumr_redundant_pair
code: /-- If `f` takes a pair of states, but always returns the same value for both elements of the
    pair, then we can simplify to just a single element of state
  -/
@[simp]
theorem mapAccumr_redundant_pair (f : α → (σ × σ) → (σ × σ) × β)
    (h : ∀ x s, (f x (s, s)).fst.fst = (f x (s, s)).fst.snd) :
    (mapAccumr f xs (s, s)).snd = (mapAccumr (fun x (s : σ) =>
      (f x (s, s) |>.fst.fst, f x (s, s) |>.snd)
    ) xs s).snd 
goal: (Mathlib.Vector.mapAccumr f xs (s, s)).2 =
  (Mathlib.Vector.mapAccumr (fun x s => ((f x (s, s)).1.1, (f x (s, s)).2)) xs s).2

full_name: Mathlib.Vector.mapAccumr₂_redundant_pair
code: /-- If `f` takes a pair of states, but always returns the same value for both elements of the
    pair, then we can simplify to just a single element of state
  -/
@[simp]
theorem mapAccumr₂_redundant_pair (f : α → β → (σ × σ) → (σ × σ) × γ)
    (h : ∀ x y s, let s' := (f x y (s, s)).fst; s'.fst = s'.snd) :
    (mapAccumr₂ f xs ys (s, s)).snd = (mapAccumr₂ (fun x y (s : σ) =>
      (f x y (s, s) |>.fst.fst, f x y (s, s) |>.snd)
    ) xs ys s).snd 
goal: (Mathlib.Vector.mapAccumr₂ f xs ys (s, s)).2 =
  (Mathlib.Vector.mapAccumr₂ (fun x y s => ((f x y (s, s)).1.1, (f x y (s, s)).2)) xs ys s).2

full_name: Mathlib.Vector.mapAccumr₂_unused_input_left
code: /--
  If `f` returns the same output and next state for every value of it's first argument, then
  `xs : Vector` is ignored, and we can rewrite `mapAccumr₂` into `map`
-/
@[simp]
theorem mapAccumr₂_unused_input_left [Inhabited α] (f : α → β → σ → σ × γ)
    (h : ∀ a b s, f default b s = f a b s) :
    mapAccumr₂ f xs ys s = mapAccumr (fun b s => f default b s) ys s 
goal: Mathlib.Vector.mapAccumr₂ f xs ys s = Mathlib.Vector.mapAccumr (fun b s => f default b s) ys s

full_name: Mathlib.Vector.mapAccumr₂_unused_input_right
code: /--
  If `f` returns the same output and next state for every value of it's second argument, then
  `ys : Vector` is ignored, and we can rewrite `mapAccumr₂` into `map`
-/
@[simp]
theorem mapAccumr₂_unused_input_right [Inhabited β] (f : α → β → σ → σ × γ)
    (h : ∀ a b s, f a default s = f a b s) :
    mapAccumr₂ f xs ys s = mapAccumr (fun a s => f a default s) xs s 
goal: Mathlib.Vector.mapAccumr₂ f xs ys s = Mathlib.Vector.mapAccumr (fun a s => f a default s) xs s

full_name: Mathlib.Vector.map₂_comm
code: theorem map₂_comm (f : α → α → β) (comm : ∀ a₁ a₂, f a₁ a₂ = f a₂ a₁) :
    map₂ f xs ys = map₂ f ys xs 
goal: Mathlib.Vector.map₂ f xs ys = Mathlib.Vector.map₂ f ys xs

full_name: Mathlib.Vector.mapAccumr₂_comm
code: theorem mapAccumr₂_comm (f : α → α → σ → σ × γ) (comm : ∀ a₁ a₂ s, f a₁ a₂ s = f a₂ a₁ s) :
    mapAccumr₂ f xs ys s = mapAccumr₂ f ys xs s 
goal: Mathlib.Vector.mapAccumr₂ f xs ys s = Mathlib.Vector.mapAccumr₂ f ys xs s

full_name: Mathlib.Vector.map₂_flip
code: theorem map₂_flip (f : α → β → γ) :
    map₂ f xs ys = map₂ (flip f) ys xs 
goal: Mathlib.Vector.map₂ f xs ys = Mathlib.Vector.map₂ (flip f) ys xs

full_name: Mathlib.Vector.mapAccumr₂_flip
code: theorem mapAccumr₂_flip (f : α → β → σ → σ × γ) :
    mapAccumr₂ f xs ys s = mapAccumr₂ (flip f) ys xs s 
goal: Mathlib.Vector.mapAccumr₂ f xs ys s = Mathlib.Vector.mapAccumr₂ (flip f) ys xs s