Goal:
  
  A : Type
  B : Type
  f : nat -> A -> option B
  a : A
  l : list A
  i : nat
  t : B
  IHl : forall (l' : list B) (i n : nat),
        map_option_out (mapi_rec f l n) = Some l' ->
        nth_error l' i = Some t ->
        ∑ x : A, nth_error l i = Some x /\ f (i + n)%nat x = Some t
  n : nat
  b : B
  Heq : f n a = Some b
  l0 : list B
  Heq' : map_option_out (mapi_rec f l (S n)) = Some l0
  ============================
   (nth_error (b :: l0) i = Some t ->
    ∑ x : A, nth_error (a :: l) i = Some x /\ f (i + n)%nat x = Some t)


DEBUG:Going to execute:
destruct i

Goals:
  
  A : Type
  B : Type
  f : nat -> A -> option B
  a : A
  l : list A
  t : B
  IHl : forall (l' : list B) (i n : nat),
        map_option_out (mapi_rec f l n) = Some l' ->
        nth_error l' i = Some t ->
        ∑ x : A, nth_error l i = Some x /\ f (i + n)%nat x = Some t
  n : nat
  b : B
  Heq : f n a = Some b
  l0 : list B
  Heq' : map_option_out (mapi_rec f l (S n)) = Some l0
  ============================
   (nth_error (b :: l0) 0 = Some t ->
    ∑ x : A, nth_error (a :: l) 0 = Some x /\ f (0 + n)%nat x = Some t)

  
  A : Type
  B : Type
  f : nat -> A -> option B
  a : A
  l : list A
  i : nat
  t : B
  IHl : forall (l' : list B) (i n : nat),
        map_option_out (mapi_rec f l n) = Some l' ->
        nth_error l' i = Some t ->
        ∑ x : A, nth_error l i = Some x /\ f (i + n)%nat x = Some t
  n : nat
  b : B
  Heq : f n a = Some b
  l0 : list B
  Heq' : map_option_out (mapi_rec f l (S n)) = Some l0
  ============================
   (nth_error (b :: l0) (S i) = Some t ->
    ∑ x : A, nth_error (a :: l) (S i) = Some x /\ f (S i + n)%nat x = Some t)


DEBUG:Going to execute:
simpl
DEBUG LTAC Evaluated term: i