reserve i,j,k,n for Nat;
reserve x,y,z for Tuple of n, BOOLEAN;
reserve m,k,k1,k2 for FinSequence of NAT;

theorem
  for m holds len m >= 4 implies IDEAoperationC( IDEAoperationC(m) ) = m
proof
  let m be FinSequence of NAT;
  consider I1 being FinSequence of NAT such that
A1: I1 = IDEAoperationC(m);
  assume
A2: len m >= 4;
  then 2 <= len m by XXREAL_0:2;
  then 2 in Seg len m by FINSEQ_1:1;
  then 2 in dom m by FINSEQ_1:def 3;
  then
A3: I1.2 = m.3 by A1,Lm3;
  consider I2 being FinSequence of NAT such that
A4: I2 = IDEAoperationC(I1);
  3 <= len m by A2,XXREAL_0:2;
  then 3 in Seg len m by FINSEQ_1:1;
  then 3 in dom m by FINSEQ_1:def 3;
  then
A5: I1.3 = m.2 by A1,Lm4;
A6: now
    let j be Nat;
    assume
A7: j in Seg len m;
    then j in Seg len I1 by A1,Def13;
    then
A8: j in dom I1 by FINSEQ_1:def 3;
A9: j in dom m by A7,FINSEQ_1:def 3;
    now
      per cases;
      suppose
        j = 2;
        hence I2.j = m.j by A4,A5,A8,Lm3;
      end;
      suppose
        j = 3;
        hence I2.j = m.j by A4,A3,A8,Lm4;
      end;
      suppose
A10:    j<>2 & j<>3;
        hence I2.j = I1.j by A4,A8,Lm5
          .= m.j by A1,A9,A10,Lm5;
      end;
    end;
    hence I2.j = m.j;
  end;
A11: Seg len m = dom m by FINSEQ_1:def 3;
  Seg len m = Seg len(I1) by A1,Def13
    .= Seg len(I2) by A4,Def13
    .= dom I2 by FINSEQ_1:def 3;
  hence thesis by A1,A4,A11,A6,FINSEQ_1:13;
end;
