l3lab/ntp-mathlib huggingface dataset:
theorem smul_mem_span_smul_of_mem {s : Set S} {t : Set A} {k : S} (hks : k ∈ span R s) {x : A}
    (hx : x ∈ t) : k • x ∈ span R (s • t) :=
  span_induction hks (fun c hc => subset_span <| Set.mem_smul.2 ⟨c, x, hc, hx, rfl⟩)
    (by rw [zero_smul]; exact zero_mem _)
    (fun c₁ c₂ ih₁ ih₂ => by rw [add_smul]; exact add_mem ih₁ ih₂)
    fun b c hc => by 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid A
inst✝³ : Module R S
inst✝² : Module S A
inst✝¹ : Module R A
inst✝ : IsScalarTower R S A
s : Set S
t : Set A
k : S
hks : k ∈ span R s
x : A
hx : x ∈ t
b : R
c : S
hc : c • x ∈ span R (s • t)
⊢ (b • c) • x ∈ span R (s • t)

Next tactic:
rw [IsScalarTower.smul_assoc]
theorem smul_mem_span_smul_of_mem {s : Set S} {t : Set A} {k : S} (hks : k ∈ span R s) {x : A}
    (hx : x ∈ t) : k • x ∈ span R (s • t) :=
  span_induction hks (fun c hc => subset_span <| Set.mem_smul.2 ⟨c, x, hc, hx, rfl⟩)
    (by rw [zero_smul]; exact zero_mem _)
    (fun c₁ c₂ ih₁ ih₂ => by rw [add_smul]; exact add_mem ih₁ ih₂)
    fun b c hc => by rw [IsScalarTower.smul_assoc]; 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid A
inst✝³ : Module R S
inst✝² : Module S A
inst✝¹ : Module R A
inst✝ : IsScalarTower R S A
s : Set S
t : Set A
k : S
hks : k ∈ span R s
x : A
hx : x ∈ t
b : R
c : S
hc : c • x ∈ span R (s • t)
⊢ b • c • x ∈ span R (s • t)

Next tactic:
exact smul_mem _ _ hc
theorem smul_mem_span_smul {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R t) : k • x ∈ span R (s • t) :=
  span_induction hx (fun x hx => smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hx)
    (by 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x : A
hx : x ∈ span R t
⊢ k • 0 ∈ span R (s • t)

Next tactic:
rw [smul_zero]
theorem smul_mem_span_smul {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R t) : k • x ∈ span R (s • t) :=
  span_induction hx (fun x hx => smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hx)
    (by rw [smul_zero]; 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x : A
hx : x ∈ span R t
⊢ 0 ∈ span R (s • t)

Next tactic:
exact zero_mem _
theorem smul_mem_span_smul {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R t) : k • x ∈ span R (s • t) :=
  span_induction hx (fun x hx => smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hx)
    (by rw [smul_zero]; exact zero_mem _)
    (fun x y ihx ihy => by 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x✝ : A
hx : x✝ ∈ span R t
x y : A
ihx : k • x ∈ span R (s • t)
ihy : k • y ∈ span R (s • t)
⊢ k • (x + y) ∈ span R (s • t)

Next tactic:
rw [smul_add]
theorem smul_mem_span_smul {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R t) : k • x ∈ span R (s • t) :=
  span_induction hx (fun x hx => smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hx)
    (by rw [smul_zero]; exact zero_mem _)
    (fun x y ihx ihy => by rw [smul_add]; 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x✝ : A
hx : x✝ ∈ span R t
x y : A
ihx : k • x ∈ span R (s • t)
ihy : k • y ∈ span R (s • t)
⊢ k • x + k • y ∈ span R (s • t)

Next tactic:
exact add_mem ihx ihy
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x✝ : A
hx✝ : x✝ ∈ span R (s • t)
x : A
hx : x ∈ s • t
⊢ k • x ∈ span R (s • t)

Next tactic:
let ⟨p, q, _hp, hq, hpq⟩ := Set.mem_smul.1 hx
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      let ⟨p, q, _hp, hq, hpq⟩ := Set.mem_smul.1 hx
      

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x✝ : A
hx✝ : x✝ ∈ span R (s • t)
x : A
hx : x ∈ s • t
p : S
q : A
_hp : p ∈ s
hq : q ∈ t
hpq : p • q = x
⊢ k • x ∈ span R (s • t)

Next tactic:
rw [← hpq, smul_smul]
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      let ⟨p, q, _hp, hq, hpq⟩ := Set.mem_smul.1 hx
      rw [← hpq, smul_smul]
      

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x✝ : A
hx✝ : x✝ ∈ span R (s • t)
x : A
hx : x ∈ s • t
p : S
q : A
_hp : p ∈ s
hq : q ∈ t
hpq : p • q = x
⊢ (k * p) • q ∈ span R (s • t)

Next tactic:
exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      let ⟨p, q, _hp, hq, hpq⟩ := Set.mem_smul.1 hx
      rw [← hpq, smul_smul]
      exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq)
    (by 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x : A
hx : x ∈ span R (s • t)
⊢ k • 0 ∈ span R (s • t)

Next tactic:
rw [smul_zero]
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      let ⟨p, q, _hp, hq, hpq⟩ := Set.mem_smul.1 hx
      rw [← hpq, smul_smul]
      exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq)
    (by rw [smul_zero]; 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x : A
hx : x ∈ span R (s • t)
⊢ 0 ∈ span R (s • t)

Next tactic:
exact zero_mem _
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      let ⟨p, q, _hp, hq, hpq⟩ := Set.mem_smul.1 hx
      rw [← hpq, smul_smul]
      exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq)
    (by rw [smul_zero]; exact zero_mem _)
    (fun x y ihx ihy => by 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x✝ : A
hx : x✝ ∈ span R (s • t)
x y : A
ihx : k • x ∈ span R (s • t)
ihy : k • y ∈ span R (s • t)
⊢ k • (x + y) ∈ span R (s • t)

Next tactic:
rw [smul_add]
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      let ⟨p, q, _hp, hq, hpq⟩ := Set.mem_smul.1 hx
      rw [← hpq, smul_smul]
      exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq)
    (by rw [smul_zero]; exact zero_mem _)
    (fun x y ihx ihy => by rw [smul_add]; 

Proof state:
R : Type u
S : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝⁷ : Semiring R
inst✝⁶ : Semiring S
inst✝⁵ : AddCommMonoid A
inst✝⁴ : Module R S
inst✝³ : Module S A
inst✝² : Module R A
inst✝¹ : IsScalarTower R S A
inst✝ : SMulCommClass R S A
s : Set S
hs : span R s = ⊤
t : Set A
k : S
x✝ : A
hx : x✝ ∈ span R (s • t)
x y : A
ihx : k • x ∈ span R (s • t)
ihy : k • y ∈ span R (s • t)
⊢ k • x + k • y ∈ span R (s • t)

Next tactic:
exact add_mem ihx ihy
theorem map_mem_span_algebraMap_image {S T : Type*} [CommSemiring S] [Semiring T] [Algebra R S]
    [Algebra R T] [Algebra S T] [IsScalarTower R S T] (x : S) (a : Set S)
    (hx : x ∈ Submodule.span R a) : algebraMap S T x ∈ Submodule.span R (algebraMap S T '' a) := by
  

Proof state:
R : Type u
S✝ : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝¹² : CommSemiring R
inst✝¹¹ : Semiring S✝
inst✝¹⁰ : AddCommMonoid A
inst✝⁹ : Algebra R S✝
inst✝⁸ : Module S✝ A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R S✝ A
S : Type u_1
T : Type u_2
inst✝⁵ : CommSemiring S
inst✝⁴ : Semiring T
inst✝³ : Algebra R S
inst✝² : Algebra R T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x : S
a : Set S
hx : x ∈ span R a
⊢ (algebraMap S T) x ∈ span R (⇑(algebraMap S T) '' a)

Next tactic:
rw [span_algebraMap_image_of_tower, mem_map]
theorem map_mem_span_algebraMap_image {S T : Type*} [CommSemiring S] [Semiring T] [Algebra R S]
    [Algebra R T] [Algebra S T] [IsScalarTower R S T] (x : S) (a : Set S)
    (hx : x ∈ Submodule.span R a) : algebraMap S T x ∈ Submodule.span R (algebraMap S T '' a) := by
  rw [span_algebraMap_image_of_tower, mem_map]
  

Proof state:
R : Type u
S✝ : Type v
A : Type w
B : Type u₁
M : Type v₁
inst✝¹² : CommSemiring R
inst✝¹¹ : Semiring S✝
inst✝¹⁰ : AddCommMonoid A
inst✝⁹ : Algebra R S✝
inst✝⁸ : Module S✝ A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R S✝ A
S : Type u_1
T : Type u_2
inst✝⁵ : CommSemiring S
inst✝⁴ : Semiring T
inst✝³ : Algebra R S
inst✝² : Algebra R T
inst✝¹ : Algebra S T
inst✝ : IsScalarTower R S T
x : S
a : Set S
hx : x ∈ span R a
⊢ ∃ y ∈ span R a, (↑R (Algebra.linearMap S T)) y = (algebraMap S T) x

Next tactic:
exact ⟨x, hx, rfl⟩
@[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) := by
  

Proof state:
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type
γ : Type u_1
σ₂ : Type
xs : Vector α n
f₁ : β → σ₁ → σ₁ × γ
f₂ : α → σ₂ → σ₂ × β
s₂ : σ₂
s₁ : σ₁
⊢ mapAccumr f₁ (mapAccumr f₂ xs s₂).2 s₁ =
    let m :=
      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)

Next tactic:
induction xs using Vector.revInductionOn generalizing s₁ s₂
@[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) := by
  induction xs using Vector.revInductionOn generalizing s₁ s₂ <;> 

Proof state:
case nil
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type
γ : Type u_1
σ₂ : Type
xs : Vector α n
f₁ : β → σ₁ → σ₁ × γ
f₂ : α → σ₂ → σ₂ × β
s₂ : σ₂
s₁ : σ₁
⊢ mapAccumr f₁ (mapAccumr f₂ nil s₂).2 s₁ =
    let m :=
      mapAccumr
        (fun x s =>
          let r₂ := f₂ x s.2;
          let r₁ := f₁ r₂.2 s.1;
          ((r₁.1, r₂.1), r₁.2))
        nil (s₁, s₂);
    (m.1.1, m.2)

Next tactic:
simp_all
@[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) := by
  induction xs using Vector.revInductionOn generalizing s₁ s₂ <;> 

Proof state:
case snoc
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type
γ : Type u_1
σ₂ : Type
xs : Vector α n
f₁ : β → σ₁ → σ₁ × γ
f₂ : α → σ₂ → σ₂ × β
n✝ : ℕ
xs✝ : Vector α n✝
x✝ : α
a✝ :
  ∀ {s₂ : σ₂} {s₁ : σ₁},
    mapAccumr f₁ (mapAccumr f₂ xs✝ s₂).2 s₁ =
      let m :=
        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)
s₂ : σ₂
s₁ : σ₁
⊢ mapAccumr f₁ (mapAccumr f₂ (snoc xs✝ x✝) s₂).2 s₁ =
    let m :=
      mapAccumr
        (fun x s =>
          let r₂ := f₂ x s.2;
          let r₁ := f₁ r₂.2 s.1;
          ((r₁.1, r₂.1), r₁.2))
        (snoc xs✝ x✝) (s₁, s₂);
    (m.1.1, m.2)

Next tactic:
simp_all
@[simp]
theorem mapAccumr_map (f₂ : α → β) :
    (mapAccumr f₁ (map f₂ xs) s) = (mapAccumr (fun x s => f₁ (f₂ x) s) xs s) := by
  

Proof state:
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type
γ : Type u_1
σ₂ : Type ?u.3155
xs : Vector α n
f₁ : β → σ₁ → σ₁ × γ
f₂✝ : α → σ₂ → σ₂ × β
s : σ₁
f₂ : α → β
⊢ mapAccumr f₁ (map f₂ xs) s = mapAccumr (fun x s => f₁ (f₂ x) s) xs s

Next tactic:
induction xs using Vector.revInductionOn generalizing s
@[simp]
theorem mapAccumr_map (f₂ : α → β) :
    (mapAccumr f₁ (map f₂ xs) s) = (mapAccumr (fun x s => f₁ (f₂ x) s) xs s) := by
  induction xs using Vector.revInductionOn generalizing s <;> 

Proof state:
case nil
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type
γ : Type u_1
σ₂ : Type ?u.3155
xs : Vector α n
f₁ : β → σ₁ → σ₁ × γ
f₂✝ : α → σ₂ → σ₂ × β
f₂ : α → β
s : σ₁
⊢ mapAccumr f₁ (map f₂ nil) s = mapAccumr (fun x s => f₁ (f₂ x) s) nil s

Next tactic:
simp_all
@[simp]
theorem mapAccumr_map (f₂ : α → β) :
    (mapAccumr f₁ (map f₂ xs) s) = (mapAccumr (fun x s => f₁ (f₂ x) s) xs s) := by
  induction xs using Vector.revInductionOn generalizing s <;> 

Proof state:
case snoc
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type
γ : Type u_1
σ₂ : Type ?u.3155
xs : Vector α n
f₁ : β → σ₁ → σ₁ × γ
f₂✝ : α → σ₂ → σ₂ × β
f₂ : α → β
n✝ : ℕ
xs✝ : Vector α n✝
x✝ : α
a✝ : ∀ {s : σ₁}, mapAccumr f₁ (map f₂ xs✝) s = mapAccumr (fun x s => f₁ (f₂ x) s) xs✝ s
s : σ₁
⊢ mapAccumr f₁ (map f₂ (snoc xs✝ x✝)) s = mapAccumr (fun x s => f₁ (f₂ x) s) (snoc xs✝ x✝) s

Next tactic:
simp_all
@[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 := by
  

Proof state:
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type ?u.4342
γ : Type u_1
σ₂ : Type
xs : Vector α n
f₁✝ : β → σ₁ → σ₁ × γ
f₂ : α → σ₂ → σ₂ × β
s : σ₂
f₁ : β → γ
⊢ map f₁ (mapAccumr f₂ xs s).2 =
    (mapAccumr
        (fun x s =>
          let r := f₂ x s;
          (r.1, f₁ r.2))
        xs s).2

Next tactic:
induction xs using Vector.revInductionOn generalizing s
@[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 := by
  induction xs using Vector.revInductionOn generalizing s <;> 

Proof state:
case nil
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type ?u.4342
γ : Type u_1
σ₂ : Type
xs : Vector α n
f₁✝ : β → σ₁ → σ₁ × γ
f₂ : α → σ₂ → σ₂ × β
f₁ : β → γ
s : σ₂
⊢ map f₁ (mapAccumr f₂ nil s).2 =
    (mapAccumr
        (fun x s =>
          let r := f₂ x s;
          (r.1, f₁ r.2))
        nil s).2

Next tactic:
simp_all
@[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 := by
  induction xs using Vector.revInductionOn generalizing s <;> 

Proof state:
case snoc
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type ?u.4342
γ : Type u_1
σ₂ : Type
xs : Vector α n
f₁✝ : β → σ₁ → σ₁ × γ
f₂ : α → σ₂ → σ₂ × β
f₁ : β → γ
n✝ : ℕ
xs✝ : Vector α n✝
x✝ : α
a✝ :
  ∀ {s : σ₂},
    map f₁ (mapAccumr f₂ xs✝ s).2 =
      (mapAccumr
          (fun x s =>
            let r := f₂ x s;
            (r.1, f₁ r.2))
          xs✝ s).2
s : σ₂
⊢ map f₁ (mapAccumr f₂ (snoc xs✝ x✝) s).2 =
    (mapAccumr
        (fun x s =>
          let r := f₂ x s;
          (r.1, f₁ r.2))
        (snoc xs✝ x✝) s).2

Next tactic:
simp_all
@[simp]
theorem map_map (f₁ : β → γ) (f₂ : α → β) :
    map f₁ (map f₂ xs) = map (fun x => f₁ <| f₂ x) xs := by
  

Proof state:
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type ?u.6647
γ : Type u_1
σ₂ : Type ?u.6655
xs : Vector α n
f₁✝ : β → σ₁ → σ₁ × γ
f₂✝ : α → σ₂ → σ₂ × β
f₁ : β → γ
f₂ : α → β
⊢ map f₁ (map f₂ xs) = map (fun x => f₁ (f₂ x)) xs

Next tactic:
induction xs using Vector.inductionOn
@[simp]
theorem map_map (f₁ : β → γ) (f₂ : α → β) :
    map f₁ (map f₂ xs) = map (fun x => f₁ <| f₂ x) xs := by
  induction xs using Vector.inductionOn <;> 

Proof state:
case h_nil
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type ?u.6647
γ : Type u_1
σ₂ : Type ?u.6655
xs : Vector α n
f₁✝ : β → σ₁ → σ₁ × γ
f₂✝ : α → σ₂ → σ₂ × β
f₁ : β → γ
f₂ : α → β
⊢ map f₁ (map f₂ nil) = map (fun x => f₁ (f₂ x)) nil

Next tactic:
simp_all
@[simp]
theorem map_map (f₁ : β → γ) (f₂ : α → β) :
    map f₁ (map f₂ xs) = map (fun x => f₁ <| f₂ x) xs := by
  induction xs using Vector.inductionOn <;> 

Proof state:
case h_cons
α : Type u_3
n : ℕ
β : Type u_2
σ₁ : Type ?u.6647
γ : Type u_1
σ₂ : Type ?u.6655
xs : Vector α n
f₁✝ : β → σ₁ → σ₁ × γ
f₂✝ : α → σ₂ → σ₂ × β
f₁ : β → γ
f₂ : α → β
n✝ : ℕ
x✝ : α
w✝ : Vector α n✝
a✝ : map f₁ (map f₂ w✝) = map (fun x => f₁ (f₂ x)) w✝
⊢ map f₁ (map f₂ (x✝ ::ᵥ w✝)) = map (fun x => f₁ (f₂ x)) (x✝ ::ᵥ w✝)

Next tactic:
simp_all
@[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) := by
  

Proof state:
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
γ σ₁ ζ σ₂ : Type
s₂ : σ₂
s₁ : σ₁
f₁ : γ → β → σ₁ → σ₁ × ζ
f₂ : α → σ₂ → σ₂ × γ
⊢ mapAccumr₂ f₁ (mapAccumr f₂ xs s₂).2 ys s₁ =
    let m :=
      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)

Next tactic:
induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂
@[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) := by
  induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> 

Proof state:
case nil
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
γ σ₁ ζ σ₂ : Type
f₁ : γ → β → σ₁ → σ₁ × ζ
f₂ : α → σ₂ → σ₂ × γ
s₂ : σ₂
s₁ : σ₁
⊢ mapAccumr₂ f₁ (mapAccumr f₂ nil s₂).2 nil s₁ =
    let m :=
      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))
        nil nil (s₁, s₂);
    (m.1.1, m.2)

Next tactic:
simp_all
@[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) := by
  induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> 

Proof state:
case snoc
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
γ σ₁ ζ σ₂ : Type
f₁ : γ → β → σ₁ → σ₁ × ζ
f₂ : α → σ₂ → σ₂ × γ
n✝ : ℕ
xs✝ : Vector α n✝
ys✝ : Vector β n✝
x✝ : α
y✝ : β
a✝ :
  ∀ {s₂ : σ₂} {s₁ : σ₁},
    mapAccumr₂ f₁ (mapAccumr f₂ xs✝ s₂).2 ys✝ s₁ =
      let m :=
        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)
s₂ : σ₂
s₁ : σ₁
⊢ mapAccumr₂ f₁ (mapAccumr f₂ (snoc xs✝ x✝) s₂).2 (snoc ys✝ y✝) s₁ =
    let m :=
      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))
        (snoc xs✝ x✝) (snoc ys✝ y✝) (s₁, s₂);
    (m.1.1, m.2)

Next tactic:
simp_all
@[simp]
theorem map₂_map_left (f₁ : γ → β → ζ) (f₂ : α → γ) :
    map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys := by
  

Proof state:
α : Type u_4
n : ℕ
β : Type u_3
xs : Vector α n
ys : Vector β n
γ : Type u_1
ζ : Type u_2
f₁ : γ → β → ζ
f₂ : α → γ
⊢ map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys

Next tactic:
induction xs, ys using Vector.revInductionOn₂
@[simp]
theorem map₂_map_left (f₁ : γ → β → ζ) (f₂ : α → γ) :
    map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys := by
  induction xs, ys using Vector.revInductionOn₂ <;> 

Proof state:
case nil
α : Type u_4
n : ℕ
β : Type u_3
xs : Vector α n
ys : Vector β n
γ : Type u_1
ζ : Type u_2
f₁ : γ → β → ζ
f₂ : α → γ
⊢ map₂ f₁ (map f₂ nil) nil = map₂ (fun x y => f₁ (f₂ x) y) nil nil

Next tactic:
simp_all
@[simp]
theorem map₂_map_left (f₁ : γ → β → ζ) (f₂ : α → γ) :
    map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys := by
  induction xs, ys using Vector.revInductionOn₂ <;> 

Proof state:
case snoc
α : Type u_4
n : ℕ
β : Type u_3
xs : Vector α n
ys : Vector β n
γ : Type u_1
ζ : Type u_2
f₁ : γ → β → ζ
f₂ : α → γ
n✝ : ℕ
xs✝ : Vector α n✝
ys✝ : Vector β n✝
x✝ : α
y✝ : β
a✝ : map₂ f₁ (map f₂ xs✝) ys✝ = map₂ (fun x y => f₁ (f₂ x) y) xs✝ ys✝
⊢ map₂ f₁ (map f₂ (snoc xs✝ x✝)) (snoc ys✝ y✝) = map₂ (fun x y => f₁ (f₂ x) y) (snoc xs✝ x✝) (snoc ys✝ y✝)

Next tactic:
simp_all
@[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) := by
  

Proof state:
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
γ σ₁ ζ σ₂ : Type
s₂ : σ₂
s₁ : σ₁
f₁ : α → γ → σ₁ → σ₁ × ζ
f₂ : β → σ₂ → σ₂ × γ
⊢ mapAccumr₂ f₁ xs (mapAccumr f₂ ys s₂).2 s₁ =
    let m :=
      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)

Next tactic:
induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂
@[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) := by
  induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> 

Proof state:
case nil
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
γ σ₁ ζ σ₂ : Type
f₁ : α → γ → σ₁ → σ₁ × ζ
f₂ : β → σ₂ → σ₂ × γ
s₂ : σ₂
s₁ : σ₁
⊢ mapAccumr₂ f₁ nil (mapAccumr f₂ nil s₂).2 s₁ =
    let m :=
      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))
        nil nil (s₁, s₂);
    (m.1.1, m.2)

Next tactic:
simp_all