reserve p,q,r,th,th1 for Real;
reserve n for Nat;

theorem
  cos|].PI/2,PI.[ is decreasing
proof
  for th st th in ].PI/2,PI.[ holds diff(cos,th) < 0
  proof
    let th;
    assume
A1: th in ].PI/2,PI.[;
    then th < PI by XXREAL_1:4;
    then
A2: th - PI/2 < PI - PI/2 by XREAL_1:9;
    PI/2 < th by A1,XXREAL_1:4;
    then PI/2 - PI/2 < th - PI/2 by XREAL_1:9;
    then th-PI/2 in ].0,PI/2.[ by A2,XXREAL_1:4;
    then cos.(th-PI/2) > 0 by SIN_COS:80;
    then
A3: 0-cos.(th-PI/2) < 0;
    diff(cos,(th))=-sin.(PI/2+(th-PI/2)) by SIN_COS:67
      .=-cos.(th-PI/2) by SIN_COS:78;
    hence thesis by A3;
  end;
  hence thesis by FDIFF_1:26,ROLLE:10,SIN_COS:24,67;
end;
