In Coq, we can formalize the concept of the limit of a function defined on R by defining a function lim
of type (R -> R) -> R -> R -> Prop
as follows:
Require Import Coq.Reals.Reals.
Open Scope R.
Definition lim (f : R -> R) (c : R) (L : R) :=
forall (eps : R), 0 < eps -> exists (del : R), 0 < del /\
(forall (x : R), 0 < R_dist x c < del -> R_dist (f x) L < eps).
We can then prove that the limit is unique:
Theorem lim_unique (f : R -> R) (c : R) (L M : R) :
lim f c L -> lim f c M -> L = M.
However in math, we normally write limits using an equals sign, like "lim x->c f(x) = L". This works because of the uniqueness of limits, so the property of = being an equivalence relation is compatible with this new implicitly-defined meaning of = that we introduce in the notation "lim x->c f(x) = L".
Is it possible to define limits in this way in Coq? More specifically, can we define a function lim2
of type (R -> R) -> R -> R
such that lim2 f c = L
if and only if lim f c L
?