reserve i,j,k,n for Nat;
reserve D for non empty set,
  p for Element of D,
  f,g for FinSequence of D;

theorem Th63:
  for f being FinSequence, x being object holds Rev(f^<*x*>) = <*x*>^ (Rev f)
proof
  let f be FinSequence, x be object;
  set n = len f + 1, g = <*x*>;
A1: len(g^(Rev f)) = len g + len (Rev f) by FINSEQ_1:22
    .= 1 + len (Rev f) by FINSEQ_1:39
    .= n by Def3;
A2: len (f^g) = n by FINSEQ_2:16;
  then
A3: len(Rev(f^g)) = n by Def3;
  now
    let i be Nat;
A4: len g = 1 by FINSEQ_1:40;
    assume
A5: i in dom Rev(f^g);
    then
A6: 1 <= i by FINSEQ_3:25;
A7: i <= n by A3,A5,FINSEQ_3:25;
    per cases by A6,XXREAL_0:1;
    suppose
A8:   i = 1;
      Seg len g = dom g by FINSEQ_1:def 3;
      then
A9:   1 in dom g by A4;
      thus (Rev(f^g)).i = (f^g).(n-1+1) by A2,A5,A8,Def3
        .= g.1 by FINSEQ_1:42
        .= (g^(Rev f)).i by A8,A9,FINSEQ_1:def 7;
    end;
    suppose
A10:  i > 1;
      then reconsider j = i-1 as Element of NAT by NAT_1:20;
      consider l being Nat such that
A11:  i = l + 1 by A10,NAT_1:6;
      reconsider k = n - i + 1 as Element of NAT by A7,Th1;
      n < len f + i by A10,XREAL_1:8;
      then n - i < len f + i - i by XREAL_1:9;
      then k < len f + 1 by XREAL_1:6;
      then
A12:  k <= len f by NAT_1:13;
      i - i <= n - i by A7,XREAL_1:9;
      then 0 + 1 <= k by XREAL_1:6;
      then
A13:  k in dom f by A12,FINSEQ_3:25;
      l <> 0 by A10,A11;
      then
A14:  1 <= j by A11,NAT_1:14;
      j <= n - 1 by A7,XREAL_1:9;
      then
A15:  j in dom f by A14,FINSEQ_3:25;
      thus (Rev(f^g)).i = (f^g).(n - i + 1) by A2,A5,Def3
        .= f.(len f - j + 1) by A13,FINSEQ_1:def 7
        .= (Rev f).j by A15,Th58
        .= (g^(Rev f)).i by A1,A7,A4,A10,FINSEQ_1:24;
    end;
  end;
  hence thesis by A1,A3,FINSEQ_2:9;
end;
