data.nat.factorization.basicMathlib.Data.Nat.Factorization.Basic

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -867,7 +867,7 @@ theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
   by
   rcases eq_or_ne n 0 with (rfl | hn); · simp
   ext x
-  simp only [mem_Icc, Finset.mem_filter, mem_Ico, and_assoc', and_congr_right_iff,
+  simp only [mem_Icc, Finset.mem_filter, mem_Ico, and_assoc, and_congr_right_iff,
     pp.pow_dvd_iff_le_factorization hn, iff_and_self]
   exact fun H1 H2 => lt_of_le_of_lt H2 (factorization_lt p hn)
 #align nat.Icc_factorization_eq_pow_dvd Nat.Icc_factorization_eq_pow_dvd
Diff
@@ -316,7 +316,7 @@ theorem factorization_pow (n k : ℕ) : factorization (n ^ k) = k • n.factoriz
   by
   induction' k with k ih; · simp
   rcases eq_or_ne n 0 with (rfl | hn); · simp
-  rw [pow_succ, factorization_mul hn (pow_ne_zero _ hn), ih, succ_eq_one_add, add_smul, one_smul]
+  rw [pow_succ', factorization_mul hn (pow_ne_zero _ hn), ih, succ_eq_one_add, add_smul, one_smul]
 #align nat.factorization_pow Nat.factorization_pow
 -/
 
@@ -980,7 +980,7 @@ def recOnPrimePow {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1)
         exact hp.factorization_pos_of_dvd (Nat.succ_ne_zero _) (min_fac_dvd _)
       convert h ((k + 2) / p ^ t) p t hp _ _ _
       · rw [Nat.mul_div_cancel' hpt]
-      · rw [Nat.dvd_div_iff hpt, ← pow_succ', ht]
+      · rw [Nat.dvd_div_iff hpt, ← pow_succ, ht]
         exact pow_succ_factorization_not_dvd (k + 1).succ_ne_zero hp
       · exact htp
       · apply hk _ (Nat.div_lt_of_lt_mul _)
Diff
@@ -109,7 +109,7 @@ theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0)
 theorem factorization_prod_pow_eq_self {n : ℕ} (hn : n ≠ 0) : n.factorization.Prod pow = n :=
   by
   rw [factorization_eq_factors_multiset n]
-  simp only [← prod_to_multiset, factorization, Multiset.coe_prod, Multiset.toFinsupp_toMultiset]
+  simp only [← prod_to_multiset, factorization, Multiset.prod_coe, Multiset.toFinsupp_toMultiset]
   exact prod_factors hn
 #align nat.factorization_prod_pow_eq_self Nat.factorization_prod_pow_eq_self
 -/
@@ -242,7 +242,7 @@ theorem factorization_eq_zero_iff_remainder {p r : ℕ} (i : ℕ) (pp : p.Prime)
     ¬p ∣ r ↔ (p * i + r).factorization p = 0 :=
   by
   refine' ⟨factorization_eq_zero_of_remainder i, fun h => _⟩
-  rw [factorization_eq_zero_iff] at h 
+  rw [factorization_eq_zero_iff] at h
   contrapose! h
   refine' ⟨pp, _, _⟩
   · rwa [← Nat.dvd_add_iff_right (Dvd.intro i rfl)]
@@ -572,7 +572,7 @@ theorem factorization_prime_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0)
 theorem pow_succ_factorization_not_dvd {n p : ℕ} (hn : n ≠ 0) (hp : p.Prime) :
     ¬p ^ (n.factorization p + 1) ∣ n := by
   intro h
-  rw [← factorization_le_iff_dvd (pow_pos hp.pos _).ne' hn] at h 
+  rw [← factorization_le_iff_dvd (pow_pos hp.pos _).ne' hn] at h
   simpa [hp.factorization] using h p
 #align nat.pow_succ_factorization_not_dvd Nat.pow_succ_factorization_not_dvd
 -/
@@ -621,7 +621,7 @@ theorem exists_factorization_lt_of_lt {a b : ℕ} (ha : a ≠ 0) (hab : a < b) :
   by
   have hb : b ≠ 0 := (ha.bot_lt.trans hab).ne'
   contrapose! hab
-  rw [← Finsupp.le_def, factorization_le_iff_dvd hb ha] at hab 
+  rw [← Finsupp.le_def, factorization_le_iff_dvd hb ha] at hab
   exact le_of_dvd ha.bot_lt hab
 #align nat.exists_factorization_lt_of_lt Nat.exists_factorization_lt_of_lt
 -/
@@ -682,7 +682,7 @@ theorem factorization_ord_compl (n p : ℕ) :
 theorem dvd_ord_compl_of_dvd_not_dvd {p d n : ℕ} (hdn : d ∣ n) (hpd : ¬p ∣ d) :
     d ∣ ord_compl[p] n := by
   rcases eq_or_ne n 0 with (rfl | hn0); · simp
-  rcases eq_or_ne d 0 with (rfl | hd0); · simp at hpd ; cases hpd
+  rcases eq_or_ne d 0 with (rfl | hd0); · simp at hpd; cases hpd
   rw [← factorization_le_iff_dvd hd0 (ord_compl_pos p hn0).ne', factorization_ord_compl]
   intro q
   rcases eq_or_ne q p with (rfl | hqp)
@@ -715,7 +715,7 @@ theorem dvd_iff_div_factorization_eq_tsub {d n : ℕ} (hd : d ≠ 0) (hdn : d 
   by_contra h2
   cases' exists_factorization_lt_of_lt (mul_ne_zero h1 hd) (not_le.mp h2) with p hp
   rwa [factorization_mul h1 hd, add_apply, ← lt_tsub_iff_right, h, tsub_apply, lt_self_iff_false] at
-    hp 
+    hp
 #align nat.dvd_iff_div_factorization_eq_tsub Nat.dvd_iff_div_factorization_eq_tsub
 -/
 
@@ -817,7 +817,7 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
   · rw [← factorization_le_iff_dvd hd_pos hb_pos, h1]; exact inf_le_right
   · intro e hea heb
     rcases Decidable.eq_or_ne e 0 with (rfl | he_pos)
-    · simp only [zero_dvd_iff] at hea ; contradiction
+    · simp only [zero_dvd_iff] at hea; contradiction
     have hea' := (factorization_le_iff_dvd he_pos ha_pos).mpr hea
     have heb' := (factorization_le_iff_dvd he_pos hb_pos).mpr heb
     simp [← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
Diff
@@ -298,7 +298,14 @@ theorem prod_factorization_eq_prod_primeFactors {n : ℕ} {β : Type _} [CommMon
 the power of `p` in `S.prod g` equals the sum over `x ∈ S` of the powers of `p` in `g x`.
 Generalises `factorization_mul`, which is the special case where `S.card = 2` and `g = id`. -/
 theorem factorization_prod {α : Type _} {S : Finset α} {g : α → ℕ} (hS : ∀ x ∈ S, g x ≠ 0) :
-    (S.Prod g).factorization = S.Sum fun x => (g x).factorization := by classical
+    (S.Prod g).factorization = S.Sum fun x => (g x).factorization := by
+  classical
+  ext p
+  apply Finset.induction_on' S
+  · simp
+  · intro x T hxS hTS hxT IH
+    have hT : T.prod g ≠ 0 := prod_ne_zero_iff.mpr fun x hx => hS x (hTS hx)
+    simp [prod_insert hxT, sum_insert hxT, ← IH, factorization_mul (hS x hxS) hT]
 #align nat.factorization_prod Nat.factorization_prod
 -/
 
Diff
@@ -298,14 +298,7 @@ theorem prod_factorization_eq_prod_primeFactors {n : ℕ} {β : Type _} [CommMon
 the power of `p` in `S.prod g` equals the sum over `x ∈ S` of the powers of `p` in `g x`.
 Generalises `factorization_mul`, which is the special case where `S.card = 2` and `g = id`. -/
 theorem factorization_prod {α : Type _} {S : Finset α} {g : α → ℕ} (hS : ∀ x ∈ S, g x ≠ 0) :
-    (S.Prod g).factorization = S.Sum fun x => (g x).factorization := by
-  classical
-  ext p
-  apply Finset.induction_on' S
-  · simp
-  · intro x T hxS hTS hxT IH
-    have hT : T.prod g ≠ 0 := prod_ne_zero_iff.mpr fun x hx => hS x (hTS hx)
-    simp [prod_insert hxT, sum_insert hxT, ← IH, factorization_mul (hS x hxS) hT]
+    (S.Prod g).factorization = S.Sum fun x => (g x).factorization := by classical
 #align nat.factorization_prod Nat.factorization_prod
 -/
 
Diff
@@ -529,7 +529,7 @@ theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p
   by_cases pp : p.prime; swap; · simp [factorization_eq_zero_of_non_prime n pp]; exact hn.bot_lt
   rw [← pow_lt_iff_lt_right pp.two_le]
   apply lt_of_le_of_lt (ord_proj_le p hn)
-  exact lt_of_lt_of_le (lt_two_pow n) (pow_le_pow_of_le_left (by linarith) pp.two_le n)
+  exact lt_of_lt_of_le (lt_two_pow n) (pow_le_pow_left (by linarith) pp.two_le n)
 #align nat.factorization_lt Nat.factorization_lt
 -/
 
Diff
@@ -148,28 +148,28 @@ theorem support_factorization {n : ℕ} : n.factorization.support = n.factors.to
 #align nat.support_factorization Nat.support_factorization
 -/
 
-#print Nat.factor_iff_mem_factorization /-
-theorem factor_iff_mem_factorization {n p : ℕ} : p ∈ n.factorization.support ↔ p ∈ n.factors := by
-  simp only [support_factorization, List.mem_toFinset]
-#align nat.factor_iff_mem_factorization Nat.factor_iff_mem_factorization
+#print Nat.mem_primeFactors_iff_mem_factors /-
+theorem mem_primeFactors_iff_mem_factors {n p : ℕ} : p ∈ n.factorization.support ↔ p ∈ n.factors :=
+  by simp only [support_factorization, List.mem_toFinset]
+#align nat.factor_iff_mem_factorization Nat.mem_primeFactors_iff_mem_factors
 -/
 
-#print Nat.prime_of_mem_factorization /-
-theorem prime_of_mem_factorization {n p : ℕ} (hp : p ∈ n.factorization.support) : p.Prime :=
-  prime_of_mem_factors (factor_iff_mem_factorization.mp hp)
-#align nat.prime_of_mem_factorization Nat.prime_of_mem_factorization
+#print Nat.prime_of_mem_primeFactors /-
+theorem prime_of_mem_primeFactors {n p : ℕ} (hp : p ∈ n.factorization.support) : p.Prime :=
+  prime_of_mem_factors (mem_primeFactors_iff_mem_factors.mp hp)
+#align nat.prime_of_mem_factorization Nat.prime_of_mem_primeFactors
 -/
 
-#print Nat.pos_of_mem_factorization /-
-theorem pos_of_mem_factorization {n p : ℕ} (hp : p ∈ n.factorization.support) : 0 < p :=
-  Prime.pos (prime_of_mem_factorization hp)
-#align nat.pos_of_mem_factorization Nat.pos_of_mem_factorization
+#print Nat.pos_of_mem_primeFactors /-
+theorem pos_of_mem_primeFactors {n p : ℕ} (hp : p ∈ n.factorization.support) : 0 < p :=
+  Prime.pos (prime_of_mem_primeFactors hp)
+#align nat.pos_of_mem_factorization Nat.pos_of_mem_primeFactors
 -/
 
-#print Nat.le_of_mem_factorization /-
-theorem le_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support) : p ≤ n :=
-  le_of_mem_factors (factor_iff_mem_factorization.mp h)
-#align nat.le_of_mem_factorization Nat.le_of_mem_factorization
+#print Nat.le_of_mem_primeFactors /-
+theorem le_of_mem_primeFactors {n p : ℕ} (h : p ∈ n.factorization.support) : p ≤ n :=
+  le_of_mem_factors (mem_primeFactors_iff_mem_factors.mp h)
+#align nat.le_of_mem_factorization Nat.le_of_mem_primeFactors
 -/
 
 /-! ## Lemmas characterising when `n.factorization p = 0` -/
@@ -200,7 +200,7 @@ theorem factorization_eq_zero_of_not_dvd {n p : ℕ} (h : ¬p ∣ n) : n.factori
 
 #print Nat.factorization_eq_zero_of_lt /-
 theorem factorization_eq_zero_of_lt {n p : ℕ} (h : n < p) : n.factorization p = 0 :=
-  Finsupp.not_mem_support_iff.mp (mt le_of_mem_factorization (not_le_of_lt h))
+  Finsupp.not_mem_support_iff.mp (mt le_of_mem_primeFactors (not_le_of_lt h))
 #align nat.factorization_eq_zero_of_lt Nat.factorization_eq_zero_of_lt
 -/
 
@@ -220,7 +220,7 @@ theorem factorization_one_right (n : ℕ) : n.factorization 1 = 0 :=
 
 #print Nat.dvd_of_factorization_pos /-
 theorem dvd_of_factorization_pos {n p : ℕ} (hn : n.factorization p ≠ 0) : p ∣ n :=
-  dvd_of_mem_factors (factor_iff_mem_factorization.1 (mem_support_iff.2 hn))
+  dvd_of_mem_factors (mem_primeFactors_iff_mem_factors.1 (mem_support_iff.2 hn))
 #align nat.dvd_of_factorization_pos Nat.dvd_of_factorization_pos
 -/
 
@@ -272,23 +272,25 @@ theorem factorization_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
 #align nat.factorization_mul Nat.factorization_mul
 -/
 
-#print Nat.factorization_mul_support /-
-theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
+/- warning: nat.factorization_mul_support clashes with nat.factors_mul_to_finset -> Nat.primeFactors_mul
+Case conversion may be inaccurate. Consider using '#align nat.factorization_mul_support Nat.primeFactors_mulₓ'. -/
+#print Nat.primeFactors_mul /-
+theorem primeFactors_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
   by
   ext q
   simp only [Finset.mem_union, factor_iff_mem_factorization]
   exact mem_factors_mul ha hb
-#align nat.factorization_mul_support Nat.factorization_mul_support
+#align nat.factorization_mul_support Nat.primeFactors_mul
 -/
 
-#print Nat.prod_factorization_eq_prod_factors /-
+#print Nat.prod_factorization_eq_prod_primeFactors /-
 /-- If a product over `n.factorization` doesn't use the multiplicities of the prime factors
 then it's equal to the corresponding product over `n.factors.to_finset` -/
-theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid β] (f : ℕ → β) :
+theorem prod_factorization_eq_prod_primeFactors {n : ℕ} {β : Type _} [CommMonoid β] (f : ℕ → β) :
     (n.factorization.Prod fun p k => f p) = ∏ p in n.factors.toFinset, f p := by
   apply prod_congr support_factorization; simp
-#align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_factors
+#align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_primeFactors
 -/
 
 #print Nat.factorization_prod /-
@@ -390,7 +392,7 @@ theorem eq_factorization_iff {n : ℕ} {f : ℕ →₀ ℕ} (hn : n ≠ 0) (hf :
 /-- The equiv between `ℕ+` and `ℕ →₀ ℕ` with support in the primes. -/
 def factorizationEquiv : ℕ+ ≃ {f : ℕ →₀ ℕ | ∀ p ∈ f.support, Prime p}
     where
-  toFun := fun ⟨n, hn⟩ => ⟨n.factorization, fun _ => prime_of_mem_factorization⟩
+  toFun := fun ⟨n, hn⟩ => ⟨n.factorization, fun _ => prime_of_mem_primeFactors⟩
   invFun := fun ⟨f, hf⟩ =>
     ⟨f.Prod pow, prod_pow_pos_of_zero_not_mem_support fun H => not_prime_zero (hf 0 H)⟩
   left_inv := fun ⟨x, hx⟩ => Subtype.ext <| factorization_prod_pow_eq_self hx.Ne.symm
@@ -512,12 +514,12 @@ theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * or
 /-! ### Factorization and divisibility -/
 
 
-#print Nat.dvd_of_mem_factorization /-
-theorem dvd_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support) : p ∣ n :=
+#print Nat.dvd_of_mem_primeFactors /-
+theorem dvd_of_mem_primeFactors {n p : ℕ} (h : p ∈ n.factorization.support) : p ∣ n :=
   by
   rcases eq_or_ne n 0 with (rfl | hn); · simp
   simp [← mem_factors_iff_dvd hn (prime_of_mem_factorization h), factor_iff_mem_factorization.mp h]
-#align nat.dvd_of_mem_factorization Nat.dvd_of_mem_factorization
+#align nat.dvd_of_mem_factorization Nat.dvd_of_mem_primeFactors
 -/
 
 #print Nat.factorization_lt /-
@@ -788,12 +790,12 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ p k : ℕ, Prime
 #align nat.dvd_iff_prime_pow_dvd_dvd Nat.dvd_iff_prime_pow_dvd_dvd
 -/
 
-#print Nat.prod_prime_factors_dvd /-
-theorem prod_prime_factors_dvd (n : ℕ) : ∏ p : ℕ in n.factors.toFinset, p ∣ n :=
+#print Nat.prod_primeFactors_dvd /-
+theorem prod_primeFactors_dvd (n : ℕ) : ∏ p : ℕ in n.factors.toFinset, p ∣ n :=
   by
   by_cases hn : n = 0; · subst hn; simp
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
-#align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvd
+#align nat.prod_prime_factors_dvd Nat.prod_primeFactors_dvd
 -/
 
 #print Nat.factorization_gcd /-
@@ -833,9 +835,10 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
 #align nat.factorization_lcm Nat.factorization_lcm
 -/
 
-#print Nat.prod_factors_gcd_mul_prod_factors_mul /-
+#print Nat.prod_primeFactors_gcd_mul_prod_primeFactors_mul /-
 @[to_additive sum_factors_gcd_add_sum_factors_mul]
-theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
+theorem prod_primeFactors_gcd_mul_prod_primeFactors_mul {β : Type _} [CommMonoid β] (m n : ℕ)
+    (f : ℕ → β) :
     (m.gcd n).factors.toFinset.Prod f * (m * n).factors.toFinset.Prod f =
       m.factors.toFinset.Prod f * n.factors.toFinset.Prod f :=
   by
@@ -845,8 +848,8 @@ theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n
   congr
   · apply factors_mul_to_finset <;> assumption
   · simp only [← support_factorization, factorization_gcd hn0 hm0, Finsupp.support_inf]
-#align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_factors_gcd_mul_prod_factors_mul
-#align nat.sum_factors_gcd_add_sum_factors_mul Nat.sum_factors_gcd_add_sum_factors_mul
+#align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_primeFactors_gcd_mul_prod_primeFactors_mul
+#align nat.sum_factors_gcd_add_sum_factors_mul Nat.sum_primeFactors_gcd_add_sum_primeFactors_mul
 -/
 
 #print Nat.setOf_pow_dvd_eq_Icc_factorization /-
@@ -930,23 +933,25 @@ theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : Coprime a b) (hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 -/
 
-#print Nat.factorization_disjoint_of_coprime /-
+#print Nat.Coprime.disjoint_primeFactors /-
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
-theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : Coprime a b) :
+theorem Nat.Coprime.disjoint_primeFactors {a b : ℕ} (hab : Coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
   simpa only [support_factorization] using
     disjoint_to_finset_iff_disjoint.mpr (coprime_factors_disjoint hab)
-#align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
+#align nat.factorization_disjoint_of_coprime Nat.Coprime.disjoint_primeFactors
 -/
 
-#print Nat.factorization_mul_support_of_coprime /-
+/- warning: nat.factorization_mul_support_of_coprime clashes with nat.factors_mul_to_finset -> Nat.primeFactors_mul
+Case conversion may be inaccurate. Consider using '#align nat.factorization_mul_support_of_coprime Nat.primeFactors_mulₓ'. -/
+#print Nat.primeFactors_mul /-
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
-theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : Coprime a b) :
+theorem primeFactors_mul {a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
   by
   rw [factorization_mul_of_coprime hab]
   exact support_add_eq (factorization_disjoint_of_coprime hab)
-#align nat.factorization_mul_support_of_coprime Nat.factorization_mul_support_of_coprime
+#align nat.factorization_mul_support_of_coprime Nat.primeFactors_mul
 -/
 
 /-! ### Induction principles involving factorizations -/
Diff
@@ -58,8 +58,8 @@ def factorization (n : ℕ) : ℕ →₀ ℕ
   toFun p := if p.Prime then padicValNat p n else 0
   mem_support_toFun := by
     rcases eq_or_ne n 0 with (rfl | hn0); · simp
-    simp only [mem_factors hn0, mem_to_finset, Ne.def, ite_eq_right_iff, not_forall, exists_prop,
-      and_congr_right_iff]
+    simp only [mem_factors hn0, mem_to_finset, Ne.def, ite_eq_right_iff, Classical.not_forall,
+      exists_prop, and_congr_right_iff]
     rintro p hp
     haveI := fact_iff.mpr hp
     exact dvd_iff_padicValNat_ne_zero hn0
@@ -778,7 +778,7 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ p k : ℕ, Prime
   by
   rcases eq_or_ne n 0 with (rfl | hn); · simp
   rcases eq_or_ne d 0 with (rfl | hd)
-  · simp only [zero_dvd_iff, hn, false_iff_iff, not_forall]
+  · simp only [zero_dvd_iff, hn, false_iff_iff, Classical.not_forall]
     exact ⟨2, n, prime_two, dvd_zero _, mt (le_of_dvd hn.bot_lt) (lt_two_pow n).not_le⟩
   refine' ⟨fun h p k _ hpkd => dvd_trans hpkd h, _⟩
   rw [← factorization_prime_le_iff_dvd hd hn]
Diff
@@ -3,12 +3,12 @@ Copyright (c) 2021 Stuart Presnell. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Stuart Presnell
 -/
-import Mathbin.Algebra.BigOperators.Finsupp
-import Mathbin.Data.Finsupp.Multiset
-import Mathbin.Data.Nat.PrimeFin
-import Mathbin.NumberTheory.Padics.PadicVal
-import Mathbin.Data.Nat.Interval
-import Mathbin.Tactic.IntervalCases
+import Algebra.BigOperators.Finsupp
+import Data.Finsupp.Multiset
+import Data.Nat.PrimeFin
+import NumberTheory.Padics.PadicVal
+import Data.Nat.Interval
+import Tactic.IntervalCases
 
 #align_import data.nat.factorization.basic from "leanprover-community/mathlib"@"31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0"
 
Diff
@@ -655,7 +655,7 @@ theorem not_dvd_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : ¬p ∣ or
 -/
 
 #print Nat.coprime_ord_compl /-
-theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : coprime p (ord_compl[p] n) :=
+theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : Coprime p (ord_compl[p] n) :=
   (or_iff_left (not_dvd_ord_compl hp hn)).mp <| coprime_or_dvd_of_prime hp _
 #align nat.coprime_ord_compl Nat.coprime_ord_compl
 -/
@@ -894,7 +894,7 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
 
 #print Nat.factorization_mul_apply_of_coprime /-
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization p = a.factorization p + b.factorization p := by
   simp only [← factors_count_eq, perm_iff_count.mp (perm_factors_mul_of_coprime hab), count_append]
 #align nat.factorization_mul_apply_of_coprime Nat.factorization_mul_apply_of_coprime
@@ -902,7 +902,7 @@ theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : coprime a b) :
 
 #print Nat.factorization_mul_of_coprime /-
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_of_coprime {a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization = a.factorization + b.factorization :=
   by
   ext q
@@ -913,7 +913,7 @@ theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
 #print Nat.factorization_eq_of_coprime_left /-
 /-- If `p` is a prime factor of `a` then the power of `p` in `a` is the same that in `a * b`,
 for any `b` coprime to `a`. -/
-theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa : p ∈ a.factors) :
+theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : Coprime a b) (hpa : p ∈ a.factors) :
     (a * b).factorization p = a.factorization p :=
   by
   rw [factorization_mul_apply_of_coprime hab, ← factors_count_eq, ← factors_count_eq]
@@ -924,7 +924,7 @@ theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa
 #print Nat.factorization_eq_of_coprime_right /-
 /-- If `p` is a prime factor of `b` then the power of `p` in `b` is the same that in `a * b`,
 for any `a` coprime to `b`. -/
-theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb : p ∈ b.factors) :
+theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : Coprime a b) (hpb : p ∈ b.factors) :
     (a * b).factorization p = b.factorization p := by rw [mul_comm];
   exact factorization_eq_of_coprime_left (coprime_comm.mp hab) hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
@@ -932,7 +932,7 @@ theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb
 
 #print Nat.factorization_disjoint_of_coprime /-
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
-theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : Coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
   simpa only [support_factorization] using
     disjoint_to_finset_iff_disjoint.mpr (coprime_factors_disjoint hab)
@@ -941,7 +941,7 @@ theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
 
 #print Nat.factorization_mul_support_of_coprime /-
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
-theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
   by
   rw [factorization_mul_of_coprime hab]
@@ -988,7 +988,7 @@ def recOnPrimePow {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1)
 `P b` to `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPosPrimePosCoprime {P : ℕ → Sort _} (hp : ∀ p n : ℕ, Prime p → 0 < n → P (p ^ n))
-    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) :
+    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) :
     ∀ a, P a :=
   recOnPrimePow h0 h1 <| by
     intro a p n hp' hpa hn hPa
@@ -1007,7 +1007,7 @@ def recOnPosPrimePosCoprime {P : ℕ → Sort _} (hp : ∀ p n : ℕ, Prime p 
 `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPrimeCoprime {P : ℕ → Sort _} (h0 : P 0) (hp : ∀ p n : ℕ, Prime p → P (p ^ n))
-    (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
+    (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
   recOnPosPrimePosCoprime (fun p n h _ => hp p n h) h0 (hp 2 0 prime_two) h
 #align nat.rec_on_prime_coprime Nat.recOnPrimeCoprime
 -/
@@ -1030,7 +1030,7 @@ def recOnMul {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p →
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
     ∀ {n : ℕ}, n ≠ 0 → f n = n.factorization.Prod fun p k => f (p ^ k) :=
   by
   apply Nat.recOnPosPrimePosCoprime
@@ -1048,7 +1048,7 @@ theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ →
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
     ∀ {n : ℕ}, f n = n.factorization.Prod fun p k => f (p ^ k) :=
   by
   apply Nat.recOnPosPrimePosCoprime
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Stuart Presnell. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Stuart Presnell
-
-! This file was ported from Lean 3 source module data.nat.factorization.basic
-! leanprover-community/mathlib commit 31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.BigOperators.Finsupp
 import Mathbin.Data.Finsupp.Multiset
@@ -15,6 +10,8 @@ import Mathbin.NumberTheory.Padics.PadicVal
 import Mathbin.Data.Nat.Interval
 import Mathbin.Tactic.IntervalCases
 
+#align_import data.nat.factorization.basic from "leanprover-community/mathlib"@"31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0"
+
 /-!
 # Prime factorizations
 
Diff
@@ -91,14 +91,18 @@ theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p :=
 #align nat.factors_count_eq Nat.factors_count_eq
 -/
 
+#print Nat.factorization_eq_factors_multiset /-
 theorem factorization_eq_factors_multiset (n : ℕ) :
     n.factorization = (n.factors : Multiset ℕ).toFinsupp := by ext p; simp
 #align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multiset
+-/
 
+#print Nat.multiplicity_eq_factorization /-
 theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
     multiplicity p n = n.factorization p := by
   simp [factorization, pp, padicValNat_def' pp.ne_one hn.bot_lt]
 #align nat.multiplicity_eq_factorization Nat.multiplicity_eq_factorization
+-/
 
 /-! ### Basic facts about factorization -/
 
@@ -139,11 +143,13 @@ theorem factorization_one : factorization 1 = 0 := by simpa [factorization]
 #align nat.factorization_one Nat.factorization_one
 -/
 
+#print Nat.support_factorization /-
 /-- The support of `n.factorization` is exactly `n.factors.to_finset` -/
 @[simp]
 theorem support_factorization {n : ℕ} : n.factorization.support = n.factors.toFinset := by
   simp [factorization]
 #align nat.support_factorization Nat.support_factorization
+-/
 
 #print Nat.factor_iff_mem_factorization /-
 theorem factor_iff_mem_factorization {n p : ℕ} : p ∈ n.factorization.support ↔ p ∈ n.factors := by
@@ -269,6 +275,7 @@ theorem factorization_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
 #align nat.factorization_mul Nat.factorization_mul
 -/
 
+#print Nat.factorization_mul_support /-
 theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
   by
@@ -276,13 +283,16 @@ theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   simp only [Finset.mem_union, factor_iff_mem_factorization]
   exact mem_factors_mul ha hb
 #align nat.factorization_mul_support Nat.factorization_mul_support
+-/
 
+#print Nat.prod_factorization_eq_prod_factors /-
 /-- If a product over `n.factorization` doesn't use the multiplicities of the prime factors
 then it's equal to the corresponding product over `n.factors.to_finset` -/
 theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid β] (f : ℕ → β) :
     (n.factorization.Prod fun p k => f p) = ∏ p in n.factors.toFinset, f p := by
   apply prod_congr support_factorization; simp
 #align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_factors
+-/
 
 #print Nat.factorization_prod /-
 /-- For any `p : ℕ` and any function `g : α → ℕ` that's non-zero on `S : finset α`,
@@ -413,10 +423,8 @@ complementary projection. The term `n.factorization p` is the $p$-adic order its
 For example, `ord_proj[2] n` is the even part of `n` and `ord_compl[2] n` is the odd part. -/
 
 
--- mathport name: «exprord_proj[ ] »
 notation "ord_proj[" p "] " n:arg => p ^ Nat.factorization n p
 
--- mathport name: «exprord_compl[ ] »
 notation "ord_compl[" p "] " n:arg => n / ord_proj[p] n
 
 #print Nat.ord_proj_of_not_prime /-
@@ -783,12 +791,15 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ p k : ℕ, Prime
 #align nat.dvd_iff_prime_pow_dvd_dvd Nat.dvd_iff_prime_pow_dvd_dvd
 -/
 
+#print Nat.prod_prime_factors_dvd /-
 theorem prod_prime_factors_dvd (n : ℕ) : ∏ p : ℕ in n.factors.toFinset, p ∣ n :=
   by
   by_cases hn : n = 0; · subst hn; simp
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
 #align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvd
+-/
 
+#print Nat.factorization_gcd /-
 theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     (gcd a b).factorization = a.factorization ⊓ b.factorization :=
   by
@@ -812,7 +823,9 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     have heb' := (factorization_le_iff_dvd he_pos hb_pos).mpr heb
     simp [← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
 #align nat.factorization_gcd Nat.factorization_gcd
+-/
 
+#print Nat.factorization_lcm /-
 theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     (a.lcm b).factorization = a.factorization ⊔ b.factorization :=
   by
@@ -821,7 +834,9 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     factorization_gcd ha hb, factorization_mul ha hb]
   ext1; exact (min_add_max _ _).symm
 #align nat.factorization_lcm Nat.factorization_lcm
+-/
 
+#print Nat.prod_factors_gcd_mul_prod_factors_mul /-
 @[to_additive sum_factors_gcd_add_sum_factors_mul]
 theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
     (m.gcd n).factors.toFinset.Prod f * (m * n).factors.toFinset.Prod f =
@@ -835,6 +850,7 @@ theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n
   · simp only [← support_factorization, factorization_gcd hn0 hm0, Finsupp.support_inf]
 #align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_factors_gcd_mul_prod_factors_mul
 #align nat.sum_factors_gcd_add_sum_factors_mul Nat.sum_factors_gcd_add_sum_factors_mul
+-/
 
 #print Nat.setOf_pow_dvd_eq_Icc_factorization /-
 theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
@@ -843,6 +859,7 @@ theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n 
 #align nat.set_of_pow_dvd_eq_Icc_factorization Nat.setOf_pow_dvd_eq_Icc_factorization
 -/
 
+#print Nat.Icc_factorization_eq_pow_dvd /-
 /-- The set of positive powers of prime `p` that divide `n` is exactly the set of
 positive natural numbers up to `n.factorization p`. -/
 theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
@@ -854,12 +871,16 @@ theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
     pp.pow_dvd_iff_le_factorization hn, iff_and_self]
   exact fun H1 H2 => lt_of_le_of_lt H2 (factorization_lt p hn)
 #align nat.Icc_factorization_eq_pow_dvd Nat.Icc_factorization_eq_pow_dvd
+-/
 
+#print Nat.factorization_eq_card_pow_dvd /-
 theorem factorization_eq_card_pow_dvd (n : ℕ) {p : ℕ} (pp : p.Prime) :
     n.factorization p = ((Ico 1 n).filterₓ fun i => p ^ i ∣ n).card := by
   simp [← Icc_factorization_eq_pow_dvd n pp]
 #align nat.factorization_eq_card_pow_dvd Nat.factorization_eq_card_pow_dvd
+-/
 
+#print Nat.Ico_filter_pow_dvd_eq /-
 theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb : n ≤ p ^ b) :
     ((Ico 1 n).filterₓ fun i => p ^ i ∣ n) = (Icc 1 b).filterₓ fun i => p ^ i ∣ n :=
   by
@@ -869,6 +890,7 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
   simp [lt_of_pow_dvd_right hn pp.two_le h1,
     (pow_le_iff_le_right pp.two_le).1 ((le_of_dvd hn.bot_lt h1).trans hb)]
 #align nat.Ico_filter_pow_dvd_eq Nat.Ico_filter_pow_dvd_eq
+-/
 
 /-! ### Factorization and coprimes -/
 
@@ -911,13 +933,16 @@ theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 -/
 
+#print Nat.factorization_disjoint_of_coprime /-
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
 theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
   simpa only [support_factorization] using
     disjoint_to_finset_iff_disjoint.mpr (coprime_factors_disjoint hab)
 #align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
+-/
 
+#print Nat.factorization_mul_support_of_coprime /-
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
 theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
@@ -925,6 +950,7 @@ theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
   rw [factorization_mul_of_coprime hab]
   exact support_add_eq (factorization_disjoint_of_coprime hab)
 #align nat.factorization_mul_support_of_coprime Nat.factorization_mul_support_of_coprime
+-/
 
 /-! ### Induction principles involving factorizations -/
 
@@ -1003,6 +1029,7 @@ def recOnMul {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p →
 #align nat.rec_on_mul Nat.recOnMul
 -/
 
+#print Nat.multiplicative_factorization /-
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ → β)
@@ -1018,7 +1045,9 @@ theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ →
       factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
     convert factorization_disjoint_of_coprime hab
 #align nat.multiplicative_factorization Nat.multiplicative_factorization
+-/
 
+#print Nat.multiplicative_factorization' /-
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ → β)
@@ -1033,6 +1062,7 @@ theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ →
     rw [h_mult a b hab, ha, hb, factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
     convert factorization_disjoint_of_coprime hab
 #align nat.multiplicative_factorization' Nat.multiplicative_factorization'
+-/
 
 #print Nat.eq_iff_prime_padicValNat_eq /-
 /-- Two positive naturals are equal if their prime padic valuations are equal -/
@@ -1073,6 +1103,7 @@ theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n <
 /-! ### Lemmas about factorizations of particular functions -/
 
 
+#print Nat.card_multiples /-
 -- TODO: Port lemmas from `data/nat/multiplicity` to here, re-written in terms of `factorization`
 /-- Exactly `n / p` naturals in `[1, n]` are multiples of `p`. -/
 theorem card_multiples (n p : ℕ) : card ((Finset.range n).filterₓ fun e => p ∣ e + 1) = n / p :=
@@ -1081,7 +1112,9 @@ theorem card_multiples (n p : ℕ) : card ((Finset.range n).filterₓ fun e => p
   simp [Nat.succ_div, add_ite, add_zero, Finset.range_succ, filter_insert, apply_ite card,
     card_insert_of_not_mem, hn]
 #align nat.card_multiples Nat.card_multiples
+-/
 
+#print Nat.Ioc_filter_dvd_card_eq_div /-
 /-- Exactly `n / p` naturals in `(0, n]` are multiples of `p`. -/
 theorem Ioc_filter_dvd_card_eq_div (n p : ℕ) : ((Ioc 0 n).filterₓ fun x => p ∣ x).card = n / p :=
   by
@@ -1094,6 +1127,7 @@ theorem Ioc_filter_dvd_card_eq_div (n p : ℕ) : ((Ioc 0 n).filterₓ fun x => p
   simp [Nat.succ_div, add_ite, add_zero, h1, filter_insert, apply_ite card, card_insert_eq_ite, IH,
     Finset.mem_filter, mem_Ioc, not_le.2 (lt_add_one n)]
 #align nat.Ioc_filter_dvd_card_eq_div Nat.Ioc_filter_dvd_card_eq_div
+-/
 
 end Nat
 
Diff
@@ -783,7 +783,7 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ p k : ℕ, Prime
 #align nat.dvd_iff_prime_pow_dvd_dvd Nat.dvd_iff_prime_pow_dvd_dvd
 -/
 
-theorem prod_prime_factors_dvd (n : ℕ) : (∏ p : ℕ in n.factors.toFinset, p) ∣ n :=
+theorem prod_prime_factors_dvd (n : ℕ) : ∏ p : ℕ in n.factors.toFinset, p ∣ n :=
   by
   by_cases hn : n = 0; · subst hn; simp
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
@@ -1051,7 +1051,7 @@ theorem eq_iff_prime_padicValNat_eq (a b : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
 
 #print Nat.prod_pow_prime_padicValNat /-
 theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n < m) :
-    (∏ p in Finset.filter Nat.Prime (Finset.range m), p ^ padicValNat p n) = n :=
+    ∏ p in Finset.filter Nat.Prime (Finset.range m), p ^ padicValNat p n = n :=
   by
   nth_rw_rhs 1 [← factorization_prod_pow_eq_self hn]
   rw [eq_comm]
Diff
@@ -122,7 +122,7 @@ theorem eq_of_factorization_eq {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0)
 
 #print Nat.factorization_inj /-
 /-- Every nonzero natural number has a unique prime factorization -/
-theorem factorization_inj : Set.InjOn factorization { x : ℕ | x ≠ 0 } := fun a ha b hb h =>
+theorem factorization_inj : Set.InjOn factorization {x : ℕ | x ≠ 0} := fun a ha b hb h =>
   eq_of_factorization_eq ha hb fun p => by simp [h]
 #align nat.factorization_inj Nat.factorization_inj
 -/
@@ -291,12 +291,12 @@ Generalises `factorization_mul`, which is the special case where `S.card = 2` an
 theorem factorization_prod {α : Type _} {S : Finset α} {g : α → ℕ} (hS : ∀ x ∈ S, g x ≠ 0) :
     (S.Prod g).factorization = S.Sum fun x => (g x).factorization := by
   classical
-    ext p
-    apply Finset.induction_on' S
-    · simp
-    · intro x T hxS hTS hxT IH
-      have hT : T.prod g ≠ 0 := prod_ne_zero_iff.mpr fun x hx => hS x (hTS hx)
-      simp [prod_insert hxT, sum_insert hxT, ← IH, factorization_mul (hS x hxS) hT]
+  ext p
+  apply Finset.induction_on' S
+  · simp
+  · intro x T hxS hTS hxT IH
+    have hT : T.prod g ≠ 0 := prod_ne_zero_iff.mpr fun x hx => hS x (hTS hx)
+    simp [prod_insert hxT, sum_insert hxT, ← IH, factorization_mul (hS x hxS) hT]
 #align nat.factorization_prod Nat.factorization_prod
 -/
 
@@ -381,7 +381,7 @@ theorem eq_factorization_iff {n : ℕ} {f : ℕ →₀ ℕ} (hn : n ≠ 0) (hf :
 
 #print Nat.factorizationEquiv /-
 /-- The equiv between `ℕ+` and `ℕ →₀ ℕ` with support in the primes. -/
-def factorizationEquiv : ℕ+ ≃ { f : ℕ →₀ ℕ | ∀ p ∈ f.support, Prime p }
+def factorizationEquiv : ℕ+ ≃ {f : ℕ →₀ ℕ | ∀ p ∈ f.support, Prime p}
     where
   toFun := fun ⟨n, hn⟩ => ⟨n.factorization, fun _ => prime_of_mem_factorization⟩
   invFun := fun ⟨f, hf⟩ =>
@@ -838,7 +838,7 @@ theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n
 
 #print Nat.setOf_pow_dvd_eq_Icc_factorization /-
 theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
-    { i : ℕ | i ≠ 0 ∧ p ^ i ∣ n } = Set.Icc 1 (n.factorization p) := by ext;
+    {i : ℕ | i ≠ 0 ∧ p ^ i ∣ n} = Set.Icc 1 (n.factorization p) := by ext;
   simp [lt_succ_iff, one_le_iff_ne_zero, pp.pow_dvd_iff_le_factorization hn]
 #align nat.set_of_pow_dvd_eq_Icc_factorization Nat.setOf_pow_dvd_eq_Icc_factorization
 -/
Diff
@@ -239,7 +239,7 @@ theorem factorization_eq_zero_iff_remainder {p r : ℕ} (i : ℕ) (pp : p.Prime)
     ¬p ∣ r ↔ (p * i + r).factorization p = 0 :=
   by
   refine' ⟨factorization_eq_zero_of_remainder i, fun h => _⟩
-  rw [factorization_eq_zero_iff] at h
+  rw [factorization_eq_zero_iff] at h 
   contrapose! h
   refine' ⟨pp, _, _⟩
   · rwa [← Nat.dvd_add_iff_right (Dvd.intro i rfl)]
@@ -565,7 +565,7 @@ theorem factorization_prime_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0)
 theorem pow_succ_factorization_not_dvd {n p : ℕ} (hn : n ≠ 0) (hp : p.Prime) :
     ¬p ^ (n.factorization p + 1) ∣ n := by
   intro h
-  rw [← factorization_le_iff_dvd (pow_pos hp.pos _).ne' hn] at h
+  rw [← factorization_le_iff_dvd (pow_pos hp.pos _).ne' hn] at h 
   simpa [hp.factorization] using h p
 #align nat.pow_succ_factorization_not_dvd Nat.pow_succ_factorization_not_dvd
 -/
@@ -614,7 +614,7 @@ theorem exists_factorization_lt_of_lt {a b : ℕ} (ha : a ≠ 0) (hab : a < b) :
   by
   have hb : b ≠ 0 := (ha.bot_lt.trans hab).ne'
   contrapose! hab
-  rw [← Finsupp.le_def, factorization_le_iff_dvd hb ha] at hab
+  rw [← Finsupp.le_def, factorization_le_iff_dvd hb ha] at hab 
   exact le_of_dvd ha.bot_lt hab
 #align nat.exists_factorization_lt_of_lt Nat.exists_factorization_lt_of_lt
 -/
@@ -675,7 +675,7 @@ theorem factorization_ord_compl (n p : ℕ) :
 theorem dvd_ord_compl_of_dvd_not_dvd {p d n : ℕ} (hdn : d ∣ n) (hpd : ¬p ∣ d) :
     d ∣ ord_compl[p] n := by
   rcases eq_or_ne n 0 with (rfl | hn0); · simp
-  rcases eq_or_ne d 0 with (rfl | hd0); · simp at hpd; cases hpd
+  rcases eq_or_ne d 0 with (rfl | hd0); · simp at hpd ; cases hpd
   rw [← factorization_le_iff_dvd hd0 (ord_compl_pos p hn0).ne', factorization_ord_compl]
   intro q
   rcases eq_or_ne q p with (rfl | hqp)
@@ -708,7 +708,7 @@ theorem dvd_iff_div_factorization_eq_tsub {d n : ℕ} (hd : d ≠ 0) (hdn : d 
   by_contra h2
   cases' exists_factorization_lt_of_lt (mul_ne_zero h1 hd) (not_le.mp h2) with p hp
   rwa [factorization_mul h1 hd, add_apply, ← lt_tsub_iff_right, h, tsub_apply, lt_self_iff_false] at
-    hp
+    hp 
 #align nat.dvd_iff_div_factorization_eq_tsub Nat.dvd_iff_div_factorization_eq_tsub
 -/
 
@@ -807,7 +807,7 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
   · rw [← factorization_le_iff_dvd hd_pos hb_pos, h1]; exact inf_le_right
   · intro e hea heb
     rcases Decidable.eq_or_ne e 0 with (rfl | he_pos)
-    · simp only [zero_dvd_iff] at hea; contradiction
+    · simp only [zero_dvd_iff] at hea ; contradiction
     have hea' := (factorization_le_iff_dvd he_pos ha_pos).mpr hea
     have heb' := (factorization_le_iff_dvd he_pos hb_pos).mpr heb
     simp [← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
Diff
@@ -48,7 +48,7 @@ with a normalization function, and then deduplicated.  The basics of this have b
 
 open Nat Finset List Finsupp
 
-open BigOperators
+open scoped BigOperators
 
 namespace Nat
 
Diff
@@ -91,22 +91,10 @@ theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p :=
 #align nat.factors_count_eq Nat.factors_count_eq
 -/
 
-/- warning: nat.factorization_eq_factors_multiset -> Nat.factorization_eq_factors_multiset is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) (coeFn.{1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (Multiset.{0} Nat) -> (Finsupp.{0, 0} Nat Nat Nat.hasZero)) (AddEquiv.hasCoeToFun.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.toFinsupp.{0} Nat) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (List.{0} Nat) (Multiset.{0} Nat) (HasLiftT.mk.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (CoeTCₓ.coe.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (coeBase.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (Multiset.hasCoe.{0} Nat)))) (Nat.factors n)))
-but is expected to have type
-  forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) (FunLike.coe.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (fun (_x : Multiset.{0} Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Multiset.{0} Nat) => Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (EquivLike.toEmbeddingLike.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddEquivClass.toEquivLike.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddEquiv.instAddEquivClassAddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))))) (Multiset.toFinsupp.{0} Nat) (Multiset.ofList.{0} Nat (Nat.factors n)))
-Case conversion may be inaccurate. Consider using '#align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multisetₓ'. -/
 theorem factorization_eq_factors_multiset (n : ℕ) :
     n.factorization = (n.factors : Multiset ℕ).toFinsupp := by ext p; simp
 #align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multiset
 
-/- warning: nat.multiplicity_eq_factorization -> Nat.multiplicity_eq_factorization is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {p : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} PartENat (multiplicity.{0} Nat Nat.monoid (fun (a : Nat) (b : Nat) => Nat.decidableDvd a b) p n) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat PartENat (HasLiftT.mk.{1, 1} Nat PartENat (CoeTCₓ.coe.{1, 1} Nat PartENat (Nat.castCoe.{0} PartENat (AddMonoidWithOne.toNatCast.{0} PartENat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} PartENat PartENat.addCommMonoidWithOne))))) (coeFn.{1, 1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (fun (_x : Finsupp.{0, 0} Nat Nat Nat.hasZero) => Nat -> Nat) (Finsupp.coeFun.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) p)))
-but is expected to have type
-  forall {n : Nat} {p : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} PartENat (multiplicity.{0} Nat Nat.monoid (fun (a : Nat) (b : Nat) => Nat.decidable_dvd a b) p n) (Nat.cast.{0} PartENat (AddMonoidWithOne.toNatCast.{0} PartENat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} PartENat PartENat.instAddCommMonoidWithOnePartENat)) (FunLike.coe.{1, 1, 1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) _x) (Finsupp.funLike.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) p)))
-Case conversion may be inaccurate. Consider using '#align nat.multiplicity_eq_factorization Nat.multiplicity_eq_factorizationₓ'. -/
 theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
     multiplicity p n = n.factorization p := by
   simp [factorization, pp, padicValNat_def' pp.ne_one hn.bot_lt]
@@ -151,12 +139,6 @@ theorem factorization_one : factorization 1 = 0 := by simpa [factorization]
 #align nat.factorization_one Nat.factorization_one
 -/
 
-/- warning: nat.support_factorization -> Nat.support_factorization is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat}, Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization n)) (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n))
-but is expected to have type
-  forall {n : Nat}, Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization n)) (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n))
-Case conversion may be inaccurate. Consider using '#align nat.support_factorization Nat.support_factorizationₓ'. -/
 /-- The support of `n.factorization` is exactly `n.factors.to_finset` -/
 @[simp]
 theorem support_factorization {n : ℕ} : n.factorization.support = n.factors.toFinset := by
@@ -287,12 +269,6 @@ theorem factorization_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
 #align nat.factorization_mul Nat.factorization_mul
 -/
 
-/- warning: nat.factorization_mul_support -> Nat.factorization_mul_support is a dubious translation:
-lean 3 declaration is
-  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.hasUnion.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization b))))
-but is expected to have type
-  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.instUnionFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization b))))
-Case conversion may be inaccurate. Consider using '#align nat.factorization_mul_support Nat.factorization_mul_supportₓ'. -/
 theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
   by
@@ -301,12 +277,6 @@ theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   exact mem_factors_mul ha hb
 #align nat.factorization_mul_support Nat.factorization_mul_support
 
-/- warning: nat.prod_factorization_eq_prod_factors -> Nat.prod_factorization_eq_prod_factors is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), Eq.{succ u1} β (Finsupp.prod.{0, 0, u1} Nat Nat β Nat.hasZero _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f p)) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n)) (fun (p : Nat) => f p))
-but is expected to have type
-  forall {n : Nat} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), Eq.{succ u1} β (Finsupp.prod.{0, 0, u1} Nat Nat β (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f p)) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n)) (fun (p : Nat) => f p))
-Case conversion may be inaccurate. Consider using '#align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_factorsₓ'. -/
 /-- If a product over `n.factorization` doesn't use the multiplicities of the prime factors
 then it's equal to the corresponding product over `n.factors.to_finset` -/
 theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid β] (f : ℕ → β) :
@@ -813,24 +783,12 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ p k : ℕ, Prime
 #align nat.dvd_iff_prime_pow_dvd_dvd Nat.dvd_iff_prime_pow_dvd_dvd
 -/
 
-/- warning: nat.prod_prime_factors_dvd -> Nat.prod_prime_factors_dvd is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat), Dvd.Dvd.{0} Nat Nat.hasDvd (Finset.prod.{0, 0} Nat Nat Nat.commMonoid (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n)) (fun (p : Nat) => p)) n
-but is expected to have type
-  forall (n : Nat), Dvd.dvd.{0} Nat Nat.instDvdNat (Finset.prod.{0, 0} Nat Nat Nat.commMonoid (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n)) (fun (p : Nat) => p)) n
-Case conversion may be inaccurate. Consider using '#align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvdₓ'. -/
 theorem prod_prime_factors_dvd (n : ℕ) : (∏ p : ℕ in n.factors.toFinset, p) ∣ n :=
   by
   by_cases hn : n = 0; · subst hn; simp
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
 #align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvd
 
-/- warning: nat.factorization_gcd -> Nat.factorization_gcd is a dubious translation:
-lean 3 declaration is
-  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization (Nat.gcd a b)) (Inf.inf.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (SemilatticeInf.toHasInf.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Finsupp.semilatticeInf.{0, 0} Nat Nat Nat.hasZero (Lattice.toSemilatticeInf.{0} Nat Nat.lattice))) (Nat.factorization a) (Nat.factorization b)))
-but is expected to have type
-  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization (Nat.gcd a b)) (Inf.inf.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Lattice.toInf.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Finsupp.lattice.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) Nat.instLatticeNat)) (Nat.factorization a) (Nat.factorization b)))
-Case conversion may be inaccurate. Consider using '#align nat.factorization_gcd Nat.factorization_gcdₓ'. -/
 theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     (gcd a b).factorization = a.factorization ⊓ b.factorization :=
   by
@@ -855,12 +813,6 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     simp [← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
 #align nat.factorization_gcd Nat.factorization_gcd
 
-/- warning: nat.factorization_lcm -> Nat.factorization_lcm is a dubious translation:
-lean 3 declaration is
-  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization (Nat.lcm a b)) (Sup.sup.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (SemilatticeSup.toHasSup.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Finsupp.semilatticeSup.{0, 0} Nat Nat Nat.hasZero (CanonicallyLinearOrderedAddMonoid.semilatticeSup.{0} Nat Nat.canonicallyLinearOrderedAddMonoid))) (Nat.factorization a) (Nat.factorization b)))
-but is expected to have type
-  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization (Nat.lcm a b)) (Sup.sup.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (SemilatticeSup.toSup.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Finsupp.semilatticeSup.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Lattice.toSemilatticeSup.{0} Nat Nat.instLatticeNat))) (Nat.factorization a) (Nat.factorization b)))
-Case conversion may be inaccurate. Consider using '#align nat.factorization_lcm Nat.factorization_lcmₓ'. -/
 theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     (a.lcm b).factorization = a.factorization ⊔ b.factorization :=
   by
@@ -870,12 +822,6 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   ext1; exact (min_add_max _ _).symm
 #align nat.factorization_lcm Nat.factorization_lcm
 
-/- warning: nat.prod_factors_gcd_mul_prod_factors_mul -> Nat.prod_factors_gcd_mul_prod_factors_mul is a dubious translation:
-lean 3 declaration is
-  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (m : Nat) (n : Nat) (f : Nat -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors (Nat.gcd m n))) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) m n))) f)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors m)) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n)) f))
-but is expected to have type
-  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (m : Nat) (n : Nat) (f : Nat -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors (Nat.gcd m n))) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) m n))) f)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors m)) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n)) f))
-Case conversion may be inaccurate. Consider using '#align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_factors_gcd_mul_prod_factors_mulₓ'. -/
 @[to_additive sum_factors_gcd_add_sum_factors_mul]
 theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
     (m.gcd n).factors.toFinset.Prod f * (m * n).factors.toFinset.Prod f =
@@ -897,12 +843,6 @@ theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n 
 #align nat.set_of_pow_dvd_eq_Icc_factorization Nat.setOf_pow_dvd_eq_Icc_factorization
 -/
 
-/- warning: nat.Icc_factorization_eq_pow_dvd -> Nat.Icc_factorization_eq_pow_dvd is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} (Finset.{0} Nat) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (coeFn.{1, 1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (fun (_x : Finsupp.{0, 0} Nat Nat Nat.hasZero) => Nat -> Nat) (Finsupp.coeFun.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) p)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) n)))
-but is expected to have type
-  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} (Finset.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p)) (Finset.Icc.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) (StrictOrderedSemiring.toPartialOrder.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) 1 (instOfNatNat 1)) (FunLike.coe.{1, 1, 1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) _x) (Finsupp.funLike.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) p)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) n)))
-Case conversion may be inaccurate. Consider using '#align nat.Icc_factorization_eq_pow_dvd Nat.Icc_factorization_eq_pow_dvdₓ'. -/
 /-- The set of positive powers of prime `p` that divide `n` is exactly the set of
 positive natural numbers up to `n.factorization p`. -/
 theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
@@ -915,23 +855,11 @@ theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
   exact fun H1 H2 => lt_of_le_of_lt H2 (factorization_lt p hn)
 #align nat.Icc_factorization_eq_pow_dvd Nat.Icc_factorization_eq_pow_dvd
 
-/- warning: nat.factorization_eq_card_pow_dvd -> Nat.factorization_eq_card_pow_dvd is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} Nat (coeFn.{1, 1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (fun (_x : Finsupp.{0, 0} Nat Nat Nat.hasZero) => Nat -> Nat) (Finsupp.coeFun.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) p) (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) n))))
-but is expected to have type
-  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) (FunLike.coe.{1, 1, 1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) _x) (Finsupp.funLike.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) p) (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) n))))
-Case conversion may be inaccurate. Consider using '#align nat.factorization_eq_card_pow_dvd Nat.factorization_eq_card_pow_dvdₓ'. -/
 theorem factorization_eq_card_pow_dvd (n : ℕ) {p : ℕ} (pp : p.Prime) :
     n.factorization p = ((Ico 1 n).filterₓ fun i => p ^ i ∣ n).card := by
   simp [← Icc_factorization_eq_pow_dvd n pp]
 #align nat.factorization_eq_card_pow_dvd Nat.factorization_eq_card_pow_dvd
 
-/- warning: nat.Ico_filter_pow_dvd_eq -> Nat.Ico_filter_pow_dvd_eq is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {p : Nat} {b : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (LE.le.{0} Nat Nat.hasLe n (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p b)) -> (Eq.{1} (Finset.{0} Nat) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) n)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) b)))
-but is expected to have type
-  forall {n : Nat} {p : Nat} {b : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (LE.le.{0} Nat instLENat n (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p b)) -> (Eq.{1} (Finset.{0} Nat) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) n)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b)))
-Case conversion may be inaccurate. Consider using '#align nat.Ico_filter_pow_dvd_eq Nat.Ico_filter_pow_dvd_eqₓ'. -/
 theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb : n ≤ p ^ b) :
     ((Ico 1 n).filterₓ fun i => p ^ i ∣ n) = (Icc 1 b).filterₓ fun i => p ^ i ∣ n :=
   by
@@ -983,12 +911,6 @@ theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 -/
 
-/- warning: nat.factorization_disjoint_of_coprime -> Nat.factorization_disjoint_of_coprime is a dubious translation:
-lean 3 declaration is
-  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Disjoint.{0} (Finset.{0} Nat) (Finset.partialOrder.{0} Nat) (Finset.orderBot.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization b)))
-but is expected to have type
-  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Disjoint.{0} (Finset.{0} Nat) (Finset.partialOrder.{0} Nat) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization b)))
-Case conversion may be inaccurate. Consider using '#align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprimeₓ'. -/
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
 theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
@@ -996,12 +918,6 @@ theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
     disjoint_to_finset_iff_disjoint.mpr (coprime_factors_disjoint hab)
 #align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
 
-/- warning: nat.factorization_mul_support_of_coprime -> Nat.factorization_mul_support_of_coprime is a dubious translation:
-lean 3 declaration is
-  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.hasUnion.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization b))))
-but is expected to have type
-  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.instUnionFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization b))))
-Case conversion may be inaccurate. Consider using '#align nat.factorization_mul_support_of_coprime Nat.factorization_mul_support_of_coprimeₓ'. -/
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
 theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
@@ -1087,12 +1003,6 @@ def recOnMul {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p →
 #align nat.rec_on_mul Nat.recOnMul
 -/
 
-/- warning: nat.multiplicative_factorization -> Nat.multiplicative_factorization is a dubious translation:
-lean 3 declaration is
-  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (forall {n : Nat}, (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β Nat.hasZero _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p k)))))
-but is expected to have type
-  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (forall {n : Nat}, (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p k)))))
-Case conversion may be inaccurate. Consider using '#align nat.multiplicative_factorization Nat.multiplicative_factorizationₓ'. -/
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ → β)
@@ -1109,12 +1019,6 @@ theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ →
     convert factorization_disjoint_of_coprime hab
 #align nat.multiplicative_factorization Nat.multiplicative_factorization
 
-/- warning: nat.multiplicative_factorization' -> Nat.multiplicative_factorization' is a dubious translation:
-lean 3 declaration is
-  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (forall {n : Nat}, Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β Nat.hasZero _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p k))))
-but is expected to have type
-  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (forall {n : Nat}, Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p k))))
-Case conversion may be inaccurate. Consider using '#align nat.multiplicative_factorization' Nat.multiplicative_factorization'ₓ'. -/
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ → β)
@@ -1169,12 +1073,6 @@ theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n <
 /-! ### Lemmas about factorizations of particular functions -/
 
 
-/- warning: nat.card_multiples -> Nat.card_multiples is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (e : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) e (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (a : Nat) => Nat.decidableDvd p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) a (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Finset.range n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.hasDiv) n p)
-but is expected to have type
-  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (e : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) e (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (a : Nat) => Nat.decidable_dvd p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) a (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Finset.range n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.instDivNat) n p)
-Case conversion may be inaccurate. Consider using '#align nat.card_multiples Nat.card_multiplesₓ'. -/
 -- TODO: Port lemmas from `data/nat/multiplicity` to here, re-written in terms of `factorization`
 /-- Exactly `n / p` naturals in `[1, n]` are multiples of `p`. -/
 theorem card_multiples (n p : ℕ) : card ((Finset.range n).filterₓ fun e => p ∣ e + 1) = n / p :=
@@ -1184,12 +1082,6 @@ theorem card_multiples (n p : ℕ) : card ((Finset.range n).filterₓ fun e => p
     card_insert_of_not_mem, hn]
 #align nat.card_multiples Nat.card_multiples
 
-/- warning: nat.Ioc_filter_dvd_card_eq_div -> Nat.Ioc_filter_dvd_card_eq_div is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (x : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd p x) (fun (a : Nat) => Nat.decidableDvd p a) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.hasDiv) n p)
-but is expected to have type
-  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (x : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat p x) (fun (a : Nat) => Nat.decidable_dvd p a) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.instDivNat) n p)
-Case conversion may be inaccurate. Consider using '#align nat.Ioc_filter_dvd_card_eq_div Nat.Ioc_filter_dvd_card_eq_divₓ'. -/
 /-- Exactly `n / p` naturals in `(0, n]` are multiples of `p`. -/
 theorem Ioc_filter_dvd_card_eq_div (n p : ℕ) : ((Ioc 0 n).filterₓ fun x => p ∣ x).card = n / p :=
   by
Diff
@@ -83,8 +83,7 @@ theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p :=
   by
   rcases n.eq_zero_or_pos with (rfl | hn0); · simp [factorization]
   by_cases pp : p.prime; swap
-  · rw [count_eq_zero_of_not_mem (mt prime_of_mem_factors pp)]
-    simp [factorization, pp]
+  · rw [count_eq_zero_of_not_mem (mt prime_of_mem_factors pp)]; simp [factorization, pp]
   simp only [factorization, coe_mk, pp, if_true]
   rw [← PartENat.natCast_inj, padicValNat_def' pp.ne_one hn0,
     UniqueFactorizationMonoid.multiplicity_eq_count_normalizedFactors pp hn0.ne']
@@ -99,10 +98,7 @@ but is expected to have type
   forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) (FunLike.coe.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (fun (_x : Multiset.{0} Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Multiset.{0} Nat) => Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (EquivLike.toEmbeddingLike.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddEquivClass.toEquivLike.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddEquiv.instAddEquivClassAddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))))) (Multiset.toFinsupp.{0} Nat) (Multiset.ofList.{0} Nat (Nat.factors n)))
 Case conversion may be inaccurate. Consider using '#align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multisetₓ'. -/
 theorem factorization_eq_factors_multiset (n : ℕ) :
-    n.factorization = (n.factors : Multiset ℕ).toFinsupp :=
-  by
-  ext p
-  simp
+    n.factorization = (n.factors : Multiset ℕ).toFinsupp := by ext p; simp
 #align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multiset
 
 /- warning: nat.multiplicity_eq_factorization -> Nat.multiplicity_eq_factorization is a dubious translation:
@@ -251,9 +247,7 @@ theorem Prime.factorization_pos_of_dvd {n p : ℕ} (hp : p.Prime) (hn : n ≠ 0)
 
 #print Nat.factorization_eq_zero_of_remainder /-
 theorem factorization_eq_zero_of_remainder {p r : ℕ} (i : ℕ) (hr : ¬p ∣ r) :
-    (p * i + r).factorization p = 0 :=
-  by
-  apply factorization_eq_zero_of_not_dvd
+    (p * i + r).factorization p = 0 := by apply factorization_eq_zero_of_not_dvd;
   rwa [← Nat.dvd_add_iff_right (Dvd.intro i rfl)]
 #align nat.factorization_eq_zero_of_remainder Nat.factorization_eq_zero_of_remainder
 -/
@@ -267,8 +261,7 @@ theorem factorization_eq_zero_iff_remainder {p r : ℕ} (i : ℕ) (pp : p.Prime)
   contrapose! h
   refine' ⟨pp, _, _⟩
   · rwa [← Nat.dvd_add_iff_right (Dvd.intro i rfl)]
-  · contrapose! hr0
-    exact (_root_.add_eq_zero_iff.mp hr0).2
+  · contrapose! hr0; exact (_root_.add_eq_zero_iff.mp hr0).2
 #align nat.factorization_eq_zero_iff_remainder Nat.factorization_eq_zero_iff_remainder
 -/
 
@@ -288,9 +281,7 @@ theorem factorization_eq_zero_iff' (n : ℕ) : n.factorization = 0 ↔ n = 0 ∨
 /-- For nonzero `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
 @[simp]
 theorem factorization_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
-    (a * b).factorization = a.factorization + b.factorization :=
-  by
-  ext p
+    (a * b).factorization = a.factorization + b.factorization := by ext p;
   simp only [add_apply, ← factors_count_eq, perm_iff_count.mp (perm_factors_mul ha hb) p,
     count_append]
 #align nat.factorization_mul Nat.factorization_mul
@@ -319,10 +310,8 @@ Case conversion may be inaccurate. Consider using '#align nat.prod_factorization
 /-- If a product over `n.factorization` doesn't use the multiplicities of the prime factors
 then it's equal to the corresponding product over `n.factors.to_finset` -/
 theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid β] (f : ℕ → β) :
-    (n.factorization.Prod fun p k => f p) = ∏ p in n.factors.toFinset, f p :=
-  by
-  apply prod_congr support_factorization
-  simp
+    (n.factorization.Prod fun p k => f p) = ∏ p in n.factors.toFinset, f p := by
+  apply prod_congr support_factorization; simp
 #align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_factors
 
 #print Nat.factorization_prod /-
@@ -383,10 +372,8 @@ theorem Prime.factorization_pow {p k : ℕ} (hp : Prime p) : factorization (p ^
 #print Nat.eq_pow_of_factorization_eq_single /-
 /-- If the factorization of `n` contains just one number `p` then `n` is a power of `p` -/
 theorem eq_pow_of_factorization_eq_single {n p k : ℕ} (hn : n ≠ 0)
-    (h : n.factorization = Finsupp.single p k) : n = p ^ k :=
-  by
-  rw [← Nat.factorization_prod_pow_eq_self hn, h]
-  simp
+    (h : n.factorization = Finsupp.single p k) : n = p ^ k := by
+  rw [← Nat.factorization_prod_pow_eq_self hn, h]; simp
 #align nat.eq_pow_of_factorization_eq_single Nat.eq_pow_of_factorization_eq_single
 -/
 
@@ -435,10 +422,8 @@ def factorizationEquiv : ℕ+ ≃ { f : ℕ →₀ ℕ | ∀ p ∈ f.support, Pr
 -/
 
 #print Nat.factorizationEquiv_apply /-
-theorem factorizationEquiv_apply (n : ℕ+) : (factorizationEquiv n).1 = n.1.factorization :=
-  by
-  cases n
-  rfl
+theorem factorizationEquiv_apply (n : ℕ+) : (factorizationEquiv n).1 = n.1.factorization := by
+  cases n; rfl
 #align nat.factorization_equiv_apply Nat.factorizationEquiv_apply
 -/
 
@@ -564,9 +549,7 @@ theorem dvd_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support)
 /-- A crude upper bound on `n.factorization p` -/
 theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p < n :=
   by
-  by_cases pp : p.prime; swap;
-  · simp [factorization_eq_zero_of_non_prime n pp]
-    exact hn.bot_lt
+  by_cases pp : p.prime; swap; · simp [factorization_eq_zero_of_non_prime n pp]; exact hn.bot_lt
   rw [← pow_lt_iff_lt_right pp.two_le]
   apply lt_of_le_of_lt (ord_proj_le p hn)
   exact lt_of_lt_of_le (lt_two_pow n) (pow_le_pow_of_le_left (by linarith) pp.two_le n)
@@ -594,9 +577,7 @@ theorem factorization_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
     use K.prod pow
     rw [← factorization_prod_pow_eq_self hn, ← factorization_prod_pow_eq_self hd, ←
       Finsupp.prod_add_index' pow_zero pow_add, hK, add_tsub_cancel_of_le hdn]
-  · rintro ⟨c, rfl⟩
-    rw [factorization_mul hd (right_ne_zero_of_mul hn)]
-    simp
+  · rintro ⟨c, rfl⟩; rw [factorization_mul hd (right_ne_zero_of_mul hn)]; simp
 #align nat.factorization_le_iff_dvd Nat.factorization_le_iff_dvd
 -/
 
@@ -631,9 +612,7 @@ theorem factorization_le_factorization_mul_left {a b : ℕ} (hb : b ≠ 0) :
 
 #print Nat.factorization_le_factorization_mul_right /-
 theorem factorization_le_factorization_mul_right {a b : ℕ} (ha : a ≠ 0) :
-    b.factorization ≤ (a * b).factorization :=
-  by
-  rw [mul_comm]
+    b.factorization ≤ (a * b).factorization := by rw [mul_comm];
   apply factorization_le_factorization_mul_left ha
 #align nat.factorization_le_factorization_mul_right Nat.factorization_le_factorization_mul_right
 -/
@@ -726,9 +705,7 @@ theorem factorization_ord_compl (n p : ℕ) :
 theorem dvd_ord_compl_of_dvd_not_dvd {p d n : ℕ} (hdn : d ∣ n) (hpd : ¬p ∣ d) :
     d ∣ ord_compl[p] n := by
   rcases eq_or_ne n 0 with (rfl | hn0); · simp
-  rcases eq_or_ne d 0 with (rfl | hd0);
-  · simp at hpd
-    cases hpd
+  rcases eq_or_ne d 0 with (rfl | hd0); · simp at hpd; cases hpd
   rw [← factorization_le_iff_dvd hd0 (ord_compl_pos p hn0).ne', factorization_ord_compl]
   intro q
   rcases eq_or_ne q p with (rfl | hqp)
@@ -844,9 +821,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvdₓ'. -/
 theorem prod_prime_factors_dvd (n : ℕ) : (∏ p : ℕ in n.factors.toFinset, p) ∣ n :=
   by
-  by_cases hn : n = 0;
-  · subst hn
-    simp
+  by_cases hn : n = 0; · subst hn; simp
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
 #align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvd
 
@@ -870,14 +845,11 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
   have hd_pos : d ≠ 0 := (factorization_equiv.inv_fun ⟨dfac, dfac_prime⟩).2.Ne.symm
   suffices d = gcd a b by rwa [← this]
   apply gcd_greatest
-  · rw [← factorization_le_iff_dvd hd_pos ha_pos, h1]
-    exact inf_le_left
-  · rw [← factorization_le_iff_dvd hd_pos hb_pos, h1]
-    exact inf_le_right
+  · rw [← factorization_le_iff_dvd hd_pos ha_pos, h1]; exact inf_le_left
+  · rw [← factorization_le_iff_dvd hd_pos hb_pos, h1]; exact inf_le_right
   · intro e hea heb
     rcases Decidable.eq_or_ne e 0 with (rfl | he_pos)
-    · simp only [zero_dvd_iff] at hea
-      contradiction
+    · simp only [zero_dvd_iff] at hea; contradiction
     have hea' := (factorization_le_iff_dvd he_pos ha_pos).mpr hea
     have heb' := (factorization_le_iff_dvd he_pos hb_pos).mpr heb
     simp [← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
@@ -920,9 +892,7 @@ theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n
 
 #print Nat.setOf_pow_dvd_eq_Icc_factorization /-
 theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
-    { i : ℕ | i ≠ 0 ∧ p ^ i ∣ n } = Set.Icc 1 (n.factorization p) :=
-  by
-  ext
+    { i : ℕ | i ≠ 0 ∧ p ^ i ∣ n } = Set.Icc 1 (n.factorization p) := by ext;
   simp [lt_succ_iff, one_le_iff_ne_zero, pp.pow_dvd_iff_le_factorization hn]
 #align nat.set_of_pow_dvd_eq_Icc_factorization Nat.setOf_pow_dvd_eq_Icc_factorization
 -/
@@ -1008,9 +978,7 @@ theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa
 /-- If `p` is a prime factor of `b` then the power of `p` in `b` is the same that in `a * b`,
 for any `a` coprime to `b`. -/
 theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb : p ∈ b.factors) :
-    (a * b).factorization p = b.factorization p :=
-  by
-  rw [mul_comm]
+    (a * b).factorization p = b.factorization p := by rw [mul_comm];
   exact factorization_eq_of_coprime_left (coprime_comm.mp hab) hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 -/
@@ -1063,11 +1031,8 @@ def recOnPrimePow {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1)
       -- to use the `factorization` API
       let t := (k + 2).factors.count p
       have ht : t = (k + 2).factorization p := factors_count_eq
-      have hpt : p ^ t ∣ k + 2 := by
-        rw [ht]
-        exact ord_proj_dvd _ _
-      have htp : 0 < t := by
-        rw [ht]
+      have hpt : p ^ t ∣ k + 2 := by rw [ht]; exact ord_proj_dvd _ _
+      have htp : 0 < t := by rw [ht];
         exact hp.factorization_pos_of_dvd (Nat.succ_ne_zero _) (min_fac_dvd _)
       convert h ((k + 2) / p ^ t) p t hp _ _ _
       · rw [Nat.mul_div_cancel' hpt]
@@ -1135,12 +1100,9 @@ theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ →
     ∀ {n : ℕ}, n ≠ 0 → f n = n.factorization.Prod fun p k => f (p ^ k) :=
   by
   apply Nat.recOnPosPrimePosCoprime
-  · intro p k hp hk hpk
-    simp [prime.factorization_pow hp, Finsupp.prod_single_index _, hf]
+  · intro p k hp hk hpk; simp [prime.factorization_pow hp, Finsupp.prod_single_index _, hf]
   · simp
-  · rintro -
-    rw [factorization_one, hf]
-    simp
+  · rintro -; rw [factorization_one, hf]; simp
   · intro a b _ _ hab ha hb hab_pos
     rw [h_mult a b hab, ha (left_ne_zero_of_mul hab_pos), hb (right_ne_zero_of_mul hab_pos),
       factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
@@ -1160,13 +1122,9 @@ theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ →
     ∀ {n : ℕ}, f n = n.factorization.Prod fun p k => f (p ^ k) :=
   by
   apply Nat.recOnPosPrimePosCoprime
-  · intro p k hp hk
-    simp only [hp.factorization_pow]
-    rw [prod_single_index _]
-    simp [hf1]
+  · intro p k hp hk; simp only [hp.factorization_pow]; rw [prod_single_index _]; simp [hf1]
   · simp [hf0]
-  · rw [factorization_one, hf1]
-    simp
+  · rw [factorization_one, hf1]; simp
   · intro a b _ _ hab ha hb
     rw [h_mult a b hab, ha, hb, factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
     convert factorization_disjoint_of_coprime hab
@@ -1178,8 +1136,7 @@ theorem eq_iff_prime_padicValNat_eq (a b : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
     a = b ↔ ∀ p : ℕ, p.Prime → padicValNat p a = padicValNat p b :=
   by
   constructor
-  · rintro rfl
-    simp
+  · rintro rfl; simp
   · intro h
     refine' eq_of_factorization_eq ha hb fun p => _
     by_cases pp : p.prime
@@ -1236,13 +1193,11 @@ Case conversion may be inaccurate. Consider using '#align nat.Ioc_filter_dvd_car
 /-- Exactly `n / p` naturals in `(0, n]` are multiples of `p`. -/
 theorem Ioc_filter_dvd_card_eq_div (n p : ℕ) : ((Ioc 0 n).filterₓ fun x => p ∣ x).card = n / p :=
   by
-  induction' n with n IH
-  · simp
+  induction' n with n IH; · simp
   -- TODO: Golf away `h1` after Yaël PRs a lemma asserting this
   have h1 : Ioc 0 n.succ = insert n.succ (Ioc 0 n) :=
     by
-    rcases n.eq_zero_or_pos with (rfl | hn)
-    · simp
+    rcases n.eq_zero_or_pos with (rfl | hn); · simp
     simp_rw [← Ico_succ_succ, Ico_insert_right (succ_le_succ hn.le), Ico_succ_right]
   simp [Nat.succ_div, add_ite, add_zero, h1, filter_insert, apply_ite card, card_insert_eq_ite, IH,
     Finset.mem_filter, mem_Ioc, not_le.2 (lt_add_one n)]
Diff
@@ -96,7 +96,7 @@ theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p :=
 lean 3 declaration is
   forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) (coeFn.{1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (Multiset.{0} Nat) -> (Finsupp.{0, 0} Nat Nat Nat.hasZero)) (AddEquiv.hasCoeToFun.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.toFinsupp.{0} Nat) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (List.{0} Nat) (Multiset.{0} Nat) (HasLiftT.mk.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (CoeTCₓ.coe.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (coeBase.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (Multiset.hasCoe.{0} Nat)))) (Nat.factors n)))
 but is expected to have type
-  forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) (FunLike.coe.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (fun (_x : Multiset.{0} Nat) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{0} Nat) => Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) _x) (AddHomClass.toFunLike.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddZeroClass.toAdd.{0} (Multiset.{0} Nat) (AddMonoid.toAddZeroClass.{0} (Multiset.{0} Nat) (AddRightCancelMonoid.toAddMonoid.{0} (Multiset.{0} Nat) (AddCancelMonoid.toAddRightCancelMonoid.{0} (Multiset.{0} Nat) (AddCancelCommMonoid.toAddCancelMonoid.{0} (Multiset.{0} Nat) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} (Multiset.{0} Nat) (Multiset.instOrderedCancelAddCommMonoidMultiset.{0} Nat))))))) (AddZeroClass.toAdd.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Finsupp.addZeroClass.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (AddMonoidHomClass.toAddHomClass.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddMonoid.toAddZeroClass.{0} (Multiset.{0} Nat) (AddRightCancelMonoid.toAddMonoid.{0} (Multiset.{0} Nat) (AddCancelMonoid.toAddRightCancelMonoid.{0} (Multiset.{0} Nat) (AddCancelCommMonoid.toAddCancelMonoid.{0} (Multiset.{0} Nat) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} (Multiset.{0} Nat) (Multiset.instOrderedCancelAddCommMonoidMultiset.{0} Nat)))))) (Finsupp.addZeroClass.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddEquivClass.instAddMonoidHomClass.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddMonoid.toAddZeroClass.{0} (Multiset.{0} Nat) (AddRightCancelMonoid.toAddMonoid.{0} (Multiset.{0} Nat) (AddCancelMonoid.toAddRightCancelMonoid.{0} (Multiset.{0} Nat) (AddCancelCommMonoid.toAddCancelMonoid.{0} (Multiset.{0} Nat) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} (Multiset.{0} Nat) (Multiset.instOrderedCancelAddCommMonoidMultiset.{0} Nat)))))) (Finsupp.addZeroClass.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddEquiv.instAddEquivClassAddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))))) (Multiset.toFinsupp.{0} Nat) (Multiset.ofList.{0} Nat (Nat.factors n)))
+  forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) (FunLike.coe.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (fun (_x : Multiset.{0} Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Multiset.{0} Nat) => Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (EquivLike.toEmbeddingLike.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddEquivClass.toEquivLike.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddEquiv.instAddEquivClassAddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))))) (Multiset.toFinsupp.{0} Nat) (Multiset.ofList.{0} Nat (Nat.factors n)))
 Case conversion may be inaccurate. Consider using '#align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multisetₓ'. -/
 theorem factorization_eq_factors_multiset (n : ℕ) :
     n.factorization = (n.factors : Multiset ℕ).toFinsupp :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Stuart Presnell
 
 ! This file was ported from Lean 3 source module data.nat.factorization.basic
-! leanprover-community/mathlib commit f694c7dead66f5d4c80f446c796a5aad14707f0e
+! leanprover-community/mathlib commit 31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -18,6 +18,9 @@ import Mathbin.Tactic.IntervalCases
 /-!
 # Prime factorizations
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
  `n.factorization` is the finitely supported function `ℕ →₀ ℕ`
  mapping each prime factor of `n` to its multiplicity in `n`.  For example, since 2000 = 2^4 * 5^3,
   * `factorization 2000 2` is 4
Diff
@@ -49,6 +49,7 @@ open BigOperators
 
 namespace Nat
 
+#print Nat.factorization /-
 /-- `n.factorization` is the finitely supported function `ℕ →₀ ℕ`
  mapping each prime factor of `n` to its multiplicity in `n`. -/
 def factorization (n : ℕ) : ℕ →₀ ℕ
@@ -63,11 +64,15 @@ def factorization (n : ℕ) : ℕ →₀ ℕ
     haveI := fact_iff.mpr hp
     exact dvd_iff_padicValNat_ne_zero hn0
 #align nat.factorization Nat.factorization
+-/
 
+#print Nat.factorization_def /-
 theorem factorization_def (n : ℕ) {p : ℕ} (pp : p.Prime) : n.factorization p = padicValNat p n := by
   simpa [factorization] using absurd pp
 #align nat.factorization_def Nat.factorization_def
+-/
 
+#print Nat.factors_count_eq /-
 /-- We can write both `n.factorization p` and `n.factors.count p` to represent the power
 of `p` in the factorization of `n`: we declare the former to be the simp-normal form. -/
 @[simp]
@@ -82,7 +87,14 @@ theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p :=
     UniqueFactorizationMonoid.multiplicity_eq_count_normalizedFactors pp hn0.ne']
   simp [factors_eq]
 #align nat.factors_count_eq Nat.factors_count_eq
+-/
 
+/- warning: nat.factorization_eq_factors_multiset -> Nat.factorization_eq_factors_multiset is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) (coeFn.{1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (Multiset.{0} Nat) -> (Finsupp.{0, 0} Nat Nat Nat.hasZero)) (AddEquiv.hasCoeToFun.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Multiset.hasAdd.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.toFinsupp.{0} Nat) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (List.{0} Nat) (Multiset.{0} Nat) (HasLiftT.mk.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (CoeTCₓ.coe.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (coeBase.{1, 1} (List.{0} Nat) (Multiset.{0} Nat) (Multiset.hasCoe.{0} Nat)))) (Nat.factors n)))
+but is expected to have type
+  forall (n : Nat), Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) (FunLike.coe.{1, 1, 1} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (fun (_x : Multiset.{0} Nat) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{0} Nat) => Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) _x) (AddHomClass.toFunLike.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddZeroClass.toAdd.{0} (Multiset.{0} Nat) (AddMonoid.toAddZeroClass.{0} (Multiset.{0} Nat) (AddRightCancelMonoid.toAddMonoid.{0} (Multiset.{0} Nat) (AddCancelMonoid.toAddRightCancelMonoid.{0} (Multiset.{0} Nat) (AddCancelCommMonoid.toAddCancelMonoid.{0} (Multiset.{0} Nat) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} (Multiset.{0} Nat) (Multiset.instOrderedCancelAddCommMonoidMultiset.{0} Nat))))))) (AddZeroClass.toAdd.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Finsupp.addZeroClass.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (AddMonoidHomClass.toAddHomClass.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddMonoid.toAddZeroClass.{0} (Multiset.{0} Nat) (AddRightCancelMonoid.toAddMonoid.{0} (Multiset.{0} Nat) (AddCancelMonoid.toAddRightCancelMonoid.{0} (Multiset.{0} Nat) (AddCancelCommMonoid.toAddCancelMonoid.{0} (Multiset.{0} Nat) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} (Multiset.{0} Nat) (Multiset.instOrderedCancelAddCommMonoidMultiset.{0} Nat)))))) (Finsupp.addZeroClass.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddEquivClass.instAddMonoidHomClass.{0, 0, 0} (AddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (AddMonoid.toAddZeroClass.{0} (Multiset.{0} Nat) (AddRightCancelMonoid.toAddMonoid.{0} (Multiset.{0} Nat) (AddCancelMonoid.toAddRightCancelMonoid.{0} (Multiset.{0} Nat) (AddCancelCommMonoid.toAddCancelMonoid.{0} (Multiset.{0} Nat) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} (Multiset.{0} Nat) (Multiset.instOrderedCancelAddCommMonoidMultiset.{0} Nat)))))) (Finsupp.addZeroClass.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddEquiv.instAddEquivClassAddEquiv.{0, 0} (Multiset.{0} Nat) (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Multiset.instAddMultiset.{0} Nat) (Finsupp.add.{0, 0} Nat Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))))) (Multiset.toFinsupp.{0} Nat) (Multiset.ofList.{0} Nat (Nat.factors n)))
+Case conversion may be inaccurate. Consider using '#align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multisetₓ'. -/
 theorem factorization_eq_factors_multiset (n : ℕ) :
     n.factorization = (n.factors : Multiset ℕ).toFinsupp :=
   by
@@ -90,6 +102,12 @@ theorem factorization_eq_factors_multiset (n : ℕ) :
   simp
 #align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multiset
 
+/- warning: nat.multiplicity_eq_factorization -> Nat.multiplicity_eq_factorization is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {p : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} PartENat (multiplicity.{0} Nat Nat.monoid (fun (a : Nat) (b : Nat) => Nat.decidableDvd a b) p n) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat PartENat (HasLiftT.mk.{1, 1} Nat PartENat (CoeTCₓ.coe.{1, 1} Nat PartENat (Nat.castCoe.{0} PartENat (AddMonoidWithOne.toNatCast.{0} PartENat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} PartENat PartENat.addCommMonoidWithOne))))) (coeFn.{1, 1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (fun (_x : Finsupp.{0, 0} Nat Nat Nat.hasZero) => Nat -> Nat) (Finsupp.coeFun.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) p)))
+but is expected to have type
+  forall {n : Nat} {p : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} PartENat (multiplicity.{0} Nat Nat.monoid (fun (a : Nat) (b : Nat) => Nat.decidable_dvd a b) p n) (Nat.cast.{0} PartENat (AddMonoidWithOne.toNatCast.{0} PartENat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} PartENat PartENat.instAddCommMonoidWithOnePartENat)) (FunLike.coe.{1, 1, 1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) _x) (Finsupp.funLike.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) p)))
+Case conversion may be inaccurate. Consider using '#align nat.multiplicity_eq_factorization Nat.multiplicity_eq_factorizationₓ'. -/
 theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
     multiplicity p n = n.factorization p := by
   simp [factorization, pp, padicValNat_def' pp.ne_one hn.bot_lt]
@@ -98,6 +116,7 @@ theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0)
 /-! ### Basic facts about factorization -/
 
 
+#print Nat.factorization_prod_pow_eq_self /-
 @[simp]
 theorem factorization_prod_pow_eq_self {n : ℕ} (hn : n ≠ 0) : n.factorization.Prod pow = n :=
   by
@@ -105,50 +124,74 @@ theorem factorization_prod_pow_eq_self {n : ℕ} (hn : n ≠ 0) : n.factorizatio
   simp only [← prod_to_multiset, factorization, Multiset.coe_prod, Multiset.toFinsupp_toMultiset]
   exact prod_factors hn
 #align nat.factorization_prod_pow_eq_self Nat.factorization_prod_pow_eq_self
+-/
 
+#print Nat.eq_of_factorization_eq /-
 theorem eq_of_factorization_eq {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0)
     (h : ∀ p : ℕ, a.factorization p = b.factorization p) : a = b :=
   eq_of_perm_factors ha hb (by simpa only [List.perm_iff_count, factors_count_eq] using h)
 #align nat.eq_of_factorization_eq Nat.eq_of_factorization_eq
+-/
 
+#print Nat.factorization_inj /-
 /-- Every nonzero natural number has a unique prime factorization -/
 theorem factorization_inj : Set.InjOn factorization { x : ℕ | x ≠ 0 } := fun a ha b hb h =>
   eq_of_factorization_eq ha hb fun p => by simp [h]
 #align nat.factorization_inj Nat.factorization_inj
+-/
 
+#print Nat.factorization_zero /-
 @[simp]
 theorem factorization_zero : factorization 0 = 0 := by simpa [factorization]
 #align nat.factorization_zero Nat.factorization_zero
+-/
 
+#print Nat.factorization_one /-
 @[simp]
 theorem factorization_one : factorization 1 = 0 := by simpa [factorization]
 #align nat.factorization_one Nat.factorization_one
+-/
 
+/- warning: nat.support_factorization -> Nat.support_factorization is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat}, Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization n)) (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n))
+but is expected to have type
+  forall {n : Nat}, Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization n)) (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n))
+Case conversion may be inaccurate. Consider using '#align nat.support_factorization Nat.support_factorizationₓ'. -/
 /-- The support of `n.factorization` is exactly `n.factors.to_finset` -/
 @[simp]
 theorem support_factorization {n : ℕ} : n.factorization.support = n.factors.toFinset := by
   simp [factorization]
 #align nat.support_factorization Nat.support_factorization
 
+#print Nat.factor_iff_mem_factorization /-
 theorem factor_iff_mem_factorization {n p : ℕ} : p ∈ n.factorization.support ↔ p ∈ n.factors := by
   simp only [support_factorization, List.mem_toFinset]
 #align nat.factor_iff_mem_factorization Nat.factor_iff_mem_factorization
+-/
 
+#print Nat.prime_of_mem_factorization /-
 theorem prime_of_mem_factorization {n p : ℕ} (hp : p ∈ n.factorization.support) : p.Prime :=
   prime_of_mem_factors (factor_iff_mem_factorization.mp hp)
 #align nat.prime_of_mem_factorization Nat.prime_of_mem_factorization
+-/
 
+#print Nat.pos_of_mem_factorization /-
 theorem pos_of_mem_factorization {n p : ℕ} (hp : p ∈ n.factorization.support) : 0 < p :=
   Prime.pos (prime_of_mem_factorization hp)
 #align nat.pos_of_mem_factorization Nat.pos_of_mem_factorization
+-/
 
+#print Nat.le_of_mem_factorization /-
 theorem le_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support) : p ≤ n :=
   le_of_mem_factors (factor_iff_mem_factorization.mp h)
 #align nat.le_of_mem_factorization Nat.le_of_mem_factorization
+-/
 
 /-! ## Lemmas characterising when `n.factorization p = 0` -/
 
 
+#print Nat.factorization_eq_zero_iff /-
 theorem factorization_eq_zero_iff (n p : ℕ) : n.factorization p = 0 ↔ ¬p.Prime ∨ ¬p ∣ n ∨ n = 0 :=
   by
   rw [← not_mem_support_iff, support_factorization, mem_to_finset]
@@ -156,45 +199,63 @@ theorem factorization_eq_zero_iff (n p : ℕ) : n.factorization p = 0 ↔ ¬p.Pr
   · simp
   · simp [hn, Nat.mem_factors, not_and_or]
 #align nat.factorization_eq_zero_iff Nat.factorization_eq_zero_iff
+-/
 
+#print Nat.factorization_eq_zero_of_non_prime /-
 @[simp]
 theorem factorization_eq_zero_of_non_prime (n : ℕ) {p : ℕ} (hp : ¬p.Prime) :
     n.factorization p = 0 := by simp [factorization_eq_zero_iff, hp]
 #align nat.factorization_eq_zero_of_non_prime Nat.factorization_eq_zero_of_non_prime
+-/
 
+#print Nat.factorization_eq_zero_of_not_dvd /-
 theorem factorization_eq_zero_of_not_dvd {n p : ℕ} (h : ¬p ∣ n) : n.factorization p = 0 := by
   simp [factorization_eq_zero_iff, h]
 #align nat.factorization_eq_zero_of_not_dvd Nat.factorization_eq_zero_of_not_dvd
+-/
 
+#print Nat.factorization_eq_zero_of_lt /-
 theorem factorization_eq_zero_of_lt {n p : ℕ} (h : n < p) : n.factorization p = 0 :=
   Finsupp.not_mem_support_iff.mp (mt le_of_mem_factorization (not_le_of_lt h))
 #align nat.factorization_eq_zero_of_lt Nat.factorization_eq_zero_of_lt
+-/
 
+#print Nat.factorization_zero_right /-
 @[simp]
 theorem factorization_zero_right (n : ℕ) : n.factorization 0 = 0 :=
   factorization_eq_zero_of_non_prime _ not_prime_zero
 #align nat.factorization_zero_right Nat.factorization_zero_right
+-/
 
+#print Nat.factorization_one_right /-
 @[simp]
 theorem factorization_one_right (n : ℕ) : n.factorization 1 = 0 :=
   factorization_eq_zero_of_non_prime _ not_prime_one
 #align nat.factorization_one_right Nat.factorization_one_right
+-/
 
+#print Nat.dvd_of_factorization_pos /-
 theorem dvd_of_factorization_pos {n p : ℕ} (hn : n.factorization p ≠ 0) : p ∣ n :=
   dvd_of_mem_factors (factor_iff_mem_factorization.1 (mem_support_iff.2 hn))
 #align nat.dvd_of_factorization_pos Nat.dvd_of_factorization_pos
+-/
 
+#print Nat.Prime.factorization_pos_of_dvd /-
 theorem Prime.factorization_pos_of_dvd {n p : ℕ} (hp : p.Prime) (hn : n ≠ 0) (h : p ∣ n) :
     0 < n.factorization p := by rwa [← factors_count_eq, count_pos, mem_factors_iff_dvd hn hp]
 #align nat.prime.factorization_pos_of_dvd Nat.Prime.factorization_pos_of_dvd
+-/
 
+#print Nat.factorization_eq_zero_of_remainder /-
 theorem factorization_eq_zero_of_remainder {p r : ℕ} (i : ℕ) (hr : ¬p ∣ r) :
     (p * i + r).factorization p = 0 :=
   by
   apply factorization_eq_zero_of_not_dvd
   rwa [← Nat.dvd_add_iff_right (Dvd.intro i rfl)]
 #align nat.factorization_eq_zero_of_remainder Nat.factorization_eq_zero_of_remainder
+-/
 
+#print Nat.factorization_eq_zero_iff_remainder /-
 theorem factorization_eq_zero_iff_remainder {p r : ℕ} (i : ℕ) (pp : p.Prime) (hr0 : r ≠ 0) :
     ¬p ∣ r ↔ (p * i + r).factorization p = 0 :=
   by
@@ -206,17 +267,21 @@ theorem factorization_eq_zero_iff_remainder {p r : ℕ} (i : ℕ) (pp : p.Prime)
   · contrapose! hr0
     exact (_root_.add_eq_zero_iff.mp hr0).2
 #align nat.factorization_eq_zero_iff_remainder Nat.factorization_eq_zero_iff_remainder
+-/
 
+#print Nat.factorization_eq_zero_iff' /-
 /-- The only numbers with empty prime factorization are `0` and `1` -/
 theorem factorization_eq_zero_iff' (n : ℕ) : n.factorization = 0 ↔ n = 0 ∨ n = 1 :=
   by
   rw [factorization_eq_factors_multiset n]
   simp [factorization, AddEquiv.map_eq_zero_iff, Multiset.coe_eq_zero]
 #align nat.factorization_eq_zero_iff' Nat.factorization_eq_zero_iff'
+-/
 
 /-! ## Lemmas about factorizations of products and powers -/
 
 
+#print Nat.factorization_mul /-
 /-- For nonzero `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
 @[simp]
 theorem factorization_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
@@ -226,7 +291,14 @@ theorem factorization_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   simp only [add_apply, ← factors_count_eq, perm_iff_count.mp (perm_factors_mul ha hb) p,
     count_append]
 #align nat.factorization_mul Nat.factorization_mul
+-/
 
+/- warning: nat.factorization_mul_support -> Nat.factorization_mul_support is a dubious translation:
+lean 3 declaration is
+  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.hasUnion.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization b))))
+but is expected to have type
+  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.instUnionFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization b))))
+Case conversion may be inaccurate. Consider using '#align nat.factorization_mul_support Nat.factorization_mul_supportₓ'. -/
 theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
   by
@@ -235,6 +307,12 @@ theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   exact mem_factors_mul ha hb
 #align nat.factorization_mul_support Nat.factorization_mul_support
 
+/- warning: nat.prod_factorization_eq_prod_factors -> Nat.prod_factorization_eq_prod_factors is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), Eq.{succ u1} β (Finsupp.prod.{0, 0, u1} Nat Nat β Nat.hasZero _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f p)) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n)) (fun (p : Nat) => f p))
+but is expected to have type
+  forall {n : Nat} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), Eq.{succ u1} β (Finsupp.prod.{0, 0, u1} Nat Nat β (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f p)) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n)) (fun (p : Nat) => f p))
+Case conversion may be inaccurate. Consider using '#align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_factorsₓ'. -/
 /-- If a product over `n.factorization` doesn't use the multiplicities of the prime factors
 then it's equal to the corresponding product over `n.factors.to_finset` -/
 theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid β] (f : ℕ → β) :
@@ -244,6 +322,7 @@ theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid 
   simp
 #align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_factors
 
+#print Nat.factorization_prod /-
 /-- For any `p : ℕ` and any function `g : α → ℕ` that's non-zero on `S : finset α`,
 the power of `p` in `S.prod g` equals the sum over `x ∈ S` of the powers of `p` in `g x`.
 Generalises `factorization_mul`, which is the special case where `S.card = 2` and `g = id`. -/
@@ -257,7 +336,9 @@ theorem factorization_prod {α : Type _} {S : Finset α} {g : α → ℕ} (hS :
       have hT : T.prod g ≠ 0 := prod_ne_zero_iff.mpr fun x hx => hS x (hTS hx)
       simp [prod_insert hxT, sum_insert hxT, ← IH, factorization_mul (hS x hxS) hT]
 #align nat.factorization_prod Nat.factorization_prod
+-/
 
+#print Nat.factorization_pow /-
 /-- For any `p`, the power of `p` in `n^k` is `k` times the power in `n` -/
 @[simp]
 theorem factorization_pow (n k : ℕ) : factorization (n ^ k) = k • n.factorization :=
@@ -266,10 +347,12 @@ theorem factorization_pow (n k : ℕ) : factorization (n ^ k) = k • n.factoriz
   rcases eq_or_ne n 0 with (rfl | hn); · simp
   rw [pow_succ, factorization_mul hn (pow_ne_zero _ hn), ih, succ_eq_one_add, add_smul, one_smul]
 #align nat.factorization_pow Nat.factorization_pow
+-/
 
 /-! ## Lemmas about factorizations of primes and prime powers -/
 
 
+#print Nat.Prime.factorization /-
 /-- The only prime factor of prime `p` is `p` itself, with multiplicity `1` -/
 @[simp]
 theorem Prime.factorization {p : ℕ} (hp : Prime p) : p.factorization = single p 1 :=
@@ -278,17 +361,23 @@ theorem Prime.factorization {p : ℕ} (hp : Prime p) : p.factorization = single
   rw [← factors_count_eq, factors_prime hp, single_apply, count_singleton', if_congr eq_comm] <;>
     rfl
 #align nat.prime.factorization Nat.Prime.factorization
+-/
 
+#print Nat.Prime.factorization_self /-
 /-- The multiplicity of prime `p` in `p` is `1` -/
 @[simp]
 theorem Prime.factorization_self {p : ℕ} (hp : Prime p) : p.factorization p = 1 := by simp [hp]
 #align nat.prime.factorization_self Nat.Prime.factorization_self
+-/
 
+#print Nat.Prime.factorization_pow /-
 /-- For prime `p` the only prime factor of `p^k` is `p` with multiplicity `k` -/
 theorem Prime.factorization_pow {p k : ℕ} (hp : Prime p) : factorization (p ^ k) = single p k := by
   simp [hp]
 #align nat.prime.factorization_pow Nat.Prime.factorization_pow
+-/
 
+#print Nat.eq_pow_of_factorization_eq_single /-
 /-- If the factorization of `n` contains just one number `p` then `n` is a power of `p` -/
 theorem eq_pow_of_factorization_eq_single {n p k : ℕ} (hn : n ≠ 0)
     (h : n.factorization = Finsupp.single p k) : n = p ^ k :=
@@ -296,15 +385,19 @@ theorem eq_pow_of_factorization_eq_single {n p k : ℕ} (hn : n ≠ 0)
   rw [← Nat.factorization_prod_pow_eq_self hn, h]
   simp
 #align nat.eq_pow_of_factorization_eq_single Nat.eq_pow_of_factorization_eq_single
+-/
 
+#print Nat.Prime.eq_of_factorization_pos /-
 /-- The only prime factor of prime `p` is `p` itself. -/
 theorem Prime.eq_of_factorization_pos {p q : ℕ} (hp : Prime p) (h : p.factorization q ≠ 0) :
     p = q := by simpa [hp.factorization, single_apply] using h
 #align nat.prime.eq_of_factorization_pos Nat.Prime.eq_of_factorization_pos
+-/
 
 /-! ### Equivalence between `ℕ+` and `ℕ →₀ ℕ` with support in the primes. -/
 
 
+#print Nat.prod_pow_factorization_eq_self /-
 /-- Any finsupp `f : ℕ →₀ ℕ` whose support is in the primes is equal to the factorization of
 the product `∏ (a : ℕ) in f.support, a ^ f a`. -/
 theorem prod_pow_factorization_eq_self {f : ℕ →₀ ℕ} (hf : ∀ p : ℕ, p ∈ f.support → Prime p) :
@@ -316,13 +409,17 @@ theorem prod_pow_factorization_eq_self {f : ℕ →₀ ℕ} (hf : ∀ p : ℕ, p
   nth_rw_rhs 1 [(sum_single f).symm]
   exact sum_congr rfl fun p hp => prime.factorization_pow (hf p hp)
 #align nat.prod_pow_factorization_eq_self Nat.prod_pow_factorization_eq_self
+-/
 
+#print Nat.eq_factorization_iff /-
 theorem eq_factorization_iff {n : ℕ} {f : ℕ →₀ ℕ} (hn : n ≠ 0) (hf : ∀ p ∈ f.support, Prime p) :
     f = n.factorization ↔ f.Prod pow = n :=
   ⟨fun h => by rw [h, factorization_prod_pow_eq_self hn], fun h => by
     rw [← h, prod_pow_factorization_eq_self hf]⟩
 #align nat.eq_factorization_iff Nat.eq_factorization_iff
+-/
 
+#print Nat.factorizationEquiv /-
 /-- The equiv between `ℕ+` and `ℕ →₀ ℕ` with support in the primes. -/
 def factorizationEquiv : ℕ+ ≃ { f : ℕ →₀ ℕ | ∀ p ∈ f.support, Prime p }
     where
@@ -332,17 +429,22 @@ def factorizationEquiv : ℕ+ ≃ { f : ℕ →₀ ℕ | ∀ p ∈ f.support, Pr
   left_inv := fun ⟨x, hx⟩ => Subtype.ext <| factorization_prod_pow_eq_self hx.Ne.symm
   right_inv := fun ⟨f, hf⟩ => Subtype.ext <| prod_pow_factorization_eq_self hf
 #align nat.factorization_equiv Nat.factorizationEquiv
+-/
 
+#print Nat.factorizationEquiv_apply /-
 theorem factorizationEquiv_apply (n : ℕ+) : (factorizationEquiv n).1 = n.1.factorization :=
   by
   cases n
   rfl
 #align nat.factorization_equiv_apply Nat.factorizationEquiv_apply
+-/
 
+#print Nat.factorizationEquiv_inv_apply /-
 theorem factorizationEquiv_inv_apply {f : ℕ →₀ ℕ} (hf : ∀ p ∈ f.support, Prime p) :
     (factorizationEquiv.symm ⟨f, hf⟩).1 = f.Prod pow :=
   rfl
 #align nat.factorization_equiv_inv_apply Nat.factorizationEquiv_inv_apply
+-/
 
 /-! ### Generalisation of the "even part" and "odd part" of a natural number
 
@@ -359,16 +461,21 @@ notation "ord_proj[" p "] " n:arg => p ^ Nat.factorization n p
 -- mathport name: «exprord_compl[ ] »
 notation "ord_compl[" p "] " n:arg => n / ord_proj[p] n
 
+#print Nat.ord_proj_of_not_prime /-
 @[simp]
 theorem ord_proj_of_not_prime (n p : ℕ) (hp : ¬p.Prime) : ord_proj[p] n = 1 := by
   simp [factorization_eq_zero_of_non_prime n hp]
 #align nat.ord_proj_of_not_prime Nat.ord_proj_of_not_prime
+-/
 
+#print Nat.ord_compl_of_not_prime /-
 @[simp]
 theorem ord_compl_of_not_prime (n p : ℕ) (hp : ¬p.Prime) : ord_compl[p] n = n := by
   simp [factorization_eq_zero_of_non_prime n hp]
 #align nat.ord_compl_of_not_prime Nat.ord_compl_of_not_prime
+-/
 
+#print Nat.ord_proj_dvd /-
 theorem ord_proj_dvd (n p : ℕ) : ord_proj[p] n ∣ n :=
   by
   by_cases hp : p.prime; swap; · simp [hp]
@@ -378,42 +485,58 @@ theorem ord_proj_dvd (n p : ℕ) : ord_proj[p] n ∣ n :=
   intro q hq
   simp [List.eq_of_mem_replicate hq]
 #align nat.ord_proj_dvd Nat.ord_proj_dvd
+-/
 
+#print Nat.ord_compl_dvd /-
 theorem ord_compl_dvd (n p : ℕ) : ord_compl[p] n ∣ n :=
   div_dvd_of_dvd (ord_proj_dvd n p)
 #align nat.ord_compl_dvd Nat.ord_compl_dvd
+-/
 
+#print Nat.ord_proj_pos /-
 theorem ord_proj_pos (n p : ℕ) : 0 < ord_proj[p] n :=
   by
   by_cases pp : p.prime
   · simp [pow_pos pp.pos]
   · simp [pp]
 #align nat.ord_proj_pos Nat.ord_proj_pos
+-/
 
+#print Nat.ord_proj_le /-
 theorem ord_proj_le {n : ℕ} (p : ℕ) (hn : n ≠ 0) : ord_proj[p] n ≤ n :=
   le_of_dvd hn.bot_lt (Nat.ord_proj_dvd n p)
 #align nat.ord_proj_le Nat.ord_proj_le
+-/
 
+#print Nat.ord_compl_pos /-
 theorem ord_compl_pos {n : ℕ} (p : ℕ) (hn : n ≠ 0) : 0 < ord_compl[p] n :=
   by
   cases' em' p.prime with pp pp
   · simpa [Nat.factorization_eq_zero_of_non_prime n pp] using hn.bot_lt
   exact Nat.div_pos (ord_proj_le p hn) (ord_proj_pos n p)
 #align nat.ord_compl_pos Nat.ord_compl_pos
+-/
 
+#print Nat.ord_compl_le /-
 theorem ord_compl_le (n p : ℕ) : ord_compl[p] n ≤ n :=
   Nat.div_le_self _ _
 #align nat.ord_compl_le Nat.ord_compl_le
+-/
 
+#print Nat.ord_proj_mul_ord_compl_eq_self /-
 theorem ord_proj_mul_ord_compl_eq_self (n p : ℕ) : ord_proj[p] n * ord_compl[p] n = n :=
   Nat.mul_div_cancel' (ord_proj_dvd n p)
 #align nat.ord_proj_mul_ord_compl_eq_self Nat.ord_proj_mul_ord_compl_eq_self
+-/
 
+#print Nat.ord_proj_mul /-
 theorem ord_proj_mul {a b : ℕ} (p : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
     ord_proj[p] (a * b) = ord_proj[p] a * ord_proj[p] b := by
   simp [factorization_mul ha hb, pow_add]
 #align nat.ord_proj_mul Nat.ord_proj_mul
+-/
 
+#print Nat.ord_compl_mul /-
 theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * ord_compl[p] b :=
   by
   rcases eq_or_ne a 0 with (rfl | ha); · simp
@@ -421,16 +544,20 @@ theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * or
   simp only [ord_proj_mul p ha hb]
   rw [mul_div_mul_comm_of_dvd_dvd (ord_proj_dvd a p) (ord_proj_dvd b p)]
 #align nat.ord_compl_mul Nat.ord_compl_mul
+-/
 
 /-! ### Factorization and divisibility -/
 
 
+#print Nat.dvd_of_mem_factorization /-
 theorem dvd_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support) : p ∣ n :=
   by
   rcases eq_or_ne n 0 with (rfl | hn); · simp
   simp [← mem_factors_iff_dvd hn (prime_of_mem_factorization h), factor_iff_mem_factorization.mp h]
 #align nat.dvd_of_mem_factorization Nat.dvd_of_mem_factorization
+-/
 
+#print Nat.factorization_lt /-
 /-- A crude upper bound on `n.factorization p` -/
 theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p < n :=
   by
@@ -441,7 +568,9 @@ theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p
   apply lt_of_le_of_lt (ord_proj_le p hn)
   exact lt_of_lt_of_le (lt_two_pow n) (pow_le_pow_of_le_left (by linarith) pp.two_le n)
 #align nat.factorization_lt Nat.factorization_lt
+-/
 
+#print Nat.factorization_le_of_le_pow /-
 /-- An upper bound on `n.factorization p` -/
 theorem factorization_le_of_le_pow {n p b : ℕ} (hb : n ≤ p ^ b) : n.factorization p ≤ b :=
   by
@@ -450,7 +579,9 @@ theorem factorization_le_of_le_pow {n p b : ℕ} (hb : n ≤ p ^ b) : n.factoriz
   · exact (pow_le_iff_le_right pp.two_le).1 (le_trans (ord_proj_le p hn) hb)
   · simp [factorization_eq_zero_of_non_prime n pp]
 #align nat.factorization_le_of_le_pow Nat.factorization_le_of_le_pow
+-/
 
+#print Nat.factorization_le_iff_dvd /-
 theorem factorization_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
     d.factorization ≤ n.factorization ↔ d ∣ n :=
   by
@@ -464,7 +595,9 @@ theorem factorization_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
     rw [factorization_mul hd (right_ne_zero_of_mul hn)]
     simp
 #align nat.factorization_le_iff_dvd Nat.factorization_le_iff_dvd
+-/
 
+#print Nat.factorization_prime_le_iff_dvd /-
 theorem factorization_prime_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
     (∀ p : ℕ, p.Prime → d.factorization p ≤ n.factorization p) ↔ d ∣ n :=
   by
@@ -472,14 +605,18 @@ theorem factorization_prime_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0)
   refine' ⟨fun h p => (em p.Prime).elim (h p) fun hp => _, fun h p _ => h p⟩
   simp_rw [factorization_eq_zero_of_non_prime _ hp]
 #align nat.factorization_prime_le_iff_dvd Nat.factorization_prime_le_iff_dvd
+-/
 
+#print Nat.pow_succ_factorization_not_dvd /-
 theorem pow_succ_factorization_not_dvd {n p : ℕ} (hn : n ≠ 0) (hp : p.Prime) :
     ¬p ^ (n.factorization p + 1) ∣ n := by
   intro h
   rw [← factorization_le_iff_dvd (pow_pos hp.pos _).ne' hn] at h
   simpa [hp.factorization] using h p
 #align nat.pow_succ_factorization_not_dvd Nat.pow_succ_factorization_not_dvd
+-/
 
+#print Nat.factorization_le_factorization_mul_left /-
 theorem factorization_le_factorization_mul_left {a b : ℕ} (hb : b ≠ 0) :
     a.factorization ≤ (a * b).factorization :=
   by
@@ -487,29 +624,39 @@ theorem factorization_le_factorization_mul_left {a b : ℕ} (hb : b ≠ 0) :
   rw [factorization_le_iff_dvd ha <| mul_ne_zero ha hb]
   exact Dvd.intro b rfl
 #align nat.factorization_le_factorization_mul_left Nat.factorization_le_factorization_mul_left
+-/
 
+#print Nat.factorization_le_factorization_mul_right /-
 theorem factorization_le_factorization_mul_right {a b : ℕ} (ha : a ≠ 0) :
     b.factorization ≤ (a * b).factorization :=
   by
   rw [mul_comm]
   apply factorization_le_factorization_mul_left ha
 #align nat.factorization_le_factorization_mul_right Nat.factorization_le_factorization_mul_right
+-/
 
+#print Nat.Prime.pow_dvd_iff_le_factorization /-
 theorem Prime.pow_dvd_iff_le_factorization {p k n : ℕ} (pp : Prime p) (hn : n ≠ 0) :
     p ^ k ∣ n ↔ k ≤ n.factorization p := by
   rw [← factorization_le_iff_dvd (pow_pos pp.pos k).ne' hn, pp.factorization_pow, single_le_iff]
 #align nat.prime.pow_dvd_iff_le_factorization Nat.Prime.pow_dvd_iff_le_factorization
+-/
 
+#print Nat.Prime.pow_dvd_iff_dvd_ord_proj /-
 theorem Prime.pow_dvd_iff_dvd_ord_proj {p k n : ℕ} (pp : Prime p) (hn : n ≠ 0) :
     p ^ k ∣ n ↔ p ^ k ∣ ord_proj[p] n := by
   rw [pow_dvd_pow_iff_le_right pp.one_lt, pp.pow_dvd_iff_le_factorization hn]
 #align nat.prime.pow_dvd_iff_dvd_ord_proj Nat.Prime.pow_dvd_iff_dvd_ord_proj
+-/
 
+#print Nat.Prime.dvd_iff_one_le_factorization /-
 theorem Prime.dvd_iff_one_le_factorization {p n : ℕ} (pp : Prime p) (hn : n ≠ 0) :
     p ∣ n ↔ 1 ≤ n.factorization p :=
   Iff.trans (by simp) (pp.pow_dvd_iff_le_factorization hn)
 #align nat.prime.dvd_iff_one_le_factorization Nat.Prime.dvd_iff_one_le_factorization
+-/
 
+#print Nat.exists_factorization_lt_of_lt /-
 theorem exists_factorization_lt_of_lt {a b : ℕ} (ha : a ≠ 0) (hab : a < b) :
     ∃ p : ℕ, a.factorization p < b.factorization p :=
   by
@@ -518,7 +665,9 @@ theorem exists_factorization_lt_of_lt {a b : ℕ} (ha : a ≠ 0) (hab : a < b) :
   rw [← Finsupp.le_def, factorization_le_iff_dvd hb ha] at hab
   exact le_of_dvd ha.bot_lt hab
 #align nat.exists_factorization_lt_of_lt Nat.exists_factorization_lt_of_lt
+-/
 
+#print Nat.factorization_div /-
 @[simp]
 theorem factorization_div {d n : ℕ} (h : d ∣ n) :
     (n / d).factorization = n.factorization - d.factorization :=
@@ -531,22 +680,30 @@ theorem factorization_div {d n : ℕ} (h : d ∣ n) :
     Nat.factorization_mul (Nat.div_pos (Nat.le_of_dvd hn.bot_lt h) hd.bot_lt).ne' hd,
     Nat.div_mul_cancel h]
 #align nat.factorization_div Nat.factorization_div
+-/
 
+#print Nat.dvd_ord_proj_of_dvd /-
 theorem dvd_ord_proj_of_dvd {n p : ℕ} (hn : n ≠ 0) (pp : p.Prime) (h : p ∣ n) : p ∣ ord_proj[p] n :=
   dvd_pow_self p (Prime.factorization_pos_of_dvd pp hn h).ne'
 #align nat.dvd_ord_proj_of_dvd Nat.dvd_ord_proj_of_dvd
+-/
 
+#print Nat.not_dvd_ord_compl /-
 theorem not_dvd_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : ¬p ∣ ord_compl[p] n :=
   by
   rw [Nat.Prime.dvd_iff_one_le_factorization hp (ord_compl_pos p hn).ne']
   rw [Nat.factorization_div (Nat.ord_proj_dvd n p)]
   simp [hp.factorization]
 #align nat.not_dvd_ord_compl Nat.not_dvd_ord_compl
+-/
 
+#print Nat.coprime_ord_compl /-
 theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : coprime p (ord_compl[p] n) :=
   (or_iff_left (not_dvd_ord_compl hp hn)).mp <| coprime_or_dvd_of_prime hp _
 #align nat.coprime_ord_compl Nat.coprime_ord_compl
+-/
 
+#print Nat.factorization_ord_compl /-
 theorem factorization_ord_compl (n p : ℕ) :
     (ord_compl[p] n).factorization = n.factorization.eraseₓ p :=
   by
@@ -559,7 +716,9 @@ theorem factorization_ord_compl (n p : ℕ) :
   · rw [Finsupp.erase_ne hqp, factorization_div (ord_proj_dvd n p)]
     simp [pp.factorization, hqp.symm]
 #align nat.factorization_ord_compl Nat.factorization_ord_compl
+-/
 
+#print Nat.dvd_ord_compl_of_dvd_not_dvd /-
 -- `ord_compl[p] n` is the largest divisor of `n` not divisible by `p`.
 theorem dvd_ord_compl_of_dvd_not_dvd {p d n : ℕ} (hdn : d ∣ n) (hpd : ¬p ∣ d) :
     d ∣ ord_compl[p] n := by
@@ -573,7 +732,9 @@ theorem dvd_ord_compl_of_dvd_not_dvd {p d n : ℕ} (hdn : d ∣ n) (hpd : ¬p 
   · simp [factorization_eq_zero_iff, hpd]
   · simp [hqp, (factorization_le_iff_dvd hd0 hn0).2 hdn q]
 #align nat.dvd_ord_compl_of_dvd_not_dvd Nat.dvd_ord_compl_of_dvd_not_dvd
+-/
 
+#print Nat.exists_eq_pow_mul_and_not_dvd /-
 /-- If `n` is a nonzero natural number and `p ≠ 1`, then there are natural numbers `e`
 and `n'` such that `n'` is not divisible by `p` and `n = p^e * n'`. -/
 theorem exists_eq_pow_mul_and_not_dvd {n : ℕ} (hn : n ≠ 0) (p : ℕ) (hp : p ≠ 1) :
@@ -583,7 +744,9 @@ theorem exists_eq_pow_mul_and_not_dvd {n : ℕ} (hn : n ≠ 0) (p : ℕ) (hp : p
       (multiplicity.finite_nat_iff.mpr ⟨hp, Nat.pos_of_ne_zero hn⟩)
   ⟨_, a', h₂, h₁⟩
 #align nat.exists_eq_pow_mul_and_not_dvd Nat.exists_eq_pow_mul_and_not_dvd
+-/
 
+#print Nat.dvd_iff_div_factorization_eq_tsub /-
 theorem dvd_iff_div_factorization_eq_tsub {d n : ℕ} (hd : d ≠ 0) (hdn : d ≤ n) :
     d ∣ n ↔ (n / d).factorization = n.factorization - d.factorization :=
   by
@@ -597,7 +760,9 @@ theorem dvd_iff_div_factorization_eq_tsub {d n : ℕ} (hd : d ≠ 0) (hdn : d 
   rwa [factorization_mul h1 hd, add_apply, ← lt_tsub_iff_right, h, tsub_apply, lt_self_iff_false] at
     hp
 #align nat.dvd_iff_div_factorization_eq_tsub Nat.dvd_iff_div_factorization_eq_tsub
+-/
 
+#print Nat.ord_proj_dvd_ord_proj_of_dvd /-
 theorem ord_proj_dvd_ord_proj_of_dvd {a b : ℕ} (hb0 : b ≠ 0) (hab : a ∣ b) (p : ℕ) :
     ord_proj[p] a ∣ ord_proj[p] b :=
   by
@@ -606,7 +771,9 @@ theorem ord_proj_dvd_ord_proj_of_dvd {a b : ℕ} (hb0 : b ≠ 0) (hab : a ∣ b)
   rw [pow_dvd_pow_iff_le_right pp.one_lt]
   exact (factorization_le_iff_dvd ha0 hb0).2 hab p
 #align nat.ord_proj_dvd_ord_proj_of_dvd Nat.ord_proj_dvd_ord_proj_of_dvd
+-/
 
+#print Nat.ord_proj_dvd_ord_proj_iff_dvd /-
 theorem ord_proj_dvd_ord_proj_iff_dvd {a b : ℕ} (ha0 : a ≠ 0) (hb0 : b ≠ 0) :
     (∀ p : ℕ, ord_proj[p] a ∣ ord_proj[p] b) ↔ a ∣ b :=
   by
@@ -616,7 +783,9 @@ theorem ord_proj_dvd_ord_proj_iff_dvd {a b : ℕ} (ha0 : a ≠ 0) (hb0 : b ≠ 0
   rcases le_or_lt q 1 with (hq_le | hq1); · interval_cases <;> simp
   exact (pow_dvd_pow_iff_le_right hq1).1 (h q)
 #align nat.ord_proj_dvd_ord_proj_iff_dvd Nat.ord_proj_dvd_ord_proj_iff_dvd
+-/
 
+#print Nat.ord_compl_dvd_ord_compl_of_dvd /-
 theorem ord_compl_dvd_ord_compl_of_dvd {a b : ℕ} (hab : a ∣ b) (p : ℕ) :
     ord_compl[p] a ∣ ord_compl[p] b :=
   by
@@ -631,7 +800,9 @@ theorem ord_compl_dvd_ord_compl_of_dvd {a b : ℕ} (hab : a ∣ b) (p : ℕ) :
   simp_rw [erase_ne hqp]
   exact (factorization_le_iff_dvd ha0 hb0).2 hab q
 #align nat.ord_compl_dvd_ord_compl_of_dvd Nat.ord_compl_dvd_ord_compl_of_dvd
+-/
 
+#print Nat.ord_compl_dvd_ord_compl_iff_dvd /-
 theorem ord_compl_dvd_ord_compl_iff_dvd (a b : ℕ) :
     (∀ p : ℕ, ord_compl[p] a ∣ ord_compl[p] b) ↔ a ∣ b :=
   by
@@ -645,7 +816,9 @@ theorem ord_compl_dvd_ord_compl_iff_dvd (a b : ℕ) :
   rw [← Nat.dvd_one, ← Nat.mul_dvd_mul_iff_left hb0.bot_lt, mul_one]
   simpa [prime.factorization_self pb, prime.factorization pa, hab] using h b
 #align nat.ord_compl_dvd_ord_compl_iff_dvd Nat.ord_compl_dvd_ord_compl_iff_dvd
+-/
 
+#print Nat.dvd_iff_prime_pow_dvd_dvd /-
 theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ p k : ℕ, Prime p → p ^ k ∣ d → p ^ k ∣ n :=
   by
   rcases eq_or_ne n 0 with (rfl | hn); · simp
@@ -658,7 +831,14 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) : d ∣ n ↔ ∀ p k : ℕ, Prime
   simp_rw [← pp.pow_dvd_iff_le_factorization hn]
   exact h p _ pp (ord_proj_dvd _ _)
 #align nat.dvd_iff_prime_pow_dvd_dvd Nat.dvd_iff_prime_pow_dvd_dvd
+-/
 
+/- warning: nat.prod_prime_factors_dvd -> Nat.prod_prime_factors_dvd is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat), Dvd.Dvd.{0} Nat Nat.hasDvd (Finset.prod.{0, 0} Nat Nat Nat.commMonoid (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n)) (fun (p : Nat) => p)) n
+but is expected to have type
+  forall (n : Nat), Dvd.dvd.{0} Nat Nat.instDvdNat (Finset.prod.{0, 0} Nat Nat Nat.commMonoid (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n)) (fun (p : Nat) => p)) n
+Case conversion may be inaccurate. Consider using '#align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvdₓ'. -/
 theorem prod_prime_factors_dvd (n : ℕ) : (∏ p : ℕ in n.factors.toFinset, p) ∣ n :=
   by
   by_cases hn : n = 0;
@@ -667,6 +847,12 @@ theorem prod_prime_factors_dvd (n : ℕ) : (∏ p : ℕ in n.factors.toFinset, p
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
 #align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvd
 
+/- warning: nat.factorization_gcd -> Nat.factorization_gcd is a dubious translation:
+lean 3 declaration is
+  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization (Nat.gcd a b)) (Inf.inf.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (SemilatticeInf.toHasInf.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Finsupp.semilatticeInf.{0, 0} Nat Nat Nat.hasZero (Lattice.toSemilatticeInf.{0} Nat Nat.lattice))) (Nat.factorization a) (Nat.factorization b)))
+but is expected to have type
+  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization (Nat.gcd a b)) (Inf.inf.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Lattice.toInf.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Finsupp.lattice.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) Nat.instLatticeNat)) (Nat.factorization a) (Nat.factorization b)))
+Case conversion may be inaccurate. Consider using '#align nat.factorization_gcd Nat.factorization_gcdₓ'. -/
 theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     (gcd a b).factorization = a.factorization ⊓ b.factorization :=
   by
@@ -694,6 +880,12 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     simp [← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
 #align nat.factorization_gcd Nat.factorization_gcd
 
+/- warning: nat.factorization_lcm -> Nat.factorization_lcm is a dubious translation:
+lean 3 declaration is
+  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization (Nat.lcm a b)) (Sup.sup.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (SemilatticeSup.toHasSup.{0} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (Finsupp.semilatticeSup.{0, 0} Nat Nat Nat.hasZero (CanonicallyLinearOrderedAddMonoid.semilatticeSup.{0} Nat Nat.canonicallyLinearOrderedAddMonoid))) (Nat.factorization a) (Nat.factorization b)))
+but is expected to have type
+  forall {a : Nat} {b : Nat}, (Ne.{1} Nat a (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Ne.{1} Nat b (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization (Nat.lcm a b)) (Sup.sup.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (SemilatticeSup.toSup.{0} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Finsupp.semilatticeSup.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Lattice.toSemilatticeSup.{0} Nat Nat.instLatticeNat))) (Nat.factorization a) (Nat.factorization b)))
+Case conversion may be inaccurate. Consider using '#align nat.factorization_lcm Nat.factorization_lcmₓ'. -/
 theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     (a.lcm b).factorization = a.factorization ⊔ b.factorization :=
   by
@@ -703,6 +895,12 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   ext1; exact (min_add_max _ _).symm
 #align nat.factorization_lcm Nat.factorization_lcm
 
+/- warning: nat.prod_factors_gcd_mul_prod_factors_mul -> Nat.prod_factors_gcd_mul_prod_factors_mul is a dubious translation:
+lean 3 declaration is
+  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (m : Nat) (n : Nat) (f : Nat -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors (Nat.gcd m n))) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) m n))) f)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors m)) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (Nat.factors n)) f))
+but is expected to have type
+  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (m : Nat) (n : Nat) (f : Nat -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors (Nat.gcd m n))) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) m n))) f)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors m)) f) (Finset.prod.{u1, 0} β Nat _inst_1 (List.toFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) (Nat.factors n)) f))
+Case conversion may be inaccurate. Consider using '#align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_factors_gcd_mul_prod_factors_mulₓ'. -/
 @[to_additive sum_factors_gcd_add_sum_factors_mul]
 theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
     (m.gcd n).factors.toFinset.Prod f * (m * n).factors.toFinset.Prod f =
@@ -717,13 +915,21 @@ theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n
 #align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_factors_gcd_mul_prod_factors_mul
 #align nat.sum_factors_gcd_add_sum_factors_mul Nat.sum_factors_gcd_add_sum_factors_mul
 
+#print Nat.setOf_pow_dvd_eq_Icc_factorization /-
 theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
     { i : ℕ | i ≠ 0 ∧ p ^ i ∣ n } = Set.Icc 1 (n.factorization p) :=
   by
   ext
   simp [lt_succ_iff, one_le_iff_ne_zero, pp.pow_dvd_iff_le_factorization hn]
 #align nat.set_of_pow_dvd_eq_Icc_factorization Nat.setOf_pow_dvd_eq_Icc_factorization
+-/
 
+/- warning: nat.Icc_factorization_eq_pow_dvd -> Nat.Icc_factorization_eq_pow_dvd is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} (Finset.{0} Nat) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (coeFn.{1, 1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (fun (_x : Finsupp.{0, 0} Nat Nat Nat.hasZero) => Nat -> Nat) (Finsupp.coeFun.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) p)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) n)))
+but is expected to have type
+  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} (Finset.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p)) (Finset.Icc.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) (StrictOrderedSemiring.toPartialOrder.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) 1 (instOfNatNat 1)) (FunLike.coe.{1, 1, 1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) _x) (Finsupp.funLike.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) p)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) n)))
+Case conversion may be inaccurate. Consider using '#align nat.Icc_factorization_eq_pow_dvd Nat.Icc_factorization_eq_pow_dvdₓ'. -/
 /-- The set of positive powers of prime `p` that divide `n` is exactly the set of
 positive natural numbers up to `n.factorization p`. -/
 theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
@@ -736,11 +942,23 @@ theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
   exact fun H1 H2 => lt_of_le_of_lt H2 (factorization_lt p hn)
 #align nat.Icc_factorization_eq_pow_dvd Nat.Icc_factorization_eq_pow_dvd
 
+/- warning: nat.factorization_eq_card_pow_dvd -> Nat.factorization_eq_card_pow_dvd is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} Nat (coeFn.{1, 1} (Finsupp.{0, 0} Nat Nat Nat.hasZero) (fun (_x : Finsupp.{0, 0} Nat Nat Nat.hasZero) => Nat -> Nat) (Finsupp.coeFun.{0, 0} Nat Nat Nat.hasZero) (Nat.factorization n) p) (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) n))))
+but is expected to have type
+  forall (n : Nat) {p : Nat}, (Nat.Prime p) -> (Eq.{1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) p) (FunLike.coe.{1, 1, 1} (Finsupp.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : Nat) => Nat) _x) (Finsupp.funLike.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) (Nat.factorization n) p) (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) n))))
+Case conversion may be inaccurate. Consider using '#align nat.factorization_eq_card_pow_dvd Nat.factorization_eq_card_pow_dvdₓ'. -/
 theorem factorization_eq_card_pow_dvd (n : ℕ) {p : ℕ} (pp : p.Prime) :
     n.factorization p = ((Ico 1 n).filterₓ fun i => p ^ i ∣ n).card := by
   simp [← Icc_factorization_eq_pow_dvd n pp]
 #align nat.factorization_eq_card_pow_dvd Nat.factorization_eq_card_pow_dvd
 
+/- warning: nat.Ico_filter_pow_dvd_eq -> Nat.Ico_filter_pow_dvd_eq is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {p : Nat} {b : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (LE.le.{0} Nat Nat.hasLe n (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p b)) -> (Eq.{1} (Finset.{0} Nat) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) n)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p i) n) (fun (a : Nat) => Nat.decidableDvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p a) n) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) b)))
+but is expected to have type
+  forall {n : Nat} {p : Nat} {b : Nat}, (Nat.Prime p) -> (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (LE.le.{0} Nat instLENat n (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p b)) -> (Eq.{1} (Finset.{0} Nat) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) n)) (Finset.filter.{0} Nat (fun (i : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p i) n) (fun (a : Nat) => Nat.decidable_dvd (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p a) n) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b)))
+Case conversion may be inaccurate. Consider using '#align nat.Ico_filter_pow_dvd_eq Nat.Ico_filter_pow_dvd_eqₓ'. -/
 theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb : n ≤ p ^ b) :
     ((Ico 1 n).filterₓ fun i => p ^ i ∣ n) = (Icc 1 b).filterₓ fun i => p ^ i ∣ n :=
   by
@@ -754,12 +972,15 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
 /-! ### Factorization and coprimes -/
 
 
+#print Nat.factorization_mul_apply_of_coprime /-
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
 theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : coprime a b) :
     (a * b).factorization p = a.factorization p + b.factorization p := by
   simp only [← factors_count_eq, perm_iff_count.mp (perm_factors_mul_of_coprime hab), count_append]
 #align nat.factorization_mul_apply_of_coprime Nat.factorization_mul_apply_of_coprime
+-/
 
+#print Nat.factorization_mul_of_coprime /-
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
 theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
     (a * b).factorization = a.factorization + b.factorization :=
@@ -767,7 +988,9 @@ theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
   ext q
   simp only [Finsupp.coe_add, add_apply, ← factors_count_eq, factorization_mul_apply_of_coprime hab]
 #align nat.factorization_mul_of_coprime Nat.factorization_mul_of_coprime
+-/
 
+#print Nat.factorization_eq_of_coprime_left /-
 /-- If `p` is a prime factor of `a` then the power of `p` in `a` is the same that in `a * b`,
 for any `b` coprime to `a`. -/
 theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa : p ∈ a.factors) :
@@ -776,7 +999,9 @@ theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa
   rw [factorization_mul_apply_of_coprime hab, ← factors_count_eq, ← factors_count_eq]
   simpa only [count_eq_zero_of_not_mem (coprime_factors_disjoint hab hpa)]
 #align nat.factorization_eq_of_coprime_left Nat.factorization_eq_of_coprime_left
+-/
 
+#print Nat.factorization_eq_of_coprime_right /-
 /-- If `p` is a prime factor of `b` then the power of `p` in `b` is the same that in `a * b`,
 for any `a` coprime to `b`. -/
 theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb : p ∈ b.factors) :
@@ -785,7 +1010,14 @@ theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb
   rw [mul_comm]
   exact factorization_eq_of_coprime_left (coprime_comm.mp hab) hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
+-/
 
+/- warning: nat.factorization_disjoint_of_coprime -> Nat.factorization_disjoint_of_coprime is a dubious translation:
+lean 3 declaration is
+  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Disjoint.{0} (Finset.{0} Nat) (Finset.partialOrder.{0} Nat) (Finset.orderBot.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization b)))
+but is expected to have type
+  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Disjoint.{0} (Finset.{0} Nat) (Finset.partialOrder.{0} Nat) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization b)))
+Case conversion may be inaccurate. Consider using '#align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprimeₓ'. -/
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
 theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
@@ -793,6 +1025,12 @@ theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
     disjoint_to_finset_iff_disjoint.mpr (coprime_factors_disjoint hab)
 #align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
 
+/- warning: nat.factorization_mul_support_of_coprime -> Nat.factorization_mul_support_of_coprime is a dubious translation:
+lean 3 declaration is
+  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.hasUnion.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat Nat.hasZero (Nat.factorization b))))
+but is expected to have type
+  forall {a : Nat} {b : Nat}, (Nat.coprime a b) -> (Eq.{1} (Finset.{0} Nat) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) a b))) (Union.union.{0} (Finset.{0} Nat) (Finset.instUnionFinset.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization a)) (Finsupp.support.{0, 0} Nat Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) (Nat.factorization b))))
+Case conversion may be inaccurate. Consider using '#align nat.factorization_mul_support_of_coprime Nat.factorization_mul_support_of_coprimeₓ'. -/
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
 theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support :=
@@ -804,6 +1042,7 @@ theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
 /-! ### Induction principles involving factorizations -/
 
 
+#print Nat.recOnPrimePow /-
 /-- Given `P 0, P 1` and a way to extend `P a` to `P (p ^ n * a)` for prime `p` not dividing `a`,
 we can define `P` for all natural numbers. -/
 @[elab_as_elim]
@@ -835,7 +1074,9 @@ def recOnPrimePow {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1)
       · apply hk _ (Nat.div_lt_of_lt_mul _)
         simp [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne, hp.one_lt]
 #align nat.rec_on_prime_pow Nat.recOnPrimePow
+-/
 
+#print Nat.recOnPosPrimePosCoprime /-
 /-- Given `P 0`, `P 1`, and `P (p ^ n)` for positive prime powers, and a way to extend `P a` and
 `P b` to `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
@@ -852,7 +1093,9 @@ def recOnPosPrimePosCoprime {P : ℕ → Sort _} (hp : ∀ p n : ℕ, Prime p 
       simp [lt_one_iff.1 (lt_of_le_of_ne hpa ha1)]
     simpa [hn, Prime.coprime_iff_not_dvd hp']
 #align nat.rec_on_pos_prime_pos_coprime Nat.recOnPosPrimePosCoprime
+-/
 
+#print Nat.recOnPrimeCoprime /-
 /-- Given `P 0`, `P (p ^ n)` for all prime powers, and a way to extend `P a` and `P b` to
 `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
@@ -860,7 +1103,9 @@ def recOnPrimeCoprime {P : ℕ → Sort _} (h0 : P 0) (hp : ∀ p n : ℕ, Prime
     (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
   recOnPosPrimePosCoprime (fun p n h _ => hp p n h) h0 (hp 2 0 prime_two) h
 #align nat.rec_on_prime_coprime Nat.recOnPrimeCoprime
+-/
 
+#print Nat.recOnMul /-
 /-- Given `P 0`, `P 1`, `P p` for all primes, and a way to extend `P a` and `P b` to
 `P (a * b)`, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
@@ -872,7 +1117,14 @@ def recOnMul {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p →
     | n + 1 => h _ _ (hp p hp') (_match _)
   recOnPrimeCoprime h0 hp fun a b _ _ _ => h a b
 #align nat.rec_on_mul Nat.recOnMul
+-/
 
+/- warning: nat.multiplicative_factorization -> Nat.multiplicative_factorization is a dubious translation:
+lean 3 declaration is
+  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (forall {n : Nat}, (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β Nat.hasZero _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p k)))))
+but is expected to have type
+  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (forall {n : Nat}, (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p k)))))
+Case conversion may be inaccurate. Consider using '#align nat.multiplicative_factorization Nat.multiplicative_factorizationₓ'. -/
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ → β)
@@ -892,6 +1144,12 @@ theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ →
     convert factorization_disjoint_of_coprime hab
 #align nat.multiplicative_factorization Nat.multiplicative_factorization
 
+/- warning: nat.multiplicative_factorization' -> Nat.multiplicative_factorization' is a dubious translation:
+lean 3 declaration is
+  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (forall {n : Nat}, Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β Nat.hasZero _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) p k))))
+but is expected to have type
+  forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), (forall (x : Nat) (y : Nat), (Nat.coprime x y) -> (Eq.{succ u1} β (f (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) x y)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (f y)))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Eq.{succ u1} β (f (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (forall {n : Nat}, Eq.{succ u1} β (f n) (Finsupp.prod.{0, 0, u1} Nat Nat β (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) _inst_1 (Nat.factorization n) (fun (p : Nat) (k : Nat) => f (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat instPowNat) p k))))
+Case conversion may be inaccurate. Consider using '#align nat.multiplicative_factorization' Nat.multiplicative_factorization'ₓ'. -/
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ → β)
@@ -911,6 +1169,7 @@ theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ →
     convert factorization_disjoint_of_coprime hab
 #align nat.multiplicative_factorization' Nat.multiplicative_factorization'
 
+#print Nat.eq_iff_prime_padicValNat_eq /-
 /-- Two positive naturals are equal if their prime padic valuations are equal -/
 theorem eq_iff_prime_padicValNat_eq (a b : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
     a = b ↔ ∀ p : ℕ, p.Prime → padicValNat p a = padicValNat p b :=
@@ -924,7 +1183,9 @@ theorem eq_iff_prime_padicValNat_eq (a b : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
     · simp [factorization_def, pp, h p pp]
     · simp [factorization_eq_zero_of_non_prime, pp]
 #align nat.eq_iff_prime_padic_val_nat_eq Nat.eq_iff_prime_padicValNat_eq
+-/
 
+#print Nat.prod_pow_prime_padicValNat /-
 theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n < m) :
     (∏ p in Finset.filter Nat.Prime (Finset.range m), p ^ padicValNat p n) = n :=
   by
@@ -943,10 +1204,17 @@ theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n <
   · intro p hp
     simp [factorization_def n (prime_of_mem_factorization hp)]
 #align nat.prod_pow_prime_padic_val_nat Nat.prod_pow_prime_padicValNat
+-/
 
 /-! ### Lemmas about factorizations of particular functions -/
 
 
+/- warning: nat.card_multiples -> Nat.card_multiples is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (e : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) e (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (a : Nat) => Nat.decidableDvd p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) a (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Finset.range n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.hasDiv) n p)
+but is expected to have type
+  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (e : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) e (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (a : Nat) => Nat.decidable_dvd p (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) a (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Finset.range n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.instDivNat) n p)
+Case conversion may be inaccurate. Consider using '#align nat.card_multiples Nat.card_multiplesₓ'. -/
 -- TODO: Port lemmas from `data/nat/multiplicity` to here, re-written in terms of `factorization`
 /-- Exactly `n / p` naturals in `[1, n]` are multiples of `p`. -/
 theorem card_multiples (n p : ℕ) : card ((Finset.range n).filterₓ fun e => p ∣ e + 1) = n / p :=
@@ -956,6 +1224,12 @@ theorem card_multiples (n p : ℕ) : card ((Finset.range n).filterₓ fun e => p
     card_insert_of_not_mem, hn]
 #align nat.card_multiples Nat.card_multiples
 
+/- warning: nat.Ioc_filter_dvd_card_eq_div -> Nat.Ioc_filter_dvd_card_eq_div is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (x : Nat) => Dvd.Dvd.{0} Nat Nat.hasDvd p x) (fun (a : Nat) => Nat.decidableDvd p a) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.hasDiv) n p)
+but is expected to have type
+  forall (n : Nat) (p : Nat), Eq.{1} Nat (Finset.card.{0} Nat (Finset.filter.{0} Nat (fun (x : Nat) => Dvd.dvd.{0} Nat Nat.instDvdNat p x) (fun (a : Nat) => Nat.decidable_dvd p a) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n))) (HDiv.hDiv.{0, 0, 0} Nat Nat Nat (instHDiv.{0} Nat Nat.instDivNat) n p)
+Case conversion may be inaccurate. Consider using '#align nat.Ioc_filter_dvd_card_eq_div Nat.Ioc_filter_dvd_card_eq_divₓ'. -/
 /-- Exactly `n / p` naturals in `(0, n]` are multiples of `p`. -/
 theorem Ioc_filter_dvd_card_eq_div (n p : ℕ) : ((Ioc 0 n).filterₓ fun x => p ∣ x).card = n / p :=
   by

Changes in mathlib4

mathlib3
mathlib4
chore: reduce proof dependencies for Nat.factors_count_eq (#12105)

This is a bit longer, partially duplicating the argument from UniqueFactorizationMonoid.multiplicity_eq_count_normalizedFactors, but it means we no longer need to depend on RingTheory.Int.Basic at this point.

The other added lemmas seem useful regardless.

Diff
@@ -3,15 +3,10 @@ Copyright (c) 2021 Stuart Presnell. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Stuart Presnell
 -/
-import Mathlib.Algebra.BigOperators.Finsupp
 import Mathlib.Data.Finsupp.Multiset
 import Mathlib.Data.Nat.PrimeFin
 import Mathlib.NumberTheory.Padics.PadicVal
 import Mathlib.Data.Nat.GCD.BigOperators
-import Mathlib.Data.Nat.Interval
-import Mathlib.Tactic.IntervalCases
-import Mathlib.Algebra.GroupPower.Order
-import Mathlib.RingTheory.Int.Basic
 
 #align_import data.nat.factorization.basic from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
 
@@ -76,10 +71,15 @@ theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p :=
   if pp : p.Prime then ?_ else
     rw [count_eq_zero_of_not_mem (mt prime_of_mem_factors pp)]
     simp [factorization, pp]
-  simp only [factorization, coe_mk, pp, if_true]
-  rw [← PartENat.natCast_inj, padicValNat_def' pp.ne_one hn0,
-    UniqueFactorizationMonoid.multiplicity_eq_count_normalizedFactors pp hn0.ne']
-  simp [factors_eq]
+  simp only [factorization_def _ pp]
+  apply _root_.le_antisymm
+  · rw [le_padicValNat_iff_replicate_subperm_factors pp hn0.ne']
+    exact List.le_count_iff_replicate_sublist.mp le_rfl |>.subperm
+  · rw [← lt_add_one_iff, lt_iff_not_ge, ge_iff_le,
+      le_padicValNat_iff_replicate_subperm_factors pp hn0.ne']
+    intro h
+    have := h.count_le p
+    simp at this
 #align nat.factors_count_eq Nat.factors_count_eq
 
 theorem factorization_eq_factors_multiset (n : ℕ) :
chore: replace refine' that already have a ?_ (#12261)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -221,7 +221,7 @@ theorem factorization_prod {α : Type*} {S : Finset α} {g : α → ℕ} (hS : 
     (S.prod g).factorization = S.sum fun x => (g x).factorization := by
   classical
     ext p
-    refine' Finset.induction_on' S ?_ ?_
+    refine Finset.induction_on' S ?_ ?_
     · simp
     · intro x T hxS hTS hxT IH
       have hT : T.prod g ≠ 0 := prod_ne_zero_iff.mpr fun x hx => hS x (hTS hx)
chore: move some basic multiplicity results out of Mathlib.RingTheory.Int.Basic (#11919)

This means Mathlib.NumberTheory.Padics.PadicVal no longer needs to depend on Mathlib.RingTheory.Int.Basic, which is surprisingly heavy (in particular through Mathlib.RingTheory.Noetherian).

Diff
@@ -11,6 +11,7 @@ import Mathlib.Data.Nat.GCD.BigOperators
 import Mathlib.Data.Nat.Interval
 import Mathlib.Tactic.IntervalCases
 import Mathlib.Algebra.GroupPower.Order
+import Mathlib.RingTheory.Int.Basic
 
 #align_import data.nat.factorization.basic from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
 
Add Commute.orderOf_mul_pow_eq_lcm (#11235)

We add Commute.orderOf_mul_pow_eq_lcm: if two commuting elements x and y of a monoid have order n and m, there is an element of order lcm n m. The result actually gives an explicit (computable) element, written as the product of a power of x and a power of y.

Co-authored-by: Junyan Xu <[junyanxu.math@gmail.com](mailto:junyanxu.math@gmail.com)>

Diff
@@ -7,6 +7,7 @@ import Mathlib.Algebra.BigOperators.Finsupp
 import Mathlib.Data.Finsupp.Multiset
 import Mathlib.Data.Nat.PrimeFin
 import Mathlib.NumberTheory.Padics.PadicVal
+import Mathlib.Data.Nat.GCD.BigOperators
 import Mathlib.Data.Nat.Interval
 import Mathlib.Tactic.IntervalCases
 import Mathlib.Algebra.GroupPower.Order
@@ -651,6 +652,110 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   exact (min_add_max _ _).symm
 #align nat.factorization_lcm Nat.factorization_lcm
 
+/-- If `a = ∏ pᵢ ^ nᵢ` and `b = ∏ pᵢ ^ mᵢ`, then `factorizationLCMLeft = ∏ pᵢ ^ kᵢ`, where
+`kᵢ = nᵢ` if `mᵢ ≤ nᵢ` and `0` otherwise. Note that the product is over the divisors of `lcm a b`,
+so if one of `a` or `b` is `0` then the result is `1`. -/
+def factorizationLCMLeft (a b : ℕ) : ℕ :=
+  (Nat.lcm a b).factorization.prod fun p n ↦
+    if b.factorization p ≤ a.factorization p then p ^ n else 1
+
+/-- If `a = ∏ pᵢ ^ nᵢ` and `b = ∏ pᵢ ^ mᵢ`, then `factorizationLCMRight = ∏ pᵢ ^ kᵢ`, where
+`kᵢ = mᵢ` if `nᵢ < mᵢ` and `0` otherwise. Note that the product is over the divisors of `lcm a b`,
+so if one of `a` or `b` is `0` then the result is `1`.
+
+Note that `factorizationLCMRight a b` is *not* `factorizationLCMLeft b a`: the difference is
+that in `factorizationLCMLeft a b` there are the primes whose exponent in `a` is bigger or equal
+than the exponent in `b`, while in `factorizationLCMRight a b` there are the primes primes whose
+exponent in `b` is strictly bigger than in `a`. For example `factorizationLCMLeft 2 2 = 2`, but
+`factorizationLCMRight 2 2 = 1`. -/
+def factorizationLCMRight (a b : ℕ) :=
+  (Nat.lcm a b).factorization.prod fun p n ↦
+    if b.factorization p ≤ a.factorization p then 1 else p ^ n
+
+variable (a b)
+
+@[simp]
+lemma factorizationLCMLeft_zero_left : factorizationLCMLeft 0 b = 1 := by
+  simp [factorizationLCMLeft]
+
+@[simp]
+lemma factorizationLCMLeft_zero_right : factorizationLCMLeft a 0 = 1 := by
+  simp [factorizationLCMLeft]
+
+@[simp]
+lemma factorizationLCRight_zero_left : factorizationLCMRight 0 b = 1 := by
+  simp [factorizationLCMRight]
+@[simp]
+lemma factorizationLCMRight_zero_right : factorizationLCMRight a 0 = 1 := by
+  simp [factorizationLCMRight]
+
+lemma factorizationLCMLeft_pos :
+    0 < factorizationLCMLeft a b := by
+  apply Nat.pos_of_ne_zero
+  rw [factorizationLCMLeft, Finsupp.prod_ne_zero_iff]
+  intro p _ H
+  by_cases h : b.factorization p ≤ a.factorization p
+  · simp only [h, reduceIte, pow_eq_zero_iff', ne_eq] at H
+    simpa [H.1] using H.2
+  · simp only [h, reduceIte, one_ne_zero] at H
+
+lemma factorizationLCMRight_pos :
+    0 < factorizationLCMRight a b := by
+  apply Nat.pos_of_ne_zero
+  rw [factorizationLCMRight, Finsupp.prod_ne_zero_iff]
+  intro p _ H
+  by_cases h : b.factorization p ≤ a.factorization p
+  · simp only [h, reduceIte, pow_eq_zero_iff', ne_eq] at H
+  · simp only [h, ↓reduceIte, pow_eq_zero_iff', ne_eq] at H
+    simpa [H.1] using H.2
+
+lemma coprime_factorizationLCMLeft_factorizationLCMRight :
+    (factorizationLCMLeft a b).Coprime (factorizationLCMRight a b) := by
+  rw [factorizationLCMLeft, factorizationLCMRight]
+  refine coprime_prod_left_iff.mpr fun p hp ↦ coprime_prod_right_iff.mpr fun q hq ↦ ?_
+  dsimp only; split_ifs with h h'
+  any_goals simp only [coprime_one_right_eq_true, coprime_one_left_eq_true]
+  refine coprime_pow_primes _ _ (prime_of_mem_primeFactors hp) (prime_of_mem_primeFactors hq) ?_
+  contrapose! h'; rwa [← h']
+
+variable {a b}
+
+lemma factorizationLCMLeft_mul_factorizationLCMRight (ha : a ≠ 0) (hb : b ≠ 0) :
+    (factorizationLCMLeft a b) * (factorizationLCMRight a b) = lcm a b := by
+  rw [← factorization_prod_pow_eq_self (lcm_ne_zero ha hb), factorizationLCMLeft,
+    factorizationLCMRight, ← prod_mul]
+  congr; ext p n; split_ifs <;> simp
+
+variable (a b)
+
+lemma factorizationLCMLeft_dvd_left : factorizationLCMLeft a b ∣ a := by
+  rcases eq_or_ne a 0 with rfl | ha
+  · simp only [dvd_zero]
+  rcases eq_or_ne b 0 with rfl | hb
+  · simp [factorizationLCMLeft]
+  nth_rewrite 2 [← factorization_prod_pow_eq_self ha]
+  rw [prod_of_support_subset (s := (lcm a b).factorization.support)]
+  · apply prod_dvd_prod_of_dvd; rintro p -; dsimp only; split_ifs with le
+    · rw [factorization_lcm ha hb]; apply pow_dvd_pow; exact sup_le le_rfl le
+    · apply one_dvd
+  · intro p hp; rw [mem_support_iff] at hp ⊢
+    rw [factorization_lcm ha hb]; exact (lt_sup_iff.mpr <| .inl <| Nat.pos_of_ne_zero hp).ne'
+  · intros; rw [pow_zero]
+
+lemma factorizationLCMRight_dvd_right : factorizationLCMRight a b ∣ b := by
+  rcases eq_or_ne a 0 with rfl | ha
+  · simp [factorizationLCMRight]
+  rcases eq_or_ne b 0 with rfl | hb
+  · simp only [dvd_zero]
+  nth_rewrite 2 [← factorization_prod_pow_eq_self hb]
+  rw [prod_of_support_subset (s := (lcm a b).factorization.support)]
+  · apply Finset.prod_dvd_prod_of_dvd; rintro p -; dsimp only; split_ifs with le
+    · apply one_dvd
+    · rw [factorization_lcm ha hb]; apply pow_dvd_pow; exact sup_le (not_le.1 le).le le_rfl
+  · intro p hp; rw [mem_support_iff] at hp ⊢
+    rw [factorization_lcm ha hb]; exact (lt_sup_iff.mpr <| .inr <| Nat.pos_of_ne_zero hp).ne'
+  · intros; rw [pow_zero]
+
 @[to_additive sum_primeFactors_gcd_add_sum_primeFactors_mul]
 theorem prod_primeFactors_gcd_mul_prod_primeFactors_mul {β : Type*} [CommMonoid β] (m n : ℕ)
     (f : ℕ → β) :
chore: move Mathlib to v4.7.0-rc1 (#11162)

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>

Diff
@@ -232,8 +232,8 @@ theorem factorization_pow (n k : ℕ) : factorization (n ^ k) = k • n.factoriz
   induction' k with k ih; · simp
   rcases eq_or_ne n 0 with (rfl | hn)
   · simp
-  rw [pow_succ, mul_comm, factorization_mul hn (pow_ne_zero _ hn), ih, succ_eq_one_add, add_smul,
-   one_smul]
+  rw [Nat.pow_succ, mul_comm, factorization_mul hn (pow_ne_zero _ hn), ih, succ_eq_one_add,
+    add_smul, one_smul]
 #align nat.factorization_pow Nat.factorization_pow
 
 /-! ## Lemmas about factorizations of primes and prime powers -/
@@ -751,7 +751,7 @@ def recOnPrimePow {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1)
       haveI htp : 0 < t := hp.factorization_pos_of_dvd (k + 1).succ_ne_zero (k + 2).minFac_dvd
       convert h ((k + 2) / p ^ t) p t hp _ htp (hk _ (Nat.div_lt_of_lt_mul _)) using 1
       · rw [Nat.mul_div_cancel' hpt]
-      · rw [Nat.dvd_div_iff hpt, ← pow_succ]
+      · rw [Nat.dvd_div_iff hpt, ← Nat.pow_succ]
         exact pow_succ_factorization_not_dvd (k + 1).succ_ne_zero hp
       · simp [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne', hp.one_lt]
 #align nat.rec_on_prime_pow Nat.recOnPrimePow
@@ -787,7 +787,7 @@ def recOnPrimeCoprime {P : ℕ → Sort*} (h0 : P 0) (hp : ∀ p n : ℕ, Prime
 def recOnMul {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p → P p)
     (h : ∀ a b, P a → P b → P (a * b)) : ∀ a, P a :=
   let hp : ∀ p n : ℕ, Prime p → P (p ^ n) := fun p n hp' =>
-    n.recOn h1 (fun n hn => by rw [pow_succ]; apply h _ _ hn (hp p hp'))
+    n.recOn h1 (fun n hn => by rw [Nat.pow_succ]; apply h _ _ hn (hp p hp'))
     -- Porting note: was
     -- match n with
     -- | 0 => h1
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -320,7 +320,7 @@ complementary projection. The term `n.factorization p` is the $p$-adic order its
 For example, `ord_proj[2] n` is the even part of `n` and `ord_compl[2] n` is the odd part. -/
 
 
--- porting note: Lean 4 thinks we need `HPow` without this
+-- Porting note: Lean 4 thinks we need `HPow` without this
 set_option quotPrecheck false in
 notation "ord_proj[" p "] " n:arg => p ^ Nat.factorization n p
 
@@ -500,7 +500,7 @@ theorem factorization_ord_compl (n p : ℕ) :
     (ord_compl[p] n).factorization = n.factorization.erase p := by
   if hn : n = 0 then simp [hn] else
   if pp : p.Prime then ?_ else
-    -- porting note: needed to solve side goal explicitly
+    -- Porting note: needed to solve side goal explicitly
     rw [Finsupp.erase_of_not_mem_support] <;> simp [pp]
   ext q
   rcases eq_or_ne q p with (rfl | hqp)
chore: Rename lemmas about the coercion List → Multiset (#11099)

These did not respect the naming convention by having the coe as a prefix instead of a suffix, or vice-versa. Also add a bunch of norm_cast

Diff
@@ -97,7 +97,7 @@ theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0)
 @[simp]
 theorem factorization_prod_pow_eq_self {n : ℕ} (hn : n ≠ 0) : n.factorization.prod (· ^ ·) = n := by
   rw [factorization_eq_factors_multiset n]
-  simp only [← prod_toMultiset, factorization, Multiset.coe_prod, Multiset.toFinsupp_toMultiset]
+  simp only [← prod_toMultiset, factorization, Multiset.prod_coe, Multiset.toFinsupp_toMultiset]
   exact prod_factors hn
 #align nat.factorization_prod_pow_eq_self Nat.factorization_prod_pow_eq_self
 
chore: prepare Lean version bump with explicit simp (#10999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -623,7 +623,7 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
   let d := dfac.prod (· ^ ·)
   have dfac_prime : ∀ p : ℕ, p ∈ dfac.support → Prime p := by
     intro p hp
-    have : p ∈ a.factors ∧ p ∈ b.factors := by simpa using hp
+    have : p ∈ a.factors ∧ p ∈ b.factors := by simpa [dfac] using hp
     exact prime_of_mem_factors this.1
   have h1 : d.factorization = dfac := prod_pow_factorization_eq_self dfac_prime
   have hd_pos : d ≠ 0 := (factorizationEquiv.invFun ⟨dfac, dfac_prime⟩).2.ne'
@@ -639,7 +639,7 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
       contradiction
     have hea' := (factorization_le_iff_dvd he_pos ha_pos).mpr hea
     have heb' := (factorization_le_iff_dvd he_pos hb_pos).mpr heb
-    simp [← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
+    simp [dfac, ← factorization_le_iff_dvd he_pos hd_pos, h1, hea', heb']
 #align nat.factorization_gcd Nat.factorization_gcd
 
 theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
chore: bump dependencies (#10315)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -667,7 +667,7 @@ theorem prod_primeFactors_gcd_mul_prod_primeFactors_mul {β : Type*} [CommMonoid
 theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
     { i : ℕ | i ≠ 0 ∧ p ^ i ∣ n } = Set.Icc 1 (n.factorization p) := by
   ext
-  simp [lt_succ_iff, one_le_iff_ne_zero, pp.pow_dvd_iff_le_factorization hn]
+  simp [Nat.lt_succ_iff, one_le_iff_ne_zero, pp.pow_dvd_iff_le_factorization hn]
 #align nat.set_of_pow_dvd_eq_Icc_factorization Nat.setOf_pow_dvd_eq_Icc_factorization
 
 /-- The set of positive powers of prime `p` that divide `n` is exactly the set of
fix: shake the import tree (#9749)

cherry-picked from #9347

Co-Authored-By: @digama0

Diff
@@ -9,6 +9,7 @@ import Mathlib.Data.Nat.PrimeFin
 import Mathlib.NumberTheory.Padics.PadicVal
 import Mathlib.Data.Nat.Interval
 import Mathlib.Tactic.IntervalCases
+import Mathlib.Algebra.GroupPower.Order
 
 #align_import data.nat.factorization.basic from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
 
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -157,7 +157,7 @@ theorem factorization_one_right (n : ℕ) : n.factorization 1 = 0 :=
 #align nat.factorization_one_right Nat.factorization_one_right
 
 theorem dvd_of_factorization_pos {n p : ℕ} (hn : n.factorization p ≠ 0) : p ∣ n :=
-  dvd_of_mem_factors $ mem_primeFactors_iff_mem_factors.1 $ mem_support_iff.2 hn
+  dvd_of_mem_factors <| mem_primeFactors_iff_mem_factors.1 <| mem_support_iff.2 hn
 #align nat.dvd_of_factorization_pos Nat.dvd_of_factorization_pos
 
 theorem Prime.factorization_pos_of_dvd {n p : ℕ} (hp : p.Prime) (hn : n ≠ 0) (h : p ∣ n) :
@@ -390,7 +390,8 @@ theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * or
 /-- A crude upper bound on `n.factorization p` -/
 theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p < n := by
   by_cases pp : p.Prime
-  · exact (pow_lt_pow_iff_right pp.one_lt).1 $ (ord_proj_le p hn).trans_lt $ lt_pow_self pp.one_lt _
+  · exact (pow_lt_pow_iff_right pp.one_lt).1 <| (ord_proj_le p hn).trans_lt <|
+      lt_pow_self pp.one_lt _
   · simpa only [factorization_eq_zero_of_non_prime n pp] using hn.bot_lt
 #align nat.factorization_lt Nat.factorization_lt
 
@@ -690,8 +691,8 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
   ext x
   simp only [Finset.mem_filter, mem_Ico, mem_Icc, and_congr_left_iff, and_congr_right_iff]
   rintro h1 -
-  exact iff_of_true (lt_of_pow_dvd_right hn pp.two_le h1) $
-    (pow_le_pow_iff_right pp.one_lt).1 $ (le_of_dvd hn.bot_lt h1).trans hb
+  exact iff_of_true (lt_of_pow_dvd_right hn pp.two_le h1) <|
+    (pow_le_pow_iff_right pp.one_lt).1 <| (le_of_dvd hn.bot_lt h1).trans hb
 #align nat.Ico_filter_pow_dvd_eq Nat.Ico_filter_pow_dvd_eq
 
 /-! ### Factorization and coprimes -/
style: use cases x with | ... instead of cases x; case => ... (#9321)

This converts usages of the pattern

cases h
case inl h' => ...
case inr h' => ...

which derive from mathported code, to the "structured cases" syntax:

cases h with
| inl h' => ...
| inr h' => ...

The case where the subgoals are handled with · instead of case is more contentious (and much more numerous) so I left those alone. This pattern also appears with cases', induction, induction', and rcases. Furthermore, there is a similar transformation for by_cases:

by_cases h : cond
case pos => ...
case neg => ...

is replaced by:

if h : cond then
  ...
else
  ...

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -70,8 +70,7 @@ of `p` in the factorization of `n`: we declare the former to be the simp-normal
 theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p := by
   rcases n.eq_zero_or_pos with (rfl | hn0)
   · simp [factorization, count]
-  by_cases pp : p.Prime
-  case neg =>
+  if pp : p.Prime then ?_ else
     rw [count_eq_zero_of_not_mem (mt prime_of_mem_factors pp)]
     simp [factorization, pp]
   simp only [factorization, coe_mk, pp, if_true]
@@ -337,8 +336,7 @@ theorem ord_compl_of_not_prime (n p : ℕ) (hp : ¬p.Prime) : ord_compl[p] n = n
 #align nat.ord_compl_of_not_prime Nat.ord_compl_of_not_prime
 
 theorem ord_proj_dvd (n p : ℕ) : ord_proj[p] n ∣ n := by
-  by_cases hp : p.Prime
-  case neg => simp [hp]
+  if hp : p.Prime then ?_ else simp [hp]
   rw [← factors_count_eq]
   apply dvd_of_factors_subperm (pow_ne_zero _ hp.ne_zero)
   rw [hp.factors_pow, List.subperm_ext_iff]
@@ -351,9 +349,7 @@ theorem ord_compl_dvd (n p : ℕ) : ord_compl[p] n ∣ n :=
 #align nat.ord_compl_dvd Nat.ord_compl_dvd
 
 theorem ord_proj_pos (n p : ℕ) : 0 < ord_proj[p] n := by
-  by_cases pp : p.Prime
-  · simp [pow_pos pp.pos]
-  · simp [pp]
+  if pp : p.Prime then simp [pow_pos pp.pos] else simp [pp]
 #align nat.ord_proj_pos Nat.ord_proj_pos
 
 theorem ord_proj_le {n : ℕ} (p : ℕ) (hn : n ≠ 0) : ord_proj[p] n ≤ n :=
@@ -361,9 +357,10 @@ theorem ord_proj_le {n : ℕ} (p : ℕ) (hn : n ≠ 0) : ord_proj[p] n ≤ n :=
 #align nat.ord_proj_le Nat.ord_proj_le
 
 theorem ord_compl_pos {n : ℕ} (p : ℕ) (hn : n ≠ 0) : 0 < ord_compl[p] n := by
-  cases' em' p.Prime with pp pp
-  · simpa [Nat.factorization_eq_zero_of_non_prime n pp] using hn.bot_lt
-  exact Nat.div_pos (ord_proj_le p hn) (ord_proj_pos n p)
+  if pp : p.Prime then
+    exact Nat.div_pos (ord_proj_le p hn) (ord_proj_pos n p)
+  else
+    simpa [Nat.factorization_eq_zero_of_non_prime n pp] using hn.bot_lt
 #align nat.ord_compl_pos Nat.ord_compl_pos
 
 theorem ord_compl_le (n p : ℕ) : ord_compl[p] n ≤ n :=
@@ -380,10 +377,8 @@ theorem ord_proj_mul {a b : ℕ} (p : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
 #align nat.ord_proj_mul Nat.ord_proj_mul
 
 theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * ord_compl[p] b := by
-  rcases eq_or_ne a 0 with (rfl | ha)
-  · simp
-  rcases eq_or_ne b 0 with (rfl | hb)
-  · simp
+  if ha : a = 0 then simp [ha] else
+  if hb : b = 0 then simp [hb] else
   simp only [ord_proj_mul p ha hb]
   rw [mul_div_mul_comm_of_dvd_dvd (ord_proj_dvd a p) (ord_proj_dvd b p)]
 #align nat.ord_compl_mul Nat.ord_compl_mul
@@ -401,11 +396,11 @@ theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p
 
 /-- An upper bound on `n.factorization p` -/
 theorem factorization_le_of_le_pow {n p b : ℕ} (hb : n ≤ p ^ b) : n.factorization p ≤ b := by
-  rcases eq_or_ne n 0 with (rfl | hn)
-  · simp
-  by_cases pp : p.Prime
-  · exact (pow_le_pow_iff_right pp.one_lt).1 ((ord_proj_le p hn).trans hb)
-  · simp [factorization_eq_zero_of_non_prime n pp]
+  if hn : n = 0 then simp [hn] else
+  if pp : p.Prime then
+    exact (pow_le_pow_iff_right pp.one_lt).1 ((ord_proj_le p hn).trans hb)
+  else
+    simp [factorization_eq_zero_of_non_prime n pp]
 #align nat.factorization_le_of_le_pow Nat.factorization_le_of_le_pow
 
 theorem factorization_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
@@ -501,9 +496,8 @@ theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : Coprime p
 
 theorem factorization_ord_compl (n p : ℕ) :
     (ord_compl[p] n).factorization = n.factorization.erase p := by
-  rcases eq_or_ne n 0 with (rfl | hn); · simp
-  by_cases pp : p.Prime
-  case neg =>
+  if hn : n = 0 then simp [hn] else
+  if pp : p.Prime then ?_ else
     -- porting note: needed to solve side goal explicitly
     rw [Finsupp.erase_of_not_mem_support] <;> simp [pp]
   ext q
@@ -517,14 +511,14 @@ theorem factorization_ord_compl (n p : ℕ) :
 -- `ord_compl[p] n` is the largest divisor of `n` not divisible by `p`.
 theorem dvd_ord_compl_of_dvd_not_dvd {p d n : ℕ} (hdn : d ∣ n) (hpd : ¬p ∣ d) :
     d ∣ ord_compl[p] n := by
-  rcases eq_or_ne n 0 with (rfl | hn0); · simp
-  rcases eq_or_ne d 0 with (rfl | hd0);
-  · simp at hpd
+  if hn0 : n = 0 then simp [hn0] else
+  if hd0 : d = 0 then simp [hd0] at hpd else
   rw [← factorization_le_iff_dvd hd0 (ord_compl_pos p hn0).ne', factorization_ord_compl]
   intro q
-  rcases eq_or_ne q p with (rfl | hqp)
-  · simp [factorization_eq_zero_iff, hpd]
-  · simp [hqp, (factorization_le_iff_dvd hd0 hn0).2 hdn q]
+  if hqp : q = p then
+    simp [factorization_eq_zero_iff, hqp, hpd]
+  else
+    simp [hqp, (factorization_le_iff_dvd hd0 hn0).2 hdn q]
 #align nat.dvd_ord_compl_of_dvd_not_dvd Nat.dvd_ord_compl_of_dvd_not_dvd
 
 /-- If `n` is a nonzero natural number and `p ≠ 1`, then there are natural numbers `e`
@@ -591,10 +585,8 @@ theorem ord_compl_dvd_ord_compl_iff_dvd (a b : ℕ) :
   refine' ⟨fun h => _, fun hab p => ord_compl_dvd_ord_compl_of_dvd hab p⟩
   rcases eq_or_ne b 0 with (rfl | hb0)
   · simp
-  by_cases pa : a.Prime
-  case neg => simpa [pa] using h a
-  by_cases pb : b.Prime
-  case neg => simpa [pb] using h b
+  if pa : a.Prime then ?_ else simpa [pa] using h a
+  if pb : b.Prime then ?_ else simpa [pb] using h b
   rw [prime_dvd_prime_iff_eq pa pb]
   by_contra hab
   apply pa.ne_one
feat(NumberTheory.SmoothNumbers): add {smooth|rough}NumbersUpTo and some API (#9240)

This adds definitions of the k-smooth numbers up to and including N as a Finset and of its complement in {1, ..., N} plus some API, in particular cardinality bounds. There are also a few additional API lemmas for Nat.primesBelow and Nat.smoothNumbers (including a decidability instance for membership in the latter).

This is a PR in preparation of the divergence of the sum of the reciprocals of the primes. See here on Zulip.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -866,7 +866,8 @@ theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n <
 
 
 -- TODO: Port lemmas from `Data/Nat/Multiplicity` to here, re-written in terms of `factorization`
-/-- Exactly `n / p` naturals in `[1, n]` are multiples of `p`. -/
+/-- Exactly `n / p` naturals in `[1, n]` are multiples of `p`.
+See `Nat.card_multiples'` for an alternative spelling of the statement.  -/
 theorem card_multiples (n p : ℕ) : card ((Finset.range n).filter fun e => p ∣ e + 1) = n / p := by
   induction' n with n hn
   · simp
@@ -887,4 +888,16 @@ theorem Ioc_filter_dvd_card_eq_div (n p : ℕ) : ((Ioc 0 n).filter fun x => p 
     Finset.mem_filter, mem_Ioc, not_le.2 (lt_add_one n), Nat.succ_eq_add_one]
 #align nat.Ioc_filter_dvd_card_eq_div Nat.Ioc_filter_dvd_card_eq_div
 
+/-- There are exactly `⌊N/n⌋` positive multiples of `n` that are `≤ N`.
+See `Nat.card_multiples` for a "shifted-by-one" version. -/
+lemma card_multiples' (N n : ℕ) :
+    ((Finset.range N.succ).filter (fun k ↦ k ≠ 0 ∧ n ∣ k)).card = N / n := by
+  induction N with
+    | zero => simp
+    | succ N ih =>
+        rw [Finset.range_succ, Finset.filter_insert]
+        by_cases h : n ∣ N.succ
+        · simp [h, succ_div_of_dvd, ih]
+        · simp [h, succ_div_of_not_dvd, ih]
+
 end Nat
chore: Protect Nat.Prime.factorization (#9242)

Else this conflicts with Nat.factorization.

Diff
@@ -241,7 +241,7 @@ theorem factorization_pow (n k : ℕ) : factorization (n ^ k) = k • n.factoriz
 
 /-- The only prime factor of prime `p` is `p` itself, with multiplicity `1` -/
 @[simp]
-theorem Prime.factorization {p : ℕ} (hp : Prime p) : p.factorization = single p 1 := by
+protected theorem Prime.factorization {p : ℕ} (hp : Prime p) : p.factorization = single p 1 := by
   ext q
   rw [← factors_count_eq, factors_prime hp, single_apply, count_singleton', if_congr eq_comm] <;>
     rfl
chore: Rename pow monotonicity lemmas (#9095)

The names for lemmas about monotonicity of (a ^ ·) and (· ^ n) were a mess. This PR tidies up everything related by following the naming convention for (a * ·) and (· * b). Namely, (a ^ ·) is pow_right and (· ^ n) is pow_left in lemma names. All lemma renames follow the corresponding multiplication lemma names closely.

Renames

Algebra.GroupPower.Order

  • pow_monopow_right_mono
  • pow_le_powpow_le_pow_right
  • pow_le_pow_of_le_leftpow_le_pow_left
  • pow_lt_pow_of_lt_leftpow_lt_pow_left
  • strictMonoOn_powpow_left_strictMonoOn
  • pow_strictMono_rightpow_right_strictMono
  • pow_lt_powpow_lt_pow_right
  • pow_lt_pow_iffpow_lt_pow_iff_right
  • pow_le_pow_iffpow_le_pow_iff_right
  • self_lt_powlt_self_pow
  • strictAnti_powpow_right_strictAnti
  • pow_lt_pow_iff_of_lt_onepow_lt_pow_iff_right_of_lt_one
  • pow_lt_pow_of_lt_onepow_lt_pow_right_of_lt_one
  • lt_of_pow_lt_powlt_of_pow_lt_pow_left
  • le_of_pow_le_powle_of_pow_le_pow_left
  • pow_lt_pow₀pow_lt_pow_right₀

Algebra.GroupPower.CovariantClass

  • pow_le_pow_of_le_left'pow_le_pow_left'
  • nsmul_le_nsmul_of_le_rightnsmul_le_nsmul_right
  • pow_lt_pow'pow_lt_pow_right'
  • nsmul_lt_nsmulnsmul_lt_nsmul_left
  • pow_strictMono_leftpow_right_strictMono'
  • nsmul_strictMono_rightnsmul_left_strictMono
  • StrictMono.pow_right'StrictMono.pow_const
  • StrictMono.nsmul_leftStrictMono.const_nsmul
  • pow_strictMono_right'pow_left_strictMono
  • nsmul_strictMono_leftnsmul_right_strictMono
  • Monotone.pow_rightMonotone.pow_const
  • Monotone.nsmul_leftMonotone.const_nsmul
  • lt_of_pow_lt_pow'lt_of_pow_lt_pow_left'
  • lt_of_nsmul_lt_nsmullt_of_nsmul_lt_nsmul_right
  • pow_le_pow'pow_le_pow_right'
  • nsmul_le_nsmulnsmul_le_nsmul_left
  • pow_le_pow_of_le_one'pow_le_pow_right_of_le_one'
  • nsmul_le_nsmul_of_nonposnsmul_le_nsmul_left_of_nonpos
  • le_of_pow_le_pow'le_of_pow_le_pow_left'
  • le_of_nsmul_le_nsmul'le_of_nsmul_le_nsmul_right'
  • pow_le_pow_iff'pow_le_pow_iff_right'
  • nsmul_le_nsmul_iffnsmul_le_nsmul_iff_left
  • pow_lt_pow_iff'pow_lt_pow_iff_right'
  • nsmul_lt_nsmul_iffnsmul_lt_nsmul_iff_left

Data.Nat.Pow

  • Nat.pow_lt_pow_of_lt_leftNat.pow_lt_pow_left
  • Nat.pow_le_iff_le_leftNat.pow_le_pow_iff_left
  • Nat.pow_lt_iff_lt_leftNat.pow_lt_pow_iff_left

Lemmas added

  • pow_le_pow_iff_left
  • pow_lt_pow_iff_left
  • pow_right_injective
  • pow_right_inj
  • Nat.pow_le_pow_left to have the correct name since Nat.pow_le_pow_of_le_left is in Std.
  • Nat.pow_le_pow_right to have the correct name since Nat.pow_le_pow_of_le_right is in Std.

Lemmas removed

  • self_le_pow was a duplicate of le_self_pow.
  • Nat.pow_lt_pow_of_lt_right is defeq to pow_lt_pow_right.
  • Nat.pow_right_strictMono is defeq to pow_right_strictMono.
  • Nat.pow_le_iff_le_right is defeq to pow_le_pow_iff_right.
  • Nat.pow_lt_iff_lt_right is defeq to pow_lt_pow_iff_right.

Other changes

  • A bunch of proofs have been golfed.
  • Some lemma assumptions have been turned from 0 < n or 1 ≤ n to n ≠ 0.
  • A few Nat lemmas have been protected.
  • One docstring has been fixed.
Diff
@@ -395,12 +395,8 @@ theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * or
 /-- A crude upper bound on `n.factorization p` -/
 theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p < n := by
   by_cases pp : p.Prime
-  case neg =>
-    simp only [factorization_eq_zero_of_non_prime n pp]
-    exact hn.bot_lt
-  rw [← pow_lt_iff_lt_right pp.two_le]
-  apply lt_of_le_of_lt (ord_proj_le p hn)
-  exact lt_of_lt_of_le (lt_two_pow n) (pow_le_pow_of_le_left pp.two_le n)
+  · exact (pow_lt_pow_iff_right pp.one_lt).1 $ (ord_proj_le p hn).trans_lt $ lt_pow_self pp.one_lt _
+  · simpa only [factorization_eq_zero_of_non_prime n pp] using hn.bot_lt
 #align nat.factorization_lt Nat.factorization_lt
 
 /-- An upper bound on `n.factorization p` -/
@@ -408,7 +404,7 @@ theorem factorization_le_of_le_pow {n p b : ℕ} (hb : n ≤ p ^ b) : n.factoriz
   rcases eq_or_ne n 0 with (rfl | hn)
   · simp
   by_cases pp : p.Prime
-  · exact (pow_le_iff_le_right pp.two_le).1 (le_trans (ord_proj_le p hn) hb)
+  · exact (pow_le_pow_iff_right pp.one_lt).1 ((ord_proj_le p hn).trans hb)
   · simp [factorization_eq_zero_of_non_prime n pp]
 #align nat.factorization_le_of_le_pow Nat.factorization_le_of_le_pow
 
@@ -702,8 +698,8 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
   ext x
   simp only [Finset.mem_filter, mem_Ico, mem_Icc, and_congr_left_iff, and_congr_right_iff]
   rintro h1 -
-  simp [lt_of_pow_dvd_right hn pp.two_le h1,
-    (pow_le_iff_le_right pp.two_le).1 ((le_of_dvd hn.bot_lt h1).trans hb)]
+  exact iff_of_true (lt_of_pow_dvd_right hn pp.two_le h1) $
+    (pow_le_pow_iff_right pp.one_lt).1 $ (le_of_dvd hn.bot_lt h1).trans hb
 #align nat.Ico_filter_pow_dvd_eq Nat.Ico_filter_pow_dvd_eq
 
 /-! ### Factorization and coprimes -/
@@ -763,10 +759,7 @@ def recOnPrimePow {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1)
       · rw [Nat.mul_div_cancel' hpt]
       · rw [Nat.dvd_div_iff hpt, ← pow_succ]
         exact pow_succ_factorization_not_dvd (k + 1).succ_ne_zero hp
-      · rw [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne]
-        exact hp.one_lt
-        -- Porting note: was
-        -- simp [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne, hp.one_lt]
+      · simp [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne', hp.one_lt]
 #align nat.rec_on_prime_pow Nat.recOnPrimePow
 
 /-- Given `P 0`, `P 1`, and `P (p ^ n)` for positive prime powers, and a way to extend `P a` and
fix: remove references to Nat.pow outside of tactic code (#9008)
Diff
@@ -630,7 +630,7 @@ theorem prod_primeFactors_dvd (n : ℕ) : ∏ p in n.primeFactors, p ∣ n := by
 theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     (gcd a b).factorization = a.factorization ⊓ b.factorization := by
   let dfac := a.factorization ⊓ b.factorization
-  let d := dfac.prod Nat.pow
+  let d := dfac.prod (· ^ ·)
   have dfac_prime : ∀ p : ℕ, p ∈ dfac.support → Prime p := by
     intro p hp
     have : p ∈ a.factors ∧ p ∈ b.factors := by simpa using hp
chore: space after (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -419,7 +419,7 @@ theorem factorization_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
     set K := n.factorization - d.factorization with hK
     use K.prod (· ^ ·)
     rw [← factorization_prod_pow_eq_self hn, ← factorization_prod_pow_eq_self hd,
-        ←Finsupp.prod_add_index' pow_zero pow_add, hK, add_tsub_cancel_of_le hdn]
+        ← Finsupp.prod_add_index' pow_zero pow_add, hK, add_tsub_cancel_of_le hdn]
   · rintro ⟨c, rfl⟩
     rw [factorization_mul hd (right_ne_zero_of_mul hn)]
     simp
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -112,11 +112,11 @@ theorem factorization_inj : Set.InjOn factorization { x : ℕ | x ≠ 0 } := fun
 #align nat.factorization_inj Nat.factorization_inj
 
 @[simp]
-theorem factorization_zero : factorization 0 = 0 := by simp [factorization]
+theorem factorization_zero : factorization 0 = 0 := by decide
 #align nat.factorization_zero Nat.factorization_zero
 
 @[simp]
-theorem factorization_one : factorization 1 = 0 := by simp [factorization]
+theorem factorization_one : factorization 1 = 0 := by decide
 #align nat.factorization_one Nat.factorization_one
 
 #noalign nat.support_factorization
@@ -430,6 +430,7 @@ theorem factorization_prime_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0)
   rw [← factorization_le_iff_dvd hd hn]
   refine' ⟨fun h p => (em p.Prime).elim (h p) fun hp => _, fun h p _ => h p⟩
   simp_rw [factorization_eq_zero_of_non_prime _ hp]
+  rfl
 #align nat.factorization_prime_le_iff_dvd Nat.factorization_prime_le_iff_dvd
 
 theorem pow_succ_factorization_not_dvd {n p : ℕ} (hn : n ≠ 0) (hp : p.Prime) :
perf(FunLike.Basic): beta reduce CoeFun.coe (#7905)

This eliminates (fun a ↦ β) α in the type when applying a FunLike.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -429,7 +429,7 @@ theorem factorization_prime_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0)
     (∀ p : ℕ, p.Prime → d.factorization p ≤ n.factorization p) ↔ d ∣ n := by
   rw [← factorization_le_iff_dvd hd hn]
   refine' ⟨fun h p => (em p.Prime).elim (h p) fun hp => _, fun h p _ => h p⟩
-  simp_rw [factorization_eq_zero_of_non_prime _ hp, le_refl]
+  simp_rw [factorization_eq_zero_of_non_prime _ hp]
 #align nat.factorization_prime_le_iff_dvd Nat.factorization_prime_le_iff_dvd
 
 theorem pow_succ_factorization_not_dvd {n p : ℕ} (hn : n ≠ 0) (hp : p.Prime) :
refactor: Unify spelling of "prime factors" (#8164)

mathlib can't make up its mind on whether to spell "the prime factors of n" as n.factors.toFinset or n.factorization.support, even though those two are defeq. This PR proposes to unify everything to a new definition Nat.primeFactors, and streamline the existing scattered API about n.factors.toFinset and n.factorization.support to Nat.primeFactors. We also get to write a bit more API that didn't make sense before, eg primeFactors_mono.

Diff
@@ -47,22 +47,19 @@ open Nat Finset List Finsupp
 open BigOperators
 
 namespace Nat
+variable {a b m n p : ℕ}
 
 /-- `n.factorization` is the finitely supported function `ℕ →₀ ℕ`
  mapping each prime factor of `n` to its multiplicity in `n`. -/
 def factorization (n : ℕ) : ℕ →₀ ℕ where
-  support := n.factors.toFinset
+  support := n.primeFactors
   toFun p := if p.Prime then padicValNat p n else 0
-  mem_support_toFun := by
-    rcases eq_or_ne n 0 with (rfl | hn0)
-    · simp
-    simp only [mem_factors hn0, mem_toFinset, Ne.def, ite_eq_right_iff, not_forall, exists_prop,
-      and_congr_right_iff]
-    rintro p hp
-    haveI := fact_iff.mpr hp
-    exact dvd_iff_padicValNat_ne_zero hn0
+  mem_support_toFun := by simp [not_or]; aesop
 #align nat.factorization Nat.factorization
 
+/-- The support of `n.factorization` is exactly `n.primeFactors`. -/
+@[simp] lemma support_factorization (n : ℕ) : (factorization n).support = n.primeFactors := rfl
+
 theorem factorization_def (n : ℕ) {p : ℕ} (pp : p.Prime) : n.factorization p = padicValNat p n := by
   simpa [factorization] using absurd pp
 #align nat.factorization_def Nat.factorization_def
@@ -122,37 +119,19 @@ theorem factorization_zero : factorization 0 = 0 := by simp [factorization]
 theorem factorization_one : factorization 1 = 0 := by simp [factorization]
 #align nat.factorization_one Nat.factorization_one
 
-/-- The support of `n.factorization` is exactly `n.factors.toFinset` -/
-@[simp]
-theorem support_factorization {n : ℕ} : n.factorization.support = n.factors.toFinset := by
-  simp [factorization]
-#align nat.support_factorization Nat.support_factorization
-
-theorem factor_iff_mem_factorization {n p : ℕ} : p ∈ n.factorization.support ↔ p ∈ n.factors := by
-  simp only [support_factorization, List.mem_toFinset]
-#align nat.factor_iff_mem_factorization Nat.factor_iff_mem_factorization
-
-theorem prime_of_mem_factorization {n p : ℕ} (hp : p ∈ n.factorization.support) : p.Prime :=
-  prime_of_mem_factors (factor_iff_mem_factorization.mp hp)
-#align nat.prime_of_mem_factorization Nat.prime_of_mem_factorization
+#noalign nat.support_factorization
 
-theorem pos_of_mem_factorization {n p : ℕ} (hp : p ∈ n.factorization.support) : 0 < p :=
-  Prime.pos (prime_of_mem_factorization hp)
-#align nat.pos_of_mem_factorization Nat.pos_of_mem_factorization
-
-theorem le_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support) : p ≤ n :=
-  le_of_mem_factors (factor_iff_mem_factorization.mp h)
-#align nat.le_of_mem_factorization Nat.le_of_mem_factorization
+#align nat.factor_iff_mem_factorization Nat.mem_primeFactors_iff_mem_factors
+#align nat.prime_of_mem_factorization Nat.prime_of_mem_primeFactors
+#align nat.pos_of_mem_factorization Nat.pos_of_mem_primeFactors
+#align nat.le_of_mem_factorization Nat.le_of_mem_primeFactors
 
 /-! ## Lemmas characterising when `n.factorization p = 0` -/
 
 
 theorem factorization_eq_zero_iff (n p : ℕ) :
     n.factorization p = 0 ↔ ¬p.Prime ∨ ¬p ∣ n ∨ n = 0 := by
-  rw [← not_mem_support_iff, support_factorization, mem_toFinset]
-  rcases eq_or_ne n 0 with (rfl | hn)
-  · simp
-  · simp [hn, Nat.mem_factors, not_and_or, -not_and]
+  simp_rw [← not_mem_support_iff, support_factorization, mem_primeFactors, not_and_or, not_ne_iff]
 #align nat.factorization_eq_zero_iff Nat.factorization_eq_zero_iff
 
 @[simp]
@@ -165,7 +144,7 @@ theorem factorization_eq_zero_of_not_dvd {n p : ℕ} (h : ¬p ∣ n) : n.factori
 #align nat.factorization_eq_zero_of_not_dvd Nat.factorization_eq_zero_of_not_dvd
 
 theorem factorization_eq_zero_of_lt {n p : ℕ} (h : n < p) : n.factorization p = 0 :=
-  Finsupp.not_mem_support_iff.mp (mt le_of_mem_factorization (not_le_of_lt h))
+  Finsupp.not_mem_support_iff.mp (mt le_of_mem_primeFactors (not_le_of_lt h))
 #align nat.factorization_eq_zero_of_lt Nat.factorization_eq_zero_of_lt
 
 @[simp]
@@ -179,7 +158,7 @@ theorem factorization_one_right (n : ℕ) : n.factorization 1 = 0 :=
 #align nat.factorization_one_right Nat.factorization_one_right
 
 theorem dvd_of_factorization_pos {n p : ℕ} (hn : n.factorization p ≠ 0) : p ∣ n :=
-  dvd_of_mem_factors (factor_iff_mem_factorization.1 (mem_support_iff.2 hn))
+  dvd_of_mem_factors $ mem_primeFactors_iff_mem_factors.1 $ mem_support_iff.2 hn
 #align nat.dvd_of_factorization_pos Nat.dvd_of_factorization_pos
 
 theorem Prime.factorization_pos_of_dvd {n p : ℕ} (hp : p.Prime) (hn : n ≠ 0) (h : p ∣ n) :
@@ -222,20 +201,16 @@ theorem factorization_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
     count_append]
 #align nat.factorization_mul Nat.factorization_mul
 
-theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
-    (a * b).factorization.support = a.factorization.support ∪ b.factorization.support := by
-  ext q
-  simp only [Finset.mem_union, factor_iff_mem_factorization]
-  exact mem_factors_mul ha hb
-#align nat.factorization_mul_support Nat.factorization_mul_support
-
-/-- If a product over `n.factorization` doesn't use the multiplicities of the prime factors
-then it's equal to the corresponding product over `n.factors.toFinset` -/
-theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type*} [CommMonoid β] (f : ℕ → β) :
-    (n.factorization.prod fun p _ => f p) = ∏ p in n.factors.toFinset, f p := by
-  apply prod_congr support_factorization
-  simp
-#align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_factors
+#align nat.factorization_mul_support Nat.primeFactors_mul
+
+/-- A product over `n.factorization` can be written as a product over `n.primeFactors`; -/
+lemma prod_factorization_eq_prod_primeFactors {β : Type*} [CommMonoid β] (f : ℕ → ℕ → β) :
+    n.factorization.prod f = ∏ p in n.primeFactors, f p (n.factorization p) := rfl
+#align nat.prod_factorization_eq_prod_factors Nat.prod_factorization_eq_prod_primeFactors
+
+/-- A product over `n.primeFactors` can be written as a product over `n.factorization`; -/
+lemma prod_primeFactors_prod_factorization {β : Type*} [CommMonoid β] (f : ℕ → β) :
+    ∏ p in n.primeFactors, f p = n.factorization.prod (fun p _ ↦ f p) := rfl
 
 /-- For any `p : ℕ` and any function `g : α → ℕ` that's non-zero on `S : Finset α`,
 the power of `p` in `S.prod g` equals the sum over `x ∈ S` of the powers of `p` in `g x`.
@@ -319,7 +294,7 @@ theorem eq_factorization_iff {n : ℕ} {f : ℕ →₀ ℕ} (hn : n ≠ 0) (hf :
 
 /-- The equiv between `ℕ+` and `ℕ →₀ ℕ` with support in the primes. -/
 def factorizationEquiv : ℕ+ ≃ { f : ℕ →₀ ℕ | ∀ p ∈ f.support, Prime p } where
-  toFun := fun ⟨n, _⟩ => ⟨n.factorization, fun _ => prime_of_mem_factorization⟩
+  toFun := fun ⟨n, _⟩ => ⟨n.factorization, fun _ => prime_of_mem_primeFactors⟩
   invFun := fun ⟨f, hf⟩ =>
     ⟨f.prod _, prod_pow_pos_of_zero_not_mem_support fun H => not_prime_zero (hf 0 H)⟩
   left_inv := fun ⟨_, hx⟩ => Subtype.ext <| factorization_prod_pow_eq_self hx.ne.symm
@@ -415,12 +390,7 @@ theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * or
 
 /-! ### Factorization and divisibility -/
 
-
-theorem dvd_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support) : p ∣ n := by
-  rcases eq_or_ne n 0 with (rfl | hn)
-  · simp
-  simp [← mem_factors_iff_dvd hn (prime_of_mem_factorization h), factor_iff_mem_factorization.mp h]
-#align nat.dvd_of_mem_factorization Nat.dvd_of_mem_factorization
+#align nat.dvd_of_mem_factorization Nat.dvd_of_mem_primeFactors
 
 /-- A crude upper bound on `n.factorization p` -/
 theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p < n := by
@@ -538,9 +508,7 @@ theorem factorization_ord_compl (n p : ℕ) :
   by_cases pp : p.Prime
   case neg =>
     -- porting note: needed to solve side goal explicitly
-    rw [Finsupp.erase_of_not_mem_support]
-    · simp [pp]
-    · simp [mt prime_of_mem_factors pp]
+    rw [Finsupp.erase_of_not_mem_support] <;> simp [pp]
   ext q
   rcases eq_or_ne q p with (rfl | hqp)
   · simp only [Finsupp.erase_same, factorization_eq_zero_iff, not_dvd_ord_compl pp hn]
@@ -651,12 +619,12 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) :
   exact h p _ pp (ord_proj_dvd _ _)
 #align nat.dvd_iff_prime_pow_dvd_dvd Nat.dvd_iff_prime_pow_dvd_dvd
 
-theorem prod_prime_factors_dvd (n : ℕ) : (∏ p : ℕ in n.factors.toFinset, p) ∣ n := by
+theorem prod_primeFactors_dvd (n : ℕ) : ∏ p in n.primeFactors, p ∣ n := by
   by_cases hn : n = 0
   · subst hn
     simp
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
-#align nat.prod_prime_factors_dvd Nat.prod_prime_factors_dvd
+#align nat.prod_prime_factors_dvd Nat.prod_primeFactors_dvd
 
 theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     (gcd a b).factorization = a.factorization ⊓ b.factorization := by
@@ -692,20 +660,18 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   exact (min_add_max _ _).symm
 #align nat.factorization_lcm Nat.factorization_lcm
 
-@[to_additive sum_factors_gcd_add_sum_factors_mul]
-theorem prod_factors_gcd_mul_prod_factors_mul {β : Type*} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
-    (m.gcd n).factors.toFinset.prod f * (m * n).factors.toFinset.prod f =
-      m.factors.toFinset.prod f * n.factors.toFinset.prod f := by
-  rcases eq_or_ne n 0 with (rfl | hm0)
+@[to_additive sum_primeFactors_gcd_add_sum_primeFactors_mul]
+theorem prod_primeFactors_gcd_mul_prod_primeFactors_mul {β : Type*} [CommMonoid β] (m n : ℕ)
+    (f : ℕ → β) :
+    (m.gcd n).primeFactors.prod f * (m * n).primeFactors.prod f =
+      m.primeFactors.prod f * n.primeFactors.prod f := by
+  obtain rfl | hm₀ := eq_or_ne m 0
   · simp
-  rcases eq_or_ne m 0 with (rfl | hn0)
+  obtain rfl | hn₀ := eq_or_ne n 0
   · simp
-  rw [← @Finset.prod_union_inter _ _ m.factors.toFinset n.factors.toFinset, mul_comm]
-  congr
-  · apply factors_mul_toFinset <;> assumption
-  · simp only [← support_factorization, factorization_gcd hn0 hm0, Finsupp.support_inf]
-#align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_factors_gcd_mul_prod_factors_mul
-#align nat.sum_factors_gcd_add_sum_factors_mul Nat.sum_factors_gcd_add_sum_factors_mul
+  · rw [primeFactors_mul hm₀ hn₀, primeFactors_gcd hm₀ hn₀, mul_comm, Finset.prod_union_inter]
+#align nat.prod_factors_gcd_mul_prod_factors_mul Nat.prod_primeFactors_gcd_mul_prod_primeFactors_mul
+#align nat.sum_factors_gcd_add_sum_factors_mul Nat.sum_primeFactors_gcd_add_sum_primeFactors_mul
 
 theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
     { i : ℕ | i ≠ 0 ∧ p ^ i ∣ n } = Set.Icc 1 (n.factorization p) := by
@@ -771,19 +737,8 @@ theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : Coprime a b) (hpb
   exact factorization_eq_of_coprime_left (coprime_comm.mp hab) hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 
-/-- The prime factorizations of coprime `a` and `b` are disjoint -/
-theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : Coprime a b) :
-    Disjoint a.factorization.support b.factorization.support := by
-  simpa only [support_factorization] using
-    disjoint_toFinset_iff_disjoint.mpr (coprime_factors_disjoint hab)
-#align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
-
-/-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
-theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : Coprime a b) :
-    (a * b).factorization.support = a.factorization.support ∪ b.factorization.support := by
-  rw [factorization_mul_of_coprime hab]
-  exact support_add_eq (factorization_disjoint_of_coprime hab)
-#align nat.factorization_mul_support_of_coprime Nat.factorization_mul_support_of_coprime
+#align nat.factorization_disjoint_of_coprime Nat.Coprime.disjoint_primeFactors
+#align nat.factorization_mul_support_of_coprime Nat.primeFactors_mul
 
 /-! ### Induction principles involving factorizations -/
 
@@ -869,25 +824,17 @@ theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → 
   · intro a b _ _ hab ha hb hab_pos
     rw [h_mult a b hab, ha (left_ne_zero_of_mul hab_pos), hb (right_ne_zero_of_mul hab_pos),
       factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
-    convert factorization_disjoint_of_coprime hab
+    exact hab.disjoint_primeFactors
 #align nat.multiplicative_factorization Nat.multiplicative_factorization
 
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type*} [CommMonoid β] (f : ℕ → β)
     (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
-    ∀ {n : ℕ}, f n = n.factorization.prod fun p k => f (p ^ k) := by
-  apply Nat.recOnPosPrimePosCoprime
-  · rintro p k hp -
-    simp only [hp.factorization_pow]
-    rw [prod_single_index _]
-    simp [hf1]
-  · simp [hf0]
-  · rw [factorization_one, hf1]
-    simp
-  · intro a b _ _ hab ha hb
-    rw [h_mult a b hab, ha, hb, factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
-    exact factorization_disjoint_of_coprime hab
+    f n = n.factorization.prod fun p k => f (p ^ k) := by
+  obtain rfl | hn := eq_or_ne n 0
+  · simpa
+  · exact multiplicative_factorization _ h_mult hf1 hn
 #align nat.multiplicative_factorization' Nat.multiplicative_factorization'
 
 /-- Two positive naturals are equal if their prime padic valuations are equal -/
@@ -911,16 +858,14 @@ theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n <
     rw [← factorization_prod_pow_eq_self hn]
   rw [eq_comm]
   apply Finset.prod_subset_one_on_sdiff
-  · exact fun p hp =>
-      Finset.mem_filter.mpr
-        ⟨Finset.mem_range.mpr (gt_of_gt_of_ge pr (le_of_mem_factorization hp)),
-          prime_of_mem_factorization hp⟩
+  · exact fun p hp => Finset.mem_filter.mpr ⟨Finset.mem_range.2 <| pr.trans_le' <|
+      le_of_mem_primeFactors hp, prime_of_mem_primeFactors hp⟩
   · intro p hp
     cases' Finset.mem_sdiff.mp hp with hp1 hp2
     rw [← factorization_def n (Finset.mem_filter.mp hp1).2]
     simp [Finsupp.not_mem_support_iff.mp hp2]
   · intro p hp
-    simp [factorization_def n (prime_of_mem_factorization hp)]
+    simp [factorization_def n (prime_of_mem_primeFactors hp)]
 #align nat.prod_pow_prime_padic_val_nat Nat.prod_pow_prime_padicValNat
 
 /-! ### Lemmas about factorizations of particular functions -/
chore: remove nonterminal simp (#7580)

Removes nonterminal simps on lines looking like simp [...]

Diff
@@ -426,7 +426,7 @@ theorem dvd_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support)
 theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p < n := by
   by_cases pp : p.Prime
   case neg =>
-    simp [factorization_eq_zero_of_non_prime n pp]
+    simp only [factorization_eq_zero_of_non_prime n pp]
     exact hn.bot_lt
   rw [← pow_lt_iff_lt_right pp.two_le]
   apply lt_of_le_of_lt (ord_proj_le p hn)
chore: tidy up a factorization proof (#7164)

This used to not work because the finsupp poisoned the computability, but it seems fine now. Also slightly tidied it whilst I was there.

However, I'm not sure if this is actually wise to keep as something towards Sort*: the created term on k + 2 is not pretty and has an Eq.mpr.

Diff
@@ -798,26 +798,16 @@ def recOnPrimePow {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1)
     | 0 => fun _ => h0
     | 1 => fun _ => h1
     | k + 2 => fun hk => by
-      let p := (k + 2).minFac
-      have hp : Prime p := minFac_prime (succ_succ_ne_one k)
-      -- the awkward `let` stuff here is because `factorization` is noncomputable (Finsupp);
-      -- we get around this by using the computable `factors.count`, and rewriting when we want
-      -- to use the `factorization` API
-      let t := (k + 2).factors.count p
-      have ht : t = (k + 2).factorization p := factors_count_eq
-      have hpt : p ^ t ∣ k + 2 := by
-        rw [ht]
-        exact ord_proj_dvd _ _
-      have htp : 0 < t := by
-        rw [ht]
-        exact hp.factorization_pos_of_dvd (Nat.succ_ne_zero _) (minFac_dvd _)
-      convert h ((k + 2) / p ^ t) p t hp _ _ _ using 1
+      letI p := (k + 2).minFac
+      haveI hp : Prime p := minFac_prime (succ_succ_ne_one k)
+      letI t := (k + 2).factorization p
+      haveI hpt : p ^ t ∣ k + 2 := ord_proj_dvd _ _
+      haveI htp : 0 < t := hp.factorization_pos_of_dvd (k + 1).succ_ne_zero (k + 2).minFac_dvd
+      convert h ((k + 2) / p ^ t) p t hp _ htp (hk _ (Nat.div_lt_of_lt_mul _)) using 1
       · rw [Nat.mul_div_cancel' hpt]
-      · rw [Nat.dvd_div_iff hpt, ← pow_succ, ht]
+      · rw [Nat.dvd_div_iff hpt, ← pow_succ]
         exact pow_succ_factorization_not_dvd (k + 1).succ_ne_zero hp
-      · exact htp
-      · apply hk _ (Nat.div_lt_of_lt_mul _)
-        rw [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne]
+      · rw [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne]
         exact hp.one_lt
         -- Porting note: was
         -- simp [lt_mul_iff_one_lt_left Nat.succ_pos', one_lt_pow_iff htp.ne, hp.one_lt]
@@ -851,7 +841,7 @@ def recOnPrimeCoprime {P : ℕ → Sort*} (h0 : P 0) (hp : ∀ p n : ℕ, Prime
 /-- Given `P 0`, `P 1`, `P p` for all primes, and a way to extend `P a` and `P b` to
 `P (a * b)`, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
-noncomputable def recOnMul {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p → P p)
+def recOnMul {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p → P p)
     (h : ∀ a b, P a → P b → P (a * b)) : ∀ a, P a :=
   let hp : ∀ p n : ℕ, Prime p → P (p ^ n) := fun p n hp' =>
     n.recOn h1 (fun n hn => by rw [pow_succ]; apply h _ _ hn (hp p hp'))
chore: bump to v4.1.0-rc1 (2nd attempt) (#7216)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -528,7 +528,7 @@ theorem not_dvd_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : ¬p ∣ or
   simp [hp.factorization]
 #align nat.not_dvd_ord_compl Nat.not_dvd_ord_compl
 
-theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : coprime p (ord_compl[p] n) :=
+theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : Coprime p (ord_compl[p] n) :=
   (or_iff_left (not_dvd_ord_compl hp hn)).mp <| coprime_or_dvd_of_prime hp _
 #align nat.coprime_ord_compl Nat.coprime_ord_compl
 
@@ -743,13 +743,13 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
 
 
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization p = a.factorization p + b.factorization p := by
   simp only [← factors_count_eq, perm_iff_count.mp (perm_factors_mul_of_coprime hab), count_append]
 #align nat.factorization_mul_apply_of_coprime Nat.factorization_mul_apply_of_coprime
 
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_of_coprime {a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization = a.factorization + b.factorization := by
   ext q
   rw [Finsupp.add_apply, factorization_mul_apply_of_coprime hab]
@@ -757,7 +757,7 @@ theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
 
 /-- If `p` is a prime factor of `a` then the power of `p` in `a` is the same that in `a * b`,
 for any `b` coprime to `a`. -/
-theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa : p ∈ a.factors) :
+theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : Coprime a b) (hpa : p ∈ a.factors) :
     (a * b).factorization p = a.factorization p := by
   rw [factorization_mul_apply_of_coprime hab, ← factors_count_eq, ← factors_count_eq,
     count_eq_zero_of_not_mem (coprime_factors_disjoint hab hpa), add_zero]
@@ -765,21 +765,21 @@ theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa
 
 /-- If `p` is a prime factor of `b` then the power of `p` in `b` is the same that in `a * b`,
 for any `a` coprime to `b`. -/
-theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb : p ∈ b.factors) :
+theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : Coprime a b) (hpb : p ∈ b.factors) :
     (a * b).factorization p = b.factorization p := by
   rw [mul_comm]
   exact factorization_eq_of_coprime_left (coprime_comm.mp hab) hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
-theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : Coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
   simpa only [support_factorization] using
     disjoint_toFinset_iff_disjoint.mpr (coprime_factors_disjoint hab)
 #align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
 
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
-theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support := by
   rw [factorization_mul_of_coprime hab]
   exact support_add_eq (factorization_disjoint_of_coprime hab)
@@ -827,7 +827,7 @@ def recOnPrimePow {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1)
 `P b` to `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPosPrimePosCoprime {P : ℕ → Sort*} (hp : ∀ p n : ℕ, Prime p → 0 < n → P (p ^ n))
-    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) :
+    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) :
     ∀ a, P a :=
   recOnPrimePow h0 h1 <| by
     intro a p n hp' hpa hn hPa
@@ -844,7 +844,7 @@ def recOnPosPrimePosCoprime {P : ℕ → Sort*} (hp : ∀ p n : ℕ, Prime p →
 `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPrimeCoprime {P : ℕ → Sort*} (h0 : P 0) (hp : ∀ p n : ℕ, Prime p → P (p ^ n))
-    (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
+    (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
   recOnPosPrimePosCoprime (fun p n h _ => hp p n h) h0 (hp 2 0 prime_two) h
 #align nat.rec_on_prime_coprime Nat.recOnPrimeCoprime
 
@@ -865,7 +865,7 @@ noncomputable def recOnMul {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1) (hp : ∀ p
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
     ∀ {n : ℕ}, n ≠ 0 → f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
   · rintro p k hp - -
@@ -885,7 +885,7 @@ theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → 
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type*} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
     ∀ {n : ℕ}, f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
   · rintro p k hp -
Revert "chore: bump to v4.1.0-rc1 (#7174)" (#7198)

This reverts commit 6f8e8104. Unfortunately this bump was not linted correctly, as CI did not run runLinter Mathlib.

We can unrevert once that's fixed.

Diff
@@ -528,7 +528,7 @@ theorem not_dvd_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : ¬p ∣ or
   simp [hp.factorization]
 #align nat.not_dvd_ord_compl Nat.not_dvd_ord_compl
 
-theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : Coprime p (ord_compl[p] n) :=
+theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : coprime p (ord_compl[p] n) :=
   (or_iff_left (not_dvd_ord_compl hp hn)).mp <| coprime_or_dvd_of_prime hp _
 #align nat.coprime_ord_compl Nat.coprime_ord_compl
 
@@ -743,13 +743,13 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
 
 
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : Coprime a b) :
+theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : coprime a b) :
     (a * b).factorization p = a.factorization p + b.factorization p := by
   simp only [← factors_count_eq, perm_iff_count.mp (perm_factors_mul_of_coprime hab), count_append]
 #align nat.factorization_mul_apply_of_coprime Nat.factorization_mul_apply_of_coprime
 
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_of_coprime {a b : ℕ} (hab : Coprime a b) :
+theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
     (a * b).factorization = a.factorization + b.factorization := by
   ext q
   rw [Finsupp.add_apply, factorization_mul_apply_of_coprime hab]
@@ -757,7 +757,7 @@ theorem factorization_mul_of_coprime {a b : ℕ} (hab : Coprime a b) :
 
 /-- If `p` is a prime factor of `a` then the power of `p` in `a` is the same that in `a * b`,
 for any `b` coprime to `a`. -/
-theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : Coprime a b) (hpa : p ∈ a.factors) :
+theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa : p ∈ a.factors) :
     (a * b).factorization p = a.factorization p := by
   rw [factorization_mul_apply_of_coprime hab, ← factors_count_eq, ← factors_count_eq,
     count_eq_zero_of_not_mem (coprime_factors_disjoint hab hpa), add_zero]
@@ -765,21 +765,21 @@ theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : Coprime a b) (hpa
 
 /-- If `p` is a prime factor of `b` then the power of `p` in `b` is the same that in `a * b`,
 for any `a` coprime to `b`. -/
-theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : Coprime a b) (hpb : p ∈ b.factors) :
+theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb : p ∈ b.factors) :
     (a * b).factorization p = b.factorization p := by
   rw [mul_comm]
   exact factorization_eq_of_coprime_left (coprime_comm.mp hab) hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
-theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : Coprime a b) :
+theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
   simpa only [support_factorization] using
     disjoint_toFinset_iff_disjoint.mpr (coprime_factors_disjoint hab)
 #align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
 
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
-theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : Coprime a b) :
+theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support := by
   rw [factorization_mul_of_coprime hab]
   exact support_add_eq (factorization_disjoint_of_coprime hab)
@@ -827,7 +827,7 @@ def recOnPrimePow {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1)
 `P b` to `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPosPrimePosCoprime {P : ℕ → Sort*} (hp : ∀ p n : ℕ, Prime p → 0 < n → P (p ^ n))
-    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) :
+    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) :
     ∀ a, P a :=
   recOnPrimePow h0 h1 <| by
     intro a p n hp' hpa hn hPa
@@ -844,7 +844,7 @@ def recOnPosPrimePosCoprime {P : ℕ → Sort*} (hp : ∀ p n : ℕ, Prime p →
 `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPrimeCoprime {P : ℕ → Sort*} (h0 : P 0) (hp : ∀ p n : ℕ, Prime p → P (p ^ n))
-    (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
+    (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
   recOnPosPrimePosCoprime (fun p n h _ => hp p n h) h0 (hp 2 0 prime_two) h
 #align nat.rec_on_prime_coprime Nat.recOnPrimeCoprime
 
@@ -865,7 +865,7 @@ noncomputable def recOnMul {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1) (hp : ∀ p
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
     ∀ {n : ℕ}, n ≠ 0 → f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
   · rintro p k hp - -
@@ -885,7 +885,7 @@ theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → 
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type*} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
     ∀ {n : ℕ}, f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
   · rintro p k hp -
chore: bump to v4.1.0-rc1 (#7174)

Some changes have already been review and delegated in #6910 and #7148.

The diff that needs looking at is https://github.com/leanprover-community/mathlib4/pull/7174/commits/64d6d07ee18163627c8f517eb31455411921c5ac

The std bump PR was insta-merged already!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -528,7 +528,7 @@ theorem not_dvd_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : ¬p ∣ or
   simp [hp.factorization]
 #align nat.not_dvd_ord_compl Nat.not_dvd_ord_compl
 
-theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : coprime p (ord_compl[p] n) :=
+theorem coprime_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : Coprime p (ord_compl[p] n) :=
   (or_iff_left (not_dvd_ord_compl hp hn)).mp <| coprime_or_dvd_of_prime hp _
 #align nat.coprime_ord_compl Nat.coprime_ord_compl
 
@@ -743,13 +743,13 @@ theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb :
 
 
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization p = a.factorization p + b.factorization p := by
   simp only [← factors_count_eq, perm_iff_count.mp (perm_factors_mul_of_coprime hab), count_append]
 #align nat.factorization_mul_apply_of_coprime Nat.factorization_mul_apply_of_coprime
 
 /-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
-theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_of_coprime {a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization = a.factorization + b.factorization := by
   ext q
   rw [Finsupp.add_apply, factorization_mul_apply_of_coprime hab]
@@ -757,7 +757,7 @@ theorem factorization_mul_of_coprime {a b : ℕ} (hab : coprime a b) :
 
 /-- If `p` is a prime factor of `a` then the power of `p` in `a` is the same that in `a * b`,
 for any `b` coprime to `a`. -/
-theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa : p ∈ a.factors) :
+theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : Coprime a b) (hpa : p ∈ a.factors) :
     (a * b).factorization p = a.factorization p := by
   rw [factorization_mul_apply_of_coprime hab, ← factors_count_eq, ← factors_count_eq,
     count_eq_zero_of_not_mem (coprime_factors_disjoint hab hpa), add_zero]
@@ -765,21 +765,21 @@ theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : coprime a b) (hpa
 
 /-- If `p` is a prime factor of `b` then the power of `p` in `b` is the same that in `a * b`,
 for any `a` coprime to `b`. -/
-theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : coprime a b) (hpb : p ∈ b.factors) :
+theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : Coprime a b) (hpb : p ∈ b.factors) :
     (a * b).factorization p = b.factorization p := by
   rw [mul_comm]
   exact factorization_eq_of_coprime_left (coprime_comm.mp hab) hpb
 #align nat.factorization_eq_of_coprime_right Nat.factorization_eq_of_coprime_right
 
 /-- The prime factorizations of coprime `a` and `b` are disjoint -/
-theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_disjoint_of_coprime {a b : ℕ} (hab : Coprime a b) :
     Disjoint a.factorization.support b.factorization.support := by
   simpa only [support_factorization] using
     disjoint_toFinset_iff_disjoint.mpr (coprime_factors_disjoint hab)
 #align nat.factorization_disjoint_of_coprime Nat.factorization_disjoint_of_coprime
 
 /-- For coprime `a` and `b` the prime factorization `a * b` is the union of those of `a` and `b` -/
-theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
+theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : Coprime a b) :
     (a * b).factorization.support = a.factorization.support ∪ b.factorization.support := by
   rw [factorization_mul_of_coprime hab]
   exact support_add_eq (factorization_disjoint_of_coprime hab)
@@ -827,7 +827,7 @@ def recOnPrimePow {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1)
 `P b` to `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPosPrimePosCoprime {P : ℕ → Sort*} (hp : ∀ p n : ℕ, Prime p → 0 < n → P (p ^ n))
-    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) :
+    (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) :
     ∀ a, P a :=
   recOnPrimePow h0 h1 <| by
     intro a p n hp' hpa hn hPa
@@ -844,7 +844,7 @@ def recOnPosPrimePosCoprime {P : ℕ → Sort*} (hp : ∀ p n : ℕ, Prime p →
 `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPrimeCoprime {P : ℕ → Sort*} (h0 : P 0) (hp : ∀ p n : ℕ, Prime p → P (p ^ n))
-    (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
+    (h : ∀ a b, 1 < a → 1 < b → Coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
   recOnPosPrimePosCoprime (fun p n h _ => hp p n h) h0 (hp 2 0 prime_two) h
 #align nat.rec_on_prime_coprime Nat.recOnPrimeCoprime
 
@@ -865,7 +865,7 @@ noncomputable def recOnMul {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1) (hp : ∀ p
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
     ∀ {n : ℕ}, n ≠ 0 → f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
   · rintro p k hp - -
@@ -885,7 +885,7 @@ theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → 
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
 theorem multiplicative_factorization' {β : Type*} [CommMonoid β] (f : ℕ → β)
-    (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
+    (h_mult : ∀ x y : ℕ, Coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
     ∀ {n : ℕ}, f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
   · rintro p k hp -
chore: bump Std (#6721)

This incorporates changes from https://github.com/leanprover-community/mathlib4/pull/6575

I have also renamed Multiset.countp to Multiset.countP for consistency.

Co-authored-by: James Gallichio <jamesgallicchio@gmail.com>

Co-authored-by: James <jamesgallicchio@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -183,7 +183,8 @@ theorem dvd_of_factorization_pos {n p : ℕ} (hn : n.factorization p ≠ 0) : p
 #align nat.dvd_of_factorization_pos Nat.dvd_of_factorization_pos
 
 theorem Prime.factorization_pos_of_dvd {n p : ℕ} (hp : p.Prime) (hn : n ≠ 0) (h : p ∣ n) :
-    0 < n.factorization p := by rwa [← factors_count_eq, count_pos, mem_factors_iff_dvd hn hp]
+    0 < n.factorization p := by
+    rwa [← factors_count_eq, count_pos_iff_mem, mem_factors_iff_dvd hn hp]
 #align nat.prime.factorization_pos_of_dvd Nat.Prime.factorization_pos_of_dvd
 
 theorem factorization_eq_zero_of_remainder {p r : ℕ} (i : ℕ) (hr : ¬p ∣ r) :
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -230,7 +230,7 @@ theorem factorization_mul_support {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
 
 /-- If a product over `n.factorization` doesn't use the multiplicities of the prime factors
 then it's equal to the corresponding product over `n.factors.toFinset` -/
-theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid β] (f : ℕ → β) :
+theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type*} [CommMonoid β] (f : ℕ → β) :
     (n.factorization.prod fun p _ => f p) = ∏ p in n.factors.toFinset, f p := by
   apply prod_congr support_factorization
   simp
@@ -239,7 +239,7 @@ theorem prod_factorization_eq_prod_factors {n : ℕ} {β : Type _} [CommMonoid 
 /-- For any `p : ℕ` and any function `g : α → ℕ` that's non-zero on `S : Finset α`,
 the power of `p` in `S.prod g` equals the sum over `x ∈ S` of the powers of `p` in `g x`.
 Generalises `factorization_mul`, which is the special case where `S.card = 2` and `g = id`. -/
-theorem factorization_prod {α : Type _} {S : Finset α} {g : α → ℕ} (hS : ∀ x ∈ S, g x ≠ 0) :
+theorem factorization_prod {α : Type*} {S : Finset α} {g : α → ℕ} (hS : ∀ x ∈ S, g x ≠ 0) :
     (S.prod g).factorization = S.sum fun x => (g x).factorization := by
   classical
     ext p
@@ -692,7 +692,7 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
 #align nat.factorization_lcm Nat.factorization_lcm
 
 @[to_additive sum_factors_gcd_add_sum_factors_mul]
-theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
+theorem prod_factors_gcd_mul_prod_factors_mul {β : Type*} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
     (m.gcd n).factors.toFinset.prod f * (m * n).factors.toFinset.prod f =
       m.factors.toFinset.prod f * n.factors.toFinset.prod f := by
   rcases eq_or_ne n 0 with (rfl | hm0)
@@ -790,7 +790,7 @@ theorem factorization_mul_support_of_coprime {a b : ℕ} (hab : coprime a b) :
 /-- Given `P 0, P 1` and a way to extend `P a` to `P (p ^ n * a)` for prime `p` not dividing `a`,
 we can define `P` for all natural numbers. -/
 @[elab_as_elim]
-def recOnPrimePow {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1)
+def recOnPrimePow {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1)
     (h : ∀ a p n : ℕ, p.Prime → ¬p ∣ a → 0 < n → P a → P (p ^ n * a)) : ∀ a : ℕ, P a := fun a =>
   Nat.strongRecOn a fun n =>
     match n with
@@ -825,7 +825,7 @@ def recOnPrimePow {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1)
 /-- Given `P 0`, `P 1`, and `P (p ^ n)` for positive prime powers, and a way to extend `P a` and
 `P b` to `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
-def recOnPosPrimePosCoprime {P : ℕ → Sort _} (hp : ∀ p n : ℕ, Prime p → 0 < n → P (p ^ n))
+def recOnPosPrimePosCoprime {P : ℕ → Sort*} (hp : ∀ p n : ℕ, Prime p → 0 < n → P (p ^ n))
     (h0 : P 0) (h1 : P 1) (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) :
     ∀ a, P a :=
   recOnPrimePow h0 h1 <| by
@@ -842,7 +842,7 @@ def recOnPosPrimePosCoprime {P : ℕ → Sort _} (hp : ∀ p n : ℕ, Prime p 
 /-- Given `P 0`, `P (p ^ n)` for all prime powers, and a way to extend `P a` and `P b` to
 `P (a * b)` when `a, b` are positive coprime, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
-def recOnPrimeCoprime {P : ℕ → Sort _} (h0 : P 0) (hp : ∀ p n : ℕ, Prime p → P (p ^ n))
+def recOnPrimeCoprime {P : ℕ → Sort*} (h0 : P 0) (hp : ∀ p n : ℕ, Prime p → P (p ^ n))
     (h : ∀ a b, 1 < a → 1 < b → coprime a b → P a → P b → P (a * b)) : ∀ a, P a :=
   recOnPosPrimePosCoprime (fun p n h _ => hp p n h) h0 (hp 2 0 prime_two) h
 #align nat.rec_on_prime_coprime Nat.recOnPrimeCoprime
@@ -850,7 +850,7 @@ def recOnPrimeCoprime {P : ℕ → Sort _} (h0 : P 0) (hp : ∀ p n : ℕ, Prime
 /-- Given `P 0`, `P 1`, `P p` for all primes, and a way to extend `P a` and `P b` to
 `P (a * b)`, we can define `P` for all natural numbers. -/
 @[elab_as_elim]
-noncomputable def recOnMul {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p → P p)
+noncomputable def recOnMul {P : ℕ → Sort*} (h0 : P 0) (h1 : P 1) (hp : ∀ p, Prime p → P p)
     (h : ∀ a b, P a → P b → P (a * b)) : ∀ a, P a :=
   let hp : ∀ p n : ℕ, Prime p → P (p ^ n) := fun p n hp' =>
     n.recOn h1 (fun n hn => by rw [pow_succ]; apply h _ _ hn (hp p hp'))
@@ -863,7 +863,7 @@ noncomputable def recOnMul {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1) (hp : ∀
 
 /-- For any multiplicative function `f` with `f 1 = 1` and any `n ≠ 0`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
-theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ → β)
+theorem multiplicative_factorization {β : Type*} [CommMonoid β] (f : ℕ → β)
     (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf : f 1 = 1) :
     ∀ {n : ℕ}, n ≠ 0 → f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
@@ -883,7 +883,7 @@ theorem multiplicative_factorization {β : Type _} [CommMonoid β] (f : ℕ →
 
 /-- For any multiplicative function `f` with `f 1 = 1` and `f 0 = 1`,
 we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
-theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ → β)
+theorem multiplicative_factorization' {β : Type*} [CommMonoid β] (f : ℕ → β)
     (h_mult : ∀ x y : ℕ, coprime x y → f (x * y) = f x * f y) (hf0 : f 0 = 1) (hf1 : f 1 = 1) :
     ∀ {n : ℕ}, f n = n.factorization.prod fun p k => f (p ^ k) := by
   apply Nat.recOnPosPrimePosCoprime
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Stuart Presnell. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Stuart Presnell
-
-! This file was ported from Lean 3 source module data.nat.factorization.basic
-! leanprover-community/mathlib commit f694c7dead66f5d4c80f446c796a5aad14707f0e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.BigOperators.Finsupp
 import Mathlib.Data.Finsupp.Multiset
@@ -15,6 +10,8 @@ import Mathlib.NumberTheory.Padics.PadicVal
 import Mathlib.Data.Nat.Interval
 import Mathlib.Tactic.IntervalCases
 
+#align_import data.nat.factorization.basic from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
+
 /-!
 # Prime factorizations
 
feat: port Init.Data.Nat.Lemmas (#5782)

Previously this was an ad-hoc port

Diff
@@ -795,7 +795,7 @@ we can define `P` for all natural numbers. -/
 @[elab_as_elim]
 def recOnPrimePow {P : ℕ → Sort _} (h0 : P 0) (h1 : P 1)
     (h : ∀ a p n : ℕ, p.Prime → ¬p ∣ a → 0 < n → P a → P (p ^ n * a)) : ∀ a : ℕ, P a := fun a =>
-  Nat.strong_rec_on a fun n =>
+  Nat.strongRecOn a fun n =>
     match n with
     | 0 => fun _ => h0
     | 1 => fun _ => h1
chore: tidy various files (#5449)
Diff
@@ -504,8 +504,6 @@ theorem exists_factorization_lt_of_lt {a b : ℕ} (ha : a ≠ 0) (hab : a < b) :
     ∃ p : ℕ, a.factorization p < b.factorization p := by
   have hb : b ≠ 0 := (ha.bot_lt.trans hab).ne'
   contrapose! hab
-  -- Porting note: `push_neg` fails to push the negation
-  simp_rw [not_exists, not_lt] at hab
   rw [← Finsupp.le_def, factorization_le_iff_dvd hb ha] at hab
   exact le_of_dvd ha.bot_lt hab
 #align nat.exists_factorization_lt_of_lt Nat.exists_factorization_lt_of_lt
fix: fix simp regression (#4982)

Presumably a consequence of https://github.com/leanprover/lean4/pull/2266 .

Diff
@@ -89,9 +89,7 @@ theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p :=
 theorem factorization_eq_factors_multiset (n : ℕ) :
     n.factorization = Multiset.toFinsupp (n.factors : Multiset ℕ) := by
   ext p
-  -- porting note: previously closed with `simp`
-  simp only [Multiset.toFinsupp_apply, Multiset.mem_coe, Multiset.coe_nodup, Multiset.coe_count]
-  rw [@factors_count_eq n p] -- porting note: TODO: why doesn't `factors_count_eq` take here?
+  simp
 #align nat.factorization_eq_factors_multiset Nat.factorization_eq_factors_multiset
 
 theorem multiplicity_eq_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
chore: tidy various files (#3233)
Diff
@@ -57,7 +57,8 @@ def factorization (n : ℕ) : ℕ →₀ ℕ where
   support := n.factors.toFinset
   toFun p := if p.Prime then padicValNat p n else 0
   mem_support_toFun := by
-    rcases eq_or_ne n 0 with (rfl | hn0); · simp
+    rcases eq_or_ne n 0 with (rfl | hn0)
+    · simp
     simp only [mem_factors hn0, mem_toFinset, Ne.def, ite_eq_right_iff, not_forall, exists_prop,
       and_congr_right_iff]
     rintro p hp
@@ -75,8 +76,9 @@ of `p` in the factorization of `n`: we declare the former to be the simp-normal
 theorem factors_count_eq {n p : ℕ} : n.factors.count p = n.factorization p := by
   rcases n.eq_zero_or_pos with (rfl | hn0)
   · simp [factorization, count]
-  by_cases pp : p.Prime; swap
-  · rw [count_eq_zero_of_not_mem (mt prime_of_mem_factors pp)]
+  by_cases pp : p.Prime
+  case neg =>
+    rw [count_eq_zero_of_not_mem (mt prime_of_mem_factors pp)]
     simp [factorization, pp]
   simp only [factorization, coe_mk, pp, if_true]
   rw [← PartENat.natCast_inj, padicValNat_def' pp.ne_one hn0,
@@ -201,9 +203,9 @@ theorem factorization_eq_zero_iff_remainder {p r : ℕ} (i : ℕ) (pp : p.Prime)
   rw [factorization_eq_zero_iff] at h
   contrapose! h
   refine' ⟨pp, _, _⟩
-  · rwa [← Nat.dvd_add_iff_right (Dvd.intro i rfl)]
+  · rwa [← Nat.dvd_add_iff_right (dvd_mul_right p i)]
   · contrapose! hr0
-    exact (_root_.add_eq_zero_iff.mp hr0).2
+    exact (add_eq_zero_iff.mp hr0).2
 #align nat.factorization_eq_zero_iff_remainder Nat.factorization_eq_zero_iff_remainder
 
 /-- The only numbers with empty prime factorization are `0` and `1` -/
@@ -347,12 +349,10 @@ complementary projection. The term `n.factorization p` is the $p$-adic order its
 For example, `ord_proj[2] n` is the even part of `n` and `ord_compl[2] n` is the odd part. -/
 
 
--- mathport name: «exprord_proj[ ] »
 -- porting note: Lean 4 thinks we need `HPow` without this
 set_option quotPrecheck false in
 notation "ord_proj[" p "] " n:arg => p ^ Nat.factorization n p
 
--- mathport name: «exprord_compl[ ] »
 notation "ord_compl[" p "] " n:arg => n / ord_proj[p] n
 
 @[simp]
@@ -366,7 +366,8 @@ theorem ord_compl_of_not_prime (n p : ℕ) (hp : ¬p.Prime) : ord_compl[p] n = n
 #align nat.ord_compl_of_not_prime Nat.ord_compl_of_not_prime
 
 theorem ord_proj_dvd (n p : ℕ) : ord_proj[p] n ∣ n := by
-  by_cases hp : p.Prime; swap; · simp [hp]
+  by_cases hp : p.Prime
+  case neg => simp [hp]
   rw [← factors_count_eq]
   apply dvd_of_factors_subperm (pow_ne_zero _ hp.ne_zero)
   rw [hp.factors_pow, List.subperm_ext_iff]
@@ -408,8 +409,10 @@ theorem ord_proj_mul {a b : ℕ} (p : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
 #align nat.ord_proj_mul Nat.ord_proj_mul
 
 theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * ord_compl[p] b := by
-  rcases eq_or_ne a 0 with (rfl | ha); · simp
-  rcases eq_or_ne b 0 with (rfl | hb); · simp
+  rcases eq_or_ne a 0 with (rfl | ha)
+  · simp
+  rcases eq_or_ne b 0 with (rfl | hb)
+  · simp
   simp only [ord_proj_mul p ha hb]
   rw [mul_div_mul_comm_of_dvd_dvd (ord_proj_dvd a p) (ord_proj_dvd b p)]
 #align nat.ord_compl_mul Nat.ord_compl_mul
@@ -418,14 +421,16 @@ theorem ord_compl_mul (a b p : ℕ) : ord_compl[p] (a * b) = ord_compl[p] a * or
 
 
 theorem dvd_of_mem_factorization {n p : ℕ} (h : p ∈ n.factorization.support) : p ∣ n := by
-  rcases eq_or_ne n 0 with (rfl | hn); · simp
+  rcases eq_or_ne n 0 with (rfl | hn)
+  · simp
   simp [← mem_factors_iff_dvd hn (prime_of_mem_factorization h), factor_iff_mem_factorization.mp h]
 #align nat.dvd_of_mem_factorization Nat.dvd_of_mem_factorization
 
 /-- A crude upper bound on `n.factorization p` -/
 theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p < n := by
-  by_cases pp : p.Prime; swap;
-  · simp [factorization_eq_zero_of_non_prime n pp]
+  by_cases pp : p.Prime
+  case neg =>
+    simp [factorization_eq_zero_of_non_prime n pp]
     exact hn.bot_lt
   rw [← pow_lt_iff_lt_right pp.two_le]
   apply lt_of_le_of_lt (ord_proj_le p hn)
@@ -434,7 +439,8 @@ theorem factorization_lt {n : ℕ} (p : ℕ) (hn : n ≠ 0) : n.factorization p
 
 /-- An upper bound on `n.factorization p` -/
 theorem factorization_le_of_le_pow {n p b : ℕ} (hb : n ≤ p ^ b) : n.factorization p ≤ b := by
-  rcases eq_or_ne n 0 with (rfl | hn); · simp
+  rcases eq_or_ne n 0 with (rfl | hn)
+  · simp
   by_cases pp : p.Prime
   · exact (pow_le_iff_le_right pp.two_le).1 (le_trans (ord_proj_le p hn) hb)
   · simp [factorization_eq_zero_of_non_prime n pp]
@@ -469,7 +475,8 @@ theorem pow_succ_factorization_not_dvd {n p : ℕ} (hn : n ≠ 0) (hp : p.Prime)
 
 theorem factorization_le_factorization_mul_left {a b : ℕ} (hb : b ≠ 0) :
     a.factorization ≤ (a * b).factorization := by
-  rcases eq_or_ne a 0 with (rfl | ha); · simp
+  rcases eq_or_ne a 0 with (rfl | ha)
+  · simp
   rw [factorization_le_iff_dvd ha <| mul_ne_zero ha hb]
   exact Dvd.intro b rfl
 #align nat.factorization_le_factorization_mul_left Nat.factorization_le_factorization_mul_left
@@ -604,14 +611,18 @@ theorem ord_proj_dvd_ord_proj_iff_dvd {a b : ℕ} (ha0 : a ≠ 0) (hb0 : b ≠ 0
 
 theorem ord_compl_dvd_ord_compl_of_dvd {a b : ℕ} (hab : a ∣ b) (p : ℕ) :
     ord_compl[p] a ∣ ord_compl[p] b := by
-  rcases em' p.Prime with (pp | pp); · simp [pp, hab]
-  rcases eq_or_ne b 0 with (rfl | hb0); · simp
-  rcases eq_or_ne a 0 with (rfl | ha0); · cases hb0 (zero_dvd_iff.1 hab)
+  rcases em' p.Prime with (pp | pp)
+  · simp [pp, hab]
+  rcases eq_or_ne b 0 with (rfl | hb0)
+  · simp
+  rcases eq_or_ne a 0 with (rfl | ha0)
+  · cases hb0 (zero_dvd_iff.1 hab)
   have ha := (Nat.div_pos (ord_proj_le p ha0) (ord_proj_pos a p)).ne'
   have hb := (Nat.div_pos (ord_proj_le p hb0) (ord_proj_pos b p)).ne'
   rw [← factorization_le_iff_dvd ha hb, factorization_ord_compl a p, factorization_ord_compl b p]
   intro q
-  rcases eq_or_ne q p with (rfl | hqp); · simp
+  rcases eq_or_ne q p with (rfl | hqp)
+  · simp
   simp_rw [erase_ne hqp]
   exact (factorization_le_iff_dvd ha0 hb0).2 hab q
 #align nat.ord_compl_dvd_ord_compl_of_dvd Nat.ord_compl_dvd_ord_compl_of_dvd
@@ -619,9 +630,12 @@ theorem ord_compl_dvd_ord_compl_of_dvd {a b : ℕ} (hab : a ∣ b) (p : ℕ) :
 theorem ord_compl_dvd_ord_compl_iff_dvd (a b : ℕ) :
     (∀ p : ℕ, ord_compl[p] a ∣ ord_compl[p] b) ↔ a ∣ b := by
   refine' ⟨fun h => _, fun hab p => ord_compl_dvd_ord_compl_of_dvd hab p⟩
-  rcases eq_or_ne b 0 with (rfl | hb0); · simp
-  by_cases pa : a.Prime; swap; · simpa [pa] using h a
-  by_cases pb : b.Prime; swap; · simpa [pb] using h b
+  rcases eq_or_ne b 0 with (rfl | hb0)
+  · simp
+  by_cases pa : a.Prime
+  case neg => simpa [pa] using h a
+  by_cases pb : b.Prime
+  case neg => simpa [pb] using h b
   rw [prime_dvd_prime_iff_eq pa pb]
   by_contra hab
   apply pa.ne_one
@@ -631,7 +645,8 @@ theorem ord_compl_dvd_ord_compl_iff_dvd (a b : ℕ) :
 
 theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) :
     d ∣ n ↔ ∀ p k : ℕ, Prime p → p ^ k ∣ d → p ^ k ∣ n := by
-  rcases eq_or_ne n 0 with (rfl | hn); · simp
+  rcases eq_or_ne n 0 with (rfl | hn)
+  · simp
   rcases eq_or_ne d 0 with (rfl | hd)
   · simp only [zero_dvd_iff, hn, false_iff_iff, not_forall]
     exact ⟨2, n, prime_two, dvd_zero _, mt (le_of_dvd hn.bot_lt) (lt_two_pow n).not_le⟩
@@ -643,7 +658,7 @@ theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) :
 #align nat.dvd_iff_prime_pow_dvd_dvd Nat.dvd_iff_prime_pow_dvd_dvd
 
 theorem prod_prime_factors_dvd (n : ℕ) : (∏ p : ℕ in n.factors.toFinset, p) ∣ n := by
-  by_cases hn : n = 0;
+  by_cases hn : n = 0
   · subst hn
     simp
   simpa [prod_factors hn] using Multiset.toFinset_prod_dvd_prod (n.factors : Multiset ℕ)
@@ -658,7 +673,7 @@ theorem factorization_gcd {a b : ℕ} (ha_pos : a ≠ 0) (hb_pos : b ≠ 0) :
     have : p ∈ a.factors ∧ p ∈ b.factors := by simpa using hp
     exact prime_of_mem_factors this.1
   have h1 : d.factorization = dfac := prod_pow_factorization_eq_self dfac_prime
-  have hd_pos : d ≠ 0 := (factorizationEquiv.invFun ⟨dfac, dfac_prime⟩).2.ne.symm
+  have hd_pos : d ≠ 0 := (factorizationEquiv.invFun ⟨dfac, dfac_prime⟩).2.ne'
   suffices d = gcd a b by rwa [← this]
   apply gcd_greatest
   · rw [← factorization_le_iff_dvd hd_pos ha_pos, h1]
@@ -679,15 +694,18 @@ theorem factorization_lcm {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
   rw [← add_right_inj (a.gcd b).factorization, ←
     factorization_mul (mt gcd_eq_zero_iff.1 fun h => ha h.1) (lcm_ne_zero ha hb), gcd_mul_lcm,
     factorization_gcd ha hb, factorization_mul ha hb]
-  ext1; exact (min_add_max _ _).symm
+  ext1
+  exact (min_add_max _ _).symm
 #align nat.factorization_lcm Nat.factorization_lcm
 
 @[to_additive sum_factors_gcd_add_sum_factors_mul]
 theorem prod_factors_gcd_mul_prod_factors_mul {β : Type _} [CommMonoid β] (m n : ℕ) (f : ℕ → β) :
     (m.gcd n).factors.toFinset.prod f * (m * n).factors.toFinset.prod f =
       m.factors.toFinset.prod f * n.factors.toFinset.prod f := by
-  rcases eq_or_ne n 0 with (rfl | hm0); · simp
-  rcases eq_or_ne m 0 with (rfl | hn0); · simp
+  rcases eq_or_ne n 0 with (rfl | hm0)
+  · simp
+  rcases eq_or_ne m 0 with (rfl | hn0)
+  · simp
   rw [← @Finset.prod_union_inter _ _ m.factors.toFinset n.factors.toFinset, mul_comm]
   congr
   · apply factors_mul_toFinset <;> assumption
@@ -705,7 +723,8 @@ theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n 
 positive natural numbers up to `n.factorization p`. -/
 theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
     Icc 1 (n.factorization p) = (Ico 1 n).filter fun i : ℕ => p ^ i ∣ n := by
-  rcases eq_or_ne n 0 with (rfl | hn); · simp
+  rcases eq_or_ne n 0 with (rfl | hn)
+  · simp
   ext x
   simp only [mem_Icc, Finset.mem_filter, mem_Ico, and_assoc, and_congr_right_iff,
     pp.pow_dvd_iff_le_factorization hn, iff_and_self]
@@ -884,7 +903,7 @@ theorem multiplicative_factorization' {β : Type _} [CommMonoid β] (f : ℕ →
     simp
   · intro a b _ _ hab ha hb
     rw [h_mult a b hab, ha, hb, factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
-    convert factorization_disjoint_of_coprime hab
+    exact factorization_disjoint_of_coprime hab
 #align nat.multiplicative_factorization' Nat.multiplicative_factorization'
 
 /-- Two positive naturals are equal if their prime padic valuations are equal -/
@@ -926,7 +945,8 @@ theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n <
 -- TODO: Port lemmas from `Data/Nat/Multiplicity` to here, re-written in terms of `factorization`
 /-- Exactly `n / p` naturals in `[1, n]` are multiples of `p`. -/
 theorem card_multiples (n p : ℕ) : card ((Finset.range n).filter fun e => p ∣ e + 1) = n / p := by
-  induction' n with n hn; · simp
+  induction' n with n hn
+  · simp
   simp [Nat.succ_div, add_ite, add_zero, Finset.range_succ, filter_insert, apply_ite card,
     card_insert_of_not_mem, hn]
 #align nat.card_multiples Nat.card_multiples
feat: Port/Data.Nat.Factorization.Basic (#3043)

Co-authored-by: qawbecrdtey <qawbecrdtey@naver.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Dependencies 8 + 480

481 files ported (98.4%)
198928 lines ported (98.5%)
Show graph

The unported dependencies are