reserve a,b,r for Real;
reserve A for non empty set;
reserve X,x for set;
reserve f,g,F,G for PartFunc of REAL,REAL;
reserve n for Element of NAT;

theorem
  sin.b-sin.a = integral(cos,a,b)
proof
A1: min(a,b) <= a by XXREAL_0:17;
A2: REAL = dom cos & [. min(a,b),max(a,b) .] c= REAL by FUNCT_2:def 1;
  cos|REAL is continuous & a <= max(a,b) by FDIFF_1:25,SIN_COS:67,XXREAL_0:25;
  then
A3: sin.max(a,b) = integral(cos,min(a,b),max(a,b)) + sin.min(a,b) by A1,A2,Th20
,Th23,XXREAL_0:2;
A4: now
    assume
A5: min(a,b) = a;
    then max(a,b) = b by XXREAL_0:36;
    hence thesis by A3,A5;
  end;
  now
    assume
A6: min(a,b) = b;
    then
A7: max(a,b) = a by XXREAL_0:36;
    now
      assume b < a;
      then integral(cos,a,b) = -integral(cos,[' b,a ']) by INTEGRA5:def 4;
      then sin.a = -integral(cos,a,b) + sin.b by A1,A3,A6,A7,INTEGRA5:def 4;
      hence thesis;
    end;
    hence thesis by A1,A4,A6,XXREAL_0:1;
  end;
  hence thesis by A4,XXREAL_0:15;
end;
