(** [sqrt_up] is a monotone function (but not a strict one) *)

(* Specifications: *)
Lemma sqrt_up_le_mono : forall a b, a <= b -> √°a <= √°b.
(** No reverse result for <=, consider for instance √°3 <= √°2 *)
Lemma sqrt_up_lt_cancel : forall a b, √°a < √°b -> a < b.
(** When left side is a square, we have an equivalence for < *)
Lemma sqrt_up_lt_square : forall a b, 0<=a -> 0<=b -> (b² < a <-> b < √°a).
(** When right side is a square, we have an equivalence for <= *)
Lemma sqrt_up_le_square : forall a b, 0<=a -> 0<=b -> (a <= b² <-> √°a <= b).
Lemma sqrt_up_pos : forall a, 0 < √°a <-> 0 < a.
Lemma sqrt_up_lt_lin : forall a, 2<a -> √°a < a.
Lemma sqrt_up_le_lin : forall a, 0<=a -> √°a<=a.
(** [sqrt_up] and multiplication. *)
(** Due to rounding error, we don't have the usual [√(a*b) = √a*√b] but only lower and upper bounds. *)
Lemma sqrt_up_mul_above : forall a b, 0<=a -> 0<=b -> √°(a*b) <= √°a * √°b.
Lemma sqrt_up_mul_below : forall a b, 0<a -> 0<b -> (P √°a)*(P √°b) < √°(a*b).
(** And we can't find better approximations in general. - The upper bound is exact for squares - Concerning the lower bound, for any c>0, take [a=b=c²+1], then [√°(a*b) = c²+1] while [P √°a = P √°b = c] *)
(** [sqrt_up] and successor : - the [sqrt_up] function climbs by at most 1 at a time - otherwise it stays at the same value - the +1 steps occur after squares *)
Lemma sqrt_up_succ_le : forall a, 0<=a -> √°(S a) <= S (√°a).
Lemma sqrt_up_succ_or : forall a, 0<=a -> √°(S a) == S (√°a) \/ √°(S a) == √°a.
Lemma sqrt_up_eq_succ_iff_square : forall a, 0<=a ->
(√°(S a) == S (√°a) <-> exists b, 0<=b /\ a == b²).