Skip to content

Commit 1c074b7

Browse files
committed
feat(Algebra/Order/BigOperators): order properties of subsets in groups with zero
1 parent 2ce6783 commit 1c074b7

2 files changed

Lines changed: 35 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ theorem prod_le_prod_of_subset_of_one_le' [MulLeftMono N] (h : s ⊆ t)
138138
_ = ∏ i ∈ t, f i := by rw [sdiff_union_of_subset h]
139139

140140
@[to_additive]
141-
theorem prod_le_prod_of_subset_of_le_one
141+
theorem prod_le_prod_of_subset_of_le_one'
142142
{ι : Type u_1} {N : Type u_5} [CommMonoid N] [PartialOrder N]
143143
{f : ι → N} {s t : Finset ι} [MulLeftMono N] (h : s ⊆ t) (hf : ∀ i ∈ t, i ∉ s → f i ≤ 1) :
144144
∏ i ∈ t, f i ≤ ∏ i ∈ s, f i :=
@@ -150,11 +150,11 @@ theorem prod_mono_set_of_one_le' [MulLeftMono N] (hf : ∀ x, 1 ≤ f x) :
150150
fun _ _ hst ↦ prod_le_prod_of_subset_of_one_le' hst fun x _ _ ↦ hf x
151151

152152
@[to_additive]
153-
theorem prod_anti_set_of_le_one
153+
theorem prod_anti_set_of_le_one'
154154
{ι : Type u_1} {N : Type u_5} [CommMonoid N] [PartialOrder N]
155155
{f : ι → N} [MulLeftMono N] (hf : ∀ (x : ι), f x ≤ 1) :
156156
Antitone fun (s : Finset ι) => ∏ x ∈ s, f x :=
157-
fun _ _ hst ↦ prod_le_prod_of_subset_of_le_one hst (by simp [hf])
157+
fun _ _ hst ↦ prod_le_prod_of_subset_of_le_one' hst (by simp [hf])
158158

159159
@[to_additive sum_le_univ_sum_of_nonneg]
160160
theorem prod_le_univ_prod_of_one_le' [MulLeftMono N] [Fintype ι] {s : Finset ι} (w : ∀ x, 1 ≤ f x) :

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,38 @@ lemma prod_le_one (h0 : ∀ i ∈ s, 0 ≤ f i) (h1 : ∀ i ∈ s, f i ≤ 1) :
5555
lemma one_le_prod (hf : ∀ i ∈ s, 1 ≤ f i) : 1 ≤ ∏ i ∈ s, f i := by
5656
simpa using prod_le_prod (by simp) hf
5757

58+
@[gcongr]
59+
theorem prod_le_prod_of_subset_of_one_le (h : s ⊆ t)
60+
(hf0 : ∀ i ∈ s, 0 ≤ f i)
61+
(hf : ∀ i ∈ t, i ∉ s → 1 ≤ f i) : ∏ i ∈ s, f i ≤ ∏ i ∈ t, f i := by
62+
have := posMulMono_iff_mulPosMono.1 ‹PosMulMono R›
63+
classical
64+
calc
65+
∏ i ∈ s, f i ≤ (∏ i ∈ t \ s, f i) * ∏ i ∈ s, f i :=
66+
le_mul_of_one_le_left (prod_nonneg hf0) <| one_le_prod <| by simpa only [mem_sdiff, and_imp]
67+
_ = ∏ i ∈ t \ s ∪ s, f i := (prod_union sdiff_disjoint).symm
68+
_ = ∏ i ∈ t, f i := by rw [sdiff_union_of_subset h]
69+
70+
theorem prod_le_prod_of_subset_of_le_one (h : s ⊆ t) (hf0 : ∀ i ∈ t, 0 ≤ f i)
71+
(hf : ∀ i ∈ t, i ∉ s → f i ≤ 1) :
72+
∏ i ∈ t, f i ≤ ∏ i ∈ s, f i := by
73+
have := posMulMono_iff_mulPosMono.1 ‹PosMulMono R›
74+
classical
75+
calc
76+
∏ i ∈ t, f i = ∏ i ∈ t \ s ∪ s, f i := by rw [sdiff_union_of_subset h]
77+
_ = (∏ i ∈ t \ s, f i) * ∏ i ∈ s, f i := prod_union sdiff_disjoint
78+
_ ≤ ∏ i ∈ s, f i :=
79+
mul_le_of_le_one_left (prod_nonneg (by grind)) (prod_le_one (by grind) (by grind))
80+
81+
theorem prod_mono_set_of_one_le (hf : ∀ x, 1 ≤ f x) :
82+
Monotone fun s ↦ ∏ x ∈ s, f x :=
83+
fun _ _ hst ↦ prod_le_prod_of_subset_of_one_le hst
84+
(fun i _ ↦ zero_le_one.trans (hf i)) (fun x _ _ ↦ hf x)
85+
86+
theorem prod_anti_set_of_le_one (hf0 : ∀ (x : ι), 0 ≤ f x) (hf : ∀ (x : ι), f x ≤ 1) :
87+
Antitone fun (s : Finset ι) => ∏ x ∈ s, f x :=
88+
fun _ _ hst ↦ prod_le_prod_of_subset_of_le_one hst (by grind) (by simp [hf])
89+
5890
end PosMulMono
5991

6092
section PosMulStrictMono

0 commit comments

Comments
 (0)