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 #
Variant of tmod_add_tdiv
with the multiplication written the other way around.
Variant of tdiv_add_tmod
with the multiplication written the other way around.
Variant of fmod_add_fdiv
with the multiplication written the other way around.
Variant of fdiv_add_fmod
with the multiplication written the other way around.
mod equivalences #
/
ediv #
@[reducible, inline, deprecated Int.ediv_neg_of_neg_of_pos (since := "2025-03-04")]
Equations
@[reducible, inline, deprecated Int.ediv_nonpos_of_nonneg_of_nonpos (since := "2025-03-04")]
Equations
emod #
properties of /
and %
#
@[reducible, inline, deprecated Int.natAbs_ediv_le_natAbs (since := "2025-03-05")]
/
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
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
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
properties of fdiv
and fmod
#
fdiv
and ordering #
bmod #
Helper theorems for dvd
simproc