algebra.squarefree
⟷
Mathlib.Algebra.Squarefree.Basic
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)
@@ -255,3 +255,14 @@ begin
end
end unique_factorization_monoid
+
+namespace int
+
+@[simp] lemma squarefree_nat_abs {n : ℤ} : squarefree n.nat_abs ↔ squarefree n :=
+by simp_rw [squarefree, nat_abs_surjective.forall, ←nat_abs_mul, nat_abs_dvd_iff_dvd,
+ is_unit_iff_nat_abs_eq, nat.is_unit_iff]
+
+@[simp] lemma squarefree_coe_nat {n : ℕ} : squarefree (n : ℤ) ↔ squarefree n :=
+by rw [←squarefree_nat_abs, nat_abs_of_nat]
+
+end int
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -322,11 +322,11 @@ theorem squarefree_natAbs {n : ℤ} : Squarefree n.natAbs ↔ Squarefree n := by
#align int.squarefree_nat_abs Int.squarefree_natAbs
-/
-#print Int.squarefree_coe_nat /-
+#print Int.squarefree_natCast /-
@[simp]
-theorem squarefree_coe_nat {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
+theorem squarefree_natCast {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
rw [← squarefree_nat_abs, nat_abs_of_nat]
-#align int.squarefree_coe_nat Int.squarefree_coe_nat
+#align int.squarefree_coe_nat Int.squarefree_natCast
-/
end Int
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -78,7 +78,7 @@ theorem Squarefree.ne_zero [MonoidWithZero R] [Nontrivial R] {m : R} (hm : Squar
theorem Irreducible.squarefree [CommMonoid R] {x : R} (h : Irreducible x) : Squarefree x :=
by
rintro y ⟨z, hz⟩
- rw [mul_assoc] at hz
+ rw [mul_assoc] at hz
rcases h.is_unit_or_is_unit hz with (hu | hu)
· exact hu
· apply isUnit_of_mul_isUnit_left hu
@@ -231,8 +231,8 @@ theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefr
by
rintro z ⟨w, rfl⟩
specialize h 2 (z * w) ⟨w, by simp_rw [pow_two, mul_left_comm, ← mul_assoc]⟩
- rwa [← one_mul (z * w), mul_assoc, mul_dvd_mul_iff_right, ← isUnit_iff_dvd_one] at h
- rw [mul_assoc, mul_ne_zero_iff] at h0 ; exact h0.2
+ rwa [← one_mul (z * w), mul_assoc, mul_dvd_mul_iff_right, ← isUnit_iff_dvd_one] at h
+ rw [mul_assoc, mul_ne_zero_iff] at h0; exact h0.2
#align is_radical.squarefree IsRadical.squarefree
-/
@@ -248,7 +248,7 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
replace hy := ((dvd_gcd_iff x x _).2 ⟨dvd_rfl, hy⟩).trans gcd_pow_right_dvd_pow_gcd
obtain ⟨z, hz⟩ := gcd_dvd_left x y
nth_rw 1 [hz] at hy ⊢
- rw [pow_two, mul_dvd_mul_iff_left h] at hy
+ rw [pow_two, mul_dvd_mul_iff_left h] at hy
obtain ⟨w, hw⟩ := hy
exact (hx z ⟨w, by rwa [mul_right_comm, ← hw]⟩).mul_right_dvd.2 dvd_rfl)
#align squarefree.is_radical Squarefree.isRadical
@@ -286,7 +286,7 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
· have ha := irreducible_of_normalized_factor _ hmem
rcases h a with (h | h)
· rw [← normalize_normalized_factor _ hmem]
- rw [multiplicity_eq_count_normalized_factors ha x0] at h
+ rw [multiplicity_eq_count_normalized_factors ha x0] at h
assumption_mod_cast
· have := ha.1; contradiction
· simp [Multiset.count_eq_zero_of_not_mem hmem]
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -301,13 +301,13 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
#align unique_factorization_monoid.squarefree_iff_nodup_normalized_factors UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors
-/
-#print UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree /-
-theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
- x ∣ y ^ n ↔ x ∣ y := by
+#print Squarefree.dvd_pow_iff_dvd /-
+theorem dvd_pow_iff_dvd {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) : x ∣ y ^ n ↔ x ∣ y :=
+ by
classical
haveI := UniqueFactorizationMonoid.toGCDMonoid R
exact ⟨hsq.is_radical n y, fun h => h.pow h0⟩
-#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
+#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree Squarefree.dvd_pow_iff_dvd
-/
end UniqueFactorizationMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -153,6 +153,21 @@ variable [CancelCommMonoidWithZero R] [WfDvdMonoid R]
#print multiplicity.finite_prime_left /-
theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b := by
classical
+ revert hb
+ refine'
+ WfDvdMonoid.induction_on_irreducible b (by contradiction) (fun u hu hu' => _)
+ fun b p hb hp ih hpb => _
+ · rw [multiplicity.finite_iff_dom, multiplicity.isUnit_right ha.not_unit hu]
+ exact PartENat.dom_natCast 0
+ · refine'
+ multiplicity.finite_mul ha
+ (multiplicity.finite_iff_dom.mpr
+ (PartENat.dom_of_le_natCast (show multiplicity a p ≤ ↑1 from _)))
+ (ih hb)
+ norm_cast
+ exact
+ ((multiplicity.squarefree_iff_multiplicity_le_one p).mp hp.squarefree a).resolve_right
+ ha.not_unit
#align multiplicity.finite_prime_left multiplicity.finite_prime_left
-/
@@ -262,7 +277,7 @@ variable [CancelCommMonoidWithZero R] [UniqueFactorizationMonoid R]
theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [DecidableEq R] {x : R}
(x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) :=
by
- have drel : DecidableRel (Dvd.Dvd : R → R → Prop) := by classical
+ have drel : DecidableRel (Dvd.Dvd : R → R → Prop) := by classical infer_instance
haveI := drel
rw [multiplicity.squarefree_iff_multiplicity_le_one, Multiset.nodup_iff_count_le_one]
haveI := nontrivial_of_ne x 0 x0
@@ -288,7 +303,10 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
#print UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree /-
theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
- x ∣ y ^ n ↔ x ∣ y := by classical
+ x ∣ y ^ n ↔ x ∣ y := by
+ classical
+ haveI := UniqueFactorizationMonoid.toGCDMonoid R
+ exact ⟨hsq.is_radical n y, fun h => h.pow h0⟩
#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -153,21 +153,6 @@ variable [CancelCommMonoidWithZero R] [WfDvdMonoid R]
#print multiplicity.finite_prime_left /-
theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b := by
classical
- revert hb
- refine'
- WfDvdMonoid.induction_on_irreducible b (by contradiction) (fun u hu hu' => _)
- fun b p hb hp ih hpb => _
- · rw [multiplicity.finite_iff_dom, multiplicity.isUnit_right ha.not_unit hu]
- exact PartENat.dom_natCast 0
- · refine'
- multiplicity.finite_mul ha
- (multiplicity.finite_iff_dom.mpr
- (PartENat.dom_of_le_natCast (show multiplicity a p ≤ ↑1 from _)))
- (ih hb)
- norm_cast
- exact
- ((multiplicity.squarefree_iff_multiplicity_le_one p).mp hp.squarefree a).resolve_right
- ha.not_unit
#align multiplicity.finite_prime_left multiplicity.finite_prime_left
-/
@@ -277,7 +262,7 @@ variable [CancelCommMonoidWithZero R] [UniqueFactorizationMonoid R]
theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [DecidableEq R] {x : R}
(x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) :=
by
- have drel : DecidableRel (Dvd.Dvd : R → R → Prop) := by classical infer_instance
+ have drel : DecidableRel (Dvd.Dvd : R → R → Prop) := by classical
haveI := drel
rw [multiplicity.squarefree_iff_multiplicity_le_one, Multiset.nodup_iff_count_le_one]
haveI := nontrivial_of_ne x 0 x0
@@ -303,10 +288,7 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
#print UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree /-
theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
- x ∣ y ^ n ↔ x ∣ y := by
- classical
- haveI := UniqueFactorizationMonoid.toGCDMonoid R
- exact ⟨hsq.is_radical n y, fun h => h.pow h0⟩
+ x ∣ y ^ n ↔ x ∣ y := by classical
#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -139,7 +139,7 @@ theorem squarefree_iff_multiplicity_le_one (r : R) :
Squarefree r ↔ ∀ x : R, multiplicity x r ≤ 1 ∨ IsUnit x :=
by
refine' forall_congr' fun a => _
- rw [← sq, pow_dvd_iff_le_multiplicity, or_iff_not_imp_left, not_le, imp_congr _ Iff.rfl]
+ rw [← sq, pow_dvd_iff_le_multiplicity, Classical.or_iff_not_imp_left, not_le, imp_congr _ Iff.rfl]
simpa using PartENat.add_one_le_iff_lt (PartENat.natCast_ne_top 1)
#align multiplicity.squarefree_iff_multiplicity_le_one multiplicity.squarefree_iff_multiplicity_le_one
-/
@@ -290,7 +290,7 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
assumption_mod_cast
· have := ha.1; contradiction
· simp [Multiset.count_eq_zero_of_not_mem hmem]
- · rw [or_iff_not_imp_right]; intro hu
+ · rw [Classical.or_iff_not_imp_right]; intro hu
by_cases h0 : a = 0
· simp [h0, x0]
rcases WfDvdMonoid.exists_irreducible_factor hu h0 with ⟨b, hib, hdvd⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/b1abe23ae96fef89ad30d9f4362c307f72a55010
@@ -60,7 +60,7 @@ theorem squarefree_one [CommMonoid R] : Squarefree (1 : R) :=
@[simp]
theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0 : R) :=
by
- erw [not_forall]
+ erw [Classical.not_forall]
exact ⟨0, by simp⟩
#align not_squarefree_zero not_squarefree_zero
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,7 +3,7 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
-/
-import Mathbin.RingTheory.UniqueFactorizationDomain
+import RingTheory.UniqueFactorizationDomain
#align_import algebra.squarefree from "leanprover-community/mathlib"@"00d163e35035c3577c1c79fa53b68de17781ffc1"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,14 +2,11 @@
Copyright (c) 2020 Aaron Anderson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
-
-! This file was ported from Lean 3 source module algebra.squarefree
-! leanprover-community/mathlib commit 00d163e35035c3577c1c79fa53b68de17781ffc1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.RingTheory.UniqueFactorizationDomain
+#align_import algebra.squarefree from "leanprover-community/mathlib"@"00d163e35035c3577c1c79fa53b68de17781ffc1"
+
/-!
# Squarefree elements of monoids
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -52,23 +52,29 @@ theorem IsUnit.squarefree [CommMonoid R] {x : R} (h : IsUnit x) : Squarefree x :
#align is_unit.squarefree IsUnit.squarefree
-/
+#print squarefree_one /-
@[simp]
theorem squarefree_one [CommMonoid R] : Squarefree (1 : R) :=
isUnit_one.Squarefree
#align squarefree_one squarefree_one
+-/
+#print not_squarefree_zero /-
@[simp]
theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0 : R) :=
by
erw [not_forall]
exact ⟨0, by simp⟩
#align not_squarefree_zero not_squarefree_zero
+-/
+#print Squarefree.ne_zero /-
theorem Squarefree.ne_zero [MonoidWithZero R] [Nontrivial R] {m : R} (hm : Squarefree (m : R)) :
m ≠ 0 := by
rintro rfl
exact not_squarefree_zero hm
#align squarefree.ne_zero Squarefree.ne_zero
+-/
#print Irreducible.squarefree /-
@[simp]
@@ -89,13 +95,17 @@ theorem Prime.squarefree [CancelCommMonoidWithZero R] {x : R} (h : Prime x) : Sq
#align prime.squarefree Prime.squarefree
-/
+#print Squarefree.of_mul_left /-
theorem Squarefree.of_mul_left [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) : Squarefree m :=
fun p hp => hmn p (dvd_mul_of_dvd_left hp n)
#align squarefree.of_mul_left Squarefree.of_mul_left
+-/
+#print Squarefree.of_mul_right /-
theorem Squarefree.of_mul_right [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) :
Squarefree n := fun p hp => hmn p (dvd_mul_of_dvd_right hp m)
#align squarefree.of_mul_right Squarefree.of_mul_right
+-/
#print Squarefree.squarefree_of_dvd /-
theorem Squarefree.squarefree_of_dvd [CommMonoid R] {x y : R} (hdvd : x ∣ y) (hsq : Squarefree y) :
@@ -143,6 +153,7 @@ section CancelCommMonoidWithZero
variable [CancelCommMonoidWithZero R] [WfDvdMonoid R]
+#print multiplicity.finite_prime_left /-
theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b := by
classical
revert hb
@@ -161,6 +172,7 @@ theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity
((multiplicity.squarefree_iff_multiplicity_le_one p).mp hp.squarefree a).resolve_right
ha.not_unit
#align multiplicity.finite_prime_left multiplicity.finite_prime_left
+-/
end CancelCommMonoidWithZero
@@ -170,6 +182,7 @@ section Irreducible
variable [CommMonoidWithZero R] [WfDvdMonoid R]
+#print irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree /-
theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r : R) :
(∀ x : R, Irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ x : R, ¬Irreducible x) ∨ Squarefree r :=
by
@@ -192,18 +205,23 @@ theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r
obtain ⟨j, hj₁, hj₂⟩ := WfDvdMonoid.exists_irreducible_factor i this
exact h _ hj₁ ((mul_dvd_mul hj₂ hj₂).trans hx)
#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree
+-/
+#print squarefree_iff_irreducible_sq_not_dvd_of_ne_zero /-
theorem squarefree_iff_irreducible_sq_not_dvd_of_ne_zero {r : R} (hr : r ≠ 0) :
Squarefree r ↔ ∀ x : R, Irreducible x → ¬x * x ∣ r := by
simpa [hr] using (irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree r).symm
#align squarefree_iff_irreducible_sq_not_dvd_of_ne_zero squarefree_iff_irreducible_sq_not_dvd_of_ne_zero
+-/
+#print squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible /-
theorem squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible {r : R}
(hr : ∃ x : R, Irreducible x) : Squarefree r ↔ ∀ x : R, Irreducible x → ¬x * x ∣ r :=
by
rw [irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree, ← not_exists]
simp only [hr, not_true, false_or_iff, and_false_iff]
#align squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible
+-/
end Irreducible
@@ -211,6 +229,7 @@ section IsRadical
variable [CancelCommMonoidWithZero R]
+#print IsRadical.squarefree /-
theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefree x :=
by
rintro z ⟨w, rfl⟩
@@ -218,6 +237,7 @@ theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefr
rwa [← one_mul (z * w), mul_assoc, mul_dvd_mul_iff_right, ← isUnit_iff_dvd_one] at h
rw [mul_assoc, mul_ne_zero_iff] at h0 ; exact h0.2
#align is_radical.squarefree IsRadical.squarefree
+-/
variable [GCDMonoid R]
@@ -237,14 +257,18 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
#align squarefree.is_radical Squarefree.isRadical
-/
+#print isRadical_iff_squarefree_or_zero /-
theorem isRadical_iff_squarefree_or_zero {x : R} : IsRadical x ↔ Squarefree x ∨ x = 0 :=
⟨fun hx => (em <| x = 0).elim Or.inr fun h => Or.inl <| hx.Squarefree h,
Or.ndrec Squarefree.isRadical <| by rintro rfl; rw [zero_isRadical_iff]; infer_instance⟩
#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zero
+-/
+#print isRadical_iff_squarefree_of_ne_zero /-
theorem isRadical_iff_squarefree_of_ne_zero {x : R} (h : x ≠ 0) : IsRadical x ↔ Squarefree x :=
⟨IsRadical.squarefree h, Squarefree.isRadical⟩
#align is_radical_iff_squarefree_of_ne_zero isRadical_iff_squarefree_of_ne_zero
+-/
end IsRadical
@@ -252,6 +276,7 @@ namespace UniqueFactorizationMonoid
variable [CancelCommMonoidWithZero R] [UniqueFactorizationMonoid R]
+#print UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors /-
theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [DecidableEq R] {x : R}
(x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) :=
by
@@ -277,6 +302,7 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
specialize h (normalize b)
assumption_mod_cast
#align unique_factorization_monoid.squarefree_iff_nodup_normalized_factors UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors
+-/
#print UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree /-
theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
@@ -291,16 +317,20 @@ end UniqueFactorizationMonoid
namespace Int
+#print Int.squarefree_natAbs /-
@[simp]
theorem squarefree_natAbs {n : ℤ} : Squarefree n.natAbs ↔ Squarefree n := by
simp_rw [Squarefree, nat_abs_surjective.forall, ← nat_abs_mul, nat_abs_dvd_iff_dvd,
is_unit_iff_nat_abs_eq, Nat.isUnit_iff]
#align int.squarefree_nat_abs Int.squarefree_natAbs
+-/
+#print Int.squarefree_coe_nat /-
@[simp]
theorem squarefree_coe_nat {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
rw [← squarefree_nat_abs, nat_abs_of_nat]
#align int.squarefree_coe_nat Int.squarefree_coe_nat
+-/
end Int
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -145,21 +145,21 @@ variable [CancelCommMonoidWithZero R] [WfDvdMonoid R]
theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b := by
classical
- revert hb
- refine'
- WfDvdMonoid.induction_on_irreducible b (by contradiction) (fun u hu hu' => _)
- fun b p hb hp ih hpb => _
- · rw [multiplicity.finite_iff_dom, multiplicity.isUnit_right ha.not_unit hu]
- exact PartENat.dom_natCast 0
- · refine'
- multiplicity.finite_mul ha
- (multiplicity.finite_iff_dom.mpr
- (PartENat.dom_of_le_natCast (show multiplicity a p ≤ ↑1 from _)))
- (ih hb)
- norm_cast
- exact
- ((multiplicity.squarefree_iff_multiplicity_le_one p).mp hp.squarefree a).resolve_right
- ha.not_unit
+ revert hb
+ refine'
+ WfDvdMonoid.induction_on_irreducible b (by contradiction) (fun u hu hu' => _)
+ fun b p hb hp ih hpb => _
+ · rw [multiplicity.finite_iff_dom, multiplicity.isUnit_right ha.not_unit hu]
+ exact PartENat.dom_natCast 0
+ · refine'
+ multiplicity.finite_mul ha
+ (multiplicity.finite_iff_dom.mpr
+ (PartENat.dom_of_le_natCast (show multiplicity a p ≤ ↑1 from _)))
+ (ih hb)
+ norm_cast
+ exact
+ ((multiplicity.squarefree_iff_multiplicity_le_one p).mp hp.squarefree a).resolve_right
+ ha.not_unit
#align multiplicity.finite_prime_left multiplicity.finite_prime_left
end CancelCommMonoidWithZero
@@ -282,8 +282,8 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
x ∣ y ^ n ↔ x ∣ y := by
classical
- haveI := UniqueFactorizationMonoid.toGCDMonoid R
- exact ⟨hsq.is_radical n y, fun h => h.pow h0⟩
+ haveI := UniqueFactorizationMonoid.toGCDMonoid R
+ exact ⟨hsq.is_radical n y, fun h => h.pow h0⟩
#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -75,7 +75,7 @@ theorem Squarefree.ne_zero [MonoidWithZero R] [Nontrivial R] {m : R} (hm : Squar
theorem Irreducible.squarefree [CommMonoid R] {x : R} (h : Irreducible x) : Squarefree x :=
by
rintro y ⟨z, hz⟩
- rw [mul_assoc] at hz
+ rw [mul_assoc] at hz
rcases h.is_unit_or_is_unit hz with (hu | hu)
· exact hu
· apply isUnit_of_mul_isUnit_left hu
@@ -215,8 +215,8 @@ theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefr
by
rintro z ⟨w, rfl⟩
specialize h 2 (z * w) ⟨w, by simp_rw [pow_two, mul_left_comm, ← mul_assoc]⟩
- rwa [← one_mul (z * w), mul_assoc, mul_dvd_mul_iff_right, ← isUnit_iff_dvd_one] at h
- rw [mul_assoc, mul_ne_zero_iff] at h0; exact h0.2
+ rwa [← one_mul (z * w), mul_assoc, mul_dvd_mul_iff_right, ← isUnit_iff_dvd_one] at h
+ rw [mul_assoc, mul_ne_zero_iff] at h0 ; exact h0.2
#align is_radical.squarefree IsRadical.squarefree
variable [GCDMonoid R]
@@ -230,8 +230,8 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
by_cases gcd x y = 0; · rw [h]; apply dvd_zero
replace hy := ((dvd_gcd_iff x x _).2 ⟨dvd_rfl, hy⟩).trans gcd_pow_right_dvd_pow_gcd
obtain ⟨z, hz⟩ := gcd_dvd_left x y
- nth_rw 1 [hz] at hy⊢
- rw [pow_two, mul_dvd_mul_iff_left h] at hy
+ nth_rw 1 [hz] at hy ⊢
+ rw [pow_two, mul_dvd_mul_iff_left h] at hy
obtain ⟨w, hw⟩ := hy
exact (hx z ⟨w, by rwa [mul_right_comm, ← hw]⟩).mul_right_dvd.2 dvd_rfl)
#align squarefree.is_radical Squarefree.isRadical
@@ -264,7 +264,7 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
· have ha := irreducible_of_normalized_factor _ hmem
rcases h a with (h | h)
· rw [← normalize_normalized_factor _ hmem]
- rw [multiplicity_eq_count_normalized_factors ha x0] at h
+ rw [multiplicity_eq_count_normalized_factors ha x0] at h
assumption_mod_cast
· have := ha.1; contradiction
· simp [Multiset.count_eq_zero_of_not_mem hmem]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -52,23 +52,11 @@ theorem IsUnit.squarefree [CommMonoid R] {x : R} (h : IsUnit x) : Squarefree x :
#align is_unit.squarefree IsUnit.squarefree
-/
-/- warning: squarefree_one -> squarefree_one is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R], Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (MulOneClass.toHasOne.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R], Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (Monoid.toOne.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1))))
-Case conversion may be inaccurate. Consider using '#align squarefree_one squarefree_oneₓ'. -/
@[simp]
theorem squarefree_one [CommMonoid R] : Squarefree (1 : R) :=
isUnit_one.Squarefree
#align squarefree_one squarefree_one
-/- warning: not_squarefree_zero -> not_squarefree_zero is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R], Not (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R _inst_1)))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R], Not (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MonoidWithZero.toZero.{u1} R _inst_1))))
-Case conversion may be inaccurate. Consider using '#align not_squarefree_zero not_squarefree_zeroₓ'. -/
@[simp]
theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0 : R) :=
by
@@ -76,12 +64,6 @@ theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0
exact ⟨0, by simp⟩
#align not_squarefree_zero not_squarefree_zero
-/- warning: squarefree.ne_zero -> Squarefree.ne_zero is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R] {m : R}, (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) m) -> (Ne.{succ u1} R m (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R _inst_1)))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R] {m : R}, (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) m) -> (Ne.{succ u1} R m (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MonoidWithZero.toZero.{u1} R _inst_1))))
-Case conversion may be inaccurate. Consider using '#align squarefree.ne_zero Squarefree.ne_zeroₓ'. -/
theorem Squarefree.ne_zero [MonoidWithZero R] [Nontrivial R] {m : R} (hm : Squarefree (m : R)) :
m ≠ 0 := by
rintro rfl
@@ -107,22 +89,10 @@ theorem Prime.squarefree [CancelCommMonoidWithZero R] {x : R} (h : Prime x) : Sq
#align prime.squarefree Prime.squarefree
-/
-/- warning: squarefree.of_mul_left -> Squarefree.of_mul_left is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toHasMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) m)
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) m)
-Case conversion may be inaccurate. Consider using '#align squarefree.of_mul_left Squarefree.of_mul_leftₓ'. -/
theorem Squarefree.of_mul_left [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) : Squarefree m :=
fun p hp => hmn p (dvd_mul_of_dvd_left hp n)
#align squarefree.of_mul_left Squarefree.of_mul_left
-/- warning: squarefree.of_mul_right -> Squarefree.of_mul_right is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toHasMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) n)
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) n)
-Case conversion may be inaccurate. Consider using '#align squarefree.of_mul_right Squarefree.of_mul_rightₓ'. -/
theorem Squarefree.of_mul_right [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) :
Squarefree n := fun p hp => hmn p (dvd_mul_of_dvd_right hp m)
#align squarefree.of_mul_right Squarefree.of_mul_right
@@ -173,12 +143,6 @@ section CancelCommMonoidWithZero
variable [CancelCommMonoidWithZero R] [WfDvdMonoid R]
-/- warning: multiplicity.finite_prime_left -> multiplicity.finite_prime_left is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)] {a : R} {b : R}, (Prime.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1) a) -> (Ne.{succ u1} R b (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (multiplicity.Finite.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) a b)
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)] {a : R} {b : R}, (Prime.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1) a) -> (Ne.{succ u1} R b (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (multiplicity.Finite.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) a b)
-Case conversion may be inaccurate. Consider using '#align multiplicity.finite_prime_left multiplicity.finite_prime_leftₓ'. -/
theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b := by
classical
revert hb
@@ -206,12 +170,6 @@ section Irreducible
variable [CommMonoidWithZero R] [WfDvdMonoid R]
-/- warning: irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree -> irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] (r : R), Iff (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.Dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))) (Or (And (Eq.{succ u1} R r (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))))))) (forall (x : R), Not (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x))) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] (r : R), Iff (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))) (Or (And (Eq.{succ u1} R r (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R _inst_1)))) (forall (x : R), Not (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x))) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r))
-Case conversion may be inaccurate. Consider using '#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefreeₓ'. -/
theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r : R) :
(∀ x : R, Irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ x : R, ¬Irreducible x) ∨ Squarefree r :=
by
@@ -235,23 +193,11 @@ theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r
exact h _ hj₁ ((mul_dvd_mul hj₂ hj₂).trans hx)
#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree
-/- warning: squarefree_iff_irreducible_sq_not_dvd_of_ne_zero -> squarefree_iff_irreducible_sq_not_dvd_of_ne_zero is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Ne.{succ u1} R r (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))))))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.Dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Ne.{succ u1} R r (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R _inst_1)))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
-Case conversion may be inaccurate. Consider using '#align squarefree_iff_irreducible_sq_not_dvd_of_ne_zero squarefree_iff_irreducible_sq_not_dvd_of_ne_zeroₓ'. -/
theorem squarefree_iff_irreducible_sq_not_dvd_of_ne_zero {r : R} (hr : r ≠ 0) :
Squarefree r ↔ ∀ x : R, Irreducible x → ¬x * x ∣ r := by
simpa [hr] using (irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree r).symm
#align squarefree_iff_irreducible_sq_not_dvd_of_ne_zero squarefree_iff_irreducible_sq_not_dvd_of_ne_zero
-/- warning: squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible -> squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Exists.{succ u1} R (fun (x : R) => Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x)) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.Dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Exists.{succ u1} R (fun (x : R) => Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x)) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
-Case conversion may be inaccurate. Consider using '#align squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducibleₓ'. -/
theorem squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible {r : R}
(hr : ∃ x : R, Irreducible x) : Squarefree r ↔ ∀ x : R, Irreducible x → ¬x * x ∣ r :=
by
@@ -265,12 +211,6 @@ section IsRadical
variable [CancelCommMonoidWithZero R]
-/- warning: is_radical.squarefree -> IsRadical.squarefree is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) -> (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x)
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) -> (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x)
-Case conversion may be inaccurate. Consider using '#align is_radical.squarefree IsRadical.squarefreeₓ'. -/
theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefree x :=
by
rintro z ⟨w, rfl⟩
@@ -297,23 +237,11 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
#align squarefree.is_radical Squarefree.isRadical
-/
-/- warning: is_radical_iff_squarefree_or_zero -> isRadical_iff_squarefree_or_zero is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Or (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Eq.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Or (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Eq.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))
-Case conversion may be inaccurate. Consider using '#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zeroₓ'. -/
theorem isRadical_iff_squarefree_or_zero {x : R} : IsRadical x ↔ Squarefree x ∨ x = 0 :=
⟨fun hx => (em <| x = 0).elim Or.inr fun h => Or.inl <| hx.Squarefree h,
Or.ndrec Squarefree.isRadical <| by rintro rfl; rw [zero_isRadical_iff]; infer_instance⟩
#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zero
-/- warning: is_radical_iff_squarefree_of_ne_zero -> isRadical_iff_squarefree_of_ne_zero is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x))
-Case conversion may be inaccurate. Consider using '#align is_radical_iff_squarefree_of_ne_zero isRadical_iff_squarefree_of_ne_zeroₓ'. -/
theorem isRadical_iff_squarefree_of_ne_zero {x : R} (h : x ≠ 0) : IsRadical x ↔ Squarefree x :=
⟨IsRadical.squarefree h, Squarefree.isRadical⟩
#align is_radical_iff_squarefree_of_ne_zero isRadical_iff_squarefree_of_ne_zero
@@ -324,12 +252,6 @@ namespace UniqueFactorizationMonoid
variable [CancelCommMonoidWithZero R] [UniqueFactorizationMonoid R]
-/- warning: unique_factorization_monoid.squarefree_iff_nodup_normalized_factors -> UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : UniqueFactorizationMonoid.{u1} R _inst_1] [_inst_3 : NormalizationMonoid.{u1} R _inst_1] [_inst_4 : DecidableEq.{succ u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Multiset.Nodup.{u1} R (UniqueFactorizationMonoid.normalizedFactors.{u1} R _inst_1 (fun (a : R) (b : R) => _inst_4 a b) _inst_3 _inst_2 x)))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : UniqueFactorizationMonoid.{u1} R _inst_1] [_inst_3 : NormalizationMonoid.{u1} R _inst_1] [_inst_4 : DecidableEq.{succ u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Multiset.Nodup.{u1} R (UniqueFactorizationMonoid.normalizedFactors.{u1} R _inst_1 (fun (a : R) (b : R) => _inst_4 a b) _inst_3 _inst_2 x)))
-Case conversion may be inaccurate. Consider using '#align unique_factorization_monoid.squarefree_iff_nodup_normalized_factors UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactorsₓ'. -/
theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [DecidableEq R] {x : R}
(x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) :=
by
@@ -369,24 +291,12 @@ end UniqueFactorizationMonoid
namespace Int
-/- warning: int.squarefree_nat_abs -> Int.squarefree_natAbs is a dubious translation:
-lean 3 declaration is
- forall {n : Int}, Iff (Squarefree.{0} Nat Nat.monoid (Int.natAbs n)) (Squarefree.{0} Int Int.monoid n)
-but is expected to have type
- forall {n : Int}, Iff (Squarefree.{0} Nat Nat.monoid (Int.natAbs n)) (Squarefree.{0} Int Int.instMonoidInt n)
-Case conversion may be inaccurate. Consider using '#align int.squarefree_nat_abs Int.squarefree_natAbsₓ'. -/
@[simp]
theorem squarefree_natAbs {n : ℤ} : Squarefree n.natAbs ↔ Squarefree n := by
simp_rw [Squarefree, nat_abs_surjective.forall, ← nat_abs_mul, nat_abs_dvd_iff_dvd,
is_unit_iff_nat_abs_eq, Nat.isUnit_iff]
#align int.squarefree_nat_abs Int.squarefree_natAbs
-/- warning: int.squarefree_coe_nat -> Int.squarefree_coe_nat is a dubious translation:
-lean 3 declaration is
- forall {n : Nat}, Iff (Squarefree.{0} Int Int.monoid ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat Int (HasLiftT.mk.{1, 1} Nat Int (CoeTCₓ.coe.{1, 1} Nat Int (coeBase.{1, 1} Nat Int Int.hasCoe))) n)) (Squarefree.{0} Nat Nat.monoid n)
-but is expected to have type
- forall {n : Nat}, Iff (Squarefree.{0} Int Int.instMonoidInt (Nat.cast.{0} Int instNatCastInt n)) (Squarefree.{0} Nat Nat.monoid n)
-Case conversion may be inaccurate. Consider using '#align int.squarefree_coe_nat Int.squarefree_coe_natₓ'. -/
@[simp]
theorem squarefree_coe_nat {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
rw [← squarefree_nat_abs, nat_abs_of_nat]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -287,9 +287,7 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
And.right <|
(dvd_gcd_iff x x y).1
(by
- by_cases gcd x y = 0;
- · rw [h]
- apply dvd_zero
+ by_cases gcd x y = 0; · rw [h]; apply dvd_zero
replace hy := ((dvd_gcd_iff x x _).2 ⟨dvd_rfl, hy⟩).trans gcd_pow_right_dvd_pow_gcd
obtain ⟨z, hz⟩ := gcd_dvd_left x y
nth_rw 1 [hz] at hy⊢
@@ -307,10 +305,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zeroₓ'. -/
theorem isRadical_iff_squarefree_or_zero {x : R} : IsRadical x ↔ Squarefree x ∨ x = 0 :=
⟨fun hx => (em <| x = 0).elim Or.inr fun h => Or.inl <| hx.Squarefree h,
- Or.ndrec Squarefree.isRadical <| by
- rintro rfl
- rw [zero_isRadical_iff]
- infer_instance⟩
+ Or.ndrec Squarefree.isRadical <| by rintro rfl; rw [zero_isRadical_iff]; infer_instance⟩
#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zero
/- warning: is_radical_iff_squarefree_of_ne_zero -> isRadical_iff_squarefree_of_ne_zero is a dubious translation:
@@ -349,11 +344,9 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
· rw [← normalize_normalized_factor _ hmem]
rw [multiplicity_eq_count_normalized_factors ha x0] at h
assumption_mod_cast
- · have := ha.1
- contradiction
+ · have := ha.1; contradiction
· simp [Multiset.count_eq_zero_of_not_mem hmem]
- · rw [or_iff_not_imp_right]
- intro hu
+ · rw [or_iff_not_imp_right]; intro hu
by_cases h0 : a = 0
· simp [h0, x0]
rcases WfDvdMonoid.exists_irreducible_factor hu h0 with ⟨b, hib, hdvd⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/3cacc945118c8c637d89950af01da78307f59325
@@ -376,12 +376,24 @@ end UniqueFactorizationMonoid
namespace Int
+/- warning: int.squarefree_nat_abs -> Int.squarefree_natAbs is a dubious translation:
+lean 3 declaration is
+ forall {n : Int}, Iff (Squarefree.{0} Nat Nat.monoid (Int.natAbs n)) (Squarefree.{0} Int Int.monoid n)
+but is expected to have type
+ forall {n : Int}, Iff (Squarefree.{0} Nat Nat.monoid (Int.natAbs n)) (Squarefree.{0} Int Int.instMonoidInt n)
+Case conversion may be inaccurate. Consider using '#align int.squarefree_nat_abs Int.squarefree_natAbsₓ'. -/
@[simp]
theorem squarefree_natAbs {n : ℤ} : Squarefree n.natAbs ↔ Squarefree n := by
simp_rw [Squarefree, nat_abs_surjective.forall, ← nat_abs_mul, nat_abs_dvd_iff_dvd,
is_unit_iff_nat_abs_eq, Nat.isUnit_iff]
#align int.squarefree_nat_abs Int.squarefree_natAbs
+/- warning: int.squarefree_coe_nat -> Int.squarefree_coe_nat is a dubious translation:
+lean 3 declaration is
+ forall {n : Nat}, Iff (Squarefree.{0} Int Int.monoid ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat Int (HasLiftT.mk.{1, 1} Nat Int (CoeTCₓ.coe.{1, 1} Nat Int (coeBase.{1, 1} Nat Int Int.hasCoe))) n)) (Squarefree.{0} Nat Nat.monoid n)
+but is expected to have type
+ forall {n : Nat}, Iff (Squarefree.{0} Int Int.instMonoidInt (Nat.cast.{0} Int instNatCastInt n)) (Squarefree.{0} Nat Nat.monoid n)
+Case conversion may be inaccurate. Consider using '#align int.squarefree_coe_nat Int.squarefree_coe_natₓ'. -/
@[simp]
theorem squarefree_coe_nat {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
rw [← squarefree_nat_abs, nat_abs_of_nat]
mathlib commit https://github.com/leanprover-community/mathlib/commit/3cacc945118c8c637d89950af01da78307f59325
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
! This file was ported from Lean 3 source module algebra.squarefree
-! leanprover-community/mathlib commit c085f3044fe585c575e322bfab45b3633c48d820
+! leanprover-community/mathlib commit 00d163e35035c3577c1c79fa53b68de17781ffc1
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -374,3 +374,18 @@ theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (
end UniqueFactorizationMonoid
+namespace Int
+
+@[simp]
+theorem squarefree_natAbs {n : ℤ} : Squarefree n.natAbs ↔ Squarefree n := by
+ simp_rw [Squarefree, nat_abs_surjective.forall, ← nat_abs_mul, nat_abs_dvd_iff_dvd,
+ is_unit_iff_nat_abs_eq, Nat.isUnit_iff]
+#align int.squarefree_nat_abs Int.squarefree_natAbs
+
+@[simp]
+theorem squarefree_coe_nat {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
+ rw [← squarefree_nat_abs, nat_abs_of_nat]
+#align int.squarefree_coe_nat Int.squarefree_coe_nat
+
+end Int
+
mathlib commit https://github.com/leanprover-community/mathlib/commit/57e09a1296bfb4330ddf6624f1028ba186117d82
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
! This file was ported from Lean 3 source module algebra.squarefree
-! leanprover-community/mathlib commit 79de90f7beca025f469dcda978ae655c4d985946
+! leanprover-community/mathlib commit c085f3044fe585c575e322bfab45b3633c48d820
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -12,6 +12,9 @@ import Mathbin.RingTheory.UniqueFactorizationDomain
/-!
# Squarefree elements of monoids
+
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
An element of a monoid is squarefree when it is not divisible by any squares
except the squares of units.
mathlib commit https://github.com/leanprover-community/mathlib/commit/dd6388c44e6f6b4547070b887c5905d5cfe6c9f8
@@ -34,22 +34,38 @@ squarefree, multiplicity
variable {R : Type _}
+#print Squarefree /-
/-- An element of a monoid is squarefree if the only squares that
divide it are the squares of units. -/
def Squarefree [Monoid R] (r : R) : Prop :=
∀ x : R, x * x ∣ r → IsUnit x
#align squarefree Squarefree
+-/
+#print IsUnit.squarefree /-
@[simp]
theorem IsUnit.squarefree [CommMonoid R] {x : R} (h : IsUnit x) : Squarefree x := fun y hdvd =>
isUnit_of_mul_isUnit_left (isUnit_of_dvd_unit hdvd h)
#align is_unit.squarefree IsUnit.squarefree
+-/
+/- warning: squarefree_one -> squarefree_one is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R], Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (MulOneClass.toHasOne.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R], Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (Monoid.toOne.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1))))
+Case conversion may be inaccurate. Consider using '#align squarefree_one squarefree_oneₓ'. -/
@[simp]
theorem squarefree_one [CommMonoid R] : Squarefree (1 : R) :=
isUnit_one.Squarefree
#align squarefree_one squarefree_one
+/- warning: not_squarefree_zero -> not_squarefree_zero is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R], Not (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R _inst_1)))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R], Not (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MonoidWithZero.toZero.{u1} R _inst_1))))
+Case conversion may be inaccurate. Consider using '#align not_squarefree_zero not_squarefree_zeroₓ'. -/
@[simp]
theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0 : R) :=
by
@@ -57,12 +73,19 @@ theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0
exact ⟨0, by simp⟩
#align not_squarefree_zero not_squarefree_zero
+/- warning: squarefree.ne_zero -> Squarefree.ne_zero is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R] {m : R}, (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) m) -> (Ne.{succ u1} R m (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R _inst_1)))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : MonoidWithZero.{u1} R] [_inst_2 : Nontrivial.{u1} R] {m : R}, (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R _inst_1) m) -> (Ne.{succ u1} R m (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MonoidWithZero.toZero.{u1} R _inst_1))))
+Case conversion may be inaccurate. Consider using '#align squarefree.ne_zero Squarefree.ne_zeroₓ'. -/
theorem Squarefree.ne_zero [MonoidWithZero R] [Nontrivial R] {m : R} (hm : Squarefree (m : R)) :
m ≠ 0 := by
rintro rfl
exact not_squarefree_zero hm
#align squarefree.ne_zero Squarefree.ne_zero
+#print Irreducible.squarefree /-
@[simp]
theorem Irreducible.squarefree [CommMonoid R] {x : R} (h : Irreducible x) : Squarefree x :=
by
@@ -72,35 +95,56 @@ theorem Irreducible.squarefree [CommMonoid R] {x : R} (h : Irreducible x) : Squa
· exact hu
· apply isUnit_of_mul_isUnit_left hu
#align irreducible.squarefree Irreducible.squarefree
+-/
+#print Prime.squarefree /-
@[simp]
theorem Prime.squarefree [CancelCommMonoidWithZero R] {x : R} (h : Prime x) : Squarefree x :=
h.Irreducible.Squarefree
#align prime.squarefree Prime.squarefree
+-/
+/- warning: squarefree.of_mul_left -> Squarefree.of_mul_left is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toHasMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) m)
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) m)
+Case conversion may be inaccurate. Consider using '#align squarefree.of_mul_left Squarefree.of_mul_leftₓ'. -/
theorem Squarefree.of_mul_left [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) : Squarefree m :=
fun p hp => hmn p (dvd_mul_of_dvd_left hp n)
#align squarefree.of_mul_left Squarefree.of_mul_left
+/- warning: squarefree.of_mul_right -> Squarefree.of_mul_right is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toHasMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) n)
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CommMonoid.{u1} R] {m : R} {n : R}, (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulOneClass.toMul.{u1} R (Monoid.toMulOneClass.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1)))) m n)) -> (Squarefree.{u1} R (CommMonoid.toMonoid.{u1} R _inst_1) n)
+Case conversion may be inaccurate. Consider using '#align squarefree.of_mul_right Squarefree.of_mul_rightₓ'. -/
theorem Squarefree.of_mul_right [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) :
Squarefree n := fun p hp => hmn p (dvd_mul_of_dvd_right hp m)
#align squarefree.of_mul_right Squarefree.of_mul_right
+#print Squarefree.squarefree_of_dvd /-
theorem Squarefree.squarefree_of_dvd [CommMonoid R] {x y : R} (hdvd : x ∣ y) (hsq : Squarefree y) :
Squarefree x := fun a h => hsq _ (h.trans hdvd)
#align squarefree.squarefree_of_dvd Squarefree.squarefree_of_dvd
+-/
section SquarefreeGcdOfSquarefree
variable {α : Type _} [CancelCommMonoidWithZero α] [GCDMonoid α]
+#print Squarefree.gcd_right /-
theorem Squarefree.gcd_right (a : α) {b : α} (hb : Squarefree b) : Squarefree (gcd a b) :=
hb.squarefree_of_dvd (gcd_dvd_right _ _)
#align squarefree.gcd_right Squarefree.gcd_right
+-/
+#print Squarefree.gcd_left /-
theorem Squarefree.gcd_left {a : α} (b : α) (ha : Squarefree a) : Squarefree (gcd a b) :=
ha.squarefree_of_dvd (gcd_dvd_left _ _)
#align squarefree.gcd_left Squarefree.gcd_left
+-/
end SquarefreeGcdOfSquarefree
@@ -110,6 +154,7 @@ section CommMonoid
variable [CommMonoid R] [DecidableRel (Dvd.Dvd : R → R → Prop)]
+#print multiplicity.squarefree_iff_multiplicity_le_one /-
theorem squarefree_iff_multiplicity_le_one (r : R) :
Squarefree r ↔ ∀ x : R, multiplicity x r ≤ 1 ∨ IsUnit x :=
by
@@ -117,6 +162,7 @@ theorem squarefree_iff_multiplicity_le_one (r : R) :
rw [← sq, pow_dvd_iff_le_multiplicity, or_iff_not_imp_left, not_le, imp_congr _ Iff.rfl]
simpa using PartENat.add_one_le_iff_lt (PartENat.natCast_ne_top 1)
#align multiplicity.squarefree_iff_multiplicity_le_one multiplicity.squarefree_iff_multiplicity_le_one
+-/
end CommMonoid
@@ -124,6 +170,12 @@ section CancelCommMonoidWithZero
variable [CancelCommMonoidWithZero R] [WfDvdMonoid R]
+/- warning: multiplicity.finite_prime_left -> multiplicity.finite_prime_left is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)] {a : R} {b : R}, (Prime.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1) a) -> (Ne.{succ u1} R b (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (multiplicity.Finite.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) a b)
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)] {a : R} {b : R}, (Prime.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1) a) -> (Ne.{succ u1} R b (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (multiplicity.Finite.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) a b)
+Case conversion may be inaccurate. Consider using '#align multiplicity.finite_prime_left multiplicity.finite_prime_leftₓ'. -/
theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b := by
classical
revert hb
@@ -151,6 +203,12 @@ section Irreducible
variable [CommMonoidWithZero R] [WfDvdMonoid R]
+/- warning: irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree -> irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] (r : R), Iff (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.Dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))) (Or (And (Eq.{succ u1} R r (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))))))) (forall (x : R), Not (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x))) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] (r : R), Iff (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))) (Or (And (Eq.{succ u1} R r (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R _inst_1)))) (forall (x : R), Not (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x))) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r))
+Case conversion may be inaccurate. Consider using '#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefreeₓ'. -/
theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r : R) :
(∀ x : R, Irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ x : R, ¬Irreducible x) ∨ Squarefree r :=
by
@@ -174,11 +232,23 @@ theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r
exact h _ hj₁ ((mul_dvd_mul hj₂ hj₂).trans hx)
#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree
+/- warning: squarefree_iff_irreducible_sq_not_dvd_of_ne_zero -> squarefree_iff_irreducible_sq_not_dvd_of_ne_zero is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Ne.{succ u1} R r (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))))))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.Dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Ne.{succ u1} R r (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R _inst_1)))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
+Case conversion may be inaccurate. Consider using '#align squarefree_iff_irreducible_sq_not_dvd_of_ne_zero squarefree_iff_irreducible_sq_not_dvd_of_ne_zeroₓ'. -/
theorem squarefree_iff_irreducible_sq_not_dvd_of_ne_zero {r : R} (hr : r ≠ 0) :
Squarefree r ↔ ∀ x : R, Irreducible x → ¬x * x ∣ r := by
simpa [hr] using (irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree r).symm
#align squarefree_iff_irreducible_sq_not_dvd_of_ne_zero squarefree_iff_irreducible_sq_not_dvd_of_ne_zero
+/- warning: squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible -> squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Exists.{succ u1} R (fun (x : R) => Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x)) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.Dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CommMonoidWithZero.{u1} R] [_inst_2 : WfDvdMonoid.{u1} R _inst_1] {r : R}, (Exists.{succ u1} R (fun (x : R) => Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x)) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) r) (forall (x : R), (Irreducible.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)) x) -> (Not (Dvd.dvd.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1)))) (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R _inst_1))))) x x) r))))
+Case conversion may be inaccurate. Consider using '#align squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducibleₓ'. -/
theorem squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible {r : R}
(hr : ∃ x : R, Irreducible x) : Squarefree r ↔ ∀ x : R, Irreducible x → ¬x * x ∣ r :=
by
@@ -192,6 +262,12 @@ section IsRadical
variable [CancelCommMonoidWithZero R]
+/- warning: is_radical.squarefree -> IsRadical.squarefree is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) -> (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x)
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) -> (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x)
+Case conversion may be inaccurate. Consider using '#align is_radical.squarefree IsRadical.squarefreeₓ'. -/
theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefree x :=
by
rintro z ⟨w, rfl⟩
@@ -202,6 +278,7 @@ theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefr
variable [GCDMonoid R]
+#print Squarefree.isRadical /-
theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
(isRadical_iff_pow_one_lt 2 one_lt_two).2 fun y hy =>
And.right <|
@@ -217,7 +294,14 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
obtain ⟨w, hw⟩ := hy
exact (hx z ⟨w, by rwa [mul_right_comm, ← hw]⟩).mul_right_dvd.2 dvd_rfl)
#align squarefree.is_radical Squarefree.isRadical
+-/
+/- warning: is_radical_iff_squarefree_or_zero -> isRadical_iff_squarefree_or_zero is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Or (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Eq.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Or (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Eq.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))
+Case conversion may be inaccurate. Consider using '#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zeroₓ'. -/
theorem isRadical_iff_squarefree_or_zero {x : R} : IsRadical x ↔ Squarefree x ∨ x = 0 :=
⟨fun hx => (em <| x = 0).elim Or.inr fun h => Or.inl <| hx.Squarefree h,
Or.ndrec Squarefree.isRadical <| by
@@ -226,6 +310,12 @@ theorem isRadical_iff_squarefree_or_zero {x : R} : IsRadical x ↔ Squarefree x
infer_instance⟩
#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zero
+/- warning: is_radical_iff_squarefree_of_ne_zero -> isRadical_iff_squarefree_of_ne_zero is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : GCDMonoid.{u1} R _inst_1] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (Iff (IsRadical.{u1} R (semigroupDvd.{u1} R (SemigroupWithZero.toSemigroup.{u1} R (MonoidWithZero.toSemigroupWithZero.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) (Monoid.Pow.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1)))) x) (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x))
+Case conversion may be inaccurate. Consider using '#align is_radical_iff_squarefree_of_ne_zero isRadical_iff_squarefree_of_ne_zeroₓ'. -/
theorem isRadical_iff_squarefree_of_ne_zero {x : R} (h : x ≠ 0) : IsRadical x ↔ Squarefree x :=
⟨IsRadical.squarefree h, Squarefree.isRadical⟩
#align is_radical_iff_squarefree_of_ne_zero isRadical_iff_squarefree_of_ne_zero
@@ -236,6 +326,12 @@ namespace UniqueFactorizationMonoid
variable [CancelCommMonoidWithZero R] [UniqueFactorizationMonoid R]
+/- warning: unique_factorization_monoid.squarefree_iff_nodup_normalized_factors -> UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : UniqueFactorizationMonoid.{u1} R _inst_1] [_inst_3 : NormalizationMonoid.{u1} R _inst_1] [_inst_4 : DecidableEq.{succ u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))))))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Multiset.Nodup.{u1} R (UniqueFactorizationMonoid.normalizedFactors.{u1} R _inst_1 (fun (a : R) (b : R) => _inst_4 a b) _inst_3 _inst_2 x)))
+but is expected to have type
+ forall {R : Type.{u1}} [_inst_1 : CancelCommMonoidWithZero.{u1} R] [_inst_2 : UniqueFactorizationMonoid.{u1} R _inst_1] [_inst_3 : NormalizationMonoid.{u1} R _inst_1] [_inst_4 : DecidableEq.{succ u1} R] {x : R}, (Ne.{succ u1} R x (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))))) -> (Iff (Squarefree.{u1} R (MonoidWithZero.toMonoid.{u1} R (CommMonoidWithZero.toMonoidWithZero.{u1} R (CancelCommMonoidWithZero.toCommMonoidWithZero.{u1} R _inst_1))) x) (Multiset.Nodup.{u1} R (UniqueFactorizationMonoid.normalizedFactors.{u1} R _inst_1 (fun (a : R) (b : R) => _inst_4 a b) _inst_3 _inst_2 x)))
+Case conversion may be inaccurate. Consider using '#align unique_factorization_monoid.squarefree_iff_nodup_normalized_factors UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactorsₓ'. -/
theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [DecidableEq R] {x : R}
(x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) :=
by
@@ -264,12 +360,14 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
assumption_mod_cast
#align unique_factorization_monoid.squarefree_iff_nodup_normalized_factors UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors
+#print UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree /-
theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
x ∣ y ^ n ↔ x ∣ y := by
classical
haveI := UniqueFactorizationMonoid.toGCDMonoid R
exact ⟨hsq.is_radical n y, fun h => h.pow h0⟩
#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
+-/
end UniqueFactorizationMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/290a7ba01fbcab1b64757bdaa270d28f4dcede35
@@ -267,7 +267,7 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
x ∣ y ^ n ↔ x ∣ y := by
classical
- haveI := UniqueFactorizationMonoid.toGcdMonoid R
+ haveI := UniqueFactorizationMonoid.toGCDMonoid R
exact ⟨hsq.is_radical n y, fun h => h.pow h0⟩
#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -169,7 +169,7 @@ theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r
have : x ≠ 0 := by
rintro rfl
apply hr
- simpa only [zero_dvd_iff, mul_zero] using hx
+ simpa only [zero_dvd_iff, MulZeroClass.mul_zero] using hx
obtain ⟨j, hj₁, hj₂⟩ := WfDvdMonoid.exists_irreducible_factor i this
exact h _ hj₁ ((mul_dvd_mul hj₂ hj₂).trans hx)
#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Occasionally, remove a "deprecated by" or "deprecated since", to fit the line length.
This is desirable (to me) because
@@ -320,7 +320,6 @@ theorem squarefree_natCast {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n :=
rw [← squarefree_natAbs, natAbs_ofNat]
#align int.squarefree_coe_nat Int.squarefree_natCast
--- 2024-04-05
-@[deprecated] alias squarefree_coe_nat := squarefree_natCast
+@[deprecated] alias squarefree_coe_nat := squarefree_natCast -- 2024-04-05
end Int
Mathlib.RingTheory.Nilpotent
has a few very simple definitions (Mathlib.Data.Nat.Lattice
is sufficient to state them), but needs some pretty heavy imports (ideals, linear algebra) towards the end. This change moves the heavier parts into a new file.
@@ -3,6 +3,7 @@ Copyright (c) 2020 Aaron Anderson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
-/
+import Mathlib.RingTheory.Nilpotent.Basic
import Mathlib.RingTheory.UniqueFactorizationDomain
#align_import algebra.squarefree from "leanprover-community/mathlib"@"00d163e35035c3577c1c79fa53b68de17781ffc1"
@@ -315,8 +315,11 @@ theorem squarefree_natAbs {n : ℤ} : Squarefree n.natAbs ↔ Squarefree n := by
#align int.squarefree_nat_abs Int.squarefree_natAbs
@[simp]
-theorem squarefree_coe_nat {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
+theorem squarefree_natCast {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
rw [← squarefree_natAbs, natAbs_ofNat]
-#align int.squarefree_coe_nat Int.squarefree_coe_nat
+#align int.squarefree_coe_nat Int.squarefree_natCast
+
+-- 2024-04-05
+@[deprecated] alias squarefree_coe_nat := squarefree_natCast
end Int
We change the following field in the definition of an additive commutative monoid:
nsmul_succ : ∀ (n : ℕ) (x : G),
- AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+ AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
where the latter is more natural
We adjust the definitions of ^
in monoids, groups, etc.
Originally there was a warning comment about why this natural order was preferred
use
x * npowRec n x
and notnpowRec n x * x
in the definition to make sure that definitional unfolding ofnpowRec
is blocked, to avoid deep recursion issues.
but it seems to no longer apply.
Remarks on the PR :
pow_succ
and pow_succ'
have switched their meanings.Ideal.IsPrime.mul_mem_pow
which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul
.@@ -212,7 +212,7 @@ theorem pow_dvd_of_squarefree_of_pow_succ_dvd_mul_right {k : ℕ}
· obtain ⟨x', rfl⟩ := hxp
have hx' : ¬ p ∣ x' := fun contra ↦ hp.not_unit <| hx p (mul_dvd_mul_left p contra)
replace h : p ^ k ∣ x' * y := by
- rw [pow_succ, mul_assoc] at h
+ rw [pow_succ', mul_assoc] at h
exact (mul_dvd_mul_iff_left hp.ne_zero).mp h
exact hp.pow_dvd_of_dvd_mul_left _ hx' h
· exact (pow_dvd_pow _ k.le_succ).trans (hp.pow_dvd_of_dvd_mul_left _ hxp h)
@@ -274,7 +274,7 @@ lemma _root_.exists_squarefree_dvd_pow_of_ne_zero {x : R} (hx : x ≠ 0) :
· exact ⟨p, 1, hp.squarefree, dvd_mul_right p z, by simp [isUnit_of_dvd_one (pow_zero y ▸ hy')]⟩
by_cases hp' : p ∣ y
· exact ⟨y, n + 1, hy, dvd_mul_of_dvd_right hyx _,
- mul_comm p z ▸ pow_succ' y n ▸ mul_dvd_mul hy' hp'⟩
+ mul_comm p z ▸ pow_succ y n ▸ mul_dvd_mul hy' hp'⟩
· suffices Squarefree (p * y) from ⟨p * y, n, this,
mul_dvd_mul_left p hyx, mul_pow p y n ▸ mul_dvd_mul (dvd_pow_self p hn.ne') hy'⟩
exact squarefree_mul_iff.mpr ⟨hp.isRelPrime_iff_not_dvd.mpr hp', hp.squarefree, hy⟩
@@ -279,9 +279,9 @@ lemma _root_.exists_squarefree_dvd_pow_of_ne_zero {x : R} (hx : x ≠ 0) :
mul_dvd_mul_left p hyx, mul_pow p y n ▸ mul_dvd_mul (dvd_pow_self p hn.ne') hy'⟩
exact squarefree_mul_iff.mpr ⟨hp.isRelPrime_iff_not_dvd.mpr hp', hp.squarefree, hy⟩
-theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [DecidableEq R] {x : R}
+theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] {x : R}
(x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) := by
- have drel : DecidableRel (Dvd.dvd : R → R → Prop) := by classical infer_instance
+ classical
rw [multiplicity.squarefree_iff_multiplicity_le_one, Multiset.nodup_iff_count_le_one]
haveI := nontrivial_of_ne x 0 x0
constructor <;> intro h a
@@ -296,13 +296,12 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
· simp [Multiset.count_eq_zero_of_not_mem hmem]
· rw [or_iff_not_imp_right]
intro hu
- by_cases h0 : a = 0
- · simp [h0, x0]
+ rcases eq_or_ne a 0 with rfl | h0
+ · simp [x0]
rcases WfDvdMonoid.exists_irreducible_factor hu h0 with ⟨b, hib, hdvd⟩
apply le_trans (multiplicity.multiplicity_le_multiplicity_of_dvd_left hdvd)
rw [multiplicity_eq_count_normalizedFactors hib x0]
- specialize h (normalize b)
- assumption_mod_cast
+ exact_mod_cast h (normalize b)
#align unique_factorization_monoid.squarefree_iff_nodup_normalized_factors UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors
end UniqueFactorizationMonoid
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -120,6 +120,7 @@ theorem squarefree_iff_multiplicity_le_one (r : R) :
Squarefree r ↔ ∀ x : R, multiplicity x r ≤ 1 ∨ IsUnit x := by
refine' forall_congr' fun a => _
rw [← sq, pow_dvd_iff_le_multiplicity, or_iff_not_imp_left, not_le, imp_congr _ Iff.rfl]
+ norm_cast
rw [← one_add_one_eq_two]
simpa using PartENat.add_one_le_iff_lt (PartENat.natCast_ne_top 1)
#align multiplicity.squarefree_iff_multiplicity_le_one multiplicity.squarefree_iff_multiplicity_le_one
WfDvdMonoid.max_power_factor[']
and multiplicity.finite_of_not_isUnit
(#11066)
UniqueFactorizationMonoid.max_power_factor
obsoletemultiplicity.finite_prime_left
trivialexists_reduced_fraction'
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
@@ -130,23 +130,8 @@ section CancelCommMonoidWithZero
variable [CancelCommMonoidWithZero R] [WfDvdMonoid R]
-theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b := by
- classical
- revert hb
- refine'
- WfDvdMonoid.induction_on_irreducible b (fun c => c.irrefl.elim) (fun u hu _ => _)
- fun b p hb hp ih _ => _
- · rw [multiplicity.finite_iff_dom, multiplicity.isUnit_right ha.not_unit hu]
- exact PartENat.dom_natCast 0
- · refine'
- multiplicity.finite_mul ha
- (multiplicity.finite_iff_dom.mpr
- (PartENat.dom_of_le_natCast (show multiplicity a p ≤ ↑1 from _)))
- (ih hb)
- norm_cast
- exact
- ((multiplicity.squarefree_iff_multiplicity_le_one p).mp hp.squarefree a).resolve_right
- ha.not_unit
+theorem finite_prime_left {a b : R} (ha : Prime a) (hb : b ≠ 0) : multiplicity.Finite a b :=
+ finite_of_not_isUnit ha.not_unit hb
#align multiplicity.finite_prime_left multiplicity.finite_prime_left
end CancelCommMonoidWithZero
@@ -45,7 +45,7 @@ theorem IsUnit.squarefree [CommMonoid R] {x : R} (h : IsUnit x) : Squarefree x :
isUnit_of_mul_isUnit_left (isUnit_of_dvd_unit hdvd h)
#align is_unit.squarefree IsUnit.squarefree
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem squarefree_one [CommMonoid R] : Squarefree (1 : R) :=
isUnit_one.squarefree
#align squarefree_one squarefree_one
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>
@@ -37,6 +37,9 @@ def Squarefree [Monoid R] (r : R) : Prop :=
∀ x : R, x * x ∣ r → IsUnit x
#align squarefree Squarefree
+theorem IsRelPrime.of_squarefree_mul [CommMonoid R] {m n : R} (h : Squarefree (m * n)) :
+ IsRelPrime m n := fun c hca hcb ↦ h c (mul_dvd_mul hca hcb)
+
@[simp]
theorem IsUnit.squarefree [CommMonoid R] {x : R} (h : IsUnit x) : Squarefree x := fun _ hdvd =>
isUnit_of_mul_isUnit_left (isUnit_of_dvd_unit hdvd h)
@@ -154,26 +157,23 @@ section Irreducible
variable [CommMonoidWithZero R] [WfDvdMonoid R]
+theorem squarefree_iff_no_irreducibles {x : R} (hx₀ : x ≠ 0) :
+ Squarefree x ↔ ∀ p, Irreducible p → ¬ (p * p ∣ x) := by
+ refine ⟨fun h p hp hp' ↦ hp.not_unit (h p hp'), fun h d hd ↦ by_contra fun hdu ↦ ?_⟩
+ have hd₀ : d ≠ 0 := ne_zero_of_dvd_ne_zero (ne_zero_of_dvd_ne_zero hx₀ hd) (dvd_mul_left d d)
+ obtain ⟨p, irr, dvd⟩ := WfDvdMonoid.exists_irreducible_factor hdu hd₀
+ exact h p irr ((mul_dvd_mul dvd dvd).trans hd)
+
theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r : R) :
(∀ x : R, Irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ x : R, ¬Irreducible x) ∨ Squarefree r := by
- symm
- constructor
+ refine ⟨fun h ↦ ?_, ?_⟩
+ · rcases eq_or_ne r 0 with (rfl | hr)
+ · exact .inl (by simpa using h)
+ · exact .inr ((squarefree_iff_no_irreducibles hr).mpr h)
· rintro (⟨rfl, h⟩ | h)
· simpa using h
intro x hx t
exact hx.not_unit (h x t)
- intro h
- rcases eq_or_ne r 0 with (rfl | hr)
- · exact Or.inl (by simpa using h)
- right
- intro x hx
- by_contra i
- have : x ≠ 0 := by
- rintro rfl
- apply hr
- simpa only [zero_dvd_iff, mul_zero] using hx
- obtain ⟨j, hj₁, hj₂⟩ := WfDvdMonoid.exists_irreducible_factor i this
- exact h _ hj₁ ((mul_dvd_mul hj₂ hj₂).trans hx)
#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree
theorem squarefree_iff_irreducible_sq_not_dvd_of_ne_zero {r : R} (hr : r ≠ 0) :
@@ -191,42 +191,84 @@ end Irreducible
section IsRadical
-variable [CancelCommMonoidWithZero R]
+section
+variable [CommMonoidWithZero R] [DecompositionMonoid R]
+
+theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
+ (isRadical_iff_pow_one_lt 2 one_lt_two).2 fun y hy ↦ by
+ obtain ⟨a, b, ha, hb, rfl⟩ := exists_dvd_and_dvd_of_dvd_mul (sq y ▸ hy)
+ exact (IsRelPrime.of_squarefree_mul hx).mul_dvd ha hb
+#align squarefree.is_radical Squarefree.isRadical
+
+theorem Squarefree.dvd_pow_iff_dvd {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
+ x ∣ y ^ n ↔ x ∣ y := ⟨hsq.isRadical n y, (·.pow h0)⟩
+#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree Squarefree.dvd_pow_iff_dvd
+@[deprecated]
+alias UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree := Squarefree.dvd_pow_iff_dvd
+
+end
+
+variable [CancelCommMonoidWithZero R] {x y p d : R}
-theorem IsRadical.squarefree {x : R} (h0 : x ≠ 0) (h : IsRadical x) : Squarefree x := by
+theorem IsRadical.squarefree (h0 : x ≠ 0) (h : IsRadical x) : Squarefree x := by
rintro z ⟨w, rfl⟩
specialize h 2 (z * w) ⟨w, by simp_rw [pow_two, mul_left_comm, ← mul_assoc]⟩
rwa [← one_mul (z * w), mul_assoc, mul_dvd_mul_iff_right, ← isUnit_iff_dvd_one] at h
rw [mul_assoc, mul_ne_zero_iff] at h0; exact h0.2
#align is_radical.squarefree IsRadical.squarefree
-variable [GCDMonoid R]
-
-theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
- (isRadical_iff_pow_one_lt 2 one_lt_two).2 fun y hy =>
- And.right <|
- (dvd_gcd_iff x x y).1
- (by
- by_cases h : gcd x y = 0
- · rw [h]
- apply dvd_zero
- replace hy := ((dvd_gcd_iff x x _).2 ⟨dvd_rfl, hy⟩).trans gcd_pow_right_dvd_pow_gcd
- obtain ⟨z, hz⟩ := gcd_dvd_left x y
- nth_rw 1 [hz] at hy ⊢
- rw [pow_two, mul_dvd_mul_iff_left h] at hy
- obtain ⟨w, hw⟩ := hy
- exact (hx z ⟨w, by rwa [mul_right_comm, ← hw]⟩).mul_right_dvd.2 dvd_rfl)
-#align squarefree.is_radical Squarefree.isRadical
-
-theorem isRadical_iff_squarefree_or_zero {x : R} : IsRadical x ↔ Squarefree x ∨ x = 0 :=
- ⟨fun hx => (em <| x = 0).elim Or.inr fun h => Or.inl <| hx.squarefree h,
+namespace Squarefree
+
+theorem pow_dvd_of_squarefree_of_pow_succ_dvd_mul_right {k : ℕ}
+ (hx : Squarefree x) (hp : Prime p) (h : p ^ (k + 1) ∣ x * y) :
+ p ^ k ∣ y := by
+ by_cases hxp : p ∣ x
+ · obtain ⟨x', rfl⟩ := hxp
+ have hx' : ¬ p ∣ x' := fun contra ↦ hp.not_unit <| hx p (mul_dvd_mul_left p contra)
+ replace h : p ^ k ∣ x' * y := by
+ rw [pow_succ, mul_assoc] at h
+ exact (mul_dvd_mul_iff_left hp.ne_zero).mp h
+ exact hp.pow_dvd_of_dvd_mul_left _ hx' h
+ · exact (pow_dvd_pow _ k.le_succ).trans (hp.pow_dvd_of_dvd_mul_left _ hxp h)
+
+theorem pow_dvd_of_squarefree_of_pow_succ_dvd_mul_left {k : ℕ}
+ (hy : Squarefree y) (hp : Prime p) (h : p ^ (k + 1) ∣ x * y) :
+ p ^ k ∣ x := by
+ rw [mul_comm] at h
+ exact pow_dvd_of_squarefree_of_pow_succ_dvd_mul_right hy hp h
+
+variable [DecompositionMonoid R]
+
+theorem dvd_of_squarefree_of_mul_dvd_mul_right (hx : Squarefree x) (h : d * d ∣ x * y) : d ∣ y := by
+ nontriviality R
+ obtain ⟨a, b, ha, hb, eq⟩ := exists_dvd_and_dvd_of_dvd_mul h
+ replace ha : Squarefree a := hx.squarefree_of_dvd ha
+ obtain ⟨c, hc⟩ : a ∣ d := ha.isRadical 2 d ⟨b, by rw [sq, eq]⟩
+ rw [hc, mul_assoc, (mul_right_injective₀ ha.ne_zero).eq_iff] at eq
+ exact dvd_trans ⟨c, by rw [hc, ← eq, mul_comm]⟩ hb
+
+theorem dvd_of_squarefree_of_mul_dvd_mul_left (hy : Squarefree y) (h : d * d ∣ x * y) : d ∣ x :=
+ dvd_of_squarefree_of_mul_dvd_mul_right hy (mul_comm x y ▸ h)
+
+end Squarefree
+
+variable [DecompositionMonoid R]
+
+/-- `x * y` is square-free iff `x` and `y` have no common factors and are themselves square-free. -/
+theorem squarefree_mul_iff : Squarefree (x * y) ↔ IsRelPrime x y ∧ Squarefree x ∧ Squarefree y :=
+ ⟨fun h ↦ ⟨IsRelPrime.of_squarefree_mul h, h.of_mul_left, h.of_mul_right⟩,
+ fun ⟨hp, sqx, sqy⟩ _ dvd ↦ hp (sqy.dvd_of_squarefree_of_mul_dvd_mul_left dvd)
+ (sqx.dvd_of_squarefree_of_mul_dvd_mul_right dvd)⟩
+
+theorem isRadical_iff_squarefree_or_zero : IsRadical x ↔ Squarefree x ∨ x = 0 :=
+ ⟨fun hx ↦ (em <| x = 0).elim .inr fun h ↦ .inl <| hx.squarefree h,
Or.rec Squarefree.isRadical <| by
rintro rfl
rw [zero_isRadical_iff]
infer_instance⟩
#align is_radical_iff_squarefree_or_zero isRadical_iff_squarefree_or_zero
-theorem isRadical_iff_squarefree_of_ne_zero {x : R} (h : x ≠ 0) : IsRadical x ↔ Squarefree x :=
+theorem isRadical_iff_squarefree_of_ne_zero (h : x ≠ 0) : IsRadical x ↔ Squarefree x :=
⟨IsRadical.squarefree h, Squarefree.isRadical⟩
#align is_radical_iff_squarefree_of_ne_zero isRadical_iff_squarefree_of_ne_zero
@@ -236,6 +278,21 @@ namespace UniqueFactorizationMonoid
variable [CancelCommMonoidWithZero R] [UniqueFactorizationMonoid R]
+lemma _root_.exists_squarefree_dvd_pow_of_ne_zero {x : R} (hx : x ≠ 0) :
+ ∃ (y : R) (n : ℕ), Squarefree y ∧ y ∣ x ∧ x ∣ y ^ n := by
+ induction' x using WfDvdMonoid.induction_on_irreducible with u hu z p hz hp ih
+ · contradiction
+ · exact ⟨1, 0, squarefree_one, one_dvd u, hu.dvd⟩
+ · obtain ⟨y, n, hy, hyx, hy'⟩ := ih hz
+ rcases n.eq_zero_or_pos with rfl | hn
+ · exact ⟨p, 1, hp.squarefree, dvd_mul_right p z, by simp [isUnit_of_dvd_one (pow_zero y ▸ hy')]⟩
+ by_cases hp' : p ∣ y
+ · exact ⟨y, n + 1, hy, dvd_mul_of_dvd_right hyx _,
+ mul_comm p z ▸ pow_succ' y n ▸ mul_dvd_mul hy' hp'⟩
+ · suffices Squarefree (p * y) from ⟨p * y, n, this,
+ mul_dvd_mul_left p hyx, mul_pow p y n ▸ mul_dvd_mul (dvd_pow_self p hn.ne') hy'⟩
+ exact squarefree_mul_iff.mpr ⟨hp.isRelPrime_iff_not_dvd.mpr hp', hp.squarefree, hy⟩
+
theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [DecidableEq R] {x : R}
(x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) := by
have drel : DecidableRel (Dvd.dvd : R → R → Prop) := by classical infer_instance
@@ -262,13 +319,6 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] [Decidabl
assumption_mod_cast
#align unique_factorization_monoid.squarefree_iff_nodup_normalized_factors UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors
-theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (h0 : n ≠ 0) :
- x ∣ y ^ n ↔ x ∣ y := by
- classical
- haveI := UniqueFactorizationMonoid.toGCDMonoid R
- exact ⟨hsq.isRadical n y, fun h => h.pow h0⟩
-#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
-
end UniqueFactorizationMonoid
namespace Int
Yet another small step toward Jordan-Chevalley-Dunford.
This was far more work than expected, partly because of missing API for Squarefree
, and partly because the definition IsCoprime
is the wrong concept for unique factorization domains.
@@ -85,6 +85,14 @@ theorem Squarefree.squarefree_of_dvd [CommMonoid R] {x y : R} (hdvd : x ∣ y) (
Squarefree x := fun _ h => hsq _ (h.trans hdvd)
#align squarefree.squarefree_of_dvd Squarefree.squarefree_of_dvd
+theorem Squarefree.eq_zero_or_one_of_pow_of_not_isUnit [CommMonoid R] {x : R} {n : ℕ}
+ (h : Squarefree (x ^ n)) (h' : ¬ IsUnit x) :
+ n = 0 ∨ n = 1 := by
+ contrapose! h'
+ replace h' : 2 ≤ n := by omega
+ have : x * x ∣ x ^ n := by rw [← sq]; exact pow_dvd_pow x h'
+ exact h.squarefree_of_dvd this x (refl _)
+
section SquarefreeGcdOfSquarefree
variable {α : Type*} [CancelCommMonoidWithZero α] [GCDMonoid α]
@@ -109,7 +109,7 @@ theorem squarefree_iff_multiplicity_le_one (r : R) :
Squarefree r ↔ ∀ x : R, multiplicity x r ≤ 1 ∨ IsUnit x := by
refine' forall_congr' fun a => _
rw [← sq, pow_dvd_iff_le_multiplicity, or_iff_not_imp_left, not_le, imp_congr _ Iff.rfl]
- rw [←one_add_one_eq_two]
+ rw [← one_add_one_eq_two]
simpa using PartENat.add_one_le_iff_lt (PartENat.natCast_ne_top 1)
#align multiplicity.squarefree_iff_multiplicity_le_one multiplicity.squarefree_iff_multiplicity_le_one
I've also got a change to make this required, but I'd like to land this first.
@@ -199,7 +199,7 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
And.right <|
(dvd_gcd_iff x x y).1
(by
- by_cases gcd x y = 0
+ by_cases h : gcd x y = 0
· rw [h]
apply dvd_zero
replace hy := ((dvd_gcd_iff x x _).2 ⟨dvd_rfl, hy⟩).trans gcd_pow_right_dvd_pow_gcd
MulZeroClass.
in mul_zero
/zero_mul
(#6682)
Search&replace MulZeroClass.mul_zero
-> mul_zero
, MulZeroClass.zero_mul
-> zero_mul
.
These were introduced by Mathport, as the full name of mul_zero
is actually MulZeroClass.mul_zero
(it's exported with the short name).
@@ -163,7 +163,7 @@ theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r
have : x ≠ 0 := by
rintro rfl
apply hr
- simpa only [zero_dvd_iff, MulZeroClass.mul_zero] using hx
+ simpa only [zero_dvd_iff, mul_zero] using hx
obtain ⟨j, hj₁, hj₂⟩ := WfDvdMonoid.exists_irreducible_factor i this
exact h _ hj₁ ((mul_dvd_mul hj₂ hj₂).trans hx)
#align irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -29,7 +29,7 @@ squarefree, multiplicity
-/
-variable {R : Type _}
+variable {R : Type*}
/-- An element of a monoid is squarefree if the only squares that
divide it are the squares of units. -/
@@ -87,7 +87,7 @@ theorem Squarefree.squarefree_of_dvd [CommMonoid R] {x y : R} (hdvd : x ∣ y) (
section SquarefreeGcdOfSquarefree
-variable {α : Type _} [CancelCommMonoidWithZero α] [GCDMonoid α]
+variable {α : Type*} [CancelCommMonoidWithZero α] [GCDMonoid α]
theorem Squarefree.gcd_right (a : α) {b : α} (hb : Squarefree b) : Squarefree (gcd a b) :=
hb.squarefree_of_dvd (gcd_dvd_right _ _)
@@ -2,14 +2,11 @@
Copyright (c) 2020 Aaron Anderson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
-
-! This file was ported from Lean 3 source module algebra.squarefree
-! leanprover-community/mathlib commit 00d163e35035c3577c1c79fa53b68de17781ffc1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.RingTheory.UniqueFactorizationDomain
+#align_import algebra.squarefree from "leanprover-community/mathlib"@"00d163e35035c3577c1c79fa53b68de17781ffc1"
+
/-!
# Squarefree elements of monoids
An element of a monoid is squarefree when it is not divisible by any squares
at
and goals (#5387)
Changes are of the form
some_tactic at h⊢
-> some_tactic at h ⊢
some_tactic at h
-> some_tactic at h
@@ -207,7 +207,7 @@ theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x :=
apply dvd_zero
replace hy := ((dvd_gcd_iff x x _).2 ⟨dvd_rfl, hy⟩).trans gcd_pow_right_dvd_pow_gcd
obtain ⟨z, hz⟩ := gcd_dvd_left x y
- nth_rw 1 [hz] at hy⊢
+ nth_rw 1 [hz] at hy ⊢
rw [pow_two, mul_dvd_mul_iff_left h] at hy
obtain ⟨w, hw⟩ := hy
exact (hx z ⟨w, by rwa [mul_right_comm, ← hw]⟩).mul_right_dvd.2 dvd_rfl)
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
! This file was ported from Lean 3 source module algebra.squarefree
-! leanprover-community/mathlib commit 79de90f7beca025f469dcda978ae655c4d985946
+! leanprover-community/mathlib commit 00d163e35035c3577c1c79fa53b68de17781ffc1
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -265,3 +265,18 @@ theorem dvd_pow_iff_dvd_of_squarefree {x y : R} {n : ℕ} (hsq : Squarefree x) (
#align unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree UniqueFactorizationMonoid.dvd_pow_iff_dvd_of_squarefree
end UniqueFactorizationMonoid
+
+namespace Int
+
+@[simp]
+theorem squarefree_natAbs {n : ℤ} : Squarefree n.natAbs ↔ Squarefree n := by
+ simp_rw [Squarefree, natAbs_surjective.forall, ← natAbs_mul, natAbs_dvd_natAbs,
+ isUnit_iff_natAbs_eq, Nat.isUnit_iff]
+#align int.squarefree_nat_abs Int.squarefree_natAbs
+
+@[simp]
+theorem squarefree_coe_nat {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n := by
+ rw [← squarefree_natAbs, natAbs_ofNat]
+#align int.squarefree_coe_nat Int.squarefree_coe_nat
+
+end Int
The unported dependencies are