reserve A for non empty closed_interval Subset of REAL;

theorem
for a,b,c being Real, f,g,h be Function of REAL,REAL st
a <= c & h | [.a,c.] = (f| [.a,b.]) +* (g | [.b,c.]) & f.b = g.b
holds
( b <= a implies h | [.a,c.] = g | [.a,c.] ) &
( c <= b implies h | [.a,c.] = f | [.a,c.] )
proof
 let a,b,c being Real, f,g,h be Function of REAL,REAL;
 assume that
 A1: a <= c and
 A2: h | [.a,c.] = (f| [.a,b.]) +* (g | [.b,c.]) and
 A3: f.b = g.b;
 A4:  b <= a implies h | [.a,c.] = g | [.a,c.]
 proof
  assume A5X: b <= a;then
  A5: [.a,c.] c= [.b,c.] by XXREAL_1:34;
  h | [.a,c.] = (h | [.b,c.] ) |  [.a,c.] by XXREAL_1:34,A5X,RELAT_1:74;
  then
  reconsider H = (h | [.b,c.] ) |  [.a,c.] as Function of [.a,c.],REAL;
  (h | [.b,c.] ) |  [.a,c.] = g | [.a,c.]
  proof
   A6: dom (H) = [.a,c.] by FUNCT_2:def 1
   .= dom (g | [.a,c.]) by FUNCT_2:def 1;
   for x being object st x in dom (g | [.a,c.]) holds
   ((h | [.b,c.] )  |  [.a,c.]) . x = (g | [.a,c.]) . x
   proof
    let x being object;
    assume Dg: x in dom (g | [.a,c.]);
    A8: x in [.b,c.] by A5,Dg;
    A9: x in dom (g | [.b,c.]) by FUNCT_2:def 1,A8;
    ((h | [.b,c.] )  |  [.a,c.]) . x
     = (h | [.b,c.] ).x by FUNCT_1:49,Dg
    .= (h ).x by FUNCT_1:49,A5,Dg
    .= ((f| [.a,b.]) +* (g | [.b,c.])).x by A2,FUNCT_1:49,Dg
    .= (g | [.b,c.]).x by A9,FUNCT_4:13
    .= g.x by FUNCT_1:49,A5,Dg;
    hence thesis by FUNCT_1:49,Dg;
   end;
   hence thesis by FUNCT_1:2,A6;
  end;
  hence thesis by RELAT_1:74,A5X,XXREAL_1:34;
 end;
 c <= b implies h | [.a,c.] = f | [.a,c.]
 proof
  assume A10: c <= b;
  then
  A5: [.a,c.] c= [.a,b.] by XXREAL_1:34;
  reconsider H1 = (h | [.a,c.] ) as Function of [.a,c.],REAL;
  reconsider F1 = (f | [.a,c.] ) as Function of [.a,c.],REAL;
  for x being object st x in [.a,c.] holds H1 . x = F1 . x
  proof
   let x be object;
   assume B2: x in [.a,c.]; then
   B3: x in [.a,b.] by A5;
   per cases;
   suppose B5: c = b;
    B6: x in dom (f | [.a,b.]) by FUNCT_2:def 1,B3;
    TO: for x being object st x in (dom (f| [.a,b.])) /\ (dom (g | [.b,c.]))
    holds
    (f| [.a,b.]).x = (g | [.b,c.]).x
    proof
     let x be object;
     assume B8: x in  (dom (f| [.a,b.])) /\ (dom (g | [.b,c.]));
     DX: (dom (f| [.a,b.])) /\ (dom (g | [.b,c.]))
      = (dom (f| [.a,b.])) /\ ([.b,c.]) by FUNCT_2:def 1
     .= [.a,b.] /\ [.b,b.] by B5,FUNCT_2:def 1
     .= {b} by XXREAL_1:418,B5,A1;
     C1: x = b by TARSKI:def 1,DX,B8;
     (f| [.a,b.]).x  = g.x by A3,FUNCT_1:49,C1, XXREAL_1:1,B5,A1;
     hence thesis by FUNCT_1:49,B8;
    end;
    (h |  [.a,c.]).x
    = (f | [.a,b.]).x by B6,FUNCT_4:15, PARTFUN1:def 4,TO,A2
    .= f.x by FUNCT_1:49,B2,A5;
    hence thesis by FUNCT_1:49,B2;
   end;
   suppose c <> b; then
    c < b by A10,XXREAL_0:1; then
    B4: {} = [.b,c.] by XXREAL_1:29
    .= dom (g | [.b,c.]) by FUNCT_2:def 1;
    (h | [.a,c.]).x
    = (f | [.a,b.]).x by B4,FUNCT_4:11,A2
    .= f.x by FUNCT_1:49,B2,A5;
    hence thesis by FUNCT_1:49,B2;
   end;
  end;
  hence thesis by FUNCT_2:12;
 end;
 hence thesis by A4;
end;
