(** * Schwarz theorem *)

(* Specifications: *)
Lemma Schwarz_aux :
forall f x y (eps : posreal),
( forall u v, Rabs (u - x) < eps -> Rabs (v - y) < eps ->
ex_derive (fun z : R => f z v) u /\
ex_derive (fun z : R => Derive (fun t => f t z) u) v ) ->
forall h k, Rabs h < eps -> Rabs k < eps ->
let phi k x := f x (y + k) - f x y in
exists u, exists v,
Rabs (u - x) <= Rabs h /\ Rabs (v - y) <= Rabs k /\
phi k (x + h) - phi k x = h * k * (Derive (fun z => Derive (fun t => f t z) u) v).
Lemma Schwarz :
forall (f : R -> R -> R) x y,
locally_2d (fun u v =>
ex_derive (fun z : R => f z v) u /\
ex_derive (fun z : R => f u z) v /\
ex_derive (fun z : R => Derive (fun t => f z t) v) u /\
ex_derive (fun z : R => Derive (fun t => f t z) u) v) x y ->
continuity_2d_pt (fun u v => Derive (fun z => Derive (fun t => f z t) v) u) x y ->
continuity_2d_pt (fun u v => Derive (fun z => Derive (fun t => f t z) u) v) x y ->
Derive (fun z => Derive (fun t => f z t) y) x = Derive (fun z => Derive (fun t => f t z) x) y.
Lemma partial_derive_add_zero: forall f p q r s x y,
(q=0)%nat \/ (r=0)%nat ->
partial_derive p q (partial_derive r s f) x y
= partial_derive (p+r) (q+s) f x y.