(** A version of [functional_extensionality_dep] which is provably
    equal to [eq_refl] on [fun _ => eq_refl] *)
Definition functional_extensionality_dep_good
           {A} {B : A -> Type}
           (f g : forall x : A, B x)
           (H : forall x, f x = g x)
  : f = g
  := eq_trans (eq_sym (functional_extensionality_dep f f (fun _ => eq_refl)))
              (functional_extensionality_dep f g H).

(* Specifications: *)
Lemma functional_extensionality_dep_good_refl {A B} f : @functional_extensionality_dep_good A B f f (fun _ => eq_refl) = eq_refl.
Lemma forall_sig_eq_rect {A B} (f : forall a : A, B a) (P : { g : _ | (forall a, f a = g a) } -> Type) (k : P (exist (fun g => forall a, f a = g a) f (fun a => eq_refl))) g : P g.