reserve            x for object,
               X,Y,Z for set,
         i,j,k,l,m,n for Nat,
                 r,s for Real,
                  no for Element of OrderedNAT,
                   A for Subset of [:NAT,NAT:];

theorem Th16:
  for A being finite Subset of [:NAT,NAT:] holds
    ex m,n st A c= [:Segm m,Segm n:]
  proof
    let A be finite Subset of [:NAT,NAT:];
    per cases;
    suppose A is empty;
      then A c= [:Segm 0,Segm 0:];
      hence thesis;
    end;
    suppose
A1:   A is non empty;
      set A1 = {x where x is Element of NAT: ex y be Element of NAT st
        [x,y] in A};
A2:   A1 is non empty
      proof
        set n = the Element of A;
        n in A by A1; then
        consider x,y be object such that
A3:     x in NAT and
A4:     y in NAT and
A5:     n = [x,y] by ZFMISC_1:def 2;
        reconsider x,y as Element of NAT by A3,A4;
        x in A1 by A4,A5,A1;
        hence thesis;
      end;
      A1 c= NAT
      proof
        let t be object;
        assume t in A1;
        then ex x be Element of NAT st t = x & ex y be Element of NAT st
          [x,y] in A;
        hence thesis;
      end;
      then reconsider B1 = A1 as non empty ext-real-membered set by A2;
      reconsider A as Relation;
      proj1 A is finite;
      then B1 is finite by Th14;
      then sup B1 in A1 by XXREAL_2:def 6;
      then consider x1 be Element of NAT such that
A6:   sup B1 = x1 and
      ex y be Element of NAT st [x1,y] in A;
      set A2 = {y where y is Element of NAT: ex x be Element of NAT st
        [x,y] in A};
A7:   A2 is non empty
      proof
        set n = the Element of A;
        n in A by A1; then
        consider x,y be object such that
A8:     x in NAT and
A9:     y in NAT and
A10:    n = [x,y] by ZFMISC_1:def 2;
        reconsider x,y as Element of NAT by A8,A9;
        y in A2 by A8,A10,A1;
        hence thesis;
      end;
      A2 c= NAT
      proof
        let t be object;
        assume t in A2;
        then ex y be Element of NAT st t = y & ex x be Element of NAT st
          [x,y] in A;
        hence thesis;
      end;
      then reconsider B2 = A2 as non empty ext-real-membered set by A7;
      reconsider A as Relation;
      proj2 A is finite;
      then B2 is finite by Th15;
      then sup B2 in A2 by XXREAL_2:def 6;
      then consider y1 be Element of NAT such that
A11:  sup B2 = y1 and
      ex x be Element of NAT st [x,y1] in A;
      A c= [:Segm (x1+1),Segm (y1+1):]
      proof
        let t be object;
        assume
A12:    t in A;
        then reconsider u = t as Element of [:NAT,NAT:];
        consider x,y be object such that
A13:    x in NAT and
A14:    y in NAT and
A15:    u = [x,y] by ZFMISC_1:def 2;
        reconsider x2 = x, y2 = y as Element of NAT by A13,A14;
        x2 in A1 by A12,A14,A15;
        then x2 <= sup B1 by XXREAL_2:4;
        then x2 < x1 + 1 by A6,NAT_1:13; then
A16:    x2 in Segm (x1+1) by NAT_1:44;
        y2 in A2 by A12,A13,A15;
        then y2 <= sup B2 by XXREAL_2:4;
        then y2 < y1 + 1 by A11,NAT_1:13;
        then y2 in Segm (y1+1) by NAT_1:44;
        hence thesis by A16,A15,ZFMISC_1:def 2;
      end;
      hence thesis;
    end;
  end;
