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 Th3:
  for D be non empty set, A,M be BinOp of D  st
    A is commutative associative having_a_unity &
    M is commutative & M is_distributive_wrt A &
    (for d be Element of D holds M.(the_unity_wrt A,d) = the_unity_wrt A)
  for X,Y be non empty finite set
    for f be Function of X,D, g be Function of Y,D
      for a be Element of Fin X,b be Element of Fin Y
        holds
   A $$ ([:a,b:],M*(f,g))=M. ( A$$(a,f),A$$(b,g))
proof
  let D be non empty set, A,M be BinOp of D such that
A1: A is commutative associative having_a_unity &
    M is commutative & M is_distributive_wrt A and
A2:(for d be Element of D holds M.(the_unity_wrt A,d) = the_unity_wrt A);
  let X,Y be non empty finite set;
  let f be Function of X,D, g be Function of Y,D;
set m=M*(f,g);
  defpred P[set] means
    for a be Element of Fin X,b be Element of Fin Y st a=$1 holds
    A $$ ([:a,b:],m)=M. ( A$$(a,f),A$$(b,g));
A3:P[{}.X]
  proof
    let a be Element of Fin X, b be Element of Fin Y such that
A4:  a={}.X;
    [:{}.X,b:] = {}.[:X,Y:] by ZFMISC_1:90;
    then
A5:   A $$ ([:{}.X,b:],m)= the_unity_wrt A by A1,SETWISEO:31;
    A$$({}.X,f) = the_unity_wrt A by A1,SETWISEO:31;
    hence thesis by A4,A2,A5;
  end;
A6:for E be (Element of Fin X), e be Element of X holds P[E] & not e in E
    implies P[E \/ {e}]
  proof
    let E be (Element of Fin X), e be Element of X such that
A7: P[E] & not e in E;
    defpred Q[set] means for B be Element of Fin Y st B=$1 holds
    A $$ ([:{.e.},B:],m)=M. ( A$$({.e.},f),A$$(B,g));
A8: Q[{}.Y]
    proof
      let B be Element of Fin Y such that
A9:     B={}.Y;
A10:    [:{.e.},{}.Y:] = {}.[:X,Y:];
      M. ( A$$({.e.},f),A$$(B,g)) = M. (A$$(B,g),A$$({.e.},f))
        by A1,BINOP_1:def 2
      .= M. ( the_unity_wrt A,A$$({.e.},f)) by A9,A1,SETWISEO:31
      .= the_unity_wrt A by A2;
      hence A $$ ([:{.e.},B:],M*(f,g))=M. ( A$$({.e.},f),A$$(B,g))
        by A10,A9,A1,SETWISEO:31;
    end;
A11: for B be (Element of Fin Y), b be Element of Y holds Q[B]
      & not b in B implies Q[B \/ {b}]
    proof
      let B be (Element of Fin Y), b be Element of Y such that
A12:    Q[B] & not b in B;
      let Bb be Element of Fin Y such that
A13:    Bb=B \/ {b};
A14:  B misses {.b.} by A12,ZFMISC_1:50;
      then
A15:    [:{.e.},B:] misses [:{.e.},{.b.}:] by ZFMISC_1:104;
A16:    {[e,b]} = [:{.e.},{.b.}:] by ZFMISC_1:29;
      reconsider eb=[e,b] as Element of [:X,Y:];
A17:  A $$([:{.e.},{.b.}:],m) = m.eb by A16,A1,SETWISEO:17
      .= m.(e,b) by BINOP_1:def 1
      .= M.(f.e,g.b) by FINSEQOP:81
      .= M.(A$$({.e.},f),g.b) by A1,SETWISEO:17
      .= M.(A$$({.e.},f),A$$({.b.},g)) by A1,SETWISEO:17;
      [:{.e.},B:] \/ [:{.e.},{.b.}:] = [:{.e.},Bb:] by A13,ZFMISC_1:97;
      hence A$$([:{.e.},Bb:],m)
        = A.(A $$([:{.e.},B:],m),A $$([:{.e.},{.b.}:],m)) by A15,A1,SETWOP_2:4
      .= A. ( M. ( A$$({.e.},f),A$$(B,g)), M.(A$$({.e.},f),A$$({.b.},g)))
        by A12,A17
      .= M. ( A$$({.e.},f),A.(A$$(B,g),A$$({.b.},g))) by A1,BINOP_1:11
      .= M. ( A$$({.e.},f),A$$(Bb,g)) by A13,A1,SETWOP_2:4,A14;
    end;
A18: for B be (Element of Fin Y) holds Q[B] from SETWISEO:sch 2(A8,A11);
    let Q be Element of Fin X,B be Element of Fin Y such that A19:Q=E \/ {e};
A20: E misses {.e.} by A7,ZFMISC_1:50;
    then
A21: [:E,B:] misses [:{.e.},B:] by ZFMISC_1:104;
    [:E,B:] \/ [:{.e.},B:] = [:Q,B:] by A19,ZFMISC_1:97;
    hence A$$([:Q,B:], m) = A. (A $$ ([:E,B:], m),A $$ ([:{.e.},B:], m))
      by A21,A1,SETWOP_2:4
    .= A. (M.(A $$ (E, f),A $$ (B, g)), A $$ ([:{.e.},B:],M*(f,g))) by A7
    .= A. (M.(A $$ (E, f),A $$ (B, g)), M.(A$$({.e.},f),A$$(B,g))) by A18
    .= M.(A. ( A $$ (E, f),A$$({.e.},f)), A$$(B,g)) by A1,BINOP_1:11
    .= M.(A $$ (Q,f), A$$(B,g)) by A19,A1,A20,SETWOP_2:4;
  end;
  for E be (Element of Fin X) holds P[E] from SETWISEO:sch 2(A3,A6);
  hence thesis;
end;
