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 Th24:
  for t being RedSequence of ConstructionRed X
  st s = t.1 holds rng t c= coset s
  proof set R = ConstructionRed X;
    let t be RedSequence of ConstructionRed X;
    assume
A1: s = t.1; then
    reconsider u = t as the carrier' of X-valued RedSequence of R by Th23;
    defpred Q[Nat] means $1 in dom t implies t.$1 in coset s;
A2: Q[0] by FINSEQ_3:24;
A3: now let i; assume
A4:   Q[i];
      thus Q[i+1]
      proof assume
A5:     i+1 in dom t & t.(i+1) nin coset s;
        i = 0 or i >= 0+1 by NAT_1:13; then
        consider j being Nat such that
A6:     i = j+1 by A1,A5,Def17,NAT_1:6;
        i <= i+1 & i+1 <= len t by A5,FINSEQ_3:25,NAT_1:11; then
A7:     1 <= i & i <= len t & rng t <> {} by A6,NAT_1:11,XXREAL_0:2; then
A8:     i in dom t & 1 in dom t by FINSEQ_3:25,32; then
A9:     t.i = u/.i & t.(i+1) = u/.(i+1) by A5,PARTFUN1:def 6; then
        [u/.i,u/.(i+1)] in R by A5,A8,REWRITE1:def 2; then
        (not emp u/.i & u/.(i+1) = pop(u/.i)) or
        ex e st u/.(i+1) = push(e,u/.i) by Def18;
        hence thesis by A4,A5,A7,A9,Def17,FINSEQ_3:25;
      end;
    end;
A10: Q[i] from NAT_1:sch 2(A2,A3);
    let x be object; assume x in rng t; then
    ex y being object st y in dom t & x = t.y by FUNCT_1:def 3;
    hence thesis by A10;
  end;
