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 Th41:
  0 < p iff numerator(1/p) = denominator(p) & denominator(1/p) = numerator(p)
proof
  set q = 1/p;
A1: now
    set x=denominator(p);
    assume
A2: 0<p;
A4: q=1/(numerator(p)/denominator(p)) by Th12
      .=(1*denominator(p))/numerator(p) by XCMPLX_1:77
      .=denominator(p)/numerator(p);
    reconsider y=numerator(p) as Element of NAT by A2,INT_1:3;
A5: not ex k st 1<k & ex m,w st x=m*k & y=w*k
    proof
      assume not thesis;
      then consider k such that
A6:   1<k and
A7:   ex m,w st x=m*k & y=w*k;
      consider m,w such that
A8:   x=m*k and
A9:   y=w*k by A7;
      0<=m by A8;
      then reconsider z=m as Element of NAT by INT_1:3;
      denominator(p)=z*k by A8;
      hence contradiction by A6,A9,Th26;
    end;
    0<>numerator(p) by A2,Th35;
    hence numerator(p)=denominator(q) & denominator(p)=numerator(q)
    by A4,A5,Th27;
  end;
  thus thesis by A1;
end;
