Skip to content

Commit f7c46cf

Browse files
erdOneocfnash
andcommitted
feat(RingTheory): results on resultant (#30983)
Also changed the definition of `sylvesterMatrix` because the old definition has the wrong sign. Co-authored-by: Oliver Nash <github@olivernash.org>
1 parent af53327 commit f7c46cf

File tree

5 files changed

+310
-35
lines changed

5 files changed

+310
-35
lines changed

Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ theorem prod_eq_single {s : Finset ι} {f : ι → M} (a : ι) (h₀ : ∀ b ∈
356356
(prod_congr rfl fun b hb => h₀ b hb <| by rintro rfl; exact this hb).trans <|
357357
prod_const_one.trans (h₁ this).symm
358358

359+
@[to_additive (attr := simp)]
360+
lemma prod_ite_mem_eq [Fintype ι] (s : Finset ι) (f : ι → M) [DecidablePred (· ∈ s)] :
361+
(∏ i, if i ∈ s then f i else 1) = ∏ i ∈ s, f i := by
362+
rw [← Finset.prod_filter]; congr; aesop
363+
359364
@[to_additive]
360365
lemma prod_eq_ite [DecidableEq ι] {s : Finset ι} {f : ι → M} (a : ι)
361366
(h₀ : ∀ b ∈ s, b ≠ a → f b = 1) :
@@ -487,7 +492,8 @@ theorem prod_extend_by_one [DecidableEq ι] (s : Finset ι) (f : ι → M) :
487492
∏ i ∈ s, (if i ∈ s then f i else 1) = ∏ i ∈ s, f i :=
488493
(prod_congr rfl) fun _i hi => if_pos hi
489494

490-
@[to_additive]
495+
/-- Also see `Finset.prod_ite_mem_eq` -/
496+
@[to_additive /-- Also see `Finset.sum_ite_mem_eq` -/]
491497
theorem prod_eq_prod_extend (f : s → M) : ∏ x, f x = ∏ x ∈ s, Subtype.val.extend f 1 x := by
492498
rw [univ_eq_attach, ← Finset.prod_attach s]
493499
congr with ⟨x, hx⟩

Mathlib/Data/Multiset/Bind.lean

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,21 @@ theorem card_product : card (s ×ˢ t) = card s * card t := by simp [SProd.sprod
290290

291291
variable {s t}
292292

293-
@[simp] lemma mem_product : ∀ {p : α × β}, p ∈ @product α β s t ↔ p.1 ∈ s ∧ p.2 ∈ t
294-
| (a, b) => by simp [product, and_left_comm]
293+
@[simp] lemma mem_product : ∀ {p : α × β}, p ∈ s ×ˢ t ↔ p.1 ∈ s ∧ p.2 ∈ t
294+
| (a, b) => by simp [SProd.sprod, product, and_left_comm]
295295

296296
protected theorem Nodup.product : Nodup s → Nodup t → Nodup (s ×ˢ t) :=
297297
Quotient.inductionOn₂ s t fun l₁ l₂ d₁ d₂ => by simp [List.Nodup.product d₁ d₂]
298298

299+
@[simp] lemma map_swap_product (s : Multiset α) (t : Multiset β) :
300+
(s ×ˢ t).map Prod.swap = t ×ˢ s := by
301+
induction s using Multiset.induction <;> simp_all
302+
303+
lemma prod_map_product_eq_prod_prod {M : Type*} [CommMonoid M]
304+
(s : Multiset α) (t : Multiset β) (f : α × β → M) :
305+
((s ×ˢ t).map f).prod = (s.map fun i ↦ (t.map fun j ↦ f (i, j)).prod).prod := by
306+
induction s using Multiset.induction <;> simp_all
307+
299308
end Product
300309

301310
/-! ### Disjoint sum of multisets -/

Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@ For the `simp` version of this lemma, see `det_submatrix_equiv_self`; this one i
252252
theorem det_reindex_self (e : m ≃ n) (A : Matrix m m R) : det (reindex e e A) = det A :=
253253
det_submatrix_equiv_self e.symm A
254254

255+
lemma det_reindex (e e' : m ≃ n) (M : Matrix m m R) :
256+
(M.reindex e e').det = sign (e'.trans e.symm) * M.det := by
257+
trans ((M.reindex (e.trans e'.symm) (.refl _)).reindex e' e').det
258+
· congr 1; ext; simp
259+
· simp_rw [det_reindex_self, reindex_apply, Equiv.refl_symm, Equiv.coe_refl, det_permute]
260+
rfl
261+
255262
/-- Reindexing both indices along equivalences preserves the absolute of the determinant.
256263
257264
For the `simp` version of this lemma, see `abs_det_submatrix_equiv_equiv`;

0 commit comments

Comments
 (0)