reserve x,x0,x1,x2,y,y0,y1,y2,r,r1,s,p,p1 for Real;
reserve z,z0 for Element of REAL 2;
reserve n,m,k for Element of NAT;
reserve Z for Subset of REAL 2;
reserve s1 for Real_Sequence;
reserve f,f1,f2 for PartFunc of REAL 2,REAL;
reserve R,R1,R2 for RestFunc;
reserve L,L1,L2 for LinearFunc;

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