Definition sqrt_spec a (Ha:0<=a) := sqrt_specif a.

(* Specifications: *)
Lemma sqrt_neg a : a<0 -> sqrt a = 0.
Lemma log2_iter_spec : forall k p q r, 2^(S p) = q + S r -> r < 2^p -> let s := log2_iter k p q r in 2^s <= k + q < 2^(S s).
Lemma log2_spec n : 0<n -> 2^(log2 n) <= n < 2^(S (log2 n)).
Lemma log2_nonpos n : n<=0 -> log2 n = 0.
Lemma iter_swap_gen A B (f:A -> B) (g:A -> A) (h:B -> B) : (forall a, f (g a) = h (f a)) -> forall n a, f (iter n g a) = iter n h (f a).
Lemma iter_swap : forall n (A:Type) (f:A -> A) (x:A), iter n f (f x) = f (iter n f x).
Lemma iter_succ : forall n (A:Type) (f:A -> A) (x:A), iter (S n) f x = f (iter n f x).
Lemma iter_succ_r : forall n (A:Type) (f:A -> A) (x:A), iter (S n) f x = iter n f (f x).
Lemma iter_add : forall p q (A:Type) (f:A -> A) (x:A), iter (p+q) f x = iter p f (iter q f x).
Lemma iter_ind (A:Type) (f:A -> A) (a:A) (P:nat -> A -> Prop) : P 0 a -> (forall n a', P n a' -> P (S n) (f a')) -> forall n, P n (iter n f a).
Lemma iter_rect (A:Type) (f:A -> A) (a:A) (P:nat -> A -> Type) : P 0 a -> (forall n a', P n a' -> P (S n) (f a')) -> forall n, P n (iter n f a).
Lemma iter_invariant : forall (n:nat) (A:Type) (f:A -> A) (Inv:A -> Prop), (forall x:A, Inv x -> Inv (f x)) -> forall x:A, Inv x -> Inv (iter n f x).