reserve A for non empty closed_interval Subset of REAL;

theorem
for a,b,c,d be Real, f be Function of REAL,REAL st
b > 0 & c > 0 & d > 0 & ['a-c,a+c'] c= A &
d < b &
( for x be Real holds f.x = min(d, max(0, b - |. b*(x-a)/c .|)) )
holds
centroid (f,A) = centroid (f,['a-c,a+c'])
proof
 let a,b,c,d be Real, f be Function of REAL,REAL;
 assume that
 A1: b > 0 & c > 0 and
 A2: d > 0 and
 A3: ['a-c,a+c'] c= A and
 A4: d < b and
 A5: for x be Real holds f.x = min(d, max(0, b - |. b*(x-a)/c .|));
 thus centroid (f,A) = a by A1,A2,A3,Lm22,A5
 .= centroid (f,['a-c,a+c']) by A1,A2,A4,A5,Lm221;
end;
