 reserve a,b,c,x for Real;
 reserve C for non empty set;

theorem Kluczyk:
  for f, g being PartFunc of REAL, REAL st
    g is continuous non empty & f = AffineMap (0,0) | (REAL \ ].a,b.[) &
  dom g = [.a,b.] & g.a = 0 & g.b = 0 holds
   ex h being PartFunc of REAL, REAL st h = f +* g &
  for x being Real st x in dom h holds h is_continuous_in x
  proof
    let f, g be PartFunc of REAL, REAL;
    assume
A1: g is continuous non empty & f = (AffineMap (0,0)) | (REAL \ ].a,b.[) &
    dom g = [.a,b.] & g.a = 0 & g.b = 0; then
KK: f tolerates g by Asi1;
    set c = b;
    take h = f +* g;
    thus h = f +* g;
    let x be Real;
U1: -infty < a by XXREAL_0:12,XREAL_0:def 1;
U3: b < +infty by XXREAL_0:9,XREAL_0:def 1;
    REAL \ ].a,b.[ c= REAL; then
    REAL \ ].a,b.[ c= dom AffineMap(0,0) by FUNCT_2:def 1; then
S1: dom f = REAL \ ].a,b.[ by A1,RELAT_1:62;
aa: (REAL \ ].a,b.[) /\ [.a,b.] = (].-infty,a.] \/ [.b,+infty.[) /\ [.a,b.]
       by XXREAL_1:398
     .= (].-infty,a.] /\ [.a,b.]) \/ ([.b,+infty.[ /\ [.a,b.])
       by XBOOLE_1:23
     .= {a} \/ ([.b,+infty.[ /\ [.a,b.]) by XXREAL_1:417,U1,XXREAL_1:29,A1
     .= {a} \/ {b} by XXREAL_1:416,XXREAL_1:29,A1,U3
     .= {a,b} by ENUMSET1:1;
    a in dom f /\ dom g by aa,S1,A1,TARSKI:def 2; then
sx: a in dom f & a in dom g by XBOOLE_0:def 4;
nn: f.a = AffineMap(0,0).a by FUNCT_1:47,A1,sx
       .= 0*a+0 by FCONT_1:def 4 .= 0;
    b in dom f /\ dom g by aa,S1,A1,TARSKI:def 2; then
sy: b in dom f & b in dom g by XBOOLE_0:def 4; then
mn: f.b = AffineMap(0,0).b by FUNCT_1:47,A1
       .= 0*b+0 by FCONT_1:def 4 .= 0;
Z7: dom f = ].-infty,a.] \/ [.b,+infty.[ by S1,XXREAL_1:398;
Z8: ].-infty,a.[ c= ].-infty,a.] by XXREAL_1:21;
xz: ].-infty,a.] c= dom f by XBOOLE_1:7,Z7; then
Z6: ].-infty,a.[ c= dom f by Z8;
z8: ].b,+infty.[ c= [.b,+infty.[ by XXREAL_1:22;
wz: [.b,+infty.[ c= dom f by XBOOLE_1:7,Z7; then
z6: ].b,+infty.[ c= dom f by z8;
    assume x in dom h; then
R1: x in dom f or x in dom g by FUNCT_4:12;
    set xx0 = x;
b2: ].a,b.[ c= [.a,b.] by XXREAL_1:25;
b1: ].a,b.[ c= dom g by A1,XXREAL_1:25;
    x in ].-infty,a.] or x in [.b,+infty.[ or x in [.a,b.]
       by A1,R1,Z7,XBOOLE_0:def 3; then
    x in ].-infty,a.[ \/ {a} or x in [.b,+infty.[ or x in [.a,b.]
       by XXREAL_1:423; then
    x in ].-infty,a.[ or x in {a} or x in [.b,+infty.[ or x in [.a,b.]
       by XBOOLE_0:def 3; then
    x in ].-infty,a.[ or x = a or x in {b} \/ ].b,+infty.[ or x in [.a,b.]
       by XXREAL_1:427,TARSKI:def 1; then
    x in ].-infty,a.[ or x = a or x in {b} or x in ].b,+infty.[ or
       x in [.a,b.] by XBOOLE_0:def 3; then
    x in ].-infty,a.[ or x = a or x = b or x in ].b,+infty.[ or
       x in {a,b} \/ ].a,b.[
         by XXREAL_1:29,XXREAL_1:128,TARSKI:def 1; then
    x in ].-infty,a.[ or x = a or x = b or x in ].b,+infty.[ or
       x in {a,b} or x in {a,b} or x in ].a,b.[ by XBOOLE_0:def 3; then
    per cases by TARSKI:def 2;
    suppose
FT:   x = a;
      for r being Real st 0 < r
       ex s being Real st 0 < s &
      for x1 being Real st x1 in dom h & |.x1-x.|<s holds |.h.x1-h.x.| < r
      proof
        let r be Real;
        assume
H1:     0 < r; then
        consider s1 being Real such that
WW:     0 < s1 &
        for x1 being Real st x1 in dom g & |.x1-x.|<s1 holds |.g.x1-g.x.| < r
          by FCONT_1:3,A1,sx,FT;
        consider s2 being Real such that
W1:     0 < s2 &
        for x1 being Real st x1 in dom f & |.x1-x.|<s2 holds |.f.x1-f.x.| < r
          by FCONT_1:3,H1,FCONT_1:def 2,A1,sx,FT;
        take s = min (s1,s2);
        thus 0 < s by WW,W1,XXREAL_0:15;
O2:     s <= s1 & s <= s2 by XXREAL_0:17;
        let x1 be Real;
        assume
O1:     x1 in dom h & |.x1-x.| < s; then
        per cases by FUNCT_4:12;
        suppose
W2:       x1 in dom f & not x1 in dom g; then
W3:       h.x1 = f.x1 by FUNCT_4:11;
W4:       h.x = f.x by A1,FT,nn,FUNCT_4:13,sx;
          |.x1-x.| < s2 by O1,O2,XXREAL_0:2;
          hence |.h.x1-h.x.| < r by W3,W4,W1,W2;
        end;
        suppose
W2:       x1 in dom f & x1 in dom g; then
W3:       h.x1 = g.x1 by FUNCT_4:13;
W4:       h.x = g.x by FUNCT_4:13,sx,FT;
          |.x1-x.| < s1 by O1,O2,XXREAL_0:2;
          hence |.h.x1-h.x.| < r by W3,W4,W2,WW;
        end;
        suppose
W2:       x1 in dom g; then
W3:       h.x1 = g.x1 by FUNCT_4:13;
W4:       h.x = g.x by FUNCT_4:13,FT,sx;
          |.x1-x.| < s1 by O1,O2,XXREAL_0:2;
          hence |.h.x1-h.x.| < r by W3,W4,W2,WW;
        end;
      end;
      hence thesis by FCONT_1:3;
    end;
    suppose
FT:   x = b;
      for r being Real st 0<r
       ex s being Real st 0<s &
      for x1 being Real st x1 in dom h & |.x1-x.|<s holds |.h.x1-h.x.| < r
      proof
        let r be Real;
        assume
H1:     0 < r; then
        consider s1 being Real such that
WW:     0 < s1 &
        for x1 being Real st x1 in dom g & |.x1-x.|<s1 holds |.g.x1-g.x.| < r
          by FCONT_1:3,A1,sy,FT;
        consider s2 being Real such that
W1:     0 < s2 &
        for x1 being Real st x1 in dom f & |.x1-x.|<s2 holds |.f.x1-f.x.| < r
          by FCONT_1:3,H1,FCONT_1:def 2,A1,sy,FT;
        take s = min (s1,s2);
        thus 0 < s by WW,W1,XXREAL_0:15;
O2:     s <= s1 & s <= s2 by XXREAL_0:17;
        let x1 be Real;
        assume
O1:     x1 in dom h & |.x1-x.|<s; then
        per cases by FUNCT_4:12;
        suppose
W2:       x1 in dom f & not x1 in dom g; then
W3:       h.x1 = f.x1 by FUNCT_4:11;
W4:       h.x = f.x by mn,A1,FT,sy,FUNCT_4:13;
          |.x1-x.| < s2 by O1,O2,XXREAL_0:2;
          hence |.h.x1-h.x.| < r by W3,W4,W1,W2;
        end;
        suppose
W2:       x1 in dom f & x1 in dom g; then
W3:       h.x1 = g.x1 by FUNCT_4:13;
W4:       h.x = g.x by FUNCT_4:13,sy,FT;
          |.x1-x.| < s1 by O1,O2,XXREAL_0:2;
          hence |.h.x1-h.x.| < r by W3,W4,W2,WW;
        end;
        suppose
W2:       x1 in dom g; then
W3:       h.x1 = g.x1 by FUNCT_4:13;
W4:       h.x = g.x by FUNCT_4:13,FT,sy;
          |.x1-x.| < s1 by O1,O2,XXREAL_0:2;
          hence |.h.x1-h.x.| < r by W3,W4,W2,WW;
        end;
      end;
      hence thesis by FCONT_1:3;
    end;
    suppose
B0:   xx0 in ].-infty,a.[;
     for N1 being Neighbourhood of h.xx0
     ex N being Neighbourhood of xx0 st
     for x1 being Real st x1 in dom h &
     x1 in N holds h.x1 in N1
     proof
       let N1 be Neighbourhood of h.xx0;
       set r = h.xx0;
       reconsider N2 = N1 as Neighbourhood of f.xx0
         by B0,Z8,xz,FUNCT_4:15,KK;
       f is continuous by A1; then
       consider Nx being Neighbourhood of xx0 such that
D0:    for x1 being Real st x1 in dom f &
       x1 in Nx holds f.x1 in N2 by FCONT_1:4,B0,Z6;
       set rr = a - xx0;
Zz:    xx0 + 0 < a by B0,XXREAL_1:233; then
Z1:    rr > 0 by XREAL_1:20;
        set rr2 = rr / 2;
        set P1 = ].xx0-rr2, xx0+rr2.[;
        xx0 / 2 < a / 2 by Zz,XREAL_1:74; then
     z5:xx0 / 2 + a / 2 < a / 2 + a / 2 by XREAL_1:8;
        P1 c= ].-infty,a.[ by XXREAL_1:263,z5; then
     Y1:P1 c= dom f by Z8,xz;
        reconsider P1 as Neighbourhood of xx0 by Z1,RCOMP_1:def 6;
        consider N being Neighbourhood of xx0 such that
     Y2:N c= Nx & N c= P1 by RCOMP_1:17;
        take N;
        let x1 be Real;
        assume
     D1:x1 in dom h & x1 in N; then
        f.x1 in N2 by D0,Y2,Y1;
        hence thesis by FUNCT_4:15,Y2,Y1,D1,KK;
        end;
        hence thesis by FCONT_1:4;
      end;
      suppose
  B0:   xx0 in ].a,b.[;
        for N1 being Neighbourhood of h.xx0
        ex N being Neighbourhood of xx0 st
        for x1 being Real st x1 in dom h &
        x1 in N holds h.x1 in N1
        proof
          let N1 be Neighbourhood of h.xx0;
          set r = h.xx0;
          reconsider N2 = N1 as Neighbourhood of g.xx0 by B0,A1,b2,FUNCT_4:13;
          consider Nx being Neighbourhood of xx0 such that
  D0:     for x1 being Real st x1 in dom g &
          x1 in Nx holds g.x1 in N2 by FCONT_1:4,B0,b2,A1;
          set rr = min (xx0-a,b-xx0);
  Zw:     a < xx0 & xx0 < b by B0,XXREAL_1:4;
          a - a < xx0 - a & b - xx0 > xx0 - xx0 by XREAL_1:14,Zw; then
  Z1:     rr > 0 by XXREAL_0:15;
          set rr2 = rr / 2;
          set P1 = ].xx0-rr2, xx0+rr2.[;
  u1:     rr2 < rr by Z1,XREAL_1:216;
  u2:     rr <= b - xx0 by XXREAL_0:17;
  u3:     xx0 + rr2 < xx0 + rr by u1,XREAL_1:8;
          xx0 + rr <= xx0 + (b - xx0) by u2,XREAL_1:7; then
  Z5:     xx0 + rr2 < b by u3,XXREAL_0:2;
          rr <= xx0 - a by XXREAL_0:17; then
          rr2 < xx0 - a by XXREAL_0:2,u1; then
  h1:     xx0 - rr2 > xx0 - (xx0 - a) by XREAL_1:15;
  y1:     P1 c= ].a,b.[ by XXREAL_1:46,Z5,h1;
          reconsider P1 as Neighbourhood of xx0 by Z1,RCOMP_1:def 6;
          consider N being Neighbourhood of xx0 such that
  Y2:     N c= Nx & N c= P1 by RCOMP_1:17;
  XX:     N c= dom g by Y2,y1,b1;
          take N;
          let x1 be Real;
          assume
  D1:     x1 in dom h & x1 in N;
          x1 in Nx & x1 in dom g by Y2,y1,b1,D1; then
          g.x1 in N2 by D0;
          hence thesis by FUNCT_4:13,XX,D1;
        end;
        hence thesis by FCONT_1:4;
      end;
      suppose
  B0:   xx0 in ].b,+infty.[;
        for N1 being Neighbourhood of h.xx0
        ex N being Neighbourhood of xx0 st
        for x1 being Real st x1 in dom h & x1 in N holds h.x1 in N1
        proof
          let N1 be Neighbourhood of h.xx0;
          set r = h.xx0;
          reconsider N2 = N1 as Neighbourhood of f.xx0
            by B0,z6,FUNCT_4:15,A1,Asi1;
  T1:     f is continuous by A1;
          consider Nx being Neighbourhood of xx0 such that
  D0:     for x1 being Real st x1 in dom f &
          x1 in Nx holds f.x1 in N2 by FCONT_1:4,B0,z6,T1;
          set rr = xx0 - b;
  Zz:     b + 0 < xx0 by B0,XXREAL_1:235; then
  Z1:     rr > 0 by XREAL_1:20;
          set rr2 = rr / 2;
          set P1 = ].xx0-rr2, xx0+rr2.[;
  Z3:     b / 2 < xx0 / 2 by Zz,XREAL_1:74;
          xx0 / 2 + b / 2 > b / 2 + b / 2 by Z3,XREAL_1:8; then
          P1 c= ].b,+infty.[ by XXREAL_1:247; then
  Y1:     P1 c= dom f by z8,wz;
          reconsider P1 as Neighbourhood of xx0 by Z1,RCOMP_1:def 6;
          consider N being Neighbourhood of xx0 such that
  Y2:     N c= Nx & N c= P1 by RCOMP_1:17;
          take N;
          let x1 be Real;
          assume
  D1:     x1 in dom h & x1 in N; then
          f.x1 in N2 by D0,Y2,Y1;
          hence thesis by FUNCT_4:15,Y2,Y1,D1,KK;
        end;
      hence thesis by FCONT_1:4;
    end;
  end;
