Theorem: List.of_toArrayAux_eq_toArrayAux
File: src/lean/Init/Data/Array/BasicAux.lean

tactic: match as, bs with
| [], []    => simp [toArrayAux] at h; simp [h]
| a::as, [] => simp [toArrayAux] at h; rw [← h] at hlen; simp_arith [size_toArrayAux] at hlen
| [], b::bs => simp [toArrayAux] at h; rw [h] at hlen; simp_arith [size_toArrayAux] at hlen
| a::as, b::bs =>
  simp [toArrayAux] at h
  have : (cs.push a).size = (ds.push b).size := by simp [*]
  have ⟨ih₁, ih₂⟩ := of_toArrayAux_eq_toArrayAux h this
  simp [ih₁]
  have := Array.of_push_eq_push ih₂
  simp [this]
state_before: α : Type u_1
as bs : List α
cs ds : Array α
h : toArrayAux as cs = toArrayAux bs ds
hlen : Array.size cs = Array.size ds
⊢ as = bs ∧ cs = ds

tactic: simp [toArrayAux] at h
state_before: α : Type u_1
as bs : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
h : toArrayAux [] cs = toArrayAux [] ds
⊢ [] = [] ∧ cs = ds

tactic: simp [h]
state_before: α : Type u_1
as bs : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
h : cs = ds
⊢ [] = [] ∧ cs = ds

tactic: simp [toArrayAux] at h
state_before: α : Type u_1
as✝ bs : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
h : toArrayAux (a :: as) cs = toArrayAux [] ds
⊢ a :: as = [] ∧ cs = ds

tactic: rw [← h] at hlen
state_before: α : Type u_1
as✝ bs : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
h : toArrayAux as (Array.push cs a) = ds
⊢ a :: as = [] ∧ cs = ds

tactic: simp_arith [size_toArrayAux] at hlen
state_before: α : Type u_1
as✝ bs : List α
cs ds : Array α
a : α
as : List α
hlen : Array.size cs = Array.size (toArrayAux as (Array.push cs a))
h : toArrayAux as (Array.push cs a) = ds
⊢ a :: as = [] ∧ cs = ds

tactic: simp [toArrayAux] at h
state_before: α : Type u_1
as bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
b : α
bs : List α
h : toArrayAux [] cs = toArrayAux (b :: bs) ds
⊢ [] = b :: bs ∧ cs = ds

tactic: rw [h] at hlen
state_before: α : Type u_1
as bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
b : α
bs : List α
h : cs = toArrayAux bs (Array.push ds b)
⊢ [] = b :: bs ∧ cs = ds

tactic: simp_arith [size_toArrayAux] at hlen
state_before: α : Type u_1
as bs✝ : List α
cs ds : Array α
b : α
bs : List α
hlen : Array.size (toArrayAux bs (Array.push ds b)) = Array.size ds
h : cs = toArrayAux bs (Array.push ds b)
⊢ [] = b :: bs ∧ cs = ds

tactic: simp [toArrayAux] at h
state_before: α : Type u_1
as✝ bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
b : α
bs : List α
h : toArrayAux (a :: as) cs = toArrayAux (b :: bs) ds
⊢ a :: as = b :: bs ∧ cs = ds

tactic: have : (cs.push a).size = (ds.push b).size := by simp [*]
state_before: α : Type u_1
as✝ bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
b : α
bs : List α
h : toArrayAux as (Array.push cs a) = toArrayAux bs (Array.push ds b)
⊢ a :: as = b :: bs ∧ cs = ds

tactic: have ⟨ih₁, ih₂⟩ := of_toArrayAux_eq_toArrayAux h this
state_before: α : Type u_1
as✝ bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
b : α
bs : List α
h : toArrayAux as (Array.push cs a) = toArrayAux bs (Array.push ds b)
this : Array.size (Array.push cs a) = Array.size (Array.push ds b)
⊢ a :: as = b :: bs ∧ cs = ds

tactic: simp [ih₁]
state_before: α : Type u_1
as✝ bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
b : α
bs : List α
h : toArrayAux as (Array.push cs a) = toArrayAux bs (Array.push ds b)
this : Array.size (Array.push cs a) = Array.size (Array.push ds b)
ih₁ : as = bs
ih₂ : Array.push cs a = Array.push ds b
⊢ a :: as = b :: bs ∧ cs = ds

tactic: have := Array.of_push_eq_push ih₂
state_before: α : Type u_1
as✝ bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
b : α
bs : List α
h : toArrayAux as (Array.push cs a) = toArrayAux bs (Array.push ds b)
this : Array.size (Array.push cs a) = Array.size (Array.push ds b)
ih₁ : as = bs
ih₂ : Array.push cs a = Array.push ds b
⊢ a = b ∧ cs = ds

tactic: simp [this]
state_before: α : Type u_1
as✝ bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
b : α
bs : List α
h : toArrayAux as (Array.push cs a) = toArrayAux bs (Array.push ds b)
this✝ : Array.size (Array.push cs a) = Array.size (Array.push ds b)
ih₁ : as = bs
ih₂ : Array.push cs a = Array.push ds b
this : cs = ds ∧ a = b
⊢ a = b ∧ cs = ds

tactic: simp [*]
state_before: α : Type u_1
as✝ bs✝ : List α
cs ds : Array α
hlen : Array.size cs = Array.size ds
a : α
as : List α
b : α
bs : List α
h : toArrayAux as (Array.push cs a) = toArrayAux bs (Array.push ds b)
⊢ Array.size (Array.push cs a) = Array.size (Array.push ds b)