reserve i,j for Nat;
reserve x,y for set;
reserve A for non empty set;
reserve c for Element of StandardStackSystem A;
reserve m for stack of StandardStackSystem A;
reserve X for non empty non void StackSystem;
reserve s,s1,s2 for stack of X;
reserve e,e1,e2 for Element of X;
reserve X for StackAlgebra;
reserve s,s1,s2,s3 for stack of X;
reserve e,e1,e2,e3 for Element of X;

theorem Th32:
  s1 in coset s & s2 in coset s & |.s1.| = |.s2.| implies s1 = s2
  proof
    defpred P[stack of X] means
    for s2 st $1 in coset s & s2 in coset s & |.$1.| = |.s2.| holds $1 = s2;
A1: for s1 st emp s1 holds P[s1]
    proof
      let s1; assume
A2:   emp s1; then
A3:   |.s1.| = {} by Th5;
      let s2; assume
      s1 in coset s & s2 in coset s & |.s1.| = |.s2.|; then
      core s1 = core s & core s2 = core s & emp s2 by A3,Th10,Th31; then
      core s = s1 & core s = s2 by A2,Th26;
      hence thesis;
    end;
A4: now let s1 be stack of X, e be Element of X such that
A5:   P[s1];
      thus P[push(e,s1)]
      proof
        let s2; assume
A6:     push(e,s1) in coset s & s2 in coset s & |.push(e,s1).| = |.s2.|; then
A7:     |.s2.| = <*e*>^|.s1.| by Th8; then
        not emp s2 by Th5; then
A8:     s2 = push(top s2, pop s2) by Def9; then
A9:     s1 in coset s & pop s2 in coset s by A6,Th20;
        |.s2.| = <*top s2*>^|.pop s2.| by A8,Th8; then
        e = |.s2.|.1 & |.s2.|.1 = top s2 & |.s1.| = |.pop s2.|
        by A7,FINSEQ_1:41,HILBERT2:2;
        hence thesis by A5,A8,A9;
      end;
    end;
    P[s1] from INDsch(A1,A4);
    hence thesis;
  end;
