reserve x1,x2,z for set;
reserve A,B for non empty set;
reserve f,g,h for Element of Funcs(A,REAL);
reserve a,b for Real;

theorem Th15:
  for A be set, f,g,h be Element of Funcs(A,REAL) holds
    (RealFuncMult(A)).(f,(RealFuncAdd A).(g,h)) =
      (RealFuncAdd A).((RealFuncMult(A)).(f,g),(RealFuncMult(A)).(f,h))
proof
  let A be set, f,g,h be Element of Funcs(A,REAL);
A1: multreal.:(f,addreal.:(g,h)) = addreal.:(multreal.:(f,g),multreal.:(f,h))
   proof let a be Element of A;
    per cases;
    suppose A = {};
      hence (multreal.:(f,addreal.:(g,h))).a
        = (addreal.:(multreal.:(f,g),multreal.:(f,h))).a;
    end;
    suppose A <> {};
      then reconsider B=A as non empty set;
      reconsider ff=f, gg=g, hh=h as Element of Funcs(B,REAL);
      reconsider b = a as Element of B;
      thus (multreal.:(f,addreal.:(g,h))).a
        = multreal.(f.b,addreal.:(g,h).b) by FUNCOP_1:37
       .= multreal.(f.b,addreal.(g.b,h.b)) by FUNCOP_1:37
       .= ff.b * addreal.(gg.b,hh.b) by BINOP_2:def 11
       .= ff.b * (gg.b + hh.b) by BINOP_2:def 9
       .= (ff.b * gg.b) + (ff.b * hh.b)
       .= (ff.b * gg.b) + multreal.(ff.b,hh.b) by BINOP_2:def 11
       .= multreal.(ff.b,gg.b) + multreal.(ff.b,hh.b) by BINOP_2:def 11
       .= addreal.(multreal.(f.a,g.a),multreal.(f.a,h.a)) by BINOP_2:def 9
       .= addreal.(multreal.(f.a,g.a),multreal.:(ff,h).a) by FUNCOP_1:37
       .= addreal.(multreal.:(ff,g).a,multreal.:(ff,h).a) by FUNCOP_1:37
       .= (addreal.:(multreal.:(f,g),multreal.:(f,h))).a by FUNCOP_1:37;
    end;
   end;
  thus (RealFuncMult(A)).(f,(RealFuncAdd A).(g,h))
    = (RealFuncMult(A)).(f,addreal.:(g,h)) by Def1
   .= addreal.:(multreal.:(f,g),multreal.:(f,h)) by A1,Def2
   .= (RealFuncAdd A).(multreal.:(f,g),multreal.:(f,h)) by Def1
   .= (RealFuncAdd A).((RealFuncMult(A)).(f,g),multreal.:(f,h)) by Def2
   .= (RealFuncAdd A).((RealFuncMult A).(f,g),(RealFuncMult A).(f,h)) by Def2;
end;
