reserve T,T1,T2,S for non empty TopSpace;

theorem
  for f being Function of T1,S, g being Function of T2,S st T1 is
  SubSpace of T & T2 is SubSpace of T & ([#] T1) \/ ([#] T2) = [#] T & T1 is
compact & T2 is compact & T is T_2 & f is continuous & g is continuous & ( for
p be set st p in ([#] T1) /\ ([#] T2) holds f.p = g.p ) ex h being Function of
  T,S st h = f+*g & h is continuous
proof
  let f be Function of T1,S, g be Function of T2,S;
  assume that
A1: T1 is SubSpace of T and
A2: T2 is SubSpace of T and
A3: ([#] T1) \/ ([#] T2) = [#] T and
A4: T1 is compact and
A5: T2 is compact and
A6: T is T_2 and
A7: f is continuous and
A8: g is continuous and
A9: for p be set st p in ([#] T1) /\ ([#] T2) holds f.p = g.p;
  set h = f+*g;
A10: dom g = [#] T2 by FUNCT_2:def 1;
A11: dom f = [#] T1 by FUNCT_2:def 1;
  then
A12: dom h = the carrier of T by A3,A10,FUNCT_4:def 1;
  rng h c= rng f \/ rng g by FUNCT_4:17;
  then reconsider h as Function of T,S by A12,FUNCT_2:2,XBOOLE_1:1;
  take h;
  thus h = f+*g;
  for P being Subset of S st P is closed holds h"P is closed
  proof
    let P be Subset of S;
    reconsider P3 = f"P as Subset of T1;
    reconsider P4 = g"P as Subset of T2;
    [#] T1 c= [#] T by A3,XBOOLE_1:7;
    then reconsider P1 = f"P as Subset of T by XBOOLE_1:1;
    [#] T2 c= [#] T by A3,XBOOLE_1:7;
    then reconsider P2 = g"P as Subset of T by XBOOLE_1:1;
A13: dom h = dom f \/ dom g by FUNCT_4:def 1;
A14: now
      let x be object;
      thus x in h"P /\ [#] T2 implies x in g"P
      proof
        assume
A15:    x in h"P /\ [#] T2;
        then x in h"P by XBOOLE_0:def 4;
        then
A16:    h.x in P by FUNCT_1:def 7;
        g.x = h.x by A10,A15,FUNCT_4:13;
        hence thesis by A10,A15,A16,FUNCT_1:def 7;
      end;
      assume
A17:  x in g"P;
      then
A18:  x in dom g by FUNCT_1:def 7;
      g.x in P by A17,FUNCT_1:def 7;
      then
A19:  h.x in P by A18,FUNCT_4:13;
      x in dom h by A13,A18,XBOOLE_0:def 3;
      then x in h"P by A19,FUNCT_1:def 7;
      hence x in h"P /\ [#] T2 by A17,XBOOLE_0:def 4;
    end;
A20: for x being set st x in [#] T1 holds h.x = f.x
    proof
      let x be set such that
A21:  x in [#] T1;
      now
        per cases;
        suppose
A22:      x in [#] T2;
          then x in [#] T1 /\ [#] T2 by A21,XBOOLE_0:def 4;
          then f.x = g.x by A9;
          hence thesis by A10,A22,FUNCT_4:13;
        end;
        suppose
          not x in [#] T2;
          hence thesis by A10,FUNCT_4:11;
        end;
      end;
      hence thesis;
    end;
    now
      let x be object;
      thus x in h"P /\ [#] T1 implies x in f"P
      proof
        assume
A23:    x in h"P /\ [#] T1;
        then x in h"P by XBOOLE_0:def 4;
        then
A24:    h.x in P by FUNCT_1:def 7;
        f.x = h.x by A20,A23;
        hence thesis by A11,A23,A24,FUNCT_1:def 7;
      end;
      assume
A25:  x in f"P;
      then x in dom f by FUNCT_1:def 7;
      then
A26:  x in dom h by A13,XBOOLE_0:def 3;
      f.x in P by A25,FUNCT_1:def 7;
      then h.x in P by A20,A25;
      then x in h"P by A26,FUNCT_1:def 7;
      hence x in h"P /\ [#] T1 by A25,XBOOLE_0:def 4;
    end;
    then
A27: h"P /\ [#] T1 = f"P by TARSKI:2;
    assume
A28: P is closed;
    then P3 is closed by A7;
    then P3 is compact by A4,COMPTS_1:8;
    then
A29: P1 is compact by A1,COMPTS_1:19;
    P4 is closed by A8,A28;
    then P4 is compact by A5,COMPTS_1:8;
    then
A30: P2 is compact by A2,COMPTS_1:19;
    h"P = h"P /\ ([#] T1 \/ [#] T2) by A11,A10,A13,RELAT_1:132,XBOOLE_1:28
      .= (h"P /\ [#](T1)) \/ (h"P /\ [#](T2)) by XBOOLE_1:23;
    then h"P = f"P \/ g"P by A27,A14,TARSKI:2;
    hence thesis by A6,A29,A30;
  end;
  hence thesis;
end;
