Goal:
  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  ============================
   (∀ (l : list A) (l0 : ∀ y : C, Q y → ∥ All (P y) l ∥) 
      (H := CoreTactics.block) (l1 : list A) (H0 : 
                                              ∀ y : C, 
                                                Q y → ∥ All (P y) l1 ∥) 
      (n : nat) (x : A),
      nth_error l1 n = Some x
      → {| pr1 := l; pr2 := l0 |} = {| pr1 := l1; pr2 := H0 |}
        → map_All fn l l0 = map_All fn l1 H0
          → let H1 := CoreTactics.block in
            ∃ D : ∀ y : C, Q y → P y x,
              nth_error (map_All fn l1 H0) n = Some (fn x D))


DEBUG:Going to execute:
<coq-equations.plugin::refine_ho@0> $1
DEBUG LTAC Evaluated term: (fun_elim ?P ?f ?f0)

Goals:
  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  ============================
   (∀ Hl : ∀ y : C, Q y → ∥ All (P y) [] ∥,
      (λ (l : list A) (Hl0 : ∀ y : C, Q y → ∥ All (P y) l ∥) (x : list B),
         ∀ (H := CoreTactics.block) (l0 : list A) 
           (H0 : ∀ y : C, Q y → ∥ All (P y) l0 ∥) 
           (n : nat) (x0 : A),
           nth_error l0 n = Some x0
           → {| pr1 := l; pr2 := Hl0 |} = {| pr1 := l0; pr2 := H0 |}
             → x = map_All fn l0 H0
               → let H1 := CoreTactics.block in
                 ∃ D : ∀ y : C, Q y → P y x0,
                   nth_error (map_All fn l0 H0) n = Some (fn x0 D)) [] Hl [])

  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  ============================
   (∀ (x : A) (xs : list A) (h : ∀ y : C, Q y → ∥ All (P y) (x :: xs) ∥),
      (λ (l : list A) (Hl : ∀ y : C, Q y → ∥ All (P y) l ∥) (x0 : list B),
         ∀ (H := CoreTactics.block) (l0 : list A) 
           (H0 : ∀ y : C, Q y → ∥ All (P y) l0 ∥) 
           (n : nat) (x1 : A),
           nth_error l0 n = Some x1
           → {| pr1 := l; pr2 := Hl |} = {| pr1 := l0; pr2 := H0 |}
             → x0 = map_All fn l0 H0
               → let H1 := CoreTactics.block in
                 ∃ D : ∀ y : C, Q y → P y x1,
                   nth_error (map_All fn l0 H0) n = Some (fn x1 D)) xs
        (map_All_obligation_2 x xs h)
        (map_All fn xs (map_All_obligation_2 x xs h))
      → (λ (l : list A) (Hl : ∀ y : C, Q y → ∥ All (P y) l ∥) (x0 : list B),
           ∀ (H := CoreTactics.block) (l0 : list A) 
             (H0 : ∀ y : C, Q y → ∥ All (P y) l0 ∥) 
             (n : nat) (x1 : A),
             nth_error l0 n = Some x1
             → {| pr1 := l; pr2 := Hl |} = {| pr1 := l0; pr2 := H0 |}
               → x0 = map_All fn l0 H0
                 → let H1 := CoreTactics.block in
                   ∃ D : ∀ y : C, Q y → P y x1,
                     nth_error (map_All fn l0 H0) n = Some (fn x1 D))
          (x :: xs) h
          (fn x (map_All_obligation_1 x xs h)
           :: map_All fn xs (map_All_obligation_2 x xs h)))


DEBUG:Going to execute:
intros

Goals:
  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  Hl : ∀ y : C, Q y → ∥ All (P y) [] ∥
  ============================
   ((λ (l : list A) (Hl : ∀ y : C, Q y → ∥ All (P y) l ∥) (x : list B),
       ∀ (H := CoreTactics.block) (l0 : list A) (H0 : 
                                                 ∀ y : C,
                                                 Q y → ∥ All (P y) l0 ∥) 
         (n : nat) (x0 : A),
         nth_error l0 n = Some x0
         → {| pr1 := l; pr2 := Hl |} = {| pr1 := l0; pr2 := H0 |}
           → x = map_All fn l0 H0
             → let H1 := CoreTactics.block in
               ∃ D : ∀ y : C, Q y → P y x0,
                 nth_error (map_All fn l0 H0) n = Some (fn x0 D)) [] Hl [])

  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  x : A
  xs : list A
  h : ∀ y : C, Q y → ∥ All (P y) (x :: xs) ∥
  H : (λ (l : list A) (Hl : ∀ y : C, Q y → ∥ All (P y) l ∥) (x : list B),
         ∀ (H := CoreTactics.block) (l0 : list A) 
           (H0 : ∀ y : C, Q y → ∥ All (P y) l0 ∥) 
           (n : nat) (x0 : A),
           nth_error l0 n = Some x0
           → {| pr1 := l; pr2 := Hl |} = {| pr1 := l0; pr2 := H0 |}
             → x = map_All fn l0 H0
               → let H1 := CoreTactics.block in
                 ∃ D : ∀ y : C, Q y → P y x0,
                   nth_error (map_All fn l0 H0) n = Some (fn x0 D)) xs
        (map_All_obligation_2 x xs h)
        (map_All fn xs (map_All_obligation_2 x xs h))
  ============================
   ((λ (l : list A) (Hl : ∀ y : C, Q y → ∥ All (P y) l ∥) (x : list B),
       ∀ (H := CoreTactics.block) (l0 : list A) (H0 : 
                                                 ∀ y : C,
                                                 Q y → ∥ All (P y) l0 ∥) 
         (n : nat) (x0 : A),
         nth_error l0 n = Some x0
         → {| pr1 := l; pr2 := Hl |} = {| pr1 := l0; pr2 := H0 |}
           → x = map_All fn l0 H0
             → let H1 := CoreTactics.block in
               ∃ D : ∀ y : C, Q y → P y x0,
                 nth_error (map_All fn l0 H0) n = Some (fn x0 D)) 
      (x :: xs) h
      (fn x (map_All_obligation_1 x xs h)
       :: map_All fn xs (map_All_obligation_2 x xs h)))


DEBUG:Going to execute:
cbv beta

Goals:
  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  Hl : ∀ y : C, Q y → ∥ All (P y) [] ∥
  ============================
   (∀ (H := CoreTactics.block) (l : list A) (H0 : 
                                             ∀ y : C, 
                                               Q y → ∥ All (P y) l ∥) 
      (n : nat) (x : A),
      nth_error l n = Some x
      → {| pr1 := []; pr2 := Hl |} = {| pr1 := l; pr2 := H0 |}
        → [] = map_All fn l H0
          → let H1 := CoreTactics.block in
            ∃ D : ∀ y : C, Q y → P y x,
              nth_error (map_All fn l H0) n = Some (fn x D))

  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  x : A
  xs : list A
  h : ∀ y : C, Q y → ∥ All (P y) (x :: xs) ∥
  H : (λ (l : list A) (Hl : ∀ y : C, Q y → ∥ All (P y) l ∥) (x : list B),
         ∀ (H := CoreTactics.block) (l0 : list A) 
           (H0 : ∀ y : C, Q y → ∥ All (P y) l0 ∥) 
           (n : nat) (x0 : A),
           nth_error l0 n = Some x0
           → {| pr1 := l; pr2 := Hl |} = {| pr1 := l0; pr2 := H0 |}
             → x = map_All fn l0 H0
               → let H1 := CoreTactics.block in
                 ∃ D : ∀ y : C, Q y → P y x0,
                   nth_error (map_All fn l0 H0) n = Some (fn x0 D)) xs
        (map_All_obligation_2 x xs h)
        (map_All fn xs (map_All_obligation_2 x xs h))
  ============================
   (∀ (H := CoreTactics.block) (l : list A) (H0 : 
                                             ∀ y : C, 
                                               Q y → ∥ All (P y) l ∥) 
      (n : nat) (x0 : A),
      nth_error l n = Some x0
      → {| pr1 := x :: xs; pr2 := h |} = {| pr1 := l; pr2 := H0 |}
        → fn x (map_All_obligation_1 x xs h)
          :: map_All fn xs (map_All_obligation_2 x xs h) = 
          map_All fn l H0
          → let H1 := CoreTactics.block in
            ∃ D : ∀ y : C, Q y → P y x0,
              nth_error (map_All fn l H0) n = Some (fn x0 D))


DEBUG:Going to execute:
DepElim.simplify_dep_elim

Goals:
  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  Hl : ∀ y : C, Q y → ∥ All (P y) [] ∥
  ============================
   (∀ (H := CoreTactics.block) (l : list A) (H0 : 
                                             ∀ y : C, 
                                               Q y → ∥ All (P y) l ∥) 
      (n : nat) (x : A),
      nth_error l n = Some x
      → {| pr1 := []; pr2 := Hl |} = {| pr1 := l; pr2 := H0 |}
        → [] = map_All fn l H0
          → let H1 := CoreTactics.block in
            ∃ D : ∀ y : C, Q y → P y x,
              nth_error (map_All fn l H0) n = Some (fn x D))

  
  A : Type
  B : Type
  C : Type
  Q : C → Type
  P : C → A → Prop
  fn : ∀ x : A, (∀ y : C, Q y → P y x) → B
  x : A
  xs : list A
  h : ∀ y : C, Q y → ∥ All (P y) (x :: xs) ∥
  H : (λ (l : list A) (Hl : ∀ y : C, Q y → ∥ All (P y) l ∥) (x : list B),
         ∀ (H := CoreTactics.block) (l0 : list A) 
           (H0 : ∀ y : C, Q y → ∥ All (P y) l0 ∥) 
           (n : nat) (x0 : A),
           nth_error l0 n = Some x0
           → {| pr1 := l; pr2 := Hl |} = {| pr1 := l0; pr2 := H0 |}
             → x = map_All fn l0 H0
               → let H1 := CoreTactics.block in
                 ∃ D : ∀ y : C, Q y → P y x0,
                   nth_error (map_All fn l0 H0) n = Some (fn x0 D)) xs
        (map_All_obligation_2 x xs h)
        (map_All fn xs (map_All_obligation_2 x xs h))
  ============================
   (∀ (H := CoreTactics.block) (l : list A) (H0 : 
                                             ∀ y : C, 
                                               Q y → ∥ All (P y) l ∥) 
      (n : nat) (x0 : A),
      nth_error l n = Some x0
      → {| pr1 := x :: xs; pr2 := h |} = {| pr1 := l; pr2 := H0 |}
        → fn x (map_All_obligation_1 x xs h)
          :: map_All fn xs (map_All_obligation_2 x xs h) = 
          map_All fn l H0
          → let H1 := CoreTactics.block in
            ∃ D : ∀ y : C, Q y → P y x0,
              nth_error (map_All fn l H0) n = Some (fn x0 D))


DEBUG:Going to execute:
repeat DepElim.simplify_one_dep_elim