reserve I for set,
  x,x1,x2,y,z for set,
  A for non empty set;
reserve C,D for Category;
reserve a,b,c,d for Object of C;
reserve f,g,h,i,j,k,p1,p2,q1,q2,i1,i2,j1,j2 for Morphism of C;
reserve f for Morphism of a,b,
        g for Morphism of b,a;
reserve g for Morphism of b,c;
reserve f,g for Morphism of C;

theorem
  c is_a_product_wrt p1,p2 & cod p2 is terminal implies c,cod p1 are_isomorphic
proof
  set a = cod p1, b = cod p2;
  assume that
A1: c is_a_product_wrt p1,p2 and
A2: b is terminal;
  set f = id(a),g = term(a,b);
  dom g = a & cod g = b by A2,Th35;
  then f in Hom(a,a) & g in Hom(a,b) by CAT_1:27;
  then consider h such that
A3: h in Hom(a,c) and
A4: for k st k in Hom(a,c) holds p1(*)k = f & p2(*)k = g iff h = k by A1;
A5: dom h = a by A3,CAT_1:1;
  reconsider h as Morphism of a,c by A3,CAT_1:def 5;
A6: dom p1 = c by A1;
  then reconsider p = p1 as Morphism of c,a by CAT_1:4;
A7: cod h = c by A3,CAT_1:1;
  then
A8: cod(h(*)p) = c by A5,CAT_1:17;
A9: dom p2 = c by A1;
  then
A10: cod(p2(*)(h(*)p)) = b by A8,CAT_1:17;
A11: dom(h(*)p) = c by A6,A5,CAT_1:17;
  then
A12: h(*)p in Hom(c,c) by A8;
  dom(p2(*)(h(*)p)) = c by A9,A11,A8,CAT_1:17;
  then
A13: p2(*)(h(*)p) = term(c,b) by A2,A10,Th36
    .= p2 by A2,A9,Th36;
A14: Hom(c,a)<>{} by A6,CAT_1:2;
  take p;
  thus Hom(c,a) <> {} & Hom(a,c) <> {} by A3,A6,CAT_1:2;
  take h;
  thus p*h = p(*)h by A3,A14,CAT_1:def 13
      .= id a by A3,A4;
  p1(*)(h(*)p) = p1(*)h(*)p by A6,A5,A7,CAT_1:18
      .= (id cod p)(*)p by A3,A4
    .= p by CAT_1:21;
  hence id c = h(*)p by A1,A13,A12,Th58
      .= h*p by A3,A14,CAT_1:def 13;
end;
