Theorem: Finset.prod_eq_prod_iff_of_le
File: Mathlib/Algebra/BigOperators/Order.lean

tactic: classical
  revert h
  refine Finset.induction_on s (fun _ ↦ ⟨fun _ _ h ↦ False.elim (Finset.not_mem_empty _ h),
    fun _ ↦ rfl⟩) fun a s ha ih H ↦ ?_
  specialize ih fun i ↦ H i ∘ Finset.mem_insert_of_mem
  rw [Finset.prod_insert ha, Finset.prod_insert ha, Finset.forall_mem_insert, ← ih]
  exact
    mul_eq_mul_iff_eq_and_eq (H a (s.mem_insert_self a))
      (Finset.prod_le_prod' fun i ↦ H i ∘ Finset.mem_insert_of_mem)
state_before: ι : Type u_1
α : Type ?u.140457
β : Type ?u.140460
M : Type u_2
N : Type ?u.140466
G : Type ?u.140469
k : Type ?u.140472
R : Type ?u.140475
inst✝ : OrderedCancelCommMonoid M
f✝ g✝ : ι → M
s t : Finset ι
f g : ι → M
h : ∀ (i : ι), i ∈ s → f i ≤ g i
⊢ ∏ i in s, f i = ∏ i in s, g i ↔ ∀ (i : ι), i ∈ s → f i = g i

tactic: revert h
state_before: ι : Type u_1
α : Type ?u.140457
β : Type ?u.140460
M : Type u_2
N : Type ?u.140466
G : Type ?u.140469
k : Type ?u.140472
R : Type ?u.140475
inst✝ : OrderedCancelCommMonoid M
f✝ g✝ : ι → M
s t : Finset ι
f g : ι → M
h : ∀ (i : ι), i ∈ s → f i ≤ g i
⊢ ∏ i in s, f i = ∏ i in s, g i ↔ ∀ (i : ι), i ∈ s → f i = g i

tactic: refine Finset.induction_on s (fun _ ↦ ⟨fun _ _ h ↦ False.elim (Finset.not_mem_empty _ h),
  fun _ ↦ rfl⟩) fun a s ha ih H ↦ ?_
state_before: ι : Type u_1
α : Type ?u.140457
β : Type ?u.140460
M : Type u_2
N : Type ?u.140466
G : Type ?u.140469
k : Type ?u.140472
R : Type ?u.140475
inst✝ : OrderedCancelCommMonoid M
f✝ g✝ : ι → M
s t : Finset ι
f g : ι → M
⊢ (∀ (i : ι), i ∈ s → f i ≤ g i) → (∏ i in s, f i = ∏ i in s, g i ↔ ∀ (i : ι), i ∈ s → f i = g i)

tactic: specialize ih fun i ↦ H i ∘ Finset.mem_insert_of_mem
state_before: ι : Type u_1
α : Type ?u.140457
β : Type ?u.140460
M : Type u_2
N : Type ?u.140466
G : Type ?u.140469
k : Type ?u.140472
R : Type ?u.140475
inst✝ : OrderedCancelCommMonoid M
f✝ g✝ : ι → M
s✝ t : Finset ι
f g : ι → M
a : ι
s : Finset ι
ha : ¬a ∈ s
ih : (∀ (i : ι), i ∈ s → f i ≤ g i) → (∏ i in s, f i = ∏ i in s, g i ↔ ∀ (i : ι), i ∈ s → f i = g i)
H : ∀ (i : ι), i ∈ insert a s → f i ≤ g i
⊢ ∏ i in insert a s, f i = ∏ i in insert a s, g i ↔ ∀ (i : ι), i ∈ insert a s → f i = g i

tactic: rw [Finset.prod_insert ha, Finset.prod_insert ha, Finset.forall_mem_insert, ← ih]
state_before: ι : Type u_1
α : Type ?u.140457
β : Type ?u.140460
M : Type u_2
N : Type ?u.140466
G : Type ?u.140469
k : Type ?u.140472
R : Type ?u.140475
inst✝ : OrderedCancelCommMonoid M
f✝ g✝ : ι → M
s✝ t : Finset ι
f g : ι → M
a : ι
s : Finset ι
ha : ¬a ∈ s
H : ∀ (i : ι), i ∈ insert a s → f i ≤ g i
ih : ∏ i in s, f i = ∏ i in s, g i ↔ ∀ (i : ι), i ∈ s → f i = g i
⊢ ∏ i in insert a s, f i = ∏ i in insert a s, g i ↔ ∀ (i : ι), i ∈ insert a s → f i = g i

tactic: exact
  mul_eq_mul_iff_eq_and_eq (H a (s.mem_insert_self a))
    (Finset.prod_le_prod' fun i ↦ H i ∘ Finset.mem_insert_of_mem)
state_before: ι : Type u_1
α : Type ?u.140457
β : Type ?u.140460
M : Type u_2
N : Type ?u.140466
G : Type ?u.140469
k : Type ?u.140472
R : Type ?u.140475
inst✝ : OrderedCancelCommMonoid M
f✝ g✝ : ι → M
s✝ t : Finset ι
f g : ι → M
a : ι
s : Finset ι
ha : ¬a ∈ s
H : ∀ (i : ι), i ∈ insert a s → f i ≤ g i
ih : ∏ i in s, f i = ∏ i in s, g i ↔ ∀ (i : ι), i ∈ s → f i = g i
⊢ f a * ∏ x in s, f x = g a * ∏ x in s, g x ↔ f a = g a ∧ ∏ i in s, f i = ∏ i in s, g i