reserve y for set;
reserve g,r,s,p,t,x,x0,x1,x2 for Real;
reserve n,n1 for Nat;
reserve s1,s2,s3 for Real_Sequence;
reserve f,f1,f2 for PartFunc of REAL,REAL;

theorem
  for x,t st 0<t for f1,f2 st [.x,x+t.] c= dom f1 & [.x,x+t.] c= dom f2
& f1|[.x,x+t.] is continuous & f1 is_differentiable_on ].x,x+t.[ & f2|[.x,x+t.]
is continuous & f2 is_differentiable_on ].x,x+t.[ & (for x1 st x1 in ].x,x+t.[
  holds diff(f2,x1)<>0) ex s st 0<s & s<1 & (f1.(x+t)-f1.x)/(f2.(x+t)-f2.x) =
  diff(f1,x+s*t)/diff(f2,x+s*t)
proof
  let x,t such that
A1: 0<t;
  let f1,f2 such that
A2: [.x,x+t.] c= dom f1 and
A3: [.x,x+t.] c= dom f2 and
A4: f1|[.x,x+t.] is continuous & f1 is_differentiable_on ].x,x+t.[ and
A5: f2|[.x,x+t.] is continuous & f2 is_differentiable_on ].x,x+t.[ and
A6: for x1 st x1 in ].x,x+t.[ holds diff(f2,x1)<>0;
  consider x0 such that
A7: x0 in ].x,x+t.[ and
A8: (f1.(x+t)-f1.x)*diff(f2,x0)=(f2.(x+t)-f2.x)*diff(f1,x0) by A1,A2,A3,A4,A5
,Th5,XREAL_1:29;
  diff(f2,x0)*((f1.(x+t)-f1.x)/diff(f2, x0))= (f2.(x+t)-f2.x)*diff(f1,x0)
  /diff(f2,x0) by A8,XCMPLX_1:74;
  then
  (f1.(x+t)-f1.x)/(f2.(x+t)-f2.x) = (f2.(x+t)-f2.x)* (diff(f1,x0)/diff(f2
  ,x0))/(f2.(x+t)-f2.x) by A6,A7,XCMPLX_1:87;
  then
A9: (f1.(x+t)-f1.x)/(f2.(x+t)-f2.x)=((diff(f1,x0)/diff(f2,x0))/(f2.(x+t) -
  f2.x))* (f2.(x+t)-f2.x);
  take s = (x0-x)/t;
  x0 in {r: x<r & r<x+t} by A7,RCOMP_1:def 2;
  then
A10: ex g st g=x0 & x<g & g<x+t;
  then 0<x0-x by XREAL_1:50;
  then 0/t < (x0-x)/t by A1,XREAL_1:74;
  hence 0<s;
  x0-x<t by A10,XREAL_1:19;
  then (x0-x)/t<t/t by A1,XREAL_1:74;
  hence s<1 by A1,XCMPLX_1:60;
A11: s*t+x = (x0-x)+x by A1,XCMPLX_1:87;
  0<>f2.(x+t)-f2.x by A1,A3,A5,A6,Th1,XREAL_1:29;
  hence thesis by A9,A11,XCMPLX_1:87;
end;
