reserve a,b,m,x,y,i1,i2,i3,i for Integer,
  k,p,q,n for Nat,
  c,c1,c2 for Element of NAT,
  z for set;
reserve fp,fp1 for FinSequence of NAT,

  b,c,d, n for Element of NAT,
  a for Nat;
reserve i,m,m1,m2,m3,r,s,a,b,c,c1,c2,x,y for Integer;
reserve

  a,b,c,m for Element of NAT;

theorem
  { a where a is Nat: a < m } is_CRS_of m
proof
  deffunc F(Nat) = $1-'1;
  consider fp being FinSequence such that
A1: len fp=m & for a be Nat st a in dom fp holds fp.a=F(a) from FINSEQ_1
  :sch 2;
  for a being Nat st a in dom fp holds fp.a in INT
  proof
    let a be Nat;
    assume a in dom fp;
    then fp.a=F(a) by A1;
    hence thesis by INT_1:def 2;
  end;
  then reconsider fp as FinSequence of INT by FINSEQ_2:12;
A2: { a where a is Nat: a < m } = rng fp
  proof
    set A = { a where a is Nat: a < m };
A3: rng fp c= A
    proof
      let b be object;
      assume b in rng fp;
      then consider k being object such that
A4:   k in dom fp and
A5:   b = fp.k by FUNCT_1:def 3;
      reconsider k as Element of NAT by A4;
A6:   k in Seg m by A1,A4,FINSEQ_1:def 3;
      then k<=m by FINSEQ_1:1;
      then
A7:   k-1<m by XREAL_1:147;
      k>=1 by A6,FINSEQ_1:1;
      then
A8:   k-'1<m by A7,XREAL_1:233;
      reconsider b as Integer by A5;
      b = k-'1 by A1,A4,A5;
      hence thesis by A8;
    end;
    A c= rng fp
    proof
      let b be object;
      assume b in A;
      then consider k being Nat such that
A9:   k = b and
A10:  k < m;
      k+1>=1 & k+1<=m by A10,NAT_1:11,13;
      then
A11:  k+1 in dom fp by A1,FINSEQ_3:25;
      then fp.(k+1) = (k+1)-'1 by A1
        .= k by NAT_D:34;
      hence thesis by A9,A11,FUNCT_1:def 3;
    end;
    hence thesis by A3;
  end;
  for a be Nat st a in dom fp holds fp.a in Class(Cong(m),a-'1)
  proof
    let a be Nat;
    (a-'1),(a-'1) are_congruent_mod m by INT_1:11;
    then
A12: [a-'1,a-'1] in Cong(m) by Def1;
    assume a in dom fp;
    then fp.a = a-'1 by A1;
    hence thesis by A12,EQREL_1:18;
  end;
  hence thesis by A1,A2;
end;
