reserve i,j,n,k,m for Nat,
     a,b,x,y,z for object,
     F,G for FinSequence-yielding FinSequence,
     f,g,p,q for FinSequence,
     X,Y for set,
     D for non empty set;

theorem Th4:
  for D be non empty set, M,A be BinOp of D, d be Element of D  st
    M is having_a_unity &
    A is associative having_a_unity having_an_inverseOp &
    M is_distributive_wrt A
  holds
   (n is even implies M "**" (n|-> (the_inverseOp_wrt A).d) =
      M "**" (n|-> d) ) &
   (n is odd implies M "**" (n|-> (the_inverseOp_wrt A).d) =
      (the_inverseOp_wrt A).(M "**" (n|-> d)) )
proof
  let D be non empty set, M,A be BinOp of D, d be Element of D;
  set I = the_inverseOp_wrt A;
  assume that
A1: M is having_a_unity and
A2: A is associative having_a_unity having_an_inverseOp and
A3: M is_distributive_wrt A;
  defpred P[Nat] means
  ($1 is even implies M "**" ($1|-> I.d) = M "**" ($1|-> d) ) &
  (not $1 is even implies M "**" ($1|-> I.d) = I.(M "**" ($1|-> d)) );
A4: P[0];
A5: P[i] implies P[i+1]
  proof
    assume
A6:   P[i];
A7:   (i+1)|-> I.d = (i|->I.d)^<*I.d*> by FINSEQ_2:60;
A8:   (i+1)|-> d = (i|->d)^<*d*> by FINSEQ_2:60;
    per cases;
    suppose
A9:   i is even;
      M "**" ((i+1) |-> I.d) = M. (M"**" (i|->d), I.d)
        by A6,A7,A1,FINSOP_1:4,A9
      .= I. (M. (M"**" (i|->d), d)) by FINSEQOP:67,A2,A3
      .= I.(M "**" ((i+1)|-> d)) by A8,A1,FINSOP_1:4;
      hence thesis by A9;
    end;
    suppose
A10:    not i is even;
      M "**" ((i+1) |-> I.d) = M. (I.(M"**" (i|->d)), I.d)
        by A6,A7,A1,FINSOP_1:4,A10
      .= I. (M. (M"**" (i|->d), I.d)) by FINSEQOP:67,A2,A3
      .= I. (I.(M. (M"**" (i|->d), d))) by FINSEQOP:67,A2,A3
      .= I.(I.(M "**" ((i+1)|-> d))) by A8,A1,FINSOP_1:4
      .= M "**" ((i+1)|-> d) by FINSEQOP:62,A2;
      hence thesis by A10;
    end;
  end;
  P[i] from NAT_1:sch 2(A4,A5);
  hence thesis;
end;
