reserve n,m,k for Nat;
reserve r,r1 for Real;
reserve f,seq,seq1 for Real_Sequence;
reserve x,y for set;
reserve e1,e2 for ExtReal;
reserve Nseq for increasing sequence of NAT;
reserve v for FinSequence of REAL,
  r,s for Real,
  n,m,i,j,k for Nat;

theorem Th40:
  |.r-s.|=1 iff r>s & r=s+1 or r<s & s=r+1
proof
  thus |.r-s.|=1 implies r>s & r=s+1 or r<s & s=r+1
  proof
    assume
A1: |.r-s.| = 1;
    now
      per cases by XXREAL_0:1;
      case
A2:     r>s;
        then 0<r-s by XREAL_1:50;
        then r-s=1 by A1,ABSVALUE:def 1;
        hence thesis by A2;
      end;
      case
        r=s;
        hence contradiction by A1,ABSVALUE:2;
      end;
      case
A3:     r<s;
        then
A4:     0<s-r by XREAL_1:50;
        1=|.-(r-s).| by A1,COMPLEX1:52
          .=s-r by A4,ABSVALUE:def 1;
        hence thesis by A3;
      end;
    end;
    hence thesis;
  end;
  assume
A5: r>s & r=s+1 or r<s & s=r+1;
  per cases by A5;
  suppose
    r>s & r=s+1;
    hence thesis by ABSVALUE:def 1;
  end;
  suppose
A6: s>r & s=r+1;
    thus |.r-s.|=|.-(r-s).| by COMPLEX1:52
      .= 1 by A6,ABSVALUE:def 1;
  end;
end;
