algebra.divisibility.units
⟷
Mathlib.Algebra.Divisibility.Units
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -148,7 +148,7 @@ theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x
#align is_unit_of_dvd_unit isUnit_of_dvd_unit
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a «expr ∣ » 1) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (a «expr ∣ » 1) -/
#print isUnit_of_dvd_one /-
theorem isUnit_of_dvd_one : ∀ (a) (_ : a ∣ 1), IsUnit (a : α)
| a, ⟨b, Eq⟩ => ⟨Units.mkOfMulEqOne a b Eq.symm, rfl⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov,
Neil Strickland, Aaron Anderson
-/
-import Mathbin.Algebra.Divisibility.Basic
-import Mathbin.Algebra.Group.Units
+import Algebra.Divisibility.Basic
+import Algebra.Group.Units
#align_import algebra.divisibility.units from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
@@ -148,7 +148,7 @@ theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x
#align is_unit_of_dvd_unit isUnit_of_dvd_unit
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a «expr ∣ » 1) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a «expr ∣ » 1) -/
#print isUnit_of_dvd_one /-
theorem isUnit_of_dvd_one : ∀ (a) (_ : a ∣ 1), IsUnit (a : α)
| a, ⟨b, Eq⟩ => ⟨Units.mkOfMulEqOne a b Eq.symm, rfl⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -38,7 +38,7 @@ theorem coe_dvd : ↑u ∣ a :=
associates of `b`. -/
theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b :=
Iff.intro (fun ⟨c, Eq⟩ => ⟨c * ↑u⁻¹, by rw [← mul_assoc, ← Eq, Units.mul_inv_cancel_right]⟩)
- fun ⟨c, Eq⟩ => Eq.symm ▸ (dvd_mul_right _ _).mul_right _
+ fun ⟨c, Eq⟩ => Eq.symm ▸ (dvd_mul_right _ _).hMul_right _
#align units.dvd_mul_right Units.dvd_mul_right
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -3,15 +3,12 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov,
Neil Strickland, Aaron Anderson
-
-! This file was ported from Lean 3 source module algebra.divisibility.units
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.Divisibility.Basic
import Mathbin.Algebra.Group.Units
+#align_import algebra.divisibility.units from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
+
/-!
# Lemmas about divisibility and units
@@ -151,7 +148,7 @@ theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x
#align is_unit_of_dvd_unit isUnit_of_dvd_unit
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a «expr ∣ » 1) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a «expr ∣ » 1) -/
#print isUnit_of_dvd_one /-
theorem isUnit_of_dvd_one : ∀ (a) (_ : a ∣ 1), IsUnit (a : α)
| a, ⟨b, Eq⟩ => ⟨Units.mkOfMulEqOne a b Eq.symm, rfl⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -36,18 +36,22 @@ theorem coe_dvd : ↑u ∣ a :=
#align units.coe_dvd Units.coe_dvd
-/
+#print Units.dvd_mul_right /-
/-- In a monoid, an element `a` divides an element `b` iff `a` divides all
associates of `b`. -/
theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b :=
Iff.intro (fun ⟨c, Eq⟩ => ⟨c * ↑u⁻¹, by rw [← mul_assoc, ← Eq, Units.mul_inv_cancel_right]⟩)
fun ⟨c, Eq⟩ => Eq.symm ▸ (dvd_mul_right _ _).mul_right _
#align units.dvd_mul_right Units.dvd_mul_right
+-/
+#print Units.mul_right_dvd /-
/-- In a monoid, an element `a` divides an element `b` iff all associates of `a` divide `b`. -/
theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b :=
Iff.intro (fun ⟨c, Eq⟩ => ⟨↑u * c, Eq.trans (mul_assoc _ _ _)⟩) fun h =>
dvd_trans (Dvd.intro (↑u⁻¹) (by rw [mul_assoc, u.mul_inv, mul_one])) h
#align units.mul_right_dvd Units.mul_right_dvd
+-/
end Monoid
@@ -55,15 +59,19 @@ section CommMonoid
variable [CommMonoid α] {a b : α} {u : αˣ}
+#print Units.dvd_mul_left /-
/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
associates of `b`. -/
theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rw [mul_comm]; apply dvd_mul_right
#align units.dvd_mul_left Units.dvd_mul_left
+-/
+#print Units.mul_left_dvd /-
/-- In a commutative monoid, an element `a` divides an element `b` iff all
left associates of `a` divide `b`.-/
theorem mul_left_dvd : ↑u * a ∣ b ↔ a ∣ b := by rw [mul_comm]; apply mul_right_dvd
#align units.mul_left_dvd Units.mul_left_dvd
+-/
end CommMonoid
@@ -75,8 +83,6 @@ section Monoid
variable [Monoid α] {a b u : α} (hu : IsUnit u)
-include hu
-
#print IsUnit.dvd /-
/-- Units of a monoid divide any element of the monoid. -/
@[simp]
@@ -84,14 +90,18 @@ theorem dvd : u ∣ a := by rcases hu with ⟨u, rfl⟩; apply Units.coe_dvd
#align is_unit.dvd IsUnit.dvd
-/
+#print IsUnit.dvd_mul_right /-
@[simp]
theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.dvd_mul_right
#align is_unit.dvd_mul_right IsUnit.dvd_mul_right
+-/
+#print IsUnit.mul_right_dvd /-
/-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`.-/
@[simp]
theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.mul_right_dvd
#align is_unit.mul_right_dvd IsUnit.mul_right_dvd
+-/
end Monoid
@@ -99,19 +109,21 @@ section CommMonoid
variable [CommMonoid α] (a b u : α) (hu : IsUnit u)
-include hu
-
+#print IsUnit.dvd_mul_left /-
/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
associates of `b`. -/
@[simp]
theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.dvd_mul_left
#align is_unit.dvd_mul_left IsUnit.dvd_mul_left
+-/
+#print IsUnit.mul_left_dvd /-
/-- In a commutative monoid, an element `a` divides an element `b` iff all
left associates of `a` divide `b`.-/
@[simp]
theorem mul_left_dvd : u * a ∣ b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.mul_left_dvd
#align is_unit.mul_left_dvd IsUnit.mul_left_dvd
+-/
end CommMonoid
@@ -121,9 +133,11 @@ section CommMonoid
variable [CommMonoid α]
+#print isUnit_iff_dvd_one /-
theorem isUnit_iff_dvd_one {x : α} : IsUnit x ↔ x ∣ 1 :=
⟨IsUnit.dvd, fun ⟨y, h⟩ => ⟨⟨x, y, h.symm, by rw [h, mul_comm]⟩, rfl⟩⟩
#align is_unit_iff_dvd_one isUnit_iff_dvd_one
+-/
#print isUnit_iff_forall_dvd /-
theorem isUnit_iff_forall_dvd {x : α} : IsUnit x ↔ ∀ y, x ∣ y :=
@@ -138,9 +152,11 @@ theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x
-/
/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a «expr ∣ » 1) -/
+#print isUnit_of_dvd_one /-
theorem isUnit_of_dvd_one : ∀ (a) (_ : a ∣ 1), IsUnit (a : α)
| a, ⟨b, Eq⟩ => ⟨Units.mkOfMulEqOne a b Eq.symm, rfl⟩
#align is_unit_of_dvd_one isUnit_of_dvd_one
+-/
#print not_isUnit_of_not_isUnit_dvd /-
theorem not_isUnit_of_not_isUnit_dvd {a b : α} (ha : ¬IsUnit a) (hb : a ∣ b) : ¬IsUnit b :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/31c24aa72e7b3e5ed97a8412470e904f82b81004
@@ -137,7 +137,7 @@ theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x
#align is_unit_of_dvd_unit isUnit_of_dvd_unit
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a «expr ∣ » 1) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a «expr ∣ » 1) -/
theorem isUnit_of_dvd_one : ∀ (a) (_ : a ∣ 1), IsUnit (a : α)
| a, ⟨b, Eq⟩ => ⟨Units.mkOfMulEqOne a b Eq.symm, rfl⟩
#align is_unit_of_dvd_one isUnit_of_dvd_one
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -36,12 +36,6 @@ theorem coe_dvd : ↑u ∣ a :=
#align units.coe_dvd Units.coe_dvd
-/
-/- warning: units.dvd_mul_right -> Units.dvd_mul_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α _inst_1}, Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) b ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Units.{u1} α _inst_1) α (HasLiftT.mk.{succ u1, succ u1} (Units.{u1} α _inst_1) α (CoeTCₓ.coe.{succ u1, succ u1} (Units.{u1} α _inst_1) α (coeBase.{succ u1, succ u1} (Units.{u1} α _inst_1) α (Units.hasCoe.{u1} α _inst_1)))) u))) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α _inst_1}, Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) b (Units.val.{u1} α _inst_1 u))) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b)
-Case conversion may be inaccurate. Consider using '#align units.dvd_mul_right Units.dvd_mul_rightₓ'. -/
/-- In a monoid, an element `a` divides an element `b` iff `a` divides all
associates of `b`. -/
theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b :=
@@ -49,12 +43,6 @@ theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b :=
fun ⟨c, Eq⟩ => Eq.symm ▸ (dvd_mul_right _ _).mul_right _
#align units.dvd_mul_right Units.dvd_mul_right
-/- warning: units.mul_right_dvd -> Units.mul_right_dvd is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α _inst_1}, Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) a ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Units.{u1} α _inst_1) α (HasLiftT.mk.{succ u1, succ u1} (Units.{u1} α _inst_1) α (CoeTCₓ.coe.{succ u1, succ u1} (Units.{u1} α _inst_1) α (coeBase.{succ u1, succ u1} (Units.{u1} α _inst_1) α (Units.hasCoe.{u1} α _inst_1)))) u)) b) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α _inst_1}, Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) a (Units.val.{u1} α _inst_1 u)) b) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b)
-Case conversion may be inaccurate. Consider using '#align units.mul_right_dvd Units.mul_right_dvdₓ'. -/
/-- In a monoid, an element `a` divides an element `b` iff all associates of `a` divide `b`. -/
theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b :=
Iff.intro (fun ⟨c, Eq⟩ => ⟨↑u * c, Eq.trans (mul_assoc _ _ _)⟩) fun h =>
@@ -67,23 +55,11 @@ section CommMonoid
variable [CommMonoid α] {a b : α} {u : αˣ}
-/- warning: units.dvd_mul_left -> Units.dvd_mul_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)}, Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (HasLiftT.mk.{succ u1, succ u1} (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (CoeTCₓ.coe.{succ u1, succ u1} (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (coeBase.{succ u1, succ u1} (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (Units.hasCoe.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) u) b)) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)}, Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (Units.val.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) u) b)) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b)
-Case conversion may be inaccurate. Consider using '#align units.dvd_mul_left Units.dvd_mul_leftₓ'. -/
/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
associates of `b`. -/
theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rw [mul_comm]; apply dvd_mul_right
#align units.dvd_mul_left Units.dvd_mul_left
-/- warning: units.mul_left_dvd -> Units.mul_left_dvd is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)}, Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (HasLiftT.mk.{succ u1, succ u1} (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (CoeTCₓ.coe.{succ u1, succ u1} (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (coeBase.{succ u1, succ u1} (Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) α (Units.hasCoe.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) u) a) b) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {a : α} {b : α} {u : Units.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)}, Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (Units.val.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) u) a) b) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b)
-Case conversion may be inaccurate. Consider using '#align units.mul_left_dvd Units.mul_left_dvdₓ'. -/
/-- In a commutative monoid, an element `a` divides an element `b` iff all
left associates of `a` divide `b`.-/
theorem mul_left_dvd : ↑u * a ∣ b ↔ a ∣ b := by rw [mul_comm]; apply mul_right_dvd
@@ -108,22 +84,10 @@ theorem dvd : u ∣ a := by rcases hu with ⟨u, rfl⟩; apply Units.coe_dvd
#align is_unit.dvd IsUnit.dvd
-/
-/- warning: is_unit.dvd_mul_right -> IsUnit.dvd_mul_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : α}, (IsUnit.{u1} α _inst_1 u) -> (Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) b u)) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : α}, (IsUnit.{u1} α _inst_1 u) -> (Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) b u)) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b))
-Case conversion may be inaccurate. Consider using '#align is_unit.dvd_mul_right IsUnit.dvd_mul_rightₓ'. -/
@[simp]
theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.dvd_mul_right
#align is_unit.dvd_mul_right IsUnit.dvd_mul_right
-/- warning: is_unit.mul_right_dvd -> IsUnit.mul_right_dvd is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : α}, (IsUnit.{u1} α _inst_1 u) -> (Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) a u) b) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : α}, (IsUnit.{u1} α _inst_1 u) -> (Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) a u) b) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b))
-Case conversion may be inaccurate. Consider using '#align is_unit.mul_right_dvd IsUnit.mul_right_dvdₓ'. -/
/-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`.-/
@[simp]
theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.mul_right_dvd
@@ -137,24 +101,12 @@ variable [CommMonoid α] (a b u : α) (hu : IsUnit u)
include hu
-/- warning: is_unit.dvd_mul_left -> IsUnit.dvd_mul_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (a : α) (b : α) (u : α), (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) u) -> (Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) u b)) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (a : α) (b : α) (u : α), (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) u) -> (Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) u b)) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b))
-Case conversion may be inaccurate. Consider using '#align is_unit.dvd_mul_left IsUnit.dvd_mul_leftₓ'. -/
/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
associates of `b`. -/
@[simp]
theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.dvd_mul_left
#align is_unit.dvd_mul_left IsUnit.dvd_mul_left
-/- warning: is_unit.mul_left_dvd -> IsUnit.mul_left_dvd is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (a : α) (b : α) (u : α), (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) u) -> (Iff (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) u a) b) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (a : α) (b : α) (u : α), (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) u) -> (Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) u a) b) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a b))
-Case conversion may be inaccurate. Consider using '#align is_unit.mul_left_dvd IsUnit.mul_left_dvdₓ'. -/
/-- In a commutative monoid, an element `a` divides an element `b` iff all
left associates of `a` divide `b`.-/
@[simp]
@@ -169,12 +121,6 @@ section CommMonoid
variable [CommMonoid α]
-/- warning: is_unit_iff_dvd_one -> isUnit_iff_dvd_one is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {x : α}, Iff (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) x) (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) x (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {x : α}, Iff (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) x) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) x (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align is_unit_iff_dvd_one isUnit_iff_dvd_oneₓ'. -/
theorem isUnit_iff_dvd_one {x : α} : IsUnit x ↔ x ∣ 1 :=
⟨IsUnit.dvd, fun ⟨y, h⟩ => ⟨⟨x, y, h.symm, by rw [h, mul_comm]⟩, rfl⟩⟩
#align is_unit_iff_dvd_one isUnit_iff_dvd_one
@@ -191,12 +137,6 @@ theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x
#align is_unit_of_dvd_unit isUnit_of_dvd_unit
-/
-/- warning: is_unit_of_dvd_one -> isUnit_of_dvd_one is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (a : α), (Dvd.Dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))))) -> (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {a : α}, (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) -> (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) a)
-Case conversion may be inaccurate. Consider using '#align is_unit_of_dvd_one isUnit_of_dvd_oneₓ'. -/
/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a «expr ∣ » 1) -/
theorem isUnit_of_dvd_one : ∀ (a) (_ : a ∣ 1), IsUnit (a : α)
| a, ⟨b, Eq⟩ => ⟨Units.mkOfMulEqOne a b Eq.symm, rfl⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -75,10 +75,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align units.dvd_mul_left Units.dvd_mul_leftₓ'. -/
/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
associates of `b`. -/
-theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b :=
- by
- rw [mul_comm]
- apply dvd_mul_right
+theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rw [mul_comm]; apply dvd_mul_right
#align units.dvd_mul_left Units.dvd_mul_left
/- warning: units.mul_left_dvd -> Units.mul_left_dvd is a dubious translation:
@@ -89,10 +86,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align units.mul_left_dvd Units.mul_left_dvdₓ'. -/
/-- In a commutative monoid, an element `a` divides an element `b` iff all
left associates of `a` divide `b`.-/
-theorem mul_left_dvd : ↑u * a ∣ b ↔ a ∣ b :=
- by
- rw [mul_comm]
- apply mul_right_dvd
+theorem mul_left_dvd : ↑u * a ∣ b ↔ a ∣ b := by rw [mul_comm]; apply mul_right_dvd
#align units.mul_left_dvd Units.mul_left_dvd
end CommMonoid
@@ -110,9 +104,7 @@ include hu
#print IsUnit.dvd /-
/-- Units of a monoid divide any element of the monoid. -/
@[simp]
-theorem dvd : u ∣ a := by
- rcases hu with ⟨u, rfl⟩
- apply Units.coe_dvd
+theorem dvd : u ∣ a := by rcases hu with ⟨u, rfl⟩; apply Units.coe_dvd
#align is_unit.dvd IsUnit.dvd
-/
@@ -123,10 +115,7 @@ but is expected to have type
forall {α : Type.{u1}} [_inst_1 : Monoid.{u1} α] {a : α} {b : α} {u : α}, (IsUnit.{u1} α _inst_1 u) -> (Iff (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_1))) b u)) (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α _inst_1)) a b))
Case conversion may be inaccurate. Consider using '#align is_unit.dvd_mul_right IsUnit.dvd_mul_rightₓ'. -/
@[simp]
-theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b :=
- by
- rcases hu with ⟨u, rfl⟩
- apply Units.dvd_mul_right
+theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.dvd_mul_right
#align is_unit.dvd_mul_right IsUnit.dvd_mul_right
/- warning: is_unit.mul_right_dvd -> IsUnit.mul_right_dvd is a dubious translation:
@@ -137,10 +126,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align is_unit.mul_right_dvd IsUnit.mul_right_dvdₓ'. -/
/-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`.-/
@[simp]
-theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b :=
- by
- rcases hu with ⟨u, rfl⟩
- apply Units.mul_right_dvd
+theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.mul_right_dvd
#align is_unit.mul_right_dvd IsUnit.mul_right_dvd
end Monoid
@@ -160,10 +146,7 @@ Case conversion may be inaccurate. Consider using '#align is_unit.dvd_mul_left I
/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
associates of `b`. -/
@[simp]
-theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b :=
- by
- rcases hu with ⟨u, rfl⟩
- apply Units.dvd_mul_left
+theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.dvd_mul_left
#align is_unit.dvd_mul_left IsUnit.dvd_mul_left
/- warning: is_unit.mul_left_dvd -> IsUnit.mul_left_dvd is a dubious translation:
@@ -175,10 +158,7 @@ Case conversion may be inaccurate. Consider using '#align is_unit.mul_left_dvd I
/-- In a commutative monoid, an element `a` divides an element `b` iff all
left associates of `a` divide `b`.-/
@[simp]
-theorem mul_left_dvd : u * a ∣ b ↔ a ∣ b :=
- by
- rcases hu with ⟨u, rfl⟩
- apply Units.mul_left_dvd
+theorem mul_left_dvd : u * a ∣ b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩; apply Units.mul_left_dvd
#align is_unit.mul_left_dvd IsUnit.mul_left_dvd
end CommMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -217,7 +217,7 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] {a : α}, (Dvd.dvd.{u1} α (semigroupDvd.{u1} α (Monoid.toSemigroup.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) a (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) -> (IsUnit.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1) a)
Case conversion may be inaccurate. Consider using '#align is_unit_of_dvd_one isUnit_of_dvd_oneₓ'. -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (a «expr ∣ » 1) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a «expr ∣ » 1) -/
theorem isUnit_of_dvd_one : ∀ (a) (_ : a ∣ 1), IsUnit (a : α)
| a, ⟨b, Eq⟩ => ⟨Units.mkOfMulEqOne a b Eq.symm, rfl⟩
#align is_unit_of_dvd_one isUnit_of_dvd_one
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.
@@ -60,7 +60,7 @@ theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by
#align units.dvd_mul_left Units.dvd_mul_left
/-- In a commutative monoid, an element `a` divides an element `b` iff all
- left associates of `a` divide `b`.-/
+ left associates of `a` divide `b`. -/
theorem mul_left_dvd : ↑u * a ∣ b ↔ a ∣ b := by
rw [mul_comm]
apply mul_right_dvd
@@ -89,7 +89,7 @@ theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b := by
apply Units.dvd_mul_right
#align is_unit.dvd_mul_right IsUnit.dvd_mul_right
-/-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`.-/
+/-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`. -/
@[simp]
theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := by
rcases hu with ⟨u, rfl⟩
@@ -113,7 +113,7 @@ theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by
#align is_unit.dvd_mul_left IsUnit.dvd_mul_left
/-- In a commutative monoid, an element `a` divides an element `b` iff all
- left associates of `a` divide `b`.-/
+ left associates of `a` divide `b`. -/
@[simp]
theorem mul_left_dvd : u * a ∣ b ↔ a ∣ b := by
rcases hu with ⟨u, rfl⟩
@@ -251,8 +251,9 @@ theorem IsRelPrime.mul_left (H1 : IsRelPrime x z) (H2 : IsRelPrime y z) : IsRelP
obtain ⟨a, b, ha, hb, rfl⟩ := exists_dvd_and_dvd_of_dvd_mul h
exact (H1 ha <| (dvd_mul_right a b).trans hz).mul (H2 hb <| (dvd_mul_left b a).trans hz)
-theorem IsRelPrime.mul_right (H1 : IsRelPrime x y) (H2 : IsRelPrime x z) : IsRelPrime x (y * z) :=
- by rw [isRelPrime_comm] at H1 H2 ⊢; exact H1.mul_left H2
+theorem IsRelPrime.mul_right (H1 : IsRelPrime x y) (H2 : IsRelPrime x z) :
+ IsRelPrime x (y * z) := by
+ rw [isRelPrime_comm] at H1 H2 ⊢; exact H1.mul_left H2
theorem IsRelPrime.mul_left_iff : IsRelPrime (x * y) z ↔ IsRelPrime x z ∧ IsRelPrime y z :=
⟨fun H ↦ ⟨H.of_mul_left_left, H.of_mul_left_right⟩, fun ⟨H1, H2⟩ ↦ H1.mul_left H2⟩
IsRelPrime
and DecompositionMonoid
and refactor (#10327)
Introduce typeclass DecompositionMonoid
, which says every element in the monoid is primal, i.e., whenever an element divides a product b * c
, it can be factored into a product such that the factors divides b
and c
respectively. A domain is called pre-Schreier if its multiplicative monoid is a decomposition monoid, and these are more general than GCD domains.
Show that any GCDMonoid
is a DecompositionMonoid
. In order for lemmas about DecompositionMonoid
s to automatically apply to UniqueFactorizationMonoid
s, we add instances from UniqueFactorizationMonoid α
to Nonempty (NormalizedGCDMonoid α)
to Nonempty (GCDMonoid α)
to DecompositionMonoid α
. (Zulip) See the bottom of message for an updated diagram of classes and instances.
Introduce binary predicate IsRelPrime
which says that the only common divisors of the two elements are units. Replace previous occurrences in mathlib by this predicate.
Duplicate all lemmas about IsCoprime
in Coprime/Basic (except three lemmas about smul) to IsRelPrime
. Due to import constraints, they are spread into three files Algebra/Divisibility/Units (including key lemmas assuming DecompositionMonoid), GroupWithZero/Divisibility, and Coprime/Basic.
Show IsCoprime
always imply IsRelPrime
and is equivalent to it in Bezout rings. To reduce duplication, the definition of Bezout rings and the GCDMonoid instance are moved from RingTheory/Bezout to RingTheory/PrincipalIdealDomain, and some results in PrincipalIdealDomain are generalized to Bezout rings.
Remove the recently added file Squarefree/UniqueFactorizationMonoid and place the results appropriately within Squarefree/Basic. All results are generalized to DecompositionMonoid or weaker except the last one.
With this PR, all the following instances (indicated by arrows) now work; this PR fills the central part.
EuclideanDomain (bundled)
↙ ↖
IsPrincipalIdealRing ← Field (bundled)
↓ ↓
NormalizationMonoid ← NormalizedGCDMonoid → GCDMonoid IsBezout ← ValuationRing ← DiscreteValuationRing
↓ ↓ ↘ ↙
Nonempty NormalizationMonoid ← Nonempty NormalizedGCDMonoid → Nonempty GCDMonoid → IsIntegrallyClosed
↑ ↓
WfDvdMonoid ← UniqueFactorizationMonoid → DecompositionMonoid
↑
IsPrincipalIdealRing
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com> Co-authored-by: Oliver Nash <github@olivernash.org>
@@ -10,7 +10,13 @@ import Mathlib.Algebra.Group.Units
#align_import algebra.divisibility.units from "leanprover-community/mathlib"@"e574b1a4e891376b0ef974b926da39e05da12a06"
/-!
-# Lemmas about divisibility and units
+# Divisibility and units
+
+## Main definition
+
+* `IsRelPrime x y`: that `x` and `y` are relatively prime, defined to mean that the only common
+divisors of `x` and `y` are the units.
+
-/
variable {α : Type*}
@@ -90,11 +96,13 @@ theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := by
apply Units.mul_right_dvd
#align is_unit.mul_right_dvd IsUnit.mul_right_dvd
+theorem isPrimal : IsPrimal u := fun _ _ _ ↦ ⟨u, 1, hu.dvd, one_dvd _, (mul_one u).symm⟩
+
end Monoid
section CommMonoid
-variable [CommMonoid α] (a b u : α) (hu : IsUnit u)
+variable [CommMonoid α] {a b u : α} (hu : IsUnit u)
/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
associates of `b`. -/
@@ -141,3 +149,118 @@ theorem not_isUnit_of_not_isUnit_dvd {a b : α} (ha : ¬IsUnit a) (hb : a ∣ b)
#align not_is_unit_of_not_is_unit_dvd not_isUnit_of_not_isUnit_dvd
end CommMonoid
+
+section RelPrime
+
+/-- `x` and `y` are relatively prime if every common divisor is a unit. -/
+def IsRelPrime [Monoid α] (x y : α) : Prop := ∀ ⦃d⦄, d ∣ x → d ∣ y → IsUnit d
+
+variable [CommMonoid α] {x y z : α}
+
+@[symm] theorem IsRelPrime.symm (H : IsRelPrime x y) : IsRelPrime y x := fun _ hx hy ↦ H hy hx
+
+theorem isRelPrime_comm : IsRelPrime x y ↔ IsRelPrime y x :=
+ ⟨IsRelPrime.symm, IsRelPrime.symm⟩
+
+theorem isRelPrime_self : IsRelPrime x x ↔ IsUnit x :=
+ ⟨(· dvd_rfl dvd_rfl), fun hu _ _ dvd ↦ isUnit_of_dvd_unit dvd hu⟩
+
+theorem IsUnit.isRelPrime_left (h : IsUnit x) : IsRelPrime x y :=
+ fun _ hx _ ↦ isUnit_of_dvd_unit hx h
+theorem IsUnit.isRelPrime_right (h : IsUnit y) : IsRelPrime x y := h.isRelPrime_left.symm
+theorem isRelPrime_one_left : IsRelPrime 1 x := isUnit_one.isRelPrime_left
+theorem isRelPrime_one_right : IsRelPrime x 1 := isUnit_one.isRelPrime_right
+
+theorem IsRelPrime.of_mul_left_left (H : IsRelPrime (x * y) z) : IsRelPrime x z :=
+ fun _ hx ↦ H (dvd_mul_of_dvd_left hx _)
+
+theorem IsRelPrime.of_mul_left_right (H : IsRelPrime (x * y) z) : IsRelPrime y z :=
+ (mul_comm x y ▸ H).of_mul_left_left
+
+theorem IsRelPrime.of_mul_right_left (H : IsRelPrime x (y * z)) : IsRelPrime x y := by
+ rw [isRelPrime_comm] at H ⊢
+ exact H.of_mul_left_left
+
+theorem IsRelPrime.of_mul_right_right (H : IsRelPrime x (y * z)) : IsRelPrime x z :=
+ (mul_comm y z ▸ H).of_mul_right_left
+
+theorem IsRelPrime.of_dvd_left (h : IsRelPrime y z) (dvd : x ∣ y) : IsRelPrime x z := by
+ obtain ⟨d, rfl⟩ := dvd; exact IsRelPrime.of_mul_left_left h
+
+theorem IsRelPrime.of_dvd_right (h : IsRelPrime z y) (dvd : x ∣ y) : IsRelPrime z x :=
+ (h.symm.of_dvd_left dvd).symm
+
+theorem IsRelPrime.isUnit_of_dvd (H : IsRelPrime x y) (d : x ∣ y) : IsUnit x := H dvd_rfl d
+
+section IsUnit
+
+variable (hu : IsUnit x)
+
+theorem isRelPrime_mul_unit_left_left : IsRelPrime (x * y) z ↔ IsRelPrime y z :=
+ ⟨IsRelPrime.of_mul_left_right, fun H _ h ↦ H (hu.dvd_mul_left.mp h)⟩
+
+theorem isRelPrime_mul_unit_left_right : IsRelPrime y (x * z) ↔ IsRelPrime y z := by
+ rw [isRelPrime_comm, isRelPrime_mul_unit_left_left hu, isRelPrime_comm]
+
+theorem isRelPrime_mul_unit_left : IsRelPrime (x * y) (x * z) ↔ IsRelPrime y z := by
+ rw [isRelPrime_mul_unit_left_left hu, isRelPrime_mul_unit_left_right hu]
+
+theorem isRelPrime_mul_unit_right_left : IsRelPrime (y * x) z ↔ IsRelPrime y z := by
+ rw [mul_comm, isRelPrime_mul_unit_left_left hu]
+
+theorem isRelPrime_mul_unit_right_right : IsRelPrime y (z * x) ↔ IsRelPrime y z := by
+ rw [mul_comm, isRelPrime_mul_unit_left_right hu]
+
+theorem isRelPrime_mul_unit_right : IsRelPrime (y * x) (z * x) ↔ IsRelPrime y z := by
+ rw [isRelPrime_mul_unit_right_left hu, isRelPrime_mul_unit_right_right hu]
+
+end IsUnit
+
+theorem IsRelPrime.dvd_of_dvd_mul_right_of_isPrimal (H1 : IsRelPrime x z) (H2 : x ∣ y * z)
+ (h : IsPrimal x) : x ∣ y := by
+ obtain ⟨a, b, ha, hb, rfl⟩ := h H2
+ exact (H1.of_mul_left_right.isUnit_of_dvd hb).mul_right_dvd.mpr ha
+
+theorem IsRelPrime.dvd_of_dvd_mul_left_of_isPrimal (H1 : IsRelPrime x y) (H2 : x ∣ y * z)
+ (h : IsPrimal x) : x ∣ z :=
+ H1.dvd_of_dvd_mul_right_of_isPrimal (mul_comm y z ▸ H2) h
+
+theorem IsRelPrime.mul_dvd_of_right_isPrimal (H : IsRelPrime x y) (H1 : x ∣ z) (H2 : y ∣ z)
+ (hy : IsPrimal y) : x * y ∣ z := by
+ obtain ⟨w, rfl⟩ := H1
+ exact mul_dvd_mul_left x (H.symm.dvd_of_dvd_mul_left_of_isPrimal H2 hy)
+
+theorem IsRelPrime.mul_dvd_of_left_isPrimal (H : IsRelPrime x y) (H1 : x ∣ z) (H2 : y ∣ z)
+ (hx : IsPrimal x) : x * y ∣ z := by
+ rw [mul_comm]; exact H.symm.mul_dvd_of_right_isPrimal H2 H1 hx
+
+/-! `IsRelPrime` enjoys desirable properties in a decomposition monoid.
+See Lemma 6.3 in *On properties of square-free elements in commutative cancellative monoids*,
+https://doi.org/10.1007/s00233-019-10022-3. -/
+
+variable [DecompositionMonoid α]
+
+theorem IsRelPrime.dvd_of_dvd_mul_right (H1 : IsRelPrime x z) (H2 : x ∣ y * z) : x ∣ y :=
+ H1.dvd_of_dvd_mul_right_of_isPrimal H2 (DecompositionMonoid.primal x)
+
+theorem IsRelPrime.dvd_of_dvd_mul_left (H1 : IsRelPrime x y) (H2 : x ∣ y * z) : x ∣ z :=
+ H1.dvd_of_dvd_mul_right (mul_comm y z ▸ H2)
+
+theorem IsRelPrime.mul_left (H1 : IsRelPrime x z) (H2 : IsRelPrime y z) : IsRelPrime (x * y) z :=
+ fun _ h hz ↦ by
+ obtain ⟨a, b, ha, hb, rfl⟩ := exists_dvd_and_dvd_of_dvd_mul h
+ exact (H1 ha <| (dvd_mul_right a b).trans hz).mul (H2 hb <| (dvd_mul_left b a).trans hz)
+
+theorem IsRelPrime.mul_right (H1 : IsRelPrime x y) (H2 : IsRelPrime x z) : IsRelPrime x (y * z) :=
+ by rw [isRelPrime_comm] at H1 H2 ⊢; exact H1.mul_left H2
+
+theorem IsRelPrime.mul_left_iff : IsRelPrime (x * y) z ↔ IsRelPrime x z ∧ IsRelPrime y z :=
+ ⟨fun H ↦ ⟨H.of_mul_left_left, H.of_mul_left_right⟩, fun ⟨H1, H2⟩ ↦ H1.mul_left H2⟩
+
+theorem IsRelPrime.mul_right_iff : IsRelPrime x (y * z) ↔ IsRelPrime x y ∧ IsRelPrime x z :=
+ ⟨fun H ↦ ⟨H.of_mul_right_left, H.of_mul_right_right⟩, fun ⟨H1, H2⟩ ↦ H1.mul_right H2⟩
+
+theorem IsRelPrime.mul_dvd (H : IsRelPrime x y) (H1 : x ∣ z) (H2 : y ∣ z) : x * y ∣ z :=
+ H.mul_dvd_of_left_isPrimal H1 H2 (DecompositionMonoid.primal x)
+
+end RelPrime
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -13,7 +13,7 @@ import Mathlib.Algebra.Group.Units
# Lemmas about divisibility and units
-/
-variable {α : Type _}
+variable {α : Type*}
namespace Units
Briefly during the port we were adding "Ported by" headers, but only ~60 / 3000 files ended up with such a header.
I propose deleting them.
We could consider adding these uniformly via a script, as part of the great history rewrite...?
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -3,7 +3,6 @@ Copyright (c) 2014 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov,
Neil Strickland, Aaron Anderson
-Ported by: Joël Riou
-/
import Mathlib.Algebra.Divisibility.Basic
import Mathlib.Algebra.Group.Units
@@ -4,15 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov,
Neil Strickland, Aaron Anderson
Ported by: Joël Riou
-
-! This file was ported from Lean 3 source module algebra.divisibility.units
-! leanprover-community/mathlib commit e574b1a4e891376b0ef974b926da39e05da12a06
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.Divisibility.Basic
import Mathlib.Algebra.Group.Units
+#align_import algebra.divisibility.units from "leanprover-community/mathlib"@"e574b1a4e891376b0ef974b926da39e05da12a06"
+
/-!
# Lemmas about divisibility and units
-/
This PR is the result of a slight variant on the following "algorithm"
_
and make all uppercase letters into lowercase_
and make all uppercase letters into lowercase(original_lean3_name, OriginalLean4Name)
#align
statement just before the next empty line#align
statement to have been inserted too early)@@ -29,12 +29,14 @@ variable [Monoid α] {a b : α} {u : αˣ}
divide any element of the monoid. -/
theorem coe_dvd : ↑u ∣ a :=
⟨↑u⁻¹ * a, by simp⟩
+#align units.coe_dvd Units.coe_dvd
/-- In a monoid, an element `a` divides an element `b` iff `a` divides all
associates of `b`. -/
theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b :=
Iff.intro (fun ⟨c, Eq⟩ ↦ ⟨c * ↑u⁻¹, by rw [← mul_assoc, ← Eq, Units.mul_inv_cancel_right]⟩)
fun ⟨c, Eq⟩ ↦ Eq.symm ▸ (_root_.dvd_mul_right _ _).mul_right _
+#align units.dvd_mul_right Units.dvd_mul_right
/-- In a monoid, an element `a` divides an element `b` iff all associates of `a` divide `b`. -/
theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b :=
@@ -77,17 +79,20 @@ variable [Monoid α] {a b u : α} (hu : IsUnit u)
theorem dvd : u ∣ a := by
rcases hu with ⟨u, rfl⟩
apply Units.coe_dvd
+#align is_unit.dvd IsUnit.dvd
@[simp]
theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b := by
rcases hu with ⟨u, rfl⟩
apply Units.dvd_mul_right
+#align is_unit.dvd_mul_right IsUnit.dvd_mul_right
/-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`.-/
@[simp]
theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := by
rcases hu with ⟨u, rfl⟩
apply Units.mul_right_dvd
+#align is_unit.mul_right_dvd IsUnit.mul_right_dvd
end Monoid
@@ -101,6 +106,7 @@ variable [CommMonoid α] (a b u : α) (hu : IsUnit u)
theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by
rcases hu with ⟨u, rfl⟩
apply Units.dvd_mul_left
+#align is_unit.dvd_mul_left IsUnit.dvd_mul_left
/-- In a commutative monoid, an element `a` divides an element `b` iff all
left associates of `a` divide `b`.-/
@@ -108,6 +114,7 @@ theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by
theorem mul_left_dvd : u * a ∣ b ↔ a ∣ b := by
rcases hu with ⟨u, rfl⟩
apply Units.mul_left_dvd
+#align is_unit.mul_left_dvd IsUnit.mul_left_dvd
end CommMonoid
The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md
@@ -4,6 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov,
Neil Strickland, Aaron Anderson
Ported by: Joël Riou
+
+! This file was ported from Lean 3 source module algebra.divisibility.units
+! leanprover-community/mathlib commit e574b1a4e891376b0ef974b926da39e05da12a06
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Algebra.Divisibility.Basic
import Mathlib.Algebra.Group.Units
All dependencies are ported!