Theorem: Finset.prod_le_prod_of_ne_one'
File: Mathlib/Algebra/BigOperators/Order.lean

tactic: classical calc
  (∏ x in s, f x) = (∏ x in s.filter fun x ↦ f x = 1, f x) *
      ∏ x in s.filter fun x ↦ f x ≠ 1, f x := by
    rw [← prod_union, filter_union_filter_neg_eq]
    exact disjoint_filter.2 fun _ _ h n_h ↦ n_h h
  _ ≤ ∏ x in t, f x :=
    mul_le_of_le_one_of_le
      (prod_le_one' <| by simp only [mem_filter, and_imp] ; exact fun _ _ ↦ le_of_eq)
      (prod_le_prod_of_subset' <| by simpa only [subset_iff, mem_filter, and_imp] )
state_before: ι : Type u_1
α : Type ?u.118811
β : Type ?u.118814
M : Type u_2
N : Type ?u.118820
G : Type ?u.118823
k : Type ?u.118826
R : Type ?u.118829
inst✝ : CanonicallyOrderedMonoid M
f : ι → M
s t : Finset ι
h : ∀ (x : ι), x ∈ s → f x ≠ 1 → x ∈ t
⊢ ∏ x in s, f x ≤ ∏ x in t, f x

tactic: calc
(∏ x in s, f x) = (∏ x in s.filter fun x ↦ f x = 1, f x) *
∏ x in s.filter fun x ↦ f x ≠ 1, f x := by
rw [← prod_union, filter_union_filter_neg_eq]
exact disjoint_filter.2 fun _ _ h n_h ↦ n_h h
_ ≤ ∏ x in t, f x :=
mul_le_of_le_one_of_le
(prod_le_one' <| by simp only [mem_filter, and_imp] ; exact fun _ _ ↦ le_of_eq)
(prod_le_prod_of_subset' <| by simpa only [subset_iff, mem_filter, and_imp] )
state_before: ι : Type u_1
α : Type ?u.118811
β : Type ?u.118814
M : Type u_2
N : Type ?u.118820
G : Type ?u.118823
k : Type ?u.118826
R : Type ?u.118829
inst✝ : CanonicallyOrderedMonoid M
f : ι → M
s t : Finset ι
h : ∀ (x : ι), x ∈ s → f x ≠ 1 → x ∈ t
⊢ ∏ x in s, f x ≤ ∏ x in t, f x

tactic: rw [← prod_union, filter_union_filter_neg_eq]
state_before: ι : Type u_1
α : Type ?u.118811
β : Type ?u.118814
M : Type u_2
N : Type ?u.118820
G : Type ?u.118823
k : Type ?u.118826
R : Type ?u.118829
inst✝ : CanonicallyOrderedMonoid M
f : ι → M
s t : Finset ι
h : ∀ (x : ι), x ∈ s → f x ≠ 1 → x ∈ t
⊢ ∏ x in s, f x = (∏ x in filter (fun x => f x = 1) s, f x) * ∏ x in filter (fun x => f x ≠ 1) s, f x

tactic: exact disjoint_filter.2 fun _ _ h n_h ↦ n_h h
state_before: ι : Type u_1
α : Type ?u.118811
β : Type ?u.118814
M : Type u_2
N : Type ?u.118820
G : Type ?u.118823
k : Type ?u.118826
R : Type ?u.118829
inst✝ : CanonicallyOrderedMonoid M
f : ι → M
s t : Finset ι
h : ∀ (x : ι), x ∈ s → f x ≠ 1 → x ∈ t
⊢ Disjoint (filter (fun x => f x = 1) s) (filter (fun x => f x ≠ 1) s)

tactic: simp only [mem_filter, and_imp]
state_before: ι : Type u_1
α : Type ?u.118811
β : Type ?u.118814
M : Type u_2
N : Type ?u.118820
G : Type ?u.118823
k : Type ?u.118826
R : Type ?u.118829
inst✝ : CanonicallyOrderedMonoid M
f : ι → M
s t : Finset ι
h : ∀ (x : ι), x ∈ s → f x ≠ 1 → x ∈ t
⊢ ∀ (i : ι), i ∈ filter (fun x => f x = 1) s → f i ≤ 1

tactic: exact fun _ _ ↦ le_of_eq
state_before: ι : Type u_1
α : Type ?u.118811
β : Type ?u.118814
M : Type u_2
N : Type ?u.118820
G : Type ?u.118823
k : Type ?u.118826
R : Type ?u.118829
inst✝ : CanonicallyOrderedMonoid M
f : ι → M
s t : Finset ι
h : ∀ (x : ι), x ∈ s → f x ≠ 1 → x ∈ t
⊢ ∀ (i : ι), i ∈ s → f i = 1 → f i ≤ 1

tactic: simpa only [subset_iff, mem_filter, and_imp]
state_before: ι : Type u_1
α : Type ?u.118811
β : Type ?u.118814
M : Type u_2
N : Type ?u.118820
G : Type ?u.118823
k : Type ?u.118826
R : Type ?u.118829
inst✝ : CanonicallyOrderedMonoid M
f : ι → M
s t : Finset ι
h : ∀ (x : ι), x ∈ s → f x ≠ 1 → x ∈ t
⊢ filter (fun x => f x ≠ 1) s ⊆ t