l3lab/ntp-mathlib huggingface dataset:
protected theorem new_def_eq_old_def :
    ∀ (f : ℕ → α → β) (l : List α), l.mapIdx f = List.oldMapIdx f l := by
  intro f
  apply list_reverse_induction
  · 

Proof state:
case base
α : Type u
β : Type v
f : ℕ → α → β
⊢ mapIdx f [] = List.oldMapIdx f []

Next tactic:
rfl
protected theorem new_def_eq_old_def :
    ∀ (f : ℕ → α → β) (l : List α), l.mapIdx f = List.oldMapIdx f l := by
  intro f
  apply list_reverse_induction
  · rfl
  · 

Proof state:
case ind
α : Type u
β : Type v
f : ℕ → α → β
⊢ ∀ (l : List α) (e : α), mapIdx f l = List.oldMapIdx f l → mapIdx f (l ++ [e]) = List.oldMapIdx f (l ++ [e])

Next tactic:
intro l e h
protected theorem new_def_eq_old_def :
    ∀ (f : ℕ → α → β) (l : List α), l.mapIdx f = List.oldMapIdx f l := by
  intro f
  apply list_reverse_induction
  · rfl
  · intro l e h
    

Proof state:
case ind
α : Type u
β : Type v
f : ℕ → α → β
l : List α
e : α
h : mapIdx f l = List.oldMapIdx f l
⊢ mapIdx f (l ++ [e]) = List.oldMapIdx f (l ++ [e])

Next tactic:
rw [List.oldMapIdx_append, mapIdx_append_one, h]
@[local simp]
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 := by
  

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

Next tactic:
intro l
@[local simp]
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 := by
  intro l
  

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

Next tactic:
generalize e : l.length = len
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  

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

Next tactic:
revert l
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  

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

Next tactic:
induction' len with len ih
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> 

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

Next tactic:
intros l e n f
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> 

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

Next tactic:
intros l e n f
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · 

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

Next tactic:
have : l = [] := by cases l; rfl; contradiction
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by 

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

Next tactic:
cases l
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; 

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

Next tactic:
rfl
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; 

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

Next tactic:
contradiction
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    

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

Next tactic:
rw [this]
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; 

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

Next tactic:
rfl
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · 

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

Next tactic:
cases' l with head tail
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · 

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

Next tactic:
contradiction
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · 

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

Next tactic:
simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      

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

Next tactic:
rw [ih]
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      rw [ih]
      

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

Next tactic:
suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
        rw [this]
        rfl
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      rw [ih]
      suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
        

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

Next tactic:
rw [this]
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      rw [ih]
      suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
        rw [this]
        

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

Next tactic:
rfl
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      rw [ih]
      suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
        rw [this]
        rfl
      

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

Next tactic:
funext n' a
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      rw [ih]
      suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
        rw [this]
        rfl
      funext n' a
      

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

Next tactic:
simp only [comp, Nat.add_assoc, Nat.add_comm, Nat.add_succ]
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      rw [ih]
      suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
        rw [this]
        rfl
      funext n' a
      simp only [comp, Nat.add_assoc, Nat.add_comm, Nat.add_succ]
      

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

Next tactic:
simp only [length_cons, Nat.succ.injEq] at e
@[local simp]
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 := by
  intro l
  generalize e : l.length = len
  revert l
  induction' len with len ih <;> intros l e n f
  · have : l = [] := by cases l; rfl; contradiction
    rw [this]; rfl
  · cases' l with head tail
    · contradiction
    · simp only [map, uncurry_apply_pair, range_succ_eq_map, zipWith, zero_add, zipWith_map_left]
      rw [ih]
      suffices (fun i ↦ f (i + (n + 1))) = ((fun i ↦ f (i + n)) ∘ Nat.succ) by
        rw [this]
        rfl
      funext n' a
      simp only [comp, Nat.add_assoc, Nat.add_comm, Nat.add_succ]
      simp only [length_cons, Nat.succ.injEq] at e; 

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

Next tactic:
exact e
theorem mapIdx_eq_enum_map (l : List α) (f : ℕ → α → β) :
    l.mapIdx f = l.enum.map (Function.uncurry f) := by
  

Proof state:
α : Type u
β : Type v
l : List α
f : ℕ → α → β
⊢ mapIdx f l = map (uncurry f) (enum l)

Next tactic:
rw [List.new_def_eq_old_def]
theorem mapIdx_eq_enum_map (l : List α) (f : ℕ → α → β) :
    l.mapIdx f = l.enum.map (Function.uncurry f) := by
  rw [List.new_def_eq_old_def]
  

Proof state:
α : Type u
β : Type v
l : List α
f : ℕ → α → β
⊢ List.oldMapIdx f l = map (uncurry f) (enum l)

Next tactic:
induction' l with hd tl hl generalizing f
theorem mapIdx_eq_enum_map (l : List α) (f : ℕ → α → β) :
    l.mapIdx f = l.enum.map (Function.uncurry f) := by
  rw [List.new_def_eq_old_def]
  induction' l with hd tl hl generalizing f
  · 

Proof state:
case nil
α : Type u
β : Type v
f : ℕ → α → β
⊢ List.oldMapIdx f [] = map (uncurry f) (enum [])

Next tactic:
rfl
theorem mapIdx_eq_enum_map (l : List α) (f : ℕ → α → β) :
    l.mapIdx f = l.enum.map (Function.uncurry f) := by
  rw [List.new_def_eq_old_def]
  induction' l with hd tl hl generalizing f
  · rfl
  · 

Proof state:
case cons
α : Type u
β : Type v
hd : α
tl : List α
hl : ∀ (f : ℕ → α → β), List.oldMapIdx f tl = map (uncurry f) (enum tl)
f : ℕ → α → β
⊢ List.oldMapIdx f (hd :: tl) = map (uncurry f) (enum (hd :: tl))

Next tactic:
rw [List.oldMapIdx, List.oldMapIdxCore, List.oldMapIdxCore_eq, hl]
theorem mapIdx_eq_enum_map (l : List α) (f : ℕ → α → β) :
    l.mapIdx f = l.enum.map (Function.uncurry f) := by
  rw [List.new_def_eq_old_def]
  induction' l with hd tl hl generalizing f
  · rfl
  · rw [List.oldMapIdx, List.oldMapIdxCore, List.oldMapIdxCore_eq, hl]
    

Proof state:
case cons
α : Type u
β : Type v
hd : α
tl : List α
hl : ∀ (f : ℕ → α → β), List.oldMapIdx f tl = map (uncurry f) (enum tl)
f : ℕ → α → β
⊢ f 0 hd :: map (uncurry fun i a => f (i + (0 + 1)) a) (enum tl) = map (uncurry f) (enum (hd :: tl))

Next tactic:
simp [map, enum_eq_zip_range, map_uncurry_zip_eq_zipWith]
@[simp]
theorem mapIdx_cons {α β} (l : List α) (f : ℕ → α → β) (a : α) :
    mapIdx f (a :: l) = f 0 a :: mapIdx (fun i ↦ f (i + 1)) l := by
  

Proof state:
α✝ : Type u
β✝ : Type v
α : Type u_1
β : Type u_2
l : List α
f : ℕ → α → β
a : α
⊢ mapIdx f (a :: l) = f 0 a :: mapIdx (fun i => f (i + 1)) l

Next tactic:
simp [mapIdx_eq_enum_map, enum_eq_zip_range, map_uncurry_zip_eq_zipWith,
    range_succ_eq_map, zipWith_map_left]
theorem mapIdx_append {α} (K L : List α) (f : ℕ → α → β) :
    (K ++ L).mapIdx f = K.mapIdx f ++ L.mapIdx fun i a ↦ f (i + K.length) a := by
  

Proof state:
α✝ : Type u
β : Type v
α : Type u_1
K L : List α
f : ℕ → α → β
⊢ mapIdx f (K ++ L) = mapIdx f K ++ mapIdx (fun i a => f (i + length K) a) L

Next tactic:
induction' K with a J IH generalizing f
theorem mapIdx_append {α} (K L : List α) (f : ℕ → α → β) :
    (K ++ L).mapIdx f = K.mapIdx f ++ L.mapIdx fun i a ↦ f (i + K.length) a := by
  induction' K with a J IH generalizing f
  · 

Proof state:
case nil
α✝ : Type u
β : Type v
α : Type u_1
L : List α
f : ℕ → α → β
⊢ mapIdx f ([] ++ L) = mapIdx f [] ++ mapIdx (fun i a => f (i + length []) a) L

Next tactic:
rfl
theorem mapIdx_append {α} (K L : List α) (f : ℕ → α → β) :
    (K ++ L).mapIdx f = K.mapIdx f ++ L.mapIdx fun i a ↦ f (i + K.length) a := by
  induction' K with a J IH generalizing f
  · rfl
  · 

Proof state:
case cons
α✝ : Type u
β : Type v
α : Type u_1
L : List α
a : α
J : List α
IH : ∀ (f : ℕ → α → β), mapIdx f (J ++ L) = mapIdx f J ++ mapIdx (fun i a => f (i + length J) a) L
f : ℕ → α → β
⊢ mapIdx f (a :: J ++ L) = mapIdx f (a :: J) ++ mapIdx (fun i a_1 => f (i + length (a :: J)) a_1) L

Next tactic:
simp [IH fun i ↦ f (i + 1), add_assoc]
@[simp]
theorem length_mapIdx {α β} (l : List α) (f : ℕ → α → β) : (l.mapIdx f).length = l.length := by
  

Proof state:
α✝ : Type u
β✝ : Type v
α : Type u_1
β : Type u_2
l : List α
f : ℕ → α → β
⊢ length (mapIdx f l) = length l

Next tactic:
induction' l with hd tl IH generalizing f
@[simp]
theorem length_mapIdx {α β} (l : List α) (f : ℕ → α → β) : (l.mapIdx f).length = l.length := by
  induction' l with hd tl IH generalizing f
  · 

Proof state:
case nil
α✝ : Type u
β✝ : Type v
α : Type u_1
β : Type u_2
f : ℕ → α → β
⊢ length (mapIdx f []) = length []

Next tactic:
rfl
@[simp]
theorem length_mapIdx {α β} (l : List α) (f : ℕ → α → β) : (l.mapIdx f).length = l.length := by
  induction' l with hd tl IH generalizing f
  · rfl
  · 

Proof state:
case cons
α✝ : Type u
β✝ : Type v
α : Type u_1
β : Type u_2
hd : α
tl : List α
IH : ∀ (f : ℕ → α → β), length (mapIdx f tl) = length tl
f : ℕ → α → β
⊢ length (mapIdx f (hd :: tl)) = length (hd :: tl)

Next tactic:
simp [IH]
@[simp]
theorem mapIdx_eq_nil {α β} {f : ℕ → α → β} {l : List α} : List.mapIdx f l = [] ↔ l = [] := by
  

Proof state:
α✝ : Type u
β✝ : Type v
α : Type u_1
β : Type u_2
f : ℕ → α → β
l : List α
⊢ mapIdx f l = [] ↔ l = []

Next tactic:
rw [List.mapIdx_eq_enum_map, List.map_eq_nil, List.enum_eq_nil]
@[simp, deprecated]
theorem nthLe_mapIdx {α β} (l : List α) (f : ℕ → α → β) (i : ℕ) (h : i < l.length)
    (h' : i < (l.mapIdx f).length := h.trans_le (l.length_mapIdx f).ge) :
    (l.mapIdx f).nthLe i h' = f i (l.nthLe i h) := by
  

Proof state:
α✝ : Type u
β✝ : Type v
α : Type u_1
β : Type u_2
l : List α
f : ℕ → α → β
i : ℕ
h : i < length l
h' : optParam (i < length (mapIdx f l)) (_ : i < length (mapIdx f l))
⊢ nthLe (mapIdx f l) i h' = f i (nthLe l i h)

Next tactic:
simp [mapIdx_eq_enum_map, enum_eq_zip_range]