reserve r,p,x for Real;
reserve n for Element of NAT;
reserve A for non empty closed_interval Subset of REAL;
reserve Z for open Subset of REAL;

theorem
  for f,g being PartFunc of REAL,REAL,
  A being non empty closed_interval Subset of
REAL st (f(#)f)||A is total & (f(#)g)||A is total & (g(#)g)||A is total & (f(#)
f)||A|A is bounded & (f(#)g)||A|A is bounded & (g(#)g)||A|A is bounded & (f(#)f
) is_integrable_on A & (f(#)g) is_integrable_on A & (g(#)g) is_integrable_on A
& f is_orthogonal_with g,A & (for x st x in A holds (f(#)f)||A.x >= 0) & (for x
  st x in A holds (g(#)g)||A.x >= 0) holds ||..(f+g),A..||^2 = ||..f,A..||^2 +
  ||..g,A..||^2
proof
  let f,g be PartFunc of REAL,REAL;
  let A be non empty closed_interval Subset of REAL;
  assume that
A1: (f(#)f)||A is total and
A2: (f(#)g)||A is total and
A3: (g(#)g)||A is total and
A4: (f(#)f)||A|A is bounded and
A5: (f(#)g)||A|A is bounded and
A6: (g(#)g)||A|A is bounded and
A7: (f(#)f) is_integrable_on A & (f(#)g) is_integrable_on A & (g(#)g)
  is_integrable_on A;
  assume
A8: f is_orthogonal_with g,A;
  assume for x st x in A holds (f(#)f)||A.x >= 0;
  then
A9: |||(f,f,A)||| >= 0 by A1,A4,INTEGRA2:32;
  assume for x st x in A holds (g(#)g)||A.x >= 0;
  then
A10: |||(g,g,A)||| >= 0 by A3,A6,INTEGRA2:32;
  then
A11: ||..g,A..||^2 = |||(g,g,A)||| by SQUARE_1:def 2;
  |||(f+g,f+g,A)||| = |||(f,f,A)||| + |||(g,g,A)||| by A1,A2,A3,A4,A5,A6,A7,A8
,Th32;
  then |||((f+g),(f+g),A)||| >=0 by A9,A10,XREAL_1:33;
  then
A12: ||..(f+g),A..||^2 = |||((f+g),(f+g),A)||| by SQUARE_1:def 2;
  ||..f,A..||^2 = |||(f,f,A)||| by A9,SQUARE_1:def 2;
  hence thesis by A1,A2,A3,A4,A5,A6,A7,A8,A12,A11,Th32;
end;
