reserve A, B for non empty set,
  A1, A2, A3 for non empty Subset of A;
reserve X for TopSpace;
reserve X for non empty TopSpace;
reserve X1, X2 for non empty SubSpace of X;
reserve X0, X1, X2, Y1, Y2 for non empty SubSpace of X;
reserve X, Y for non empty TopSpace;
reserve f for Function of X,Y;
reserve X,Y,Z for non empty TopSpace;
reserve f for Function of X,Y,
  g for Function of Y,Z;
reserve X, Y for non empty TopSpace,
  X0 for non empty SubSpace of X;
reserve f for Function of X,Y;
reserve f for Function of X,Y,
  X0 for non empty SubSpace of X;
reserve X, Y for non empty TopSpace,
  X0, X1 for non empty SubSpace of X;
reserve f for Function of X,Y,
  g for Function of X0,Y;
reserve X0, X1, X2 for non empty SubSpace of X;
reserve f for Function of X,Y,
  g for Function of X0,Y;
reserve X for non empty TopSpace,
  H, G for Subset of X;
reserve A for Subset of X;
reserve X0 for non empty SubSpace of X;
reserve X, Y for non empty TopSpace;
reserve X1, X2 for non empty SubSpace of X;

theorem Th123:
  X1,X2 are_separated iff X1 misses X2 & for Y being non empty
  TopSpace, g being Function of X1 union X2,Y st g|X1 is continuous Function of
X1,Y & g|X2 is continuous Function of X2,Y holds g is continuous Function of X1
  union X2,Y
proof
  thus X1,X2 are_separated implies X1 misses X2 & for Y being non empty
  TopSpace, g being Function of X1 union X2,Y st g|X1 is continuous Function of
X1,Y & g|X2 is continuous Function of X2,Y holds g is continuous Function of X1
  union X2,Y
  proof
    assume
A1: X1,X2 are_separated;
    hence X1 misses X2 by TSEP_1:63;
    X1,X2 are_weakly_separated by A1,TSEP_1:78;
    hence thesis by Th114;
  end;
  thus X1 misses X2 & (for Y being non empty TopSpace, g being Function of X1
union X2,Y st g|X1 is continuous Function of X1,Y & g|X2 is continuous Function
  of X2,Y holds g is continuous Function of X1 union X2,Y) implies X1,X2
  are_separated
  proof
    reconsider Y1 = X1, Y2 = X2 as SubSpace of X1 union X2 by TSEP_1:22;
    reconsider A2 = the carrier of X2 as Subset of X by TSEP_1:1;
    reconsider A1 = the carrier of X1 as Subset of X by TSEP_1:1;
A2: the carrier of X1 union X2 = A1 \/ A2 by TSEP_1:def 2;
    then reconsider C1 = A1 as Subset of X1 union X2 by XBOOLE_1:7;
    reconsider C2 = A2 as Subset of X1 union X2 by A2,XBOOLE_1:7;
A3: Cl C1 = (Cl A1) /\ [#](X1 union X2) by PRE_TOPC:17;
A4: Cl C2 = (Cl A2) /\ [#](X1 union X2) by PRE_TOPC:17;
    assume X1 misses X2;
    then
A5: C1 misses C2 by TSEP_1:def 3;
    assume
A6: for Y being non empty TopSpace, g being Function of X1 union X2,Y
st g|X1 is continuous Function of X1,Y & g|X2 is continuous Function of X2,Y
    holds g is continuous Function of X1 union X2,Y;
    assume X1,X2 are_not_separated;
    then
A7: ex A10, A20 being Subset of X st A10 = the carrier of X1 & A20 = the
    carrier of X2 & A10,A20 are_not_separated by TSEP_1:def 6;
A8: now
      assume
A9:   C1,C2 are_separated;
      then ((Cl A1) /\ [#](X1 union X2)) misses A2 by A3,CONNSP_1:def 1;
      then ((Cl A1) /\ [#](X1 union X2)) /\ A2 = {};
      then
A10:  (Cl A1 /\ A2) /\ [#](X1 union X2) = {} by XBOOLE_1:16;
      A1 misses ((Cl A2) /\ [#](X1 union X2)) by A4,A9,CONNSP_1:def 1;
      then A1 /\ ((Cl A2) /\ [#](X1 union X2)) = {};
      then
A11:  (A1 /\ Cl A2) /\ [#](X1 union X2) = {} by XBOOLE_1:16;
      C1 c= [#](X1 union X2) & A1 /\ Cl A2 c= A1 by XBOOLE_1:17;
      then A1 /\ Cl A2 = {} by A11,XBOOLE_1:1,28;
      then
A12:  A1 misses Cl A2;
      C2 c= [#](X1 union X2) & Cl A1 /\ A2 c= A2 by XBOOLE_1:17;
      then Cl A1 /\ A2 = {} by A10,XBOOLE_1:1,28;
      then Cl A1 misses A2;
      hence contradiction by A7,A12,CONNSP_1:def 1;
    end;
    now
      per cases by A8,A5,TSEP_1:37;
      suppose
A13:    not C1 is open;
        set g = modid(X1 union X2,C1);
        set Y = (X1 union X2) modified_with_respect_to C1;
        g|Y1 = g|X1 by Def5;
        then
A14:    g|X1 is continuous Function of X1,Y by Th100;
        g|Y2 = g|X2 by Def5;
        then
A15:    g|X2 is continuous Function of X2,Y by A5,Th99;
        not g is continuous Function of X1 union X2,Y by A13,Th101;
        hence contradiction by A6,A14,A15;
      end;
      suppose
A16:    not C2 is open;
        set g = modid(X1 union X2,C2);
        set Y = (X1 union X2) modified_with_respect_to C2;
        g|Y2 = g|X2 by Def5;
        then
A17:    g|X2 is continuous Function of X2,Y by Th100;
        g|Y1 = g|X1 by Def5;
        then
A18:    g|X1 is continuous Function of X1,Y by A5,Th99;
        not g is continuous Function of X1 union X2,Y by A16,Th101;
        hence contradiction by A6,A18,A17;
      end;
    end;
    hence contradiction;
  end;
end;
