-- 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
α : 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
l : List α
e : l.length = len + 1
n : ℕ
f : ℕ → α → β
⊢ map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range (len + 1)) l

Tactic:
rcases l with - | ⟨head, tail⟩

Result:
case succ.nil
α : 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 : ℕ → α → β
e : [].length = len + 1
⊢ map (uncurry f) (enumFrom n []) = zipWith (fun i => f (i + n)) (range (len + 1)) []

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
⊢ map (uncurry f) (enumFrom n (head :: tail)) = zipWith (fun i => f (i + n)) (range (len + 1)) (head :: tail)

Proof state:
α : 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

Tactic:
revert l

Result:
α : Type u
β : Type v
len : ℕ
⊢ ∀ (l : List α),
    l.length = len →
      ∀ (n : ℕ) (f : ℕ → α → β), map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range len) 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
⊢ (fun i => f (i + (n + 1))) = (fun i => f (i + n)) ∘ Nat.succ

Tactic:
funext n' a

Result:
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

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:
intro l

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

Proof state:
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 : tail.length = len
⊢ tail.length = len

Tactic:
exact e

Result:
no goals

Proof state:
case succ.nil
α : 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 : ℕ → α → β
e : [].length = len + 1
⊢ map (uncurry f) (enumFrom n []) = zipWith (fun i => f (i + n)) (range (len + 1)) []

Tactic:
contradiction

Result:
no goals

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

Tactic:
induction' len with len ih <;> intros l e n f

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

case succ
α : 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
l : List α
e : l.length = len + 1
n : ℕ
f : ℕ → α → β
⊢ map (uncurry f) (enumFrom n l) = zipWith (fun i => f (i + n)) (range (len + 1)) l

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 + 1))) (range len) tail =
    f n head :: zipWith (fun a b => f (a.succ + n) b) (range len) tail

Tactic:
rw [this]

Result:
α : 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

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

Tactic:
contradiction

Result:
no goals

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
⊢ map (uncurry f) (enumFrom n (head :: tail)) = zipWith (fun i => f (i + n)) (range (len + 1)) (head :: tail)

Tactic:
simp only [enumFrom_cons, map_cons, range_succ_eq_map, zipWith_cons_cons,
  Nat.zero_add, zipWith_map_left, true_and]

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) :: map (uncurry f) (enumFrom (n + 1) tail) =
    f n head :: zipWith (fun a b => f (a.succ + n) b) (range len) tail

Proof state:
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

Tactic:
simp only [length_cons, Nat.succ.injEq] at e

Result:
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 : tail.length = len
⊢ tail.length = len