Correctness of power comparison from logarithm bounds #
The real logarithm is strictly increasing on positive values. Consequently a strict sign certificate for the logarithm difference determines the original comparison. When no such certificate is available, the exact denominator-clearing theorem supplies the result.
theorem
FloatLib.Numerics.RationalPower.contains_logDifference
(base exponent target : ℚ)
(degree : ℕ)
(hbase : 0 < base)
(htarget : 0 < target)
:
The executable interval contains the exact difference of real logarithms.
theorem
FloatLib.Numerics.RationalPower.rpow_lt_of_logDifference_hi_neg
(base exponent target : ℚ)
(degree : ℕ)
(hbase : 0 < base)
(htarget : 0 < target)
(hnegative : (logDifference base exponent target degree).hi < 0)
:
A strictly negative upper bound proves that the real power is below the target.
theorem
FloatLib.Numerics.RationalPower.lt_rpow_of_logDifference_lo_pos
(base exponent target : ℚ)
(degree : ℕ)
(hbase : 0 < base)
(htarget : 0 < target)
(hpositive : 0 < (logDifference base exponent target degree).lo)
:
A strictly positive lower bound proves that the target is below the real power.
theorem
FloatLib.Numerics.RationalPower.compareWithEnclosure_eq_real
(base exponent target : ℚ)
(degree : ℕ)
(hbase : 0 < base)
:
The bounds and exact fallback together always return the real-power ordering.