reserve x,y,z, X,Y,Z for set,
  n for Element of NAT;
reserve A for set,
  D for non empty set,
  a,b,c,l,r for Element of D,
  o,o9 for BinOp of D,
  f,g,h for Function of A,D;

theorem Th12:
  o is invertible implies (o,D).:A is invertible
proof
  assume
A1: for a,b ex r,l st o.(a,r) = b & o.(l,a) = b;
  let f,g be Element of Funcs(A,D);
  defpred P[object,object] means o.(f.$1,$2) = g.$1;
A2: for x being object st x in A ex c st P[x,c]
  proof
    let x be object;
    assume x in A;
    then reconsider a = f.x, b = g.x as Element of D by FUNCT_2:5;
    consider r,l such that
A3: o.(a,r) = b and
    o.(l,a) = b by A1;
    take r;
    thus thesis by A3;
  end;
  consider h1 being Function of A,D such that
A4: for x being object st x in A holds P[x,h1.x] from NonUniqFuncDEx(A2);
  defpred Q[object,object] means o.($2,f.$1) = g.$1;
A5: for x being object st x in A ex c st Q[x,c]
  proof
    let x be object;
    assume x in A;
    then reconsider a = f.x, b = g.x as Element of D by FUNCT_2:5;
    consider r,l such that
    o.(a,r) = b and
A6: o.(l,a) = b by A1;
    take l;
    thus thesis by A6;
  end;
  consider h2 being Function of A,D such that
A7: for x being object st x in A holds Q[x,h2.x] from NonUniqFuncDEx(A5);
A8: dom h1 = A & dom h2 = A by FUNCT_2:def 1;
  rng h1 c= D & rng h2 c= D;
  then reconsider h1, h2 as Element of Funcs(A,D) by A8,FUNCT_2:def 2;
  take h1, h2;
A9: dom g = A by FUNCT_2:def 1;
A10: dom (o.:(f,h1)) = A by FUNCT_2:def 1;
A11: now
    let x be object;
    assume
A12: x in A;
    hence o.:(f,h1).x = o.(f.x,h1.x) by A10,FUNCOP_1:22
      .= g.x by A4,A12;
  end;
  o.:(f,h1) = ((o,D).:A).(f,h1) by Def2;
  hence ((o,D).:A).(f,h1) = g by A10,A9,A11,FUNCT_1:2;
A13: dom (o.:(h2,f)) = A by FUNCT_2:def 1;
A14: now
    let x be object;
    assume
A15: x in A;
    hence o.:(h2,f).x = o.(h2.x,f.x) by A13,FUNCOP_1:22
      .= g.x by A7,A15;
  end;
  o.:(h2,f) = ((o,D).:A).(h2,f) by Def2;
  hence thesis by A13,A9,A14,FUNCT_1:2;
end;
