-- Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean
theorem esymm_mul_psum_summand_to_weight (k : ℕ) (a : ℕ × ℕ) (ha : a ∈ antidiagonal k) :
    ∑ A ∈ powersetCard a.fst univ, ∑ j, weight σ R k (A, j) =
    (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd

Proof state:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
⊢ ∑ A ∈ powersetCard a.1 univ, ∑ j : σ, MvPolynomial.NewtonIdentities.weight σ R k (A, j) =
    (-1) ^ a.1 * esymm σ R a.1 * psum σ R a.2

Tactic:
simp only [esymm, psum, weight, ← mul_assoc, mul_sum]

Result:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
⊢ ∑ x ∈ powersetCard a.1 univ, ∑ x_1 : σ, ((-1) ^ #x * ∏ a ∈ x, X a) * X x_1 ^ (k - #x) =
    ∑ i : σ, (∑ i ∈ powersetCard a.1 univ, (-1) ^ a.1 * ∏ a ∈ i, X a) * X i ^ a.2

Proof state:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
⊢ ∑ y : σ, ∑ x ∈ powersetCard a.1 univ, ((-1) ^ #x * ∏ a ∈ x, X a) * X y ^ (k - #x) =
    ∑ i : σ, (∑ i ∈ powersetCard a.1 univ, (-1) ^ a.1 * ∏ a ∈ i, X a) * X i ^ a.2

Tactic:
refine sum_congr rfl fun x _ ↦ ?_

Result:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
x : σ
x✝ : x ∈ univ
⊢ ∑ x_1 ∈ powersetCard a.1 univ, ((-1) ^ #x_1 * ∏ a ∈ x_1, X a) * X x ^ (k - #x_1) =
    (∑ i ∈ powersetCard a.1 univ, (-1) ^ a.1 * ∏ a ∈ i, X a) * X x ^ a.2

Proof state:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
⊢ ∑ x ∈ powersetCard a.1 univ, ∑ x_1 : σ, ((-1) ^ #x * ∏ a ∈ x, X a) * X x_1 ^ (k - #x) =
    ∑ i : σ, (∑ i ∈ powersetCard a.1 univ, (-1) ^ a.1 * ∏ a ∈ i, X a) * X i ^ a.2

Tactic:
rw [sum_comm]

Result:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
⊢ ∑ y : σ, ∑ x ∈ powersetCard a.1 univ, ((-1) ^ #x * ∏ a ∈ x, X a) * X y ^ (k - #x) =
    ∑ i : σ, (∑ i ∈ powersetCard a.1 univ, (-1) ^ a.1 * ∏ a ∈ i, X a) * X i ^ a.2

Proof state:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
x : σ
x✝ : x ∈ univ
s : Finset σ
hs : s ∈ powersetCard a.1 univ
⊢ ((-1) ^ #s * ∏ a ∈ s, X a) * X x ^ (k - #s) = ((-1) ^ a.1 * ∏ a ∈ s, X a) * X x ^ a.2

Tactic:
rw [mem_powersetCard_univ.mp hs, ← mem_antidiagonal.mp ha, add_sub_self_left]

Result:
no goals

Proof state:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
x : σ
x✝ : x ∈ univ
⊢ ∑ x_1 ∈ powersetCard a.1 univ, ((-1) ^ #x_1 * ∏ a ∈ x_1, X a) * X x ^ (k - #x_1) =
    (∑ i ∈ powersetCard a.1 univ, (-1) ^ a.1 * ∏ a ∈ i, X a) * X x ^ a.2

Tactic:
rw [sum_mul]

Result:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
x : σ
x✝ : x ∈ univ
⊢ ∑ x_1 ∈ powersetCard a.1 univ, ((-1) ^ #x_1 * ∏ a ∈ x_1, X a) * X x ^ (k - #x_1) =
    ∑ i ∈ powersetCard a.1 univ, ((-1) ^ a.1 * ∏ a ∈ i, X a) * X x ^ a.2

Proof state:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
x : σ
x✝ : x ∈ univ
⊢ ∑ x_1 ∈ powersetCard a.1 univ, ((-1) ^ #x_1 * ∏ a ∈ x_1, X a) * X x ^ (k - #x_1) =
    ∑ i ∈ powersetCard a.1 univ, ((-1) ^ a.1 * ∏ a ∈ i, X a) * X x ^ a.2

Tactic:
refine sum_congr rfl fun s hs ↦ ?_

Result:
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : Fintype σ
k : ℕ
a : ℕ × ℕ
ha : a ∈ antidiagonal k
x : σ
x✝ : x ∈ univ
s : Finset σ
hs : s ∈ powersetCard a.1 univ
⊢ ((-1) ^ #s * ∏ a ∈ s, X a) * X x ^ (k - #s) = ((-1) ^ a.1 * ∏ a ∈ s, X a) * X x ^ a.2