(** Another well-used function for having the logarithm of a real number x to the base #&beta;# *)
Record ln_beta_prop x := {
ln_beta_val :> Z ;
_ : (x <> 0)%R -> (bpow (ln_beta_val - 1)%Z <= Rabs x < bpow ln_beta_val)%R
}.
Definition ln_beta :
forall x : R, ln_beta_prop x.

(* Specifications: *)
Theorem bpow_lt_bpow :
forall e1 e2,
(bpow (e1 - 1) < bpow e2)%R ->
(e1 <= e2)%Z.
Theorem bpow_unique :
forall x e1 e2,
(bpow (e1 - 1) <= x < bpow e1)%R ->
(bpow (e2 - 1) <= x < bpow e2)%R ->
e1 = e2.
Theorem ln_beta_unique :
forall (x : R) (e : Z),
(bpow (e - 1) <= Rabs x < bpow e)%R ->
ln_beta x = e :> Z.
Theorem ln_beta_opp :
forall x,
ln_beta (-x) = ln_beta x :> Z.
Theorem ln_beta_abs :
forall x,
ln_beta (Rabs x) = ln_beta x :> Z.
Theorem ln_beta_unique_pos :
forall (x : R) (e : Z),
(bpow (e - 1) <= x < bpow e)%R ->
ln_beta x = e :> Z.
Theorem ln_beta_le_abs :
forall x y,
(x <> 0)%R -> (Rabs x <= Rabs y)%R ->
(ln_beta x <= ln_beta y)%Z.
Theorem ln_beta_le :
forall x y,
(0 < x)%R -> (x <= y)%R ->
(ln_beta x <= ln_beta y)%Z.
Lemma ln_beta_lt_pos :
forall x y,
(0 < y)%R ->
(ln_beta x < ln_beta y)%Z -> (x < y)%R.
Theorem ln_beta_bpow :
forall e, (ln_beta (bpow e) = e + 1 :> Z)%Z.
Theorem ln_beta_mult_bpow :
forall x e, x <> 0%R ->
(ln_beta (x * bpow e) = ln_beta x + e :>Z)%Z.
Theorem ln_beta_le_bpow :
forall x e,
x <> 0%R ->
(Rabs x < bpow e)%R ->
(ln_beta x <= e)%Z.
Theorem ln_beta_gt_bpow :
forall x e,
(bpow e <= Rabs x)%R ->
(e < ln_beta x)%Z.
Theorem ln_beta_ge_bpow :
forall x e,
(bpow (e - 1) <= Rabs x)%R ->
(e <= ln_beta x)%Z.
Theorem bpow_ln_beta_gt :
forall x,
(Rabs x < bpow (ln_beta x))%R.
Theorem bpow_ln_beta_le :
forall x, (x <> 0)%R ->
(bpow (ln_beta x-1) <= Rabs x)%R.
Theorem ln_beta_le_Zpower :
forall m e,
m <> Z0 ->
(Zabs m < Zpower r e)%Z->
(ln_beta (Z2R m) <= e)%Z.
Theorem ln_beta_gt_Zpower :
forall m e,
m <> Z0 ->
(Zpower r e <= Zabs m)%Z ->
(e < ln_beta (Z2R m))%Z.
Lemma ln_beta_mult :
forall x y,
(x <> 0)%R -> (y <> 0)%R ->
(ln_beta x + ln_beta y - 1 <= ln_beta (x * y) <= ln_beta x + ln_beta y)%Z.
Lemma ln_beta_plus :
forall x y,
(0 < y)%R -> (y <= x)%R ->
(ln_beta x <= ln_beta (x + y) <= ln_beta x + 1)%Z.
Lemma ln_beta_minus :
forall x y,
(0 < y)%R -> (y < x)%R ->
(ln_beta (x - y) <= ln_beta x)%Z.
Lemma ln_beta_minus_lb :
forall x y,
(0 < x)%R -> (0 < y)%R ->
(ln_beta y <= ln_beta x - 2)%Z ->
(ln_beta x - 1 <= ln_beta (x - y))%Z.
Lemma ln_beta_div :
forall x y : R,
(0 < x)%R -> (0 < y)%R ->
(ln_beta x - ln_beta y <= ln_beta (x / y) <= ln_beta x - ln_beta y + 1)%Z.
Lemma ln_beta_sqrt :
forall x,
(0 < x)%R ->
(2 * ln_beta (sqrt x) - 1 <= ln_beta x <= 2 * ln_beta (sqrt x))%Z.