
theorem
  for X being non empty set for o1,o2 being Object of EnsCat X st <^o1,
  o2^> <> {} for A being Morphism of o1,o2, F being Function of o1,o2 st F = A
  holds A is mono iff F is one-to-one
proof
  let X be non empty set, o1,o2 be Object of EnsCat X;
  assume
A1: <^o1,o2^> <> {};
  let A be Morphism of o1,o2, F be Function of o1,o2;
  assume
A2: F = A;
  per cases;
  suppose
    o2 <> {};
    then
A3: dom F = o1 by FUNCT_2:def 1;
    thus A is mono implies F is one-to-one
    proof
      set o = o1;
      assume
A4:   A is mono;
      assume not F is one-to-one;
      then consider x1,x2 be object such that
A5:   x1 in dom F and
A6:   x2 in dom F and
A7:   F.x1 = F.x2 and
A8:   x1 <> x2 by FUNCT_1:def 4;
      set C = o --> x2;
      set B = o --> x1;
A9:   dom C = o by FUNCOP_1:13;
A10:  rng C c= o1
      proof
        let y be object;
        assume y in rng C;
        then ex x be object st x in dom C & C.x = y by FUNCT_1:def 3;
        hence thesis by A3,A6,A9,FUNCOP_1:7;
      end;
      then
A11:  dom (F * C) = o by A3,A9,RELAT_1:27;
      C in Funcs(o,o1) by A9,A10,FUNCT_2:def 2;
      then reconsider C1=C as Morphism of o,o1 by ALTCAT_1:def 14;
      set o9 = the Element of o;
A12:  <^o,o1^> <> {} by ALTCAT_1:19;
      B.o9 = x1 by A3,A5,FUNCOP_1:7;
      then
A13:  B.o9 <> C.o9 by A3,A5,A8,FUNCOP_1:7;
A14:  dom B = o by FUNCOP_1:13;
A15:  rng B c= o1
      proof
        let y be object;
        assume y in rng B;
        then ex x be object st x in dom B & B.x = y by FUNCT_1:def 3;
        hence thesis by A3,A5,A14,FUNCOP_1:7;
      end;
      then B in Funcs(o,o1) by A14,FUNCT_2:def 2;
      then reconsider B1=B as Morphism of o,o1 by ALTCAT_1:def 14;
A16:  dom (F * B) = o by A3,A14,A15,RELAT_1:27;
      now
        let z be object;
        assume
A17:    z in o;
        hence (F * B).z = F.(B.z) by A16,FUNCT_1:12
          .= F.x2 by A7,A17,FUNCOP_1:7
          .= F.(C.z) by A17,FUNCOP_1:7
          .= (F * C).z by A11,A17,FUNCT_1:12;
      end;
      then F * B = F * C by A16,A11,FUNCT_1:2;
      then A * B1 = F * C by A1,A2,A12,ALTCAT_1:16
        .= A * C1 by A1,A2,A12,ALTCAT_1:16;
      hence contradiction by A4,A12,A13;
    end;
    thus F is one-to-one implies A is mono
    proof
      assume
A18:  F is one-to-one;
      let o be Object of EnsCat X;
      assume
A19:  <^o,o1^> <> {};
      then
A20:  <^o,o2^> <> {} by A1,ALTCAT_1:def 2;
      let B,C be Morphism of o,o1;
A21:  <^o,o1^> = Funcs(o,o1) by ALTCAT_1:def 14;
      then consider B1 be Function such that
A22:  B1 = B and
A23:  dom B1 = o and
A24:  rng B1 c= o1 by A19,FUNCT_2:def 2;
      consider C1 be Function such that
A25:  C1 = C and
A26:  dom C1 = o and
A27:  rng C1 c= o1 by A19,A21,FUNCT_2:def 2;
      assume A * B = A * C;
      then
A28:  F * B1 = A * C by A1,A2,A19,A22,A20,ALTCAT_1:16
        .= F * C1 by A1,A2,A19,A25,A20,ALTCAT_1:16;
      now
        let z be object;
        assume
A29:    z in o;
        then F.(B1.z) = (F*B1).z by A23,FUNCT_1:13;
        then
A30:    F.(B1.z) = F.(C1.z) by A26,A28,A29,FUNCT_1:13;
        B1.z in rng B1 & C1.z in rng C1 by A23,A26,A29,FUNCT_1:def 3;
        hence B1.z = C1.z by A3,A18,A24,A27,A30,FUNCT_1:def 4;
      end;
      hence thesis by A22,A23,A25,A26,FUNCT_1:2;
    end;
  end;
  suppose
A31: o2 = {};
     then F = {};
    hence A is mono implies F is one-to-one;
    thus F is one-to-one implies A is mono
    proof
      set x = the Element of Funcs(o1,o2);
      assume F is one-to-one;
      let o be Object of EnsCat X;
      assume
A32:  <^o,o1^> <> {};
      <^o1,o2^> = Funcs(o1,o2) by ALTCAT_1:def 14;
      then consider f be Function such that
      f = x and
A33:  dom f = o1 and
A34:  rng f c= o2 by A1,FUNCT_2:def 2;
      let B,C be Morphism of o,o1;
A35:  <^o,o1^> = Funcs(o,o1) by ALTCAT_1:def 14;
      then consider B1 be Function such that
A36:  B1 = B and
A37:  dom B1 = o and
A38:  rng B1 c= o1 by A32,FUNCT_2:def 2;
      rng f = {} by A31,A34,XBOOLE_1:3;
      then dom f = {} by RELAT_1:42;
      then
A39:  rng B1 = {} by A38,A33,XBOOLE_1:3;
      then
A40:  dom B1 = {} by RELAT_1:42;
      assume A * B = A * C;
      consider C1 be Function such that
A41:  C1 = C and
A42:  dom C1 = o and
      rng C1 c= o1 by A32,A35,FUNCT_2:def 2;
      B1 = {} by A39,RELAT_1:41
        .= C1 by A37,A42,A40,RELAT_1:41;
      hence thesis by A36,A41;
    end;
  end;
end;
