reserve A for non empty closed_interval Subset of REAL;

theorem Th13:
for f,g be Function of REAL,REAL holds
min(f,g) = (1/2) (#) ((f + g) - abs(f - g))
proof
 let f,g be Function of REAL,REAL;
 D1: REAL = dom ((1/2) (#) ((f + g)-abs(f - g))) by FUNCT_2:52;
 for x being object st x in dom min(f,g) holds
 min(f,g) . x = ((1/2) (#) ((f + g)-abs(f - g))) . x
 proof
  let x be object;
  assume A0: x in dom min(f,g); then
  A1: x in REAL; then
  A2: x in dom ((f + g)-abs(f - g)) by FUNCT_2:52;
  A3: x in dom(f-g) by A1,FUNCT_2:52;
  A4: x in dom(f+g) by A1,FUNCT_2:52;
  reconsider x as Element of REAL by A0;
  ((1/2) (#) ((f + g)-abs(f - g))) . x = (1/2)*(((f + g)-abs(f - g)) . x )
       by VALUED_1:6
  .= (1/2)*((f + g).x - abs(f - g).x ) by VALUED_1:13,A2
  .= (1/2)*((f + g).x - |. (f - g).x .| ) by VALUED_1:18
  .= (1/2)*((f + g).x - |. f.x - g.x .| ) by VALUED_1:13,A3
  .= (1/2)*((f.x + g.x) - |. f.x - g.x .| ) by VALUED_1:def 1,A4
  .= ((f.x + g.x) - |. f.x - g.x .| ) / 2
  .= min(f.x,g.x) by COMPLEX1:73;
  hence thesis by COUSIN2:def 1;
 end;
 hence thesis by FUNCT_1:2,D1,FUNCT_2:52;
end;
