Skip to content

Commit a19f0b8

Browse files
Merge master into nightly-testing
2 parents 2c3b2d9 + b2540cf commit a19f0b8

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

Diff for: Mathlib/Algebra/Associated.lean

+8-5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ theorem dvd_or_dvd (hp : Prime p) {a b : α} (h : p ∣ a * b) : p ∣ a ∨ p
4848
hp.2.2 a b h
4949
#align prime.dvd_or_dvd Prime.dvd_or_dvd
5050

51+
theorem dvd_mul {a b : α} : p ∣ a * b ↔ p ∣ a ∨ p ∣ b :=
52+
⟨hp.dvd_or_dvd, (Or.elim · (dvd_mul_of_dvd_left · _) (dvd_mul_of_dvd_right · _))⟩
53+
54+
theorem not_dvd_mul {a b : α} (ha : ¬ p ∣ a) (hb : ¬ p ∣ b) : ¬ p ∣ a * b :=
55+
hp.dvd_mul.not.mpr <| not_or.mpr ⟨ha, hb⟩
56+
5157
theorem dvd_of_dvd_pow (hp : Prime p) {a : α} {n : ℕ} (h : p ∣ a ^ n) : p ∣ a := by
5258
induction' n with n ih
5359
· rw [pow_zero] at h
@@ -60,11 +66,8 @@ theorem dvd_of_dvd_pow (hp : Prime p) {a : α} {n : ℕ} (h : p ∣ a ^ n) : p
6066
exact ih dvd_pow
6167
#align prime.dvd_of_dvd_pow Prime.dvd_of_dvd_pow
6268

63-
theorem dvd_mul {a b : α} : p ∣ a * b ↔ p ∣ a ∨ p ∣ b :=
64-
⟨hp.dvd_or_dvd, (Or.elim · (dvd_mul_of_dvd_left · _) (dvd_mul_of_dvd_right · _))⟩
65-
66-
theorem not_dvd_mul {a b : α} (ha : ¬ p ∣ a) (hb : ¬ p ∣ b) : ¬ p ∣ a * b :=
67-
hp.dvd_mul.not.mpr <| not_or.mpr ⟨ha, hb⟩
69+
theorem dvd_pow_iff_dvd {a : α} {n : ℕ} (hn : n ≠ 0) : p ∣ a ^ n ↔ p ∣ a :=
70+
⟨hp.dvd_of_dvd_pow, (dvd_pow · hn)⟩
6871

6972
end Prime
7073

Diff for: Mathlib/Algebra/BigOperators/Associated.lean

+13
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M × N} :
5757
fun ⟨⟨u₁, h₁⟩, ⟨u₂, h₂⟩⟩ =>
5858
⟨MulEquiv.prodUnits.invFun (u₁, u₂), Prod.eq_iff_fst_eq_snd_eq.2 ⟨h₁, h₂⟩⟩⟩
5959

60+
theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) (f : ι → M)
61+
(g : ι → M) (h : ∀ i, i ∈ s → (f i) ~ᵤ (g i)) : (∏ i in s, f i) ~ᵤ (∏ i in s, g i) := by
62+
induction s using Finset.induction with
63+
| empty =>
64+
simp only [Finset.prod_empty]
65+
rfl
66+
| @insert j s hjs IH =>
67+
classical
68+
convert_to (∏ i in insert j s, f i) ~ᵤ (∏ i in insert j s, g i)
69+
rw [Finset.prod_insert hjs, Finset.prod_insert hjs]
70+
exact Associated.mul_mul (h j (Finset.mem_insert_self j s))
71+
(IH (fun i hi ↦ h i (Finset.mem_insert_of_mem hi)))
72+
6073
theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero α] {p : α} (hp : Prime p)
6174
{s : Multiset α} : (∀ r ∈ s, Prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q :=
6275
Multiset.induction_on s (by simp [mt isUnit_iff_dvd_one.2 hp.not_unit]) fun a s ih hs hps => by

Diff for: Mathlib/Algebra/Ring/Units.lean

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ theorem IsUnit.neg_iff [Monoid α] [HasDistribNeg α] (a : α) : IsUnit (-a) ↔
101101
fun h => neg_neg a ▸ h.neg, IsUnit.neg⟩
102102
#align is_unit.neg_iff IsUnit.neg_iff
103103

104+
theorem isUnit_neg_one [Monoid α] [HasDistribNeg α] : IsUnit (-1 : α) := isUnit_one.neg
105+
104106
theorem IsUnit.sub_iff [Ring α] {x y : α} : IsUnit (x - y) ↔ IsUnit (y - x) :=
105107
(IsUnit.neg_iff _).symm.trans <| neg_sub x y ▸ Iff.rfl
106108
#align is_unit.sub_iff IsUnit.sub_iff

0 commit comments

Comments
 (0)