(** * 2D-continuity *)
(** ** Definitions *)
Definition continuity_2d_pt f x y :=
forall eps : posreal, locally_2d (fun u v => Rabs (f u v - f x y) < eps) x y.

(* Specifications: *)
Lemma continuity_2d_pt_filterlim :
forall f x y,
continuity_2d_pt f x y <->
filterlim (fun z : R * R => f (fst z) (snd z)) (locally (x,y)) (locally (f x y)).
Lemma uniform_continuity_2d :
forall f a b c d,
(forall x y, a <= x <= b -> c <= y <= d -> continuity_2d_pt f x y) ->
forall eps : posreal, exists delta : posreal,
forall x y u v,
a <= x <= b -> c <= y <= d ->
a <= u <= b -> c <= v <= d ->
Rabs (u - x) < delta -> Rabs (v - y) < delta ->
Rabs (f u v - f x y) < eps.
Lemma uniform_continuity_2d_1d :
forall f a b c,
(forall x, a <= x <= b -> continuity_2d_pt f x c) ->
forall eps : posreal, exists delta : posreal,
forall x y u v,
a <= x <= b -> c - delta <= y <= c + delta ->
a <= u <= b -> c - delta <= v <= c + delta ->
Rabs (u - x) < delta ->
Rabs (f u v - f x y) < eps.
Lemma uniform_continuity_2d_1d' :
forall f a b c,
(forall x, a <= x <= b -> continuity_2d_pt f c x) ->
forall eps : posreal, exists delta : posreal,
forall x y u v,
a <= x <= b -> c - delta <= y <= c + delta ->
a <= u <= b -> c - delta <= v <= c + delta ->
Rabs (u - x) < delta ->
Rabs (f v u - f y x) < eps.
Lemma continuity_2d_pt_neq_0 :
forall f x y,
continuity_2d_pt f x y -> f x y <> 0 ->
locally_2d (fun u v => f u v <> 0) x y.