Skip to content

Commit

Permalink
feat(data/nat/basic): (∀ a : ℕ, m ∣ a ↔ n ∣ a) ↔ m = n (#7132)
Browse files Browse the repository at this point in the history
... and the dual statement
`(∀ a : ℕ, a ∣ m ↔ a ∣ n) ↔ m = n`

Zulip discussion:
https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/semilattice.2C.20dvd.2C.20associated

Co-authored-by: tb65536 <tb65536@users.noreply.github.com>
  • Loading branch information
adomani and tb65536 committed Apr 14, 2021
1 parent 4605b55 commit 5052ad9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/data/nat/basic.lean
Expand Up @@ -1350,6 +1350,18 @@ begin
rw [add_comm _ 1, left_distrib, mul_one], exact add_lt_add_right (mod_lt _ hn) _ }
end

/-- Two natural numbers are equal if and only if the have the same multiples. -/
lemma dvd_right_iff_eq {m n : ℕ} : (∀ a : ℕ, m ∣ a ↔ n ∣ a) ↔ m = n :=
⟨λ h, dvd_antisymm ((h _).mpr (dvd_refl _)) ((h _).mp (dvd_refl _)), λ h n, by rw h⟩

/-- Two natural numbers are equal if and only if the have the same divisors. -/
lemma dvd_left_iff_eq {m n : ℕ} : (∀ a : ℕ, a ∣ m ↔ a ∣ n) ↔ m = n :=
⟨λ h, dvd_antisymm ((h _).mp (dvd_refl _)) ((h _).mpr (dvd_refl _)), λ h n, by rw h⟩

/-- `dvd` is injective in the left argument -/
lemma dvd_left_injective : function.injective ((∣) : ℕ → ℕ → Prop) :=
λ m n h, dvd_right_iff_eq.mp $ λ a, iff_of_eq (congr_fun h a)

/-! ### `find` -/
section find

Expand Down

0 comments on commit 5052ad9

Please sign in to comment.