reserve k,n,i,j for Nat;

theorem Th23:
  for G being Group, f being FinSequence of G holds Product (f^( Rev f)")=1_G
proof
  let G be Group,f be FinSequence of G;
  defpred P[Nat] means for g being FinSequence of G st len g <=$1
  holds Product (g^(Rev g)")=1_G;
A1: for k being Nat st P[k] holds P[k+1]
  proof
    let k be Nat;
    assume
A2: P[k];
    for g being FinSequence of G st len g <= k+1 holds Product (g^(Rev g)
    ")=1_G
    proof
      let g be FinSequence of G;
      assume
A3:   len g <= k+1;
      now
        per cases by A3,XXREAL_0:1;
        case
          len g<k+1;
          then len g<=k by NAT_1:13;
          hence thesis by A2;
        end;
        case
A4:       len g=k+1;
          reconsider h=g|k as FinSequence of G;
          k< len g by A4,NAT_1:13;
          then
A5:       len h=k by FINSEQ_1:59;
A6:       Product (<* g/.(k+1) *> ^ (<* g/.(k + 1) *>)") =Product (<* g/.
          (k+1) *>) * Product ((<* g/.(k + 1) *>)") by GROUP_4:5
            .=(g/.(k+1))*Product ((<* g/.(k + 1) *>)") by FINSOP_1:11
            .=(g/.(k+1))*Product ((<* (g/.(k + 1))" *>)) by Th22
            .=(g/.(k+1))*(g/.(k + 1))" by FINSOP_1:11
            .=1_G by GROUP_1:def 5;
A7:       g=h^<* g/.(k+1) *> by A4,FINSEQ_5:21;
          then Rev g=<* g/.(k+1) *> ^ (Rev h) by FINSEQ_5:63;
          then (Rev g)"=(<* g/.(k + 1) *>)" ^ (Rev h)" by Th21;
          then
          g^(Rev g)"=h^ (<* g/.(k+1) *> ^ ((<* g/.(k + 1) *>)" ^ (Rev h)"
          )) by A7,FINSEQ_1:32
            .=h^ (<* g/.(k+1) *> ^ (<* g/.(k + 1) *>)" ^ (Rev h)") by
FINSEQ_1:32;
          then
          Product (g^(Rev g)") =Product (h) * Product (<* g/.(k+1) *> ^ (
          <* g/.(k + 1) *>)" ^ (Rev h)") by GROUP_4:5
            .=Product (h) * (Product (<* g/.(k+1) *> ^ (<* g/.(k + 1) *>)" )
          * Product ((Rev h)")) by GROUP_4:5
            .=Product (h) * Product ((Rev h)") by A6,GROUP_1:def 4
            .=Product (h^((Rev h)")) by GROUP_4:5;
          hence thesis by A2,A5;
        end;
      end;
      hence thesis;
    end;
    hence thesis;
  end;
  for g being FinSequence of G st len g <= 0 holds Product (g^(Rev g)")= 1_G
  proof
    let g be FinSequence of G;
    assume len g <= 0;
    then
A8: g=<*>(the carrier of G);
    then Rev g=<*>(the carrier of G) by FINSEQ_5:79;
    then (Rev g)" = <*>(the carrier of G) by Th20;
    then g^(Rev g)"=<*>(the carrier of G) by A8,FINSEQ_1:34;
    hence thesis by GROUP_4:8;
  end;
  then
A9: P[0];
  for j being Nat holds P[j] from NAT_1:sch 2(A9,A1);
  then P[len f];
  hence thesis;
end;
