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
  |.i-j.|+|.n-m.|=1 iff |.i-j.|=1 & n=m or |.n-m.|=1 & i=j
proof
  thus |.i-j.|+|.n-m.|=1 implies |.i-j.|=1 & n=m or |.n-m.|=1 & i=j
  proof
    assume
A1: |.i-j.|+|.n-m.|=1;
    now
      per cases;
      suppose
A2:     n=m;
        then 1=|.i-j.|+|.0.| by A1
          .=|.i-j.|+ (0 qua Real) by ABSVALUE:2
          .= |.i-j.|;
        hence thesis by A2;
      end;
      suppose
A3:     n<>m;
        now
          per cases by A3,XXREAL_0:1;
          suppose
A4:         n<m;
            reconsider l=m-n as Element of NAT by INT_1:5,A4;
            0<l by A4,XREAL_1:50;
            then
A5:         0+1<=l by NAT_1:13;
A6:         |.-(m-n).|=|.l.| by COMPLEX1:52;
            then
A7:         |.n-m.|=|.l.|;
A8:         |.l.|=l by ABSVALUE:def 1;
            then
A9:         l<=1 by A1,A6,COMPLEX1:46,XREAL_1:31;
            then l=1 by A5,XXREAL_0:1;
            then i-j=0 by A1,A8,A7,ABSVALUE:2;
            hence thesis by A6,A5,A8,A9,XXREAL_0:1;
          end;
          suppose
A10:        n>m;
            then reconsider l=n-m as Element of NAT by INT_1:5;
            0<l by A10,XREAL_1:50;
            then
A11:        0+1<=l by NAT_1:13;
A12:        |.n-m.|=l by ABSVALUE:def 1;
            then
A13:        l<=1 by A1,COMPLEX1:46,XREAL_1:31;
            then l=1 by A11,XXREAL_0:1;
            then i-j=0 by A1,A12,ABSVALUE:2;
            hence thesis by A11,A12,A13,XXREAL_0:1;
          end;
        end;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
  assume
A14: |.i-j.|=1 & n=m or |.n-m.|=1 & i=j;
  now
    per cases by A14;
    suppose
A15:  |.i-j.|=1 & n=m;
      then |.n-m.|=0 by ABSVALUE:2;
      hence thesis by A15;
    end;
    suppose
A16:  |.n-m.|=1 & i=j;
      then |.i-j.|=0 by ABSVALUE:2;
      hence thesis by A16;
    end;
  end;
  hence thesis;
end;
