case h.h.h
α : Type u_1
n : Nat
l : List α
⊢ take n l = takeTR n l
⊢ @take = @takeTR
funext α n l
case h.h.h
α : Type u_1
n : Nat
l : List α
⊢ take n l = takeTR.go l l n #[]
case h.h.h
α : Type u_1
n : Nat
l : List α
⊢ take n l = takeTR n l
simp [takeTR]
case h.h.h
α : Type u_1
n : Nat
l : List α
⊢ ∀ (xs : List α) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
case h.h.h
α : Type u_1
n : Nat
l : List α
⊢ take n l = takeTR.go l l n #[]
suffices ∀ xs acc, l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ xs.take n from
  (this l #[] (by simp)).symm
case h.h.h
α : Type u_1
n : Nat
l xs : List α
⊢ ∀ (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
case h.h.h
α : Type u_1
n : Nat
l : List α
⊢ ∀ (xs : List α) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
intro xs
no goals
case h.h.h
α : Type u_1
n : Nat
l xs : List α
⊢ ∀ (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
induction xs generalizing n with intro acc
| nil => cases n <;> simp [take, takeTR.go]
| cons x xs IH =>
cases n with simp [take, takeTR.go]
| succ n => intro h; rw [IH]; simp; simp; exact h
no goals
α : Type u_1
n : Nat
l : List α
this : ∀ (xs : List α) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
⊢ l = #[].data ++ l
simp
no goals
case h.h.h.nil
α : Type u_1
l : List α
n : Nat
acc : Array α
⊢ l = acc.data ++ [] → takeTR.go l [] n acc = acc.data ++ take n []
cases n <;> simp [take, takeTR.go]
no goals
case h.h.h.cons
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
n : Nat
acc : Array α
⊢ l = acc.data ++ x :: xs → takeTR.go l (x :: xs) n acc = acc.data ++ take n (x :: xs)
cases n with simp [take, takeTR.go]
| succ n => intro h; rw [IH]; simp; simp; exact h
case h.h.h.cons.succ
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ takeTR.go l xs n (Array.push acc x) = acc.data ++ x :: take n xs
case h.h.h.cons.succ
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
⊢ l = acc.data ++ x :: xs → takeTR.go l xs n (Array.push acc x) = acc.data ++ x :: take n xs
intro h
case h.h.h.cons.succ
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ (Array.push acc x).data ++ take n xs = acc.data ++ x :: take n xs

case h.h.h.cons.succ.a
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ l = (Array.push acc x).data ++ xs
case h.h.h.cons.succ
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ takeTR.go l xs n (Array.push acc x) = acc.data ++ x :: take n xs
rw [IH]
case h.h.h.cons.succ.a
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ l = (Array.push acc x).data ++ xs
case h.h.h.cons.succ
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ (Array.push acc x).data ++ take n xs = acc.data ++ x :: take n xs

case h.h.h.cons.succ.a
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ l = (Array.push acc x).data ++ xs
simp
case h.h.h.cons.succ.a
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ l = acc.data ++ x :: xs
case h.h.h.cons.succ.a
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ l = (Array.push acc x).data ++ xs
simp
no goals
case h.h.h.cons.succ.a
α : Type u_1
l : List α
x : α
xs : List α
IH : ∀ (n : Nat) (acc : Array α), l = acc.data ++ xs → takeTR.go l xs n acc = acc.data ++ take n xs
acc : Array α
n : Nat
h : l = acc.data ++ x :: xs
⊢ l = acc.data ++ x :: xs
exact h