Skip to content

Commit

Permalink
feat(algebra/big_operators/basic): add lemma finset.prod_dvd_prod (#…
Browse files Browse the repository at this point in the history
…11521)

For any `S : finset α`, if `∀ a ∈ S, g1 a ∣ g2 a` then `S.prod g1 ∣ S.prod g2`.
  • Loading branch information
stuart-presnell committed Jan 25, 2022
1 parent 4f5d6ac commit 88479be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/algebra/big_operators/basic.lean
Expand Up @@ -1220,6 +1220,16 @@ lemma prod_pow_boole [decidable_eq α] (s : finset α) (f : α → β) (a : α)
(∏ x in s, (f x)^(ite (a = x) 1 0)) = ite (a ∈ s) (f a) 1 :=
by simp

lemma prod_dvd_prod {S : finset α} (g1 g2 : α → β) (h : ∀ a ∈ S, g1 a ∣ g2 a) :
S.prod g1 ∣ S.prod g2 :=
begin
classical,
apply finset.induction_on' S, { simp },
intros a T haS _ haT IH,
repeat {rw finset.prod_insert haT},
exact mul_dvd_mul (h a haS) IH,
end

end comm_monoid

/-- If `f = g = h` everywhere but at `i`, where `f i = g i + h i`, then the product of `f` over `s`
Expand Down

0 comments on commit 88479be

Please sign in to comment.