Order arithmetic is taken from Elementary Order Arithmetic in an Ordered Field (claim 1 strict compatibility with addition, claim 2 mixed transitivity, claim 6 0<1, claim 7 inverse of a positive element, claim 10 strict compatibility with multiplication by a positive element) and from Elementary Arithmetic in an Ordered Field (claim 3 translation), and the field axioms of the field R are used for rearrangement.
Midpoints. If s<t then m=21(s+t) satisfies s<m<t: strict compatibility with addition gives s+s<s+t and s+t<t+t, and multiplying by the positive element 21 together with 21(s+s)=s and 21(t+t)=t gives the two strict inequalities. In particular (a,b) is nonempty.
Restriction to the open interval. Let c∈(a,b) and let g be the restriction of f to (a,b). By the midpoint remark applied to a<c and to c<b there are u,v∈(a,b) with u<c<v, so c is an interior point of the interval (a,b). Moreover g is differentiable at c with g′(c)=f′(c): taking L=f′(c) and, for a given ε, the same δ as for f, every h with 0<∣h∣<δ and c+h∈(a,b) also satisfies c+h∈[a,b], and g agrees with f at c and at c+h, so the required estimate holds; the value is f′(c) by Uniqueness of the Derivative at an Interior Point.
Claim 1. By Extreme Value Theorem on a Closed Interval there are xmax,xmin∈[a,b] with f(xmin)≤f(x)≤f(xmax) for every x∈[a,b].
Suppose first that xmax∈(a,b). Then g has a local maximum at xmax relative to (a,b): the choice δ=1 is positive, and every y∈(a,b) satisfies g(y)=f(y)≤f(xmax)=g(xmax). Hence g′(xmax)=0 by Vanishing of the Derivative at an Interior Local Extremum, and f′(xmax)=0 by the restriction remark; take c=xmax. If instead xmin∈(a,b), the same argument with a local minimum gives f′(xmin)=0.
Otherwise neither point lies in (a,b). A point x∈[a,b] with x=a and x=b satisfies a<x<b and hence lies in (a,b), so xmax and xmin each equal a or b. Since f(a)=f(b) this gives f(xmax)=f(xmin), so every x∈[a,b] satisfies f(xmin)≤f(x)≤f(xmin) and therefore f(x)=f(xmin) by antisymmetry of ≤. Let c=21(a+b), which lies in (a,b) by the midpoint remark. Then g is constant, so it has a local maximum at c relative to (a,b), and Vanishing of the Derivative at an Interior Local Extremum with the restriction remark gives f′(c)=0.
Claim 2. Translating a<b by −a gives 0<b−a, so b−a=0 and its inverse exists. Put
α=(f(b)−f(a))(b−a)−1,so thatα(b−a)=f(b)−f(a).
Let ι:[a,b]→R be given by ι(x)=x; it is continuous on [a,b], since for a given ε the choice δ=ε satisfies dR(ι(x),ι(x0))=dR(x0,x)<ε whenever dR(x0,x)<δ, using the symmetry axiom of Metric Space. Let ϕ:[a,b]→R be given by ϕ(x)=f(x)+(−α)x. By claims 4, 2 and 5 of Continuity of Sums and Products of Real-Valued Functions on a Metric Space, applied to the scalar multiple (−α)ι and then to the sum, ϕ is continuous on [a,b].
Let c∈(a,b). The function (−α)ι is differentiable at c with derivative −α: for every h=0 distributivity gives
h(−α)(c+h)−(−α)c=h(−α)h=−α,
so the condition of Derivative at an Interior Point holds with L=−α and δ=1, the absolute value of 0 being 0 by Absolute Value in an Ordered Field. Claim 2 of Sum and Product Rules for One-Dimensional Derivatives and Continuity now shows that ϕ is differentiable at c with
ϕ′(c)=f′(c)+(−α).
Finally
ϕ(b)−ϕ(a)=(f(b)−f(a))+(−α)(b−a)=0,
so ϕ(a)=ϕ(b) by claim 3 of Additive Cancellation and Elementary Additive Identities in a Field. Claim 1, applied to ϕ, therefore provides c∈(a,b) with ϕ′(c)=0, that is f′(c)+(−α)=0, whence f′(c)=α by claim 1 of Additive Cancellation and Elementary Additive Identities in a Field and claim 5 of that lemma. Multiplying by b−a gives f′(c)(b−a)=α(b−a)=f(b)−f(a).