Theorem: Multiset.finset_sum_eq_sup_iff_disjoint
File: Mathlib/Algebra/BigOperators/Basic.lean

tactic: induction' i using Finset.cons_induction_on with z i hz hr
state_before: ι : Type ?u.903903
β✝ : Type u
α : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
f✝ g : α → β✝
inst✝ : DecidableEq α
β : Type u_1
i : Finset β
f : β → Multiset α
⊢ Finset.sum i f = Finset.sup i f ↔ ∀ (x : β), x ∈ i → ∀ (y : β), y ∈ i → x ≠ y → Disjoint (f x) (f y)

tactic: simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
  Finset.sup_empty, bot_eq_zero, eq_self_iff_true]
state_before: case h₁
ι : Type ?u.903903
β✝ : Type u
α : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
f✝ g : α → β✝
inst✝ : DecidableEq α
β : Type u_1
f : β → Multiset α
⊢ Finset.sum ∅ f = Finset.sup ∅ f ↔ ∀ (x : β), x ∈ ∅ → ∀ (y : β), y ∈ ∅ → x ≠ y → Disjoint (f x) (f y)

tactic: simp_rw [Finset.sum_cons hz, Finset.sup_cons, Finset.mem_cons, Multiset.sup_eq_union,
  forall_eq_or_imp, Ne.def, IsEmpty.forall_iff, true_and_iff,
  imp_and, forall_and, ← hr, @eq_comm _ z]
state_before: case h₂
ι : Type ?u.903903
β✝ : Type u
α : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
f✝ g : α → β✝
inst✝ : DecidableEq α
β : Type u_1
f : β → Multiset α
z : β
i : Finset β
hz : ¬z ∈ i
hr : Finset.sum i f = Finset.sup i f ↔ ∀ (x : β), x ∈ i → ∀ (y : β), y ∈ i → x ≠ y → Disjoint (f x) (f y)
⊢ Finset.sum (Finset.cons z i hz) f = Finset.sup (Finset.cons z i hz) f ↔
    ∀ (x : β), x ∈ Finset.cons z i hz → ∀ (y : β), y ∈ Finset.cons z i hz → x ≠ y → Disjoint (f x) (f y)

tactic: have := fun x (H : x ∈ i) => ne_of_mem_of_not_mem H hz
state_before: case h₂
ι : Type ?u.903903
β✝ : Type u
α : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
f✝ g : α → β✝
inst✝ : DecidableEq α
β : Type u_1
f : β → Multiset α
z : β
i : Finset β
hz : ¬z ∈ i
hr : Finset.sum i f = Finset.sup i f ↔ ∀ (x : β), x ∈ i → ∀ (y : β), y ∈ i → x ≠ y → Disjoint (f x) (f y)
⊢ f z + ∑ x in i, f x = f z ∪ Finset.sup i f ↔
    (∀ (a : β), a ∈ i → ¬a = z → Disjoint (f z) (f a)) ∧
      (∀ (x : β), x ∈ i → ¬x = z → Disjoint (f x) (f z)) ∧ Finset.sum i f = Finset.sup i f

tactic: simp (config := { contextual := true }) only [this, not_false_iff, true_imp_iff]
state_before: case h₂
ι : Type ?u.903903
β✝ : Type u
α : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
f✝ g : α → β✝
inst✝ : DecidableEq α
β : Type u_1
f : β → Multiset α
z : β
i : Finset β
hz : ¬z ∈ i
hr : Finset.sum i f = Finset.sup i f ↔ ∀ (x : β), x ∈ i → ∀ (y : β), y ∈ i → x ≠ y → Disjoint (f x) (f y)
this : ∀ (x : β), x ∈ i → x ≠ z
⊢ f z + ∑ x in i, f x = f z ∪ Finset.sup i f ↔
    (∀ (a : β), a ∈ i → ¬a = z → Disjoint (f z) (f a)) ∧
      (∀ (x : β), x ∈ i → ¬x = z → Disjoint (f x) (f z)) ∧ Finset.sum i f = Finset.sup i f

tactic: simp_rw [← disjoint_finset_sum_left, ← disjoint_finset_sum_right, disjoint_comm, ← and_assoc,
  and_self_iff]
state_before: case h₂
ι : Type ?u.903903
β✝ : Type u
α : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
f✝ g : α → β✝
inst✝ : DecidableEq α
β : Type u_1
f : β → Multiset α
z : β
i : Finset β
hz : ¬z ∈ i
hr : Finset.sum i f = Finset.sup i f ↔ ∀ (x : β), x ∈ i → ∀ (y : β), y ∈ i → x ≠ y → Disjoint (f x) (f y)
this : ∀ (x : β), x ∈ i → x ≠ z
⊢ f z + ∑ x in i, f x = f z ∪ Finset.sup i f ↔
    (∀ (a : β), a ∈ i → Disjoint (f z) (f a)) ∧
      (∀ (x : β), x ∈ i → Disjoint (f x) (f z)) ∧ Finset.sum i f = Finset.sup i f

tactic: exact add_eq_union_left_of_le (Finset.sup_le fun x hx => le_sum_of_mem (mem_map_of_mem f hx))
state_before: case h₂
ι : Type ?u.903903
β✝ : Type u
α : Type v
γ : Type w
s s₁ s₂ : Finset α
a : α
f✝ g : α → β✝
inst✝ : DecidableEq α
β : Type u_1
f : β → Multiset α
z : β
i : Finset β
hz : ¬z ∈ i
hr : Finset.sum i f = Finset.sup i f ↔ ∀ (x : β), x ∈ i → ∀ (y : β), y ∈ i → x ≠ y → Disjoint (f x) (f y)
this : ∀ (x : β), x ∈ i → x ≠ z
⊢ f z + ∑ x in i, f x = f z ∪ Finset.sup i f ↔ Disjoint (f z) (∑ x in i, f x) ∧ Finset.sum i f = Finset.sup i f