reserve x,y for set;
reserve C,C9,D,E for non empty set;
reserve c,c9,c1,c2,c3 for Element of C;
reserve B,B9,B1,B2 for Element of Fin C;
reserve A for Element of Fin C9;
reserve d,d1,d2,d3,d4,e for Element of D;
reserve F,G for BinOp of D;
reserve u for UnOp of D;
reserve f,f9 for Function of C,D;
reserve g for Function of C9,D;
reserve H for BinOp of E;
reserve h for Function of D,E;
reserve i,j for Nat;
reserve s for Function;
reserve p,q for FinSequence of D;
reserve T1,T2 for Element of i-tuples_on D;

theorem
  F is commutative associative & (i>=1 & j>=1 or F is having_a_unity)
  implies F"**"((i*j)|->d) = F"**"(j|->(F"**"(i|->d)))
proof
  assume that
A1: F is commutative associative and
A2: i>=1 & j>=1 or F is having_a_unity;
  per cases;
  suppose
A3: i = 0 or j = 0;
    set e = the_unity_wrt F;
A4: now
      per cases by A3;
      suppose
        i = 0;
        then i|->d = <*>D;
        then F"**"(i|->d) = e by A2,A3,FINSOP_1:10;
        hence F"**"(j|->(F"**"(i|->d))) = e by A2,A3,Th25;
      end;
      suppose
        j = 0;
        then j|->(F"**"(i|->d)) = <*>D;
        hence F"**"(j|->(F"**"(i|->d))) = e by A2,A3,FINSOP_1:10;
      end;
    end;
    (i*j)|->d = <*>D by A3;
    hence thesis by A2,A3,A4,FINSOP_1:10;
  end;
  suppose
A5: i > 0 & j > 0;
    defpred X[Nat] means $1 <> 0 implies F"**"((i*$1)|->d) = F"**"($1|->(F"**"
    (i|->d)));
A6: for j st X[j] holds X[j+1]
    proof
      let j such that
A7:   j <> 0 implies F"**"((i*j)|->d) = F"**"(j|->(F"**"(i|->d)));
      now
        per cases by NAT_1:14;
        suppose
A8:       j = 0;
          1|->(F"**"(i|->d)) = <*F"**"(i|->d)*> by FINSEQ_2:59;
          hence thesis by A8,FINSOP_1:11;
        end;
        suppose
A9:       j >= 1+0;
          then j > 0;
          then i*j > i*0 by A5,XREAL_1:68;
          then
A10:      i*j >= 1+0 by NAT_1:13;
          F"**"((i*(j+1))|->d) = F"**"((i*j+i*1)|->d)
            .= F.(F"**"((i*j)|->d),F"**"(i|->d)) by A1,A2,A10,Th26
            .= F.(F"**"((i*j)|->d),F"**"(1|->(F"**"(i|->d)))) by FINSOP_1:16
            .= F"**"((j+1)|->(F"**"(i|->d))) by A1,A7,A9,Th26;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
A11: X[0];
    for j holds X[j] from NAT_1:sch 2(A11,A6);
    hence thesis by A5;
  end;
end;
