reserve x,y,z for set;
reserve f,f1,f2,f3 for FinSequence,
  p,p1,p2,p3 for set,
  i,k for Nat;
reserve D for non empty set,
  p,p1,p2,p3 for Element of D,
  f,f1,f2 for FinSequence of D;
reserve D for non empty set;
reserve p, q for FinSequence,
  X, Y, x, y for set,
  D for non empty set,
  i, j, k, l, m, n, r for Nat;

theorem
  for l st 1<=l & l<=n
    holds Sgm {kk where kk is Nat: m+1<=kk & kk<=m+n}.l = m+l
proof
  set F= Sgm {kk where kk is Nat: m+1<=kk & kk<=m+n};
  defpred P[Nat] means 1<=$1 & $1<=n & F.$1 <> m+$1;
  set rF = {kk where kk is Nat: m+1<=kk & kk<=m+n};
A1: rF c= Seg (m+n)
  proof
    let x be object;
    assume x in rF;
    then consider x9 being Nat such that
A2: x9=x and
A3: m+1<=x9 and
A4: x9<=m+n;
    1<=m+1 by NAT_1:11;
    then 1<=x9 by A3,XXREAL_0:2;
    hence thesis by A2,A4;
  end;
  then reconsider rF as finite set;
a1: rF is included_in_Seg by A1;
  assume ex l st P[l];
  then
A5: ex l be Nat st P[l];
  consider k be Nat such that
A6: P[k] and
A7: for nn being Nat st P[nn] holds k <= nn from NAT_1:sch 5 (A5);
  reconsider k as Element of NAT by ORDINAL1:def 12;
A8: m+k<=m+n by A6,XREAL_1:7;
  reconsider Fk = F.k as Element of NAT by ORDINAL1:def 12;
A9: card rF = n
  proof
    per cases;
    suppose
A10:  n = 0;
      rF = {}
      proof
        assume rF <> {};
        then consider x being object such that
A11:    x in rF by XBOOLE_0:def 1;
        ex x9 being Nat st x9=x & m+1<=x9 & x9<=m+n by A11;
        then m+1<=m+0 by A10,XXREAL_0:2;
        hence contradiction by XREAL_1:6;
      end;
      hence thesis by A10;
    end;
    suppose
      0<n;
      then 0+1<=n by NAT_1:13;
      then 1-1<=n-1 by XREAL_1:9;
      then n-'1 = n-1 by XREAL_0:def 2;
      then reconsider n1 = n-1 as Element of NAT;
      (m+1)+n1 = m+n;
      then card rF = n1+1 by Th4;
      hence thesis;
    end;
  end;
  then
A12: len Sgm rF = n by a1,FINSEQ_3:39;
A13: rng F = rF by a1,FINSEQ_1:def 14;
  now
    defpred P[Nat] means for Fk be Element of NAT st 1<=$1 & $1<=n & Fk = F.$1
    holds m+$1<=Fk;
A14: for k being Nat st P[k] holds P[k+1]
    proof
      let k be Nat;
      assume
A15:  P[k];
A16:  k<k+1 by NAT_1:13;
      let Fk1 be Element of NAT;
      assume that
A17:  1<=k+1 and
A18:  k+1<=n and
A19:  Fk1 = F.(k+1);
      per cases by A17,XXREAL_0:1;
      suppose
A20:    1<k+1;
        reconsider Fk = F.k as Element of NAT by ORDINAL1:def 12;
A21:    1<=k by A20,NAT_1:13;
        k<=n by A18,NAT_1:13;
        then
A22:    m+k<=Fk by A15,A21;
        Fk < Fk1 by a1,A12,A18,A19,A16,A21,FINSEQ_1:def 14;
        then m+k<Fk1 by A22,XXREAL_0:2;
        then m+k+1<=Fk1 by NAT_1:13;
        hence thesis;
      end;
      suppose
A23:    1=k+1;
        then 1 in dom F by A12,A18,FINSEQ_3:25;
        then F.1 in rng F by FUNCT_1:def 3;
        then ex F1 being Nat st F1 = F.1 & m+1<=F1 & F1<=m +n
        by A13;
        hence thesis by A19,A23;
      end;
    end;
A24: P[0];
    thus for k being Nat holds P[k] from NAT_1:sch 2(A24,A14);
  end;
  then
A25: m+k<=Fk by A6;
  m+1<=m+k by A6,XREAL_1:7;
  then m+k in rF by A8;
  then m+k in rng Sgm rF by a1,FINSEQ_1:def 14;
  then consider x being object such that
A26: x in dom Sgm rF and
A27: m+k = (Sgm rF).x by FUNCT_1:def 3;
  reconsider x as Element of NAT by A26;
A28: dom Sgm rF = Seg n by a1,A9,FINSEQ_3:40;
  then
A29: 1<=x by A26,FINSEQ_1:1;
A30: x<=n by A28,A26,FINSEQ_1:1;
  per cases by A6,A27,XXREAL_0:1;
  suppose
    k < x;
    hence contradiction by a1,A6,A12,A27,A25,A30,FINSEQ_1:def 14;
  end;
  suppose
A31: k > x;
    F.x <> m+x by A6,A27,XCMPLX_1:2;
    hence contradiction by A7,A29,A30,A31;
  end;
end;
