Further lemmas about integer division, now that omega
is available. #
dvd #
Equations
- x✝¹.decidableDvd x✝ = decidable_of_decidable_of_iff ⋯
*div zero #
preliminaries for div equivalences #
div equivalences #
mod zero #
mod definitions #
@[deprecated Int.tmod_add_mul_tdiv (since := "2025-09-01")]
Equations
Instances For
@[deprecated Int.mul_tdiv_add_tmod (since := "2025-09-01")]
Equations
Instances For
@[deprecated Int.tmod_add_tdiv_mul (since := "2025-09-01")]
Equations
Instances For
@[deprecated Int.tdiv_mul_add_tmod (since := "2025-09-01")]
Equations
Instances For
@[deprecated Int.fmod_add_mul_fdiv (since := "2025-09-01")]
Equations
Instances For
@[deprecated Int.fmod_add_fdiv_mul (since := "2025-09-01")]
Equations
Instances For
@[deprecated Int.mul_fdiv_add_fmod (since := "2025-09-01")]
Equations
Instances For
@[deprecated Int.mul_fdiv_add_fmod (since := "2025-09-01")]
Equations
Instances For
mod equivalences #
/
ediv #
@[reducible, inline, deprecated Int.ediv_neg_of_neg_of_pos (since := "2025-03-04")]
Equations
Instances For
@[reducible, inline, deprecated Int.ediv_nonpos_of_nonneg_of_nonpos (since := "2025-03-04")]
Equations
Instances For
emod #
properties of /
and %
#
@[reducible, inline, deprecated Int.natAbs_ediv_le_natAbs (since := "2025-03-05")]
Instances For
/
and ordering #
tdiv #
There are no lemmas
add_mul_tdiv_right : c ≠ 0 → (a + b * c).tdiv c = a.tdiv c + b
add_mul_tdiv_left : b ≠ 0 → (a + b * c).tdiv b = a.tdiv b + c
- (similarly
mul_add_tdiv_right
,mul_add_tdiv_left
) add_tdiv_of_dvd_right : c ∣ b → (a + b).tdiv c = a.tdiv c + b.tdiv c
add_tdiv_of_dvd_left : c ∣ a → (a + b).tdiv c = a.tdiv c + b.tdiv c
because these statements are all incorrect, and require awkward conditional off-by-one corrections.
@[reducible, inline, deprecated Int.tdiv_nonpos_of_nonneg_of_nonpos (since := "2025-03-04")]
Equations
Instances For
tmod #
properties of tdiv
and tmod
tdiv
and ordering #
fdiv #
@[reducible, inline, deprecated Int.fdiv_nonpos_of_nonneg_of_nonpos (since := "2025-03-04")]
Equations
Instances For
One could prove the following, but as the statements are quite awkward, so far it doesn't seem worthwhile.
theorem natAbs_fdiv {a b : Int} (h : b ≠ 0) :
natAbs (a.fdiv b) = a.natAbs / b.natAbs + if a.sign = b.sign ∨ b ∣ a then 0 else 1 := ...
theorem sign_fdiv (a b : Int) :
sign (a.fdiv b) = if a.sign = b.sign ∧ natAbs a < natAbs b then 0 else sign a * sign b := ...
fmod #
@[reducible, inline, deprecated Int.fmod_nonneg_of_pos (since := "2025-03-04")]
Equations
Instances For
properties of fdiv
and fmod
#
fdiv
and ordering #
bmod #
@[reducible, inline, deprecated Int.bmod_one (since := "2025-04-10")]
Equations
Instances For
@[reducible, inline, deprecated Int.bmod_natAbs_add_one (since := "2025-04-04")]
Instances For
theorem
Int.ediv_lt_natAbs_self_of_lt_neg_one_of_lt_neg_one
{x y : Int}
(hx : x < -1)
(hy : y < -1)
:
When both x and y are negative we need stricter bounds on x and y
to establish the upper bound of x/y, i.e., x / y < x.natAbs.
In particular, consider the following counter examples:
· (-1) / (-2) = 1 and ¬ 1 < (-1).natAbs
(note that Int.neg_one_ediv already handles ediv
where the numerator is -1)
· (-2) / (-1) = 2 and ¬ 1 < (-2).natAbs
To exclude these cases, we enforce stricter bounds on the values of x and y.
Helper theorems for dvd
simproc