Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a53da16

Browse files
committed
feat(data/int/basic): nat_abs_dvd_iff_dvd (#10469)
Co-authored-by: Eric <37984851+ericrbg@users.noreply.github.com>
1 parent 50cc57b commit a53da16

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/data/int/basic.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,14 @@ by { rw [sq, sq], exact nat_abs_lt_iff_mul_self_lt }
343343
lemma nat_abs_le_iff_sq_le {a b : ℤ} : a.nat_abs ≤ b.nat_abs ↔ a ^ 2 ≤ b ^ 2 :=
344344
by { rw [sq, sq], exact nat_abs_le_iff_mul_self_le }
345345

346+
@[simp] lemma nat_abs_dvd_iff_dvd (a b : ℤ) : a.nat_abs ∣ b.nat_abs ↔ a ∣ b :=
347+
begin
348+
refine ⟨_, λ ⟨k, hk⟩, ⟨k.nat_abs, hk.symm ▸ nat_abs_mul a k⟩⟩,
349+
rintro ⟨k, hk⟩,
350+
rw [←nat_abs_of_nat k, ←nat_abs_mul, nat_abs_eq_nat_abs_iff, neg_mul_eq_mul_neg] at hk,
351+
cases hk; exact ⟨_, hk⟩
352+
end
353+
346354
/-! ### `/` -/
347355

348356
@[simp] theorem of_nat_div (m n : ℕ) : of_nat (m / n) = (of_nat m) / (of_nat n) := rfl

0 commit comments

Comments
 (0)