Definition left_total(r : nat -> A -> Prop) :=
    forall n, exists a, r n a.Definition functional(r : nat -> A -> Prop) :=
    forall n a1 a2,
      r n a1 ->
      r n a2 ->
      eq a1 a2.Definition inf_limit(f : nat -> A -> Prop)(a : A) :=
    forall (epsilon : A),
      ~eq epsilon zero -> 
      exists n : nat,
        forall (n' : nat),
          n' >= n ->
          forall a',
            f n' a' ->
            le (distance a' a) epsilon.(* Note: if the codomain of the relation is empty (after any point), then we can assign any limit to it. *)

  (* We could define inf_limit in terms of inf_limit_2, but inf_limit_2 only shows up in proofs, while inf_limit shows up in top-level definitions. *)
  Definition inf_limit_2(f f' : nat -> A -> Prop) :=
    forall (epsilon : A),
      ~eq epsilon zero -> 
      exists n : nat,
        forall (n' : nat),
          n' >= n ->
          forall a a',
            f n' a ->
            f' n' a' ->
            le (distance a a') epsilon.

(* Specifications: *)
Theorem inf_limit_2_const : forall (f : nat -> A -> Prop)(a : A), inf_limit_2 f (fun x => eq a) <-> inf_limit f a.
Theorem limit_eq_h : forall f epsilon a1 a2, left_total f -> ~eq epsilon zero -> inf_limit f a1 -> inf_limit f a2 -> le (distance a1 a2) epsilon.
Theorem limits_eq : forall f a1 a2, left_total f -> inf_limit f a1 -> inf_limit f a2 -> eq a1 a2.
Theorem limit_f_eq : forall f1 f2 a, inf_limit f1 a -> (forall n a', (f1 n a' <-> f2 n a')) -> inf_limit f2 a.