Documentation

Complexity.Foundations.Data.Rat.Basic

Properties of integer quotients Rat.divInt #

Elementary properties of Rat.divInt a b: the reduced numerator magnitude in terms of Nat.gcd a.natAbs b.natAbs, the numerator sign bit, and magnitude bounds on numerator and denominator.

Main results #

theorem Rat.natAbs_num_divInt_of_ne_zero (a b : ℤ) (hb : b ≠ 0) :

Reduced numerator magnitude of Rat.divInt a b for b ≠ 0.

theorem Rat.natAbs_num_divInt (a b : ℤ) :

Reduced numerator magnitude of Rat.divInt a b for arbitrary integers a, b.

theorem Rat.natAbs_num_divInt_le (a b : ℤ) (hb : b ≠ 0) :

Reduced numerator magnitude of Rat.divInt a b is bounded by |a|.

theorem Rat.den_divInt_le (a b : ℤ) (hb : b ≠ 0) :

Reduced denominator of Rat.divInt a b is bounded by |b|.

theorem Rat.decide_num_divInt_lt_zero_of_ne_zero (a b : ℤ) (hb : b ≠ 0) :
decide ((divInt a b).num < 0) = if a = 0 then false else decide (a < 0) ^^ decide (b < 0)

Sign bit of Rat.divInt a b for b ≠ 0.

theorem Rat.decide_num_divInt_lt_zero (a b : ℤ) :
decide ((divInt a b).num < 0) = if a = 0 then false else if b = 0 then false else decide (a < 0) ^^ decide (b < 0)

Sign bit of Rat.divInt a b for arbitrary integers a, b.