Section InducedFunction2arg.
(* well-defined function A x B -> C induces a function (A/R) x (B/S) -> C *)
Variable A B C:Type.
Variable R:relation A.
Variable S:relation B.
Variable f:A->B->C.
Hypothesis equivR:equivalence R.
Hypothesis equivS:equivalence S.
Hypothesis well_defined_2arg: forall (a1 a2:A) (b1 b2:B),
R a1 a2 -> S b1 b2 -> f a1 b1 = f a2 b2.
Definition induced1 (a:A) : quotient S -> C :=
induced_function (f a) equivS (slices_well_defined a).
Definition eq_fn (f g:quotient S->C) :=
forall b:quotient S, f b = g b.
Definition induced2 :=
induced_function2 induced1 equivR eq_fn_equiv well_defined_induced1.
Definition eval (b:quotient S) (f:quotient S->C): C := f b.
Definition induced_eval (b:quotient S) :=
induced_function (eval b) eq_fn_equiv (well_defined_eval b).
Definition induced_function2arg (a:quotient R) (b:quotient S) : C :=
induced_eval b (induced2 a).

Lemma induced_function2arg_correct: forall (a:A) (b:B),
induced_function2arg (quotient_projection R a) (quotient_projection S b) =
f a b.