reserve x for object,
  a,b for Real,
  k,k1,i1,j1,w for Nat,
  m,m1,n,n1 for Integer;
reserve p,q for Rational;

theorem
  p < 0 iff numerator(1/p) = -denominator(p) & denominator(1/p) = -numerator(p)
proof
  set q = 1/p;
A1: now
    set s=-q;
    set r=-p;
    assume
A2: p<0;
A4: s=1/r by XCMPLX_1:188;
A5: 0<r by A2,XREAL_1:58;
    then numerator(s)=denominator(r) by A4,Th41;
    then -numerator(q)=denominator(r) by Th40;
    then
A6: -(-numerator(q))=-denominator(p) by Th40;
    denominator(s)=numerator(r) by A5,A4,Th41;
    then denominator(q)=numerator(r) by Th40;
    hence numerator(q)=-denominator(p) & denominator(q)=-numerator(p)
    by A6,Th40;
  end;
  thus thesis by A1;
end;
