
theorem Th22:
  for X,Y being non empty set, n,m being Element of NAT st n<>0 &
  n-tuples_on X = m-tuples_on Y holds X=Y & n=m
proof
  let X,Y be non empty set;
  let n,m be Element of NAT;
  assume that
A1: n<>0 and
A2: n-tuples_on X = m-tuples_on Y;
  thus X=Y
  proof
    thus X c= Y
    proof
      let a be object;
      assume a in X;
      then n |-> a is Element of n-tuples_on X by FINSEQ_2:112;
      then n |-> a in m-tuples_on Y by A2;
      then n |-> a in { s where s is Element of Y*: len s = m } by
FINSEQ_2:def 4;
      then ex s being Element of Y* st s = n |-> a & len s = m;
      then
A3:   rng (n |-> a) c= Y by FINSEQ_1:def 4;
      n |-> a = (Seg n) --> a by FINSEQ_2:def 2;
      then rng (n |-> a) = {a} by A1,FUNCOP_1:8;
      then a in rng (n |-> a) by TARSKI:def 1;
      hence thesis by A3;
    end;
    let a be object;
A4: m |-> a = (Seg m) --> a by FINSEQ_2:def 2;
    assume a in Y;
    then m |-> a is Element of m-tuples_on Y by FINSEQ_2:112;
    then m |-> a in n-tuples_on X by A2;
    then m |-> a in { s where s is Element of X*: len s = n } by FINSEQ_2:def 4
;
    then
A5: ex s being Element of X* st s = m |-> a & len s = n;
    then m=n by CARD_1:def 7;
    then rng (m |-> a) = {a} by A1,A4,FUNCOP_1:8;
    then
A6: a in rng (m |-> a) by TARSKI:def 1;
    rng (m |-> a) c= X by A5,FINSEQ_1:def 4;
    hence thesis by A6;
  end;
  thus thesis by A2,FINSEQ_2:110;
end;
