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

tactic: classical calc
  ∏ x ∈ s, f x = (∏ x ∈ s.filter fun x ↦ f x = 1, f x) *
      ∏ x ∈ 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 ∈ 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_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ ∏ x ∈ s, f x ≤ ∏ x ∈ t, f x
state_after: no goals

tactic: calc
∏ x ∈ s, f x = (∏ x ∈ s.filter fun x ↦ f x = 1, f x) *
∏ x ∈ 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 ∈ 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_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ ∏ x ∈ s, f x ≤ ∏ x ∈ t, f x
state_after: no goals

tactic: rw [← prod_union, filter_union_filter_neg_eq]
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ ∏ x ∈ s, f x = (∏ x ∈ filter (fun x => f x = 1) s, f x) * ∏ x ∈ filter (fun x => f x ≠ 1) s, f x
state_after: ι : Type u_1
α : Type u_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ Disjoint (filter (fun x => f x = 1) s) (filter (fun x => f x ≠ 1) s)

tactic: exact disjoint_filter.2 fun _ _ h n_h ↦ n_h h
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ Disjoint (filter (fun x => f x = 1) s) (filter (fun x => f x ≠ 1) s)
state_after: no goals

tactic: simp only [mem_filter, and_imp]
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ ∀ i ∈ filter (fun x => f x = 1) s, f i ≤ 1
state_after: ι : Type u_1
α : Type u_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ ∀ i ∈ s, f i = 1 → f i ≤ 1

tactic: exact fun _ _ ↦ le_of_eq
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ ∀ i ∈ s, f i = 1 → f i ≤ 1
state_after: no goals

tactic: simpa only [subset_iff, mem_filter, and_imp]
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
M : Type u_4
N : Type u_5
G : Type u_6
k : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
f : ι → M
s t : Finset ι
h : ∀ x ∈ s, f x ≠ 1 → x ∈ t
⊢ filter (fun x => f x ≠ 1) s ⊆ t
state_after: no goals