The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Data.Int.Lemmas

17 declarations. Mathlib docs · Source

Miscellaneous lemmas about the integers

This file contains lemmas about integers, which require further imports than Data.Int.Basic or Data.Int.Order.

succ and pred

natAbs

bitwise ops

This lemma is orphaned from Data.Int.Bitwise as it also requires material from Data.Int.Order.

theorem Int.le_natCast_sub E1 #

∀ (m n : ℕ), ↑m - ↑n ≤ ↑(m - n)

theorem Int.succ_natCast_pos E1 #

∀ (n : ℕ), 0 < ↑n + 1

theorem Int.natAbs_eq_iff_sq_eq E0 #

∀ {a b : ℤ}, a.natAbs = b.natAbs ↔ a ^ 2 = b ^ 2

theorem Int.natAbs_lt_iff_sq_lt E1 #

∀ {a b : ℤ}, a.natAbs < b.natAbs ↔ a ^ 2 < b ^ 2

theorem Int.natAbs_le_iff_sq_le E1 #

∀ {a b : ℤ}, a.natAbs ≤ b.natAbs ↔ a ^ 2 ≤ b ^ 2

theorem Int.natAbs_inj_of_nonneg_of_nonneg E1 #

∀ {a b : ℤ}, 0 ≤ a → 0 ≤ b → (a.natAbs = b.natAbs ↔ a = b)

theorem Int.natAbs_inj_of_nonpos_of_nonpos E1 #

∀ {a b : ℤ}, a ≤ 0 → b ≤ 0 → (a.natAbs = b.natAbs ↔ a = b)

theorem Int.natAbs_inj_of_nonneg_of_nonpos E1 #

∀ {a b : ℤ}, 0 ≤ a → b ≤ 0 → (a.natAbs = b.natAbs ↔ a = -b)

theorem Int.natAbs_inj_of_nonpos_of_nonneg E1 #

∀ {a b : ℤ}, a ≤ 0 → 0 ≤ b → (a.natAbs = b.natAbs ↔ -a = b)

theorem Int.natAbs_coe_sub_coe_le_of_le E1 #

∀ {a b n : ℕ}, a ≤ n → b ≤ n → (↑a - ↑b).natAbs ≤ n

A specialization of abs_sub_le_of_nonneg_of_le for working with the signed subtraction of natural numbers.

theorem Int.natAbs_coe_sub_coe_lt_of_lt E1 #

∀ {a b n : ℕ}, a < n → b < n → (↑a - ↑b).natAbs < n

A specialization of abs_sub_lt_of_nonneg_of_lt for working with the signed subtraction of natural numbers.

theorem Int.strictMonoOn_natAbs E1 #

StrictMonoOn Int.natAbs (Set.Ici 0)

theorem Int.strictAntiOn_natAbs E1 #

StrictAntiOn Int.natAbs (Set.Iic 0)

theorem Int.injOn_natAbs_Ici E1 #

Set.InjOn Int.natAbs (Set.Ici 0)

theorem Int.injOn_natAbs_Iic E1 #

Set.InjOn Int.natAbs (Set.Iic 0)

theorem Int.div2_bit E0 #

∀ (b : Bool) (n : ℤ), (Int.bit b n).div2 = n

theorem Int.ediv_emod_unique'' E1 #

∀ {a b r q : ℤ}, b ≠ 0 → (a / b = q ∧ a % b = r ↔ r + b * q = a ∧ 0 ≤ r ∧ r < |b|)

Like Int.ediv_emod_unique, but permitting negative b.