-- Mathlib/Data/List/Indexes.lean
theorem map_enumFrom_eq_zipWith : ∀ (l : List α) (n : ℕ) (f : ℕ → α → β),
    map (uncurry f) (enumFrom n l) = zipWith (fun i ↦ f (i + n)) (range (length l)) l

Proof state:
case succ.cons
α : Type u
β : Type v
len : ℕ
ih :
  ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l
n : ℕ
f : ℕ → α → β
head : α
tail : List α
e : (head :: tail).length = len + 1
⊢ uncurry f (n, head) :: map (uncurry f) (enumFrom (n + 1) tail) =
    f n head :: zipWith (fun a b => f (a.succ + n) b) (range len) tail

Tactic:
rw [ih]

Result:
case succ.cons
α : Type u
β : Type v
len : ℕ
ih :
  ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l
n : ℕ
f : ℕ → α → β
head : α
tail : List α
e : (head :: tail).length = len + 1
⊢ uncurry f (n, head) :: zipWith (fun i => f (i + (n + 1))) (range len) tail =
    f n head :: zipWith (fun a b => f (a.succ + n) b) (range len) tail

case succ.cons.e
α : Type u
β : Type v
len : ℕ
ih :
  ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l
n : ℕ
f : ℕ → α → β
head : α
tail : List α
e : (head :: tail).length = len + 1
⊢ tail.length = len

Proof state:
case succ.cons
α : Type u
β : Type v
len : ℕ
ih :
  ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l
n : ℕ
f : ℕ → α → β
head : α
tail : List α
e : (head :: tail).length = len + 1
⊢ uncurry f (n, head) :: zipWith (fun i => f (i + (n + 1))) (range len) tail =
    f n head :: zipWith (fun a b => f (a.succ + n) b) (range len) tail

Tactic:
suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
  rw [this]
  rfl

Result:
case succ.cons
α : Type u
β : Type v
len : ℕ
ih :
  ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l
n : ℕ
f : ℕ → α → β
head : α
tail : List α
e : (head :: tail).length = len + 1
⊢ (fun i => f (i + (n + 1))) = (fun i => f (i + n)) ∘ Nat.succ

Proof state:
α : Type u
β : Type v
l : List α
e : l.length = 0
n : ℕ
f : ℕ → α → β
⊢ l = []

Tactic:
cases l

Result:
case nil
α : Type u
β : Type v
n : ℕ
f : ℕ → α → β
e : [].length = 0
⊢ [] = []

case cons
α : Type u
β : Type v
n : ℕ
f : ℕ → α → β
head✝ : α
tail✝ : List α
e : (head✝ :: tail✝).length = 0
⊢ head✝ :: tail✝ = []

Proof state:
α : Type u
β : Type v
l : List α
⊢ ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range l.length) l

Tactic:
generalize e : l.length = len

Result:
α : Type u
β : Type v
l : List α
len : ℕ
e : l.length = len
⊢ ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l

Proof state:
case zero
α : Type u
β : Type v
l : List α
e : l.length = 0
n : ℕ
f : ℕ → α → β
this : l = []
⊢ map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range 0) l

Tactic:
rw [this]

Result:
case zero
α : Type u
β : Type v
l : List α
e : l.length = 0
n : ℕ
f : ℕ → α → β
this : l = []
⊢ map (uncurry f) (enumFrom n []) = zipWith (fun i => f (i + n)) (range 0) []

Proof state:
case succ.cons.h.h
α : Type u
β : Type v
len : ℕ
ih :
  ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l
n : ℕ
f : ℕ → α → β
head : α
tail : List α
e : (head :: tail).length = len + 1
n' : ℕ
a : α
⊢ f (n' + (n + 1)) a = ((fun i => f (i + n)) ∘ Nat.succ) n' a

Tactic:
simp only [comp, Nat.add_assoc, Nat.add_comm, Nat.add_succ]

Result:
no goals

Proof state:
case zero
α : Type u
β : Type v
l : List α
e : l.length = 0
n : ℕ
f : ℕ → α → β
this : l = []
⊢ map (uncurry f) (enumFrom n []) = zipWith (fun i => f (i + n)) (range 0) []

Tactic:
rfl

Result:
no goals

Proof state:
case nil
α : Type u
β : Type v
n : ℕ
f : ℕ → α → β
e : [].length = 0
⊢ [] = []

Tactic:
rfl

Result:
no goals

Proof state:
α : Type u
β : Type v
len : ℕ
ih :
  ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) l
n : ℕ
f : ℕ → α → β
head : α
tail : List α
e : (head :: tail).length = len + 1
this : (fun i => f (i + (n + 1))) = (fun i => f (i + n)) ∘ Nat.succ
⊢ uncurry f (n, head) :: zipWith ((fun i => f (i + n)) ∘ Nat.succ) (range len) tail =
    f n head :: zipWith (fun a b => f (a.succ + n) b) (range len) tail

Tactic:
rfl

Result:
no goals