Skip to content

Commit 6ba5988

Browse files
feat: remove unnecessary typeclass argument to Finset.prod lemmas for CanonicallyOrderedMul (#27294)
1 parent 5d382e7 commit 6ba5988

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ end DoubleCounting
363363

364364
section CanonicallyOrderedMul
365365

366-
variable [CommMonoid M] [PartialOrder M] [IsOrderedMonoid M] [CanonicallyOrderedMul M]
367-
{f : ι → M} {s t : Finset ι}
366+
variable [CommMonoid M] [PartialOrder M] [CanonicallyOrderedMul M] {f : ι → M} {s t : Finset ι}
368367

369368
/-- In a canonically-ordered monoid, a product bounds each of its terms.
370369
@@ -374,19 +373,23 @@ See also `Finset.single_le_prod'`. -/
374373
See also `Finset.single_le_sum`."]
375374
lemma _root_.CanonicallyOrderedCommMonoid.single_le_prod {i : ι} (hi : i ∈ s) :
376375
f i ≤ ∏ j ∈ s, f j :=
376+
have := CanonicallyOrderedMul.toIsOrderedMonoid (α := M)
377377
single_le_prod' (fun _ _ ↦ one_le _) hi
378378

379379
@[to_additive sum_le_sum_of_subset]
380380
theorem prod_le_prod_of_subset' (h : s ⊆ t) : ∏ x ∈ s, f x ≤ ∏ x ∈ t, f x :=
381+
have := CanonicallyOrderedMul.toIsOrderedMonoid (α := M)
381382
prod_le_prod_of_subset_of_one_le' h fun _ _ _ ↦ one_le _
382383

383384
@[to_additive sum_mono_set]
384385
theorem prod_mono_set' (f : ι → M) : Monotone fun s ↦ ∏ x ∈ s, f x := fun _ _ hs ↦
386+
have := CanonicallyOrderedMul.toIsOrderedMonoid (α := M)
385387
prod_le_prod_of_subset' hs
386388

387389
@[to_additive sum_le_sum_of_ne_zero]
388390
theorem prod_le_prod_of_ne_one' (h : ∀ x ∈ s, f x ≠ 1 → x ∈ t) :
389391
∏ x ∈ s, f x ≤ ∏ x ∈ t, f x := by
392+
have := CanonicallyOrderedMul.toIsOrderedMonoid (α := M)
390393
classical calc
391394
∏ x ∈ s, f x = (∏ x ∈ s with f x = 1, f x) * ∏ x ∈ s with f x ≠ 1, f x := by
392395
rw [← prod_union, filter_union_filter_neg_eq]
@@ -398,6 +401,7 @@ theorem prod_le_prod_of_ne_one' (h : ∀ x ∈ s, f x ≠ 1 → x ∈ t) :
398401

399402
@[to_additive sum_pos_iff]
400403
lemma one_lt_prod_iff : 1 < ∏ x ∈ s, f x ↔ ∃ x ∈ s, 1 < f x :=
404+
have := CanonicallyOrderedMul.toIsOrderedMonoid (α := M)
401405
Finset.one_lt_prod_iff_of_one_le <| fun _ _ => one_le _
402406

403407
end CanonicallyOrderedMul

Mathlib/Data/Finsupp/Weight.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ lemma degree_eq_zero_iff {R : Type*}
229229
DFunLike.ext_iff, coe_zero, Pi.zero_apply]
230230

231231
theorem le_degree {R : Type*}
232-
[AddCommMonoid R] [PartialOrder R] [IsOrderedAddMonoid R] [CanonicallyOrderedAdd R]
232+
[AddCommMonoid R] [PartialOrder R] [CanonicallyOrderedAdd R]
233233
(s : σ) (f : σ →₀ R) :
234234
f s ≤ degree f := by
235235
by_cases h : s ∈ f.support

Mathlib/Topology/Algebra/InfiniteSum/Order.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ protected theorem Multipliable.tprod_ne_one_iff (hf : Multipliable f) :
298298
@[to_additive existing, deprecated (since := "2025-04-12")] alias tprod_ne_one_iff :=
299299
Multipliable.tprod_ne_one_iff
300300

301+
omit [IsOrderedMonoid α] in
301302
@[to_additive]
302303
theorem isLUB_hasProd' (hf : HasProd f a) : IsLUB (Set.range fun s ↦ ∏ i ∈ s, f i) a := by
303304
classical
@@ -324,7 +325,7 @@ theorem hasProd_of_isLUB_of_one_le [CommMonoid α] [LinearOrder α] [IsOrderedMo
324325
tendsto_atTop_isLUB (Finset.prod_mono_set_of_one_le' h) hf
325326

326327
@[to_additive]
327-
theorem hasProd_of_isLUB [CommMonoid α] [LinearOrder α] [IsOrderedMonoid α]
328+
theorem hasProd_of_isLUB [CommMonoid α] [LinearOrder α]
328329
[CanonicallyOrderedMul α] [TopologicalSpace α]
329330
[OrderTopology α] {f : ι → α} (b : α) (hf : IsLUB (Set.range fun s ↦ ∏ i ∈ s, f i) b) :
330331
HasProd f b :=

0 commit comments

Comments
 (0)