reserve a,b,c,x,y,z for object,X,Y,Z for set,
  n for Nat,
  i,j for Integer,
  r,r1,r2,r3,s for Real,
  c1,c2 for Complex,
  p for Point of TOP-REAL n;

theorem Th29:
  for a, b being Real,
  f being continuous Function of Closed-Interval-TSpace(a,b), R^1,
  g being PartFunc of REAL, REAL st a <= b & f = g holds
  g is continuous
  proof
    set X = R^1;
    let a, b be Real;
    set S = Closed-Interval-TSpace(a,b);
    let f be continuous Function of S, X;
    let g be PartFunc of REAL, REAL;
    assume that
A1: a <= b and
A2: f = g;
    set A = left_closed_halfline a;
    set B = [.a,b.];
    set C = right_closed_halfline b;
    the carrier of S = B by A1,TOPMETR:18;
    then reconsider a1 = a, b1 = b as Point of S by A1,XXREAL_1:1;
    set f1 = X|R^1(A) --> f.a1;
    set f2 = X|R^1(C) --> f.b1;
A3: the carrier of (X|R^1(A)) = A by PRE_TOPC:8;
    S = X|R^1(B) by A1,TOPMETR:19;
    then reconsider f as continuous Function of X|R^1(B), X;
A4: dom f1 = the carrier of (X|R^1(A))
    .= A by PRE_TOPC:8;
A5: dom f = the carrier of (X|R^1(B)) by FUNCT_2:def 1
    .= B by PRE_TOPC:8;
A6: dom f2 = the carrier of (X|R^1(C))
    .= C by PRE_TOPC:8;
    b in REAL by XREAL_0:def 1;
    then
A7: b < +infty by XXREAL_0:9;
    f1 tolerates f
    proof
      let x be object such that
A8:   x in dom f1 /\ dom f;
      a in REAL by XREAL_0:def 1;
      then A /\ B = {a} by A1,XXREAL_0:12,XXREAL_1:417;
      then
A9:   x = a by A4,A5,A8,TARSKI:def 1;
      then a in A by A4,A8,XBOOLE_0:def 4;
      hence f1.x = f.x by A3,A9,FUNCOP_1:7;
    end;
    then reconsider ff = f1+*f as
    continuous Function of X| (R^1(A) \/ R^1(B)), X by TOPGEN_5:10;
    set G = ff+*f2;
    ff tolerates f2
    proof
      let x be object;
      assume
A10:   x in dom ff /\ dom f2;
      then
A11:   x in dom ff by XBOOLE_0:def 4;
A12:   x in dom f2 by A10;
      then
      reconsider y = x as Real;
A13:   b <= y by A6,A12,XXREAL_1:3;
A14:   dom ff = dom f1 \/ dom f by FUNCT_4:def 1;
      per cases by A11,A14,XBOOLE_0:def 3;
      suppose that
A15:     x in dom f1 and
A16:     not x in dom f;
        y <= a by A4,A15,XXREAL_1:2;
        then b <= a by A13,XXREAL_0:2;
        then a = b by A1,XXREAL_0:1;
        hence f2.x = f.a1 by A10,FUNCOP_1:7
        .= f1.x by A15,FUNCOP_1:7
        .= ff.x by A16,FUNCT_4:11;
      end;
      suppose
A17:     x in dom f;
        then y <= b by A5,XXREAL_1:1;
        then b = y by A13,XXREAL_0:1;
        hence f2.x = f.x by A10,FUNCOP_1:7
        .= ff.x by A17,FUNCT_4:13;
      end;
    end;
    then
A18: G is continuous Function of X| (R^1(A\/B) \/ R^1(C)), X by TOPGEN_5:10;
A19: A \/ B \/ C c= REAL;
A20: dom G = dom ff \/ dom f2 by FUNCT_4:def 1
    .= dom f1 \/ dom f \/ dom f2 by FUNCT_4:def 1;
A21: dom G = REAL
    proof
      thus dom G c= REAL by A4,A5,A6,A19,A20;
      let x be object;
      assume x in REAL;
      then reconsider y = x as Element of REAL;
A22:   y < +infty by XXREAL_0:9;
A23:   -infty < y by XXREAL_0:12;
      per cases;
      suppose
A24:     y < b;
        per cases;
        suppose y < a;
          then y in A by A23,XXREAL_1:2;
          then y in dom f1 \/ dom f by A4,XBOOLE_0:def 3;
          hence thesis by A20,XBOOLE_0:def 3;
        end;
        suppose y >= a;
          then y in B by A24,XXREAL_1:1;
          then y in dom f1 \/ dom f by A5,XBOOLE_0:def 3;
          hence thesis by A20,XBOOLE_0:def 3;
        end;
      end;
      suppose y >= b;
        then y in C by A22,XXREAL_1:3;
        hence thesis by A6,A20,XBOOLE_0:def 3;
      end;
    end;
    then A \/ B \/ C = [#]X by A4,A5,A6,A20,TOPMETR:17;
    then
A25: X| (R^1(A\/B) \/ R^1(C)) = X by TSEP_1:3;
    rng G c= REAL;
    then reconsider G as PartFunc of REAL,REAL by A21,RELSET_1:4;
A26: G is continuous by A18,A25,JORDAN5A:7;
A27: dom f = dom G /\ B by A5,A21,XBOOLE_1:28;
    now
      let x be object;
      assume
A28:   x in dom f;
      then reconsider y = x as Real;
A29:   y <= b by A5,A28,XXREAL_1:1;
      per cases by A29,XXREAL_0:1;
      suppose y < b;
        then not y in dom f2 by A6,XXREAL_1:3;
        hence G.x = ff.x by FUNCT_4:11
        .= f.x by A28,FUNCT_4:13;
      end;
      suppose
A30:     y = b;
        then
A31:     x in dom f2 by A6,A7,XXREAL_1:3;
        hence G.x = f2.x by FUNCT_4:13
        .= f.x by A30,A31,FUNCOP_1:7;
      end;
    end;
    then g = G|B by A2,A27,FUNCT_1:46;
    hence g is continuous by A26;
  end;
