reserve i,j,k,n,m for Nat,
  x,y,z,y1,y2 for object, X,Y,D for set,
  p,q for XFinSequence;
reserve k1,k2 for Nat;
reserve D for non empty set,
  F,G for XFinSequence of D,
  b for BinOp of D,
  d,d1,d2 for Element of D;

theorem Th43: :: CARD_FIN:47
b is having_a_unity or len F >= 1 implies b "**" F = b "**" (XFS2FS F)
proof
assume
A1: b is having_a_unity or len F >= 1;
  per cases by A1;
  suppose
A2: len F >=1;
    set FS=XFS2FS F;
    len F=len FS by AFINSQ_1:def 9;
    then consider f be sequence of D such that
A3: f.1 = FS.1 and
A4: for n be Nat st 0<>n & n<len F holds
f.(n+1) = b.(f.n,FS.(n+1)) and
A5: b "**" FS = f.(len F) by A2,FINSOP_1:def 1;
    consider xf be sequence of D such that
A6: xf.0 = F.0 and
A7: for n
st n+1 < len F holds xf.(n + 1) = b.(xf.n,F.(n + 1)) and
A8: b "**" F = xf.(len F-1) by A2,Def8;
    defpred P[Nat] means $1 < len F implies xf.$1=f.($1+1);
A9: for n st P[n] holds P[n+1]
    proof
      let n such that
A10:  P[n];
      set n1=n+1;
      set n2=n1+1;
      assume
A11:  n1 < len F;
      then zz+1<=n2 & n2 <=len F by NAT_1:13;
      then
A12:  F.(n2-1)=FS.n2 by AFINSQ_1:def 9;
      xf.n1 = b.(xf.n,F.n1) & f.(n1+1) = b.(f.n1,FS.(n1+1)) by A7,A4,A11;
      hence thesis by A10,A11,A12,NAT_1:13;
    end;
    reconsider L1=len F-1 as Element of NAT by A2,NAT_1:21;
A13: L1<L1+1 by NAT_1:13;
A14: P[0]
    proof
      assume 0 <len F;
      then zz+1<=len F by NAT_1:13;
      then F.(1-1)=FS.1 by AFINSQ_1:def 9;
      hence thesis by A6,A3;
    end;
    for n holds P[n] from NAT_1:sch 2(A14,A9);
    hence thesis by A8,A5,A13;
  end;
  suppose
A15: b is having_a_unity & len F<1;
    then len F<=zz+1;
    then
A16: len F=0 by A15,NAT_1:8;
    then len F=len (XFS2FS F) & b "**" F=the_unity_wrt b
by A15,Def8,AFINSQ_1:def 9;
    hence thesis by A15,A16,FINSOP_1:def 1;
  end;
end;
