reserve D for set;
reserve x,x0,x1,x2,y,y0,y1,y2,z,z0,z1,z2,r,s,t for Real;
reserve p,a,u,u0 for Element of REAL 3;
reserve n,m,k for Element of NAT;
reserve f,f1,f2,f3,g for PartFunc of REAL 3,REAL;
reserve R,R1,R2 for RestFunc;
reserve L,L1,L2 for LinearFunc;

theorem
  f1 is_partial_differentiable_in u0,2 &
  f2 is_partial_differentiable_in u0,2 implies
  f1(#)f2 is_partial_differentiable_in u0,2
proof
     assume that
A1:  f1 is_partial_differentiable_in u0,2 and
A2:  f2 is_partial_differentiable_in u0,2;
     consider x0,y0,z0 being Real such that
A3:  u0 = <*x0,y0,z0*> & ex N being Neighbourhood of y0
     st N c= dom SVF1(2,f1,u0) & ex L,R st for y st y in N holds
     SVF1(2,f1,u0).y - SVF1(2,f1,u0).y0 = L.(y-y0) + R.(y-y0)
     by A1,Th14;
     consider N1 be Neighbourhood of y0 such that
A4:  N1 c= dom SVF1(2,f1,u0) & ex L,R st for y st y in N1 holds
     SVF1(2,f1,u0).y - SVF1(2,f1,u0).y0 = L.(y-y0) + R.(y-y0) by A3;
     consider L1,R1 such that
A5:  for y st y in N1 holds
     SVF1(2,f1,u0).y - SVF1(2,f1,u0).y0 = L1.(y-y0) + R1.(y-y0) by A4;
     consider x1,y1,z1 being Real such that
A6:  u0 = <*x1,y1,z1*> & ex N being Neighbourhood of y1
     st N c= dom SVF1(2,f2,u0) & ex L,R st for y st y in N holds
     SVF1(2,f2,u0).y - SVF1(2,f2,u0).y1 = L.(y-y1) + R.(y-y1)
     by A2,Th14;
  x0 = x1 & y0 = y1 & z0 = z1 by A3,A6,FINSEQ_1:78;
     then consider N2 be Neighbourhood of y0 such that
A7:  N2 c= dom SVF1(2,f2,u0) & ex L,R st for y st y in N2 holds
     SVF1(2,f2,u0).y - SVF1(2,f2,u0).y0 = L.(y-y0) + R.(y-y0) by A6;
     consider L2,R2 such that
A8:  for y st y in N2 holds
     SVF1(2,f2,u0).y - SVF1(2,f2,u0).y0 = L2.(y-y0) + R2.(y-y0) by A7;
     consider N be Neighbourhood of y0 such that
A9: N c= N1 & N c= N2 by RCOMP_1:17;
     reconsider L11=(SVF1(2,f2,u0).y0)(#)L1 as LinearFunc by FDIFF_1:3;
     reconsider L12=(SVF1(2,f1,u0).y0)(#)L2 as LinearFunc by FDIFF_1:3;
A10: L11 is total & L12 is total & L1 is total & L2 is total by FDIFF_1:def 3;
     reconsider L=L11+L12 as LinearFunc by FDIFF_1:2;
     reconsider R11=(SVF1(2,f2,u0).y0)(#)R1, R12=(SVF1(2,f1,u0).y0)(#)R2
       as RestFunc by FDIFF_1:5;
     reconsider R13=R11+R12 as RestFunc by FDIFF_1:4;
     reconsider R14=L1(#)L2 as RestFunc by FDIFF_1:6;
     reconsider R15=R13+R14, R17=R1(#)R2 as RestFunc by FDIFF_1:4;
     reconsider R16=R1(#)L2, R18=R2(#)L1 as RestFunc by FDIFF_1:7;
     reconsider R19=R16+R17 as RestFunc by FDIFF_1:4;
     reconsider R20=R19+R18 as RestFunc by FDIFF_1:4;
     reconsider R=R15+R20 as RestFunc by FDIFF_1:4;
A11: R1 is total & R2 is total & R11 is total & R12 is total &
     R13 is total & R14 is total & R15 is total & R16 is total &
     R17 is total & R18 is total & R19 is total & R20 is total
     by FDIFF_1:def 2;
A12: N c= dom SVF1(2,f1,u0) by A4,A9;
A13: N c= dom SVF1(2,f2,u0) by A7,A9;
 A14: for y st y in N holds y in dom SVF1(2,f1(#)f2,u0)
     proof
       let y;
       assume
  A15: y in N;
  then
A16: y in dom reproj(2,u0) & reproj(2,u0).y in dom f1 by A12,FUNCT_1:11;
       y in dom reproj(2,u0) & reproj(2,u0).y in dom f2 by A13,A15,FUNCT_1:11;
       then y in dom reproj(2,u0) & reproj(2,u0).y in dom f1 /\ dom f2
       by A16,XBOOLE_0:def 4;then
    y in dom reproj(2,u0) & reproj(2,u0).y in dom (f1(#)f2)
       by VALUED_1:def 4;
       hence thesis by FUNCT_1:11;
     end;
     then for y be object st y in N holds y in dom SVF1(2,f1(#)f2,u0);then
A17: N c= dom SVF1(2,f1(#)f2,u0);
 now
       let yy be Real;
       assume
  A18: yy in N;
    reconsider y=yy, yy0=y0 as Element of REAL by XREAL_0:def 1;
  A19: SVF1(2,f1,u0).y - SVF1(2,f1,u0).y0 + SVF1(2,f1,u0).y0
       = L1.(y-y0) + R1.(y-y0) + SVF1(2,f1,u0).y0 by A5,A9,A18;
       y in dom ((f1(#)f2)*reproj(2,u0)) by A14,A18;then
  A20: y in dom reproj(2,u0) & reproj(2,u0).y in dom (f1(#)f2) by FUNCT_1:11;
       then reproj(2,u0).y in dom f1 /\ dom f2 by VALUED_1:def 4;
       then reproj(2,u0).y in dom f1 & reproj(2,u0).y in dom f2
       by XBOOLE_0:def 4;then
  A21: y in dom (f1*reproj(2,u0)) & y in dom (f2*reproj(2,u0))
       by A20,FUNCT_1:11;
  A22: y0 in N by RCOMP_1:16;
       y0 in dom ((f1(#)f2)*reproj(2,u0)) by A14,RCOMP_1:16;then
  A23: y0 in dom reproj(2,u0) & reproj(2,u0).y0 in dom (f1(#)f2) by FUNCT_1:11;
       then reproj(2,u0).y0 in dom f1 /\ dom f2 by VALUED_1:def 4;
       then reproj(2,u0).y0 in dom f1 & reproj(2,u0).y0 in dom f2
       by XBOOLE_0:def 4;then
  A24: y0 in dom (f1*reproj(2,u0)) & y0 in dom (f2*reproj(2,u0))
       by A23,FUNCT_1:11;
       thus SVF1(2,f1(#)f2,u0).yy - SVF1(2,f1(#)f2,u0).y0
       = (f1(#)f2).(reproj(2,u0).y) - SVF1(2,f1(#)f2,u0).y0
         by A17,A18,FUNCT_1:12
      .= (f1.(reproj(2,u0).y))*(f2.(reproj(2,u0).y)) - SVF1(2,f1(#)f2,u0).y0
         by VALUED_1:5
      .= (SVF1(2,f1,u0).y)*(f2.(reproj(2,u0).y)) - SVF1(2,f1(#)f2,u0).y0
         by A21,FUNCT_1:12
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y) - ((f1(#)f2)*reproj(2,u0)).y0
         by A21,FUNCT_1:12
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y) - (f1(#)f2).(reproj(2,u0).y0)
         by A17,A22,FUNCT_1:12
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y) -
         (f1.(reproj(2,u0).y0))*(f2.(reproj(2,u0).y0)) by VALUED_1:5
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y) -
         (SVF1(2,f1,u0).y0)*(f2.(reproj(2,u0).y0)) by A24,FUNCT_1:12
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y)+
         -(SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y0)+
         (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y0)-
         (SVF1(2,f1,u0).y0)*(SVF1(2,f2,u0).y0) by A24,FUNCT_1:12
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y-SVF1(2,f2,u0).y0)+
         (SVF1(2,f1,u0).y-SVF1(2,f1,u0).y0)*(SVF1(2,f2,u0).y0)
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y-SVF1(2,f2,u0).y0)+
         (L1.(y-y0)+R1.(y-y0))*(SVF1(2,f2,u0).y0) by A5,A9,A18
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y-SVF1(2,f2,u0).y0)+
         ((SVF1(2,f2,u0).y0)*L1.(y-y0)+(SVF1(2,f2,u0).y0)*R1.(y-y0))
      .= (SVF1(2,f1,u0).y)*(SVF1(2,f2,u0).y-SVF1(2,f2,u0).y0)+
         (L11.(y-yy0)+(SVF1(2,f2,u0).y0)*R1.(y-yy0)) by A10,RFUNCT_1:57
      .= (L1.(y-yy0)+R1.(y-yy0)+SVF1(2,f1,u0).y0)*
         (SVF1(2,f2,u0).y-SVF1(2,f2,u0).y0)+
         (L11.(y-y0)+R11.(y-y0)) by A11,A19,RFUNCT_1:57
      .= (L1.(y-y0)+R1.(y-y0)+SVF1(2,f1,u0).y0)*(L2.(y-y0)+R2.(y-y0))+
         (L11.(y-y0)+R11.(y-y0)) by A8,A9,A18
      .= (L1.(y-y0)+R1.(y-y0))*(L2.(y-y0)+R2.(y-y0))+
         ((SVF1(2,f1,u0).y0)*L2.(y-y0)+(SVF1(2,f1,u0).y0)*R2.(y-y0))+
         (L11.(y-y0)+R11.(y-y0))
      .= (L1.(y-yy0)+R1.(y-y0))*(L2.(y-y0)+R2.(y-y0))+
         (L12.(y-y0)+(SVF1(2,f1,u0).y0)*R2.(y-y0))+(L11.(y-y0)+R11.(y-y0))
         by A10,RFUNCT_1:57
      .= (L1.(y-y0)+R1.(y-y0))*(L2.(y-y0)+R2.(y-y0))+
         (L12.(y-y0)+R12.(y-y0))+(L11.(y-y0)+R11.(y-y0)) by A11,RFUNCT_1:57
      .= (L1.(y-y0)+R1.(y-y0))*(L2.(y-y0)+R2.(y-y0))+
         (L12.(y-y0)+(L11.(y-y0)+(R11.(y-y0)+R12.(y-y0))))
      .= (L1.(y-y0)+R1.(y-y0))*(L2.(y-y0)+R2.(y-y0))+
         (L12.(y-yy0)+(L11.(y-y0)+R13.(y-y0))) by A11,RFUNCT_1:56
      .= (L1.(y-y0)+R1.(y-y0))*(L2.(y-y0)+R2.(y-y0))+
         (L11.(y-y0)+L12.(y-y0)+R13.(y-y0))
      .= (L1.(y-y0)*L2.(y-y0)+L1.(y-y0)*R2.(y-y0))+
         R1.(y-yy0)*(L2.(y-y0)+R2.(y-y0))+(L.(y-y0)+R13.(y-y0))
         by A10,RFUNCT_1:56
      .= R14.(y-y0)+R2.(y-y0)*L1.(y-y0)+R1.(y-y0)*(L2.(y-y0)+R2.(y-y0))+
         (L.(y-yy0)+R13.(y-y0)) by A10,RFUNCT_1:56
      .= R14.(y-y0)+R18.(y-y0)+(R1.(y-y0)*L2.(y-y0)+R1.(y-y0)*R2.(y-y0))+
         (L.(y-yy0)+R13.(y-y0)) by A10,A11,RFUNCT_1:56
      .= R14.(y-y0)+R18.(y-y0)+(R16.(y-y0)+R1.(y-y0)*R2.(y-y0))+
         (L.(y-yy0)+R13.(y-y0)) by A10,A11,RFUNCT_1:56
      .= R14.(y-y0)+R18.(y-y0)+(R16.(y-y0)+R17.(y-y0))+(L.(y-y0)+R13.(y-y0))
         by A11,RFUNCT_1:56
      .= R14.(y-yy0)+R18.(y-y0)+R19.(y-y0)+(L.(y-y0)+R13.(y-y0))
         by A11,RFUNCT_1:56
      .= R14.(y-y0)+(R19.(y-y0)+R18.(y-y0))+(L.(y-y0)+R13.(y-y0))
      .= L.(y-yy0)+R13.(y-y0)+(R14.(y-y0)+R20.(y-y0)) by A11,RFUNCT_1:56
      .= L.(y-y0)+(R13.(y-y0)+R14.(y-y0)+R20.(y-y0))
      .= L.(y-yy0)+(R15.(y-y0)+R20.(y-y0)) by A11,RFUNCT_1:56
      .= L.(yy-y0)+R.(yy-y0) by A11,RFUNCT_1:56;
     end;
     hence thesis by A3,A17,Th14;
end;
