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 Th41:
  for S being stack of X/== st S = Class(==_X, s) holds |.S.| = |.s.|
  proof
    defpred P[stack of X] means
    for S being stack of X/== st S = Class(==_X, $1) holds |.S.| = |.$1.|;
A1: emp s1 implies P[s1]
    proof assume
A2:   emp s1;
      let S be stack of X/==; assume
      S = Class(==_X, s1); then
      emp S by A2,Th36; then
      |.S.| = {} by Th5;
      hence thesis by A2,Th5;
    end;
A3: P[s1] implies P[push(e,s1)]
    proof assume
A4:   P[s1];
      reconsider E = e as Element of X/== by Def20;
      let S be stack of X/==; assume
A5:   S = Class(==_X, push(e,s1));
      reconsider P = Class(==_X, s1) as stack of X/== by Th35;
      S = push(E,P) by A5,Th38;
      hence |.S.| = <*E*>^|.P.| by Th8 .= <*e*>^|.s1.| by A4
      .= |.push(e,s1).| by Th8;
    end;
    thus P[s] from INDsch(A1,A3);
  end;
