reserve x,y,X,Y for set,
  k,l,n for Nat,
  i,i1,i2,i3,j for Integer,
  G for Group,
  a,b,c,d for Element of G,
  A,B,C for Subset of G,
  H,H1,H2, H3 for Subgroup of G,
  h for Element of H,
  F,F1,F2 for FinSequence of the carrier of G,
  I,I1,I2 for FinSequence of INT;

theorem Th14:
  len F1 = len F2 & (for k st k in dom F1 holds F2.(len F1 - k + 1
  ) = (F1/.k)") implies Product(F1) = Product(F2)"
proof
  defpred P[Nat] means
  for F1,F2 st len F1 = $1 & len F1 = len F2 &
(for k st k in dom F1 holds F2.(len F1 - k + 1) = (F1/.k)") holds Product(F1) =
  Product(F2)";
A1: for n st P[n] holds P[n + 1]
  proof
    let n;
    assume
A2: P[n];
    let F1,F2;
    assume that
A3: len F1 = n + 1 and
A4: len F1 = len F2 and
A5: for k st k in dom F1 holds F2.(len F1 - k + 1) = (F1/.k)";
    reconsider p = F1 | Seg n as FinSequence of the carrier of G by FINSEQ_1:18
;
    deffunc F(Nat) = F2.($1 + 1);
    consider q being FinSequence such that
A6: len q = len p and
A7: for k be Nat st k in dom q holds q.k = F(k) from FINSEQ_1:sch 2;
A8: dom q = dom p by A6,FINSEQ_3:29;
A9: len p = n by A3,FINSEQ_3:53;
A10: rng q c= the carrier of G
    proof
      let x be object;
      assume x in rng q;
      then consider y being object such that
A11:  y in dom q and
A12:  x = q.y by FUNCT_1:def 3;
      reconsider y as Element of NAT by A11;
      y <= len p by A6,A11,FINSEQ_3:25;
      then 1 <= y + 1 & y + 1 <= len F2 by A3,A4,A9,NAT_1:12,XREAL_1:7;
      then
A13:  y + 1 in dom F2 by FINSEQ_3:25;
      x = F2.(y + 1) by A7,A11,A12;
      then
A14:  x in rng F2 by A13,FUNCT_1:def 3;
      rng F2 c= the carrier of G by FINSEQ_1:def 4;
      hence thesis by A14;
    end;
A15: rng F1 c= the carrier of G by FINSEQ_1:def 4;
    1 <= n + 1 by NAT_1:12;
    then n + 1 in dom F1 by A3,FINSEQ_3:25;
    then F1.(n + 1) in rng F1 by FUNCT_1:def 3;
    then reconsider a = F1.(n + 1) as Element of G by A15;
A16: F1 = p ^ <* a *> by A3,FINSEQ_3:55;
A17: now
      let k;
      assume k in dom<* a" *>;
      then
A18:  k in {1} by FINSEQ_1:2,def 8;
      len F2 >= 1 by A3,A4,NAT_1:12;
      then
A19:  len F2 in dom F1 by A4,FINSEQ_3:25;
      then F2.(len F1 - len F1 + 1) = (F1/.len F1)" by A4,A5;
      then (F1/.len F1)" = F2.k by A18,TARSKI:def 1;
      then
A20:  F2.k = a" by A3,A4,A19,PARTFUN1:def 6;
      k = 1 by A18,TARSKI:def 1;
      hence <* a" *>.k = F2.k by A20;
    end;
    reconsider q as FinSequence of the carrier of G by A10,FINSEQ_1:def 4;
    now
      let k;
      assume
A21:  k in dom p;
      then reconsider i = len p - k + 1 as Element of NAT by Lm3;
A22:  i + 1 = len F1 - k + 1 by A3,A9;
      1 <= i & i <= len p by A21,Lm3;
      then i in dom p by FINSEQ_3:25;
      then
A23:  q.i = F2.(i + 1) by A7,A8;
      k <= len p by A21,FINSEQ_3:25;
      then
A24:  k <= len F1 by A3,A9,NAT_1:12;
      1 <= k by A21,FINSEQ_3:25;
      then
A25:  k in dom F1 by A24,FINSEQ_3:25;
      then F1/.k = F1.k by PARTFUN1:def 6
        .= p.k by A21,FUNCT_1:47
        .= p/.k by A21,PARTFUN1:def 6;
      hence q.(len p - k + 1) = (p/.k)" by A5,A23,A25,A22;
    end;
    then
A26: Product p = Product q" by A2,A9,A6;
A27: now
      let k;
A28:  len<* a" *> = 1 by FINSEQ_1:39;
      assume k in dom q;
      hence F2.(len<* a" *> + k) = q.k by A7,A28;
    end;
    len F2 = len<* a" *> + len q by A3,A4,A9,A6,FINSEQ_1:39;
    then F2 = <* a" *> ^ q by A17,A27,FINSEQ_3:38;
    then Product F2 = a" * Product q by FINSOP_1:6
      .= a" * Product p" by A26
      .= (Product p * a)" by GROUP_1:17;
    hence thesis by A16,FINSOP_1:4;
  end;
A29: P[0]
  proof
    let F1,F2;
    assume that
A30: len F1 = 0 and
A31: len F1 = len F2;
    F1 = <*> the carrier of G by A30;
    then
A32: Product F1 = 1_G by Th8;
    F2 = <*> the carrier of G by A30,A31;
    then Product F2 = 1_G by Th8;
    hence thesis by A32,GROUP_1:8;
  end;
  for k holds P[k] from NAT_1:sch 2(A29,A1);
  hence thesis;
end;
