File: Mathlib/RingTheory/MvPolynomial/NewtonIdentities.lean

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.pairs
code: private def pairs (k : ℕ) : Finset (Finset σ × σ) 
goal: Finset (Finset σ × σ)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.mem_pairs
code: @[simp]
private lemma mem_pairs (k : ℕ) (t : Finset σ × σ) :
    t ∈ pairs σ k ↔ card t.fst ≤ k ∧ (card t.fst = k → t.snd ∈ t.fst) 
goal: t ∈ MvPolynomial.NewtonIdentities.pairs σ k ↔ t.1.card ≤ k ∧ (t.1.card = k → t.2 ∈ t.1)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.weight
code: private def weight (k : ℕ) (t : Finset σ × σ) : MvPolynomial σ R 
goal: MvPolynomial σ R

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.pairMap
code: private def pairMap (t : Finset σ × σ) : Finset σ × σ 
goal: Finset σ × σ

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.pairMap_ne_self
code: private lemma pairMap_ne_self (t : Finset σ × σ) : pairMap σ t ≠ t 
goal: MvPolynomial.NewtonIdentities.pairMap σ t ≠ t

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.pairMap_of_snd_mem_fst
code: private lemma pairMap_of_snd_mem_fst {t : Finset σ × σ} (h : t.snd ∈ t.fst) :
    pairMap σ t = (t.fst.erase t.snd, t.snd) 
goal: MvPolynomial.NewtonIdentities.pairMap σ t = (t.1.erase t.2, t.2)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.pairMap_of_snd_nmem_fst
code: private lemma pairMap_of_snd_nmem_fst {t : Finset σ × σ} (h : t.snd ∉ t.fst) :
    pairMap σ t = (t.fst.cons t.snd h, t.snd) 
goal: MvPolynomial.NewtonIdentities.pairMap σ t = (Finset.cons t.2 t.1 h, t.2)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.pairMap_mem_pairs
code: private theorem pairMap_mem_pairs {k : ℕ} (t : Finset σ × σ) (h : t ∈ pairs σ k) :
    pairMap σ t ∈ pairs σ k 
goal: MvPolynomial.NewtonIdentities.pairMap σ t ∈ MvPolynomial.NewtonIdentities.pairs σ k

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.pairMap_involutive
code: @[simp]
private theorem pairMap_involutive : (pairMap σ).Involutive 
goal: Function.Involutive (MvPolynomial.NewtonIdentities.pairMap σ)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.weight_add_weight_pairMap
code: private theorem weight_add_weight_pairMap {k : ℕ} (t : Finset σ × σ) (h : t ∈ pairs σ k) :
    weight σ R k t + weight σ R k (pairMap σ t) = 0 
goal: MvPolynomial.NewtonIdentities.weight σ R k t +
    MvPolynomial.NewtonIdentities.weight σ R k (MvPolynomial.NewtonIdentities.pairMap σ t) =
  0

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.weight_sum
code: private theorem weight_sum (k : ℕ) : ∑ t ∈ pairs σ k, weight σ R k t = 0 
goal: ∑ t ∈ MvPolynomial.NewtonIdentities.pairs σ k, MvPolynomial.NewtonIdentities.weight σ R k t = 0

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.sum_filter_pairs_eq_sum_powersetCard_sum
code: private theorem sum_filter_pairs_eq_sum_powersetCard_sum (k : ℕ)
    (f : Finset σ × σ → MvPolynomial σ R) :
    (∑ t ∈ filter (fun t ↦ card t.fst = k) (pairs σ k), f t) =
    ∑ A ∈ powersetCard k univ, (∑ j ∈ A, f (A, j)) 
goal: ∑ t ∈ Finset.filter (fun t => t.1.card = k) (MvPolynomial.NewtonIdentities.pairs σ k), f t =
  ∑ A ∈ Finset.powersetCard k Finset.univ, ∑ j ∈ A, f (A, j)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.sum_filter_pairs_eq_sum_powersetCard_mem_filter_antidiagonal_sum
code: private theorem sum_filter_pairs_eq_sum_powersetCard_mem_filter_antidiagonal_sum (k : ℕ) (a : ℕ × ℕ)
    (ha : a ∈ (antidiagonal k).filter (fun a ↦ a.fst < k)) (f : Finset σ × σ → MvPolynomial σ R) :
    (∑ t ∈ filter (fun t ↦ card t.fst = a.fst) (pairs σ k), f t) =
    ∑ A ∈ powersetCard a.fst univ, (∑ j, f (A, j)) 
goal: ∑ t ∈ Finset.filter (fun t => t.1.card = a.1) (MvPolynomial.NewtonIdentities.pairs σ k), f t =
  ∑ A ∈ Finset.powersetCard a.1 Finset.univ, ∑ j : σ, f (A, j)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.filter_pairs_lt
code: private lemma filter_pairs_lt (k : ℕ) :
    (pairs σ k).filter (fun (s, _) ↦ s.card < k) =
      (range k).disjiUnion (powersetCard · univ) ((pairwise_disjoint_powersetCard _).set_pairwise _)
        ×ˢ univ 
goal: Finset.filter
    (fun x =>
      match x with
      | (s, snd) => s.card < k)
    (MvPolynomial.NewtonIdentities.pairs σ k) =
  (Finset.range k).disjiUnion (fun x => Finset.powersetCard x Finset.univ) ⋯ ×ˢ Finset.univ

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.sum_filter_pairs_eq_sum_filter_antidiagonal_powersetCard_sum
code: private theorem sum_filter_pairs_eq_sum_filter_antidiagonal_powersetCard_sum (k : ℕ)
    (f : Finset σ × σ → MvPolynomial σ R) :
    ∑ t ∈ (pairs σ k).filter fun t ↦ card t.fst < k, f t =
      ∑ a ∈ (antidiagonal k).filter fun a ↦ a.fst < k,
        ∑ A ∈ powersetCard a.fst univ, ∑ j, f (A, j) 
goal: ∑ t ∈ Finset.filter (fun t => t.1.card < k) (MvPolynomial.NewtonIdentities.pairs σ k), f t =
  ∑ a ∈ Finset.filter (fun a => a.1 < k) (Finset.antidiagonal k),
    ∑ A ∈ Finset.powersetCard a.1 Finset.univ, ∑ j : σ, f (A, j)

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.disjoint_filter_pairs_lt_filter_pairs_eq
code: private theorem disjoint_filter_pairs_lt_filter_pairs_eq (k : ℕ) :
    Disjoint (filter (fun t ↦ card t.fst < k) (pairs σ k))
    (filter (fun t ↦ card t.fst = k) (pairs σ k)) 
goal: Disjoint (Finset.filter (fun t => t.1.card < k) (MvPolynomial.NewtonIdentities.pairs σ k))
  (Finset.filter (fun t => t.1.card = k) (MvPolynomial.NewtonIdentities.pairs σ k))

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.disjUnion_filter_pairs_eq_pairs
code: private theorem disjUnion_filter_pairs_eq_pairs (k : ℕ) :
    disjUnion (filter (fun t ↦ card t.fst < k) (pairs σ k))
    (filter (fun t ↦ card t.fst = k) (pairs σ k)) (disjoint_filter_pairs_lt_filter_pairs_eq σ k) =
    pairs σ k 
goal: (Finset.filter (fun t => t.1.card < k) (MvPolynomial.NewtonIdentities.pairs σ k)).disjUnion
    (Finset.filter (fun t => t.1.card = k) (MvPolynomial.NewtonIdentities.pairs σ k)) ⋯ =
  MvPolynomial.NewtonIdentities.pairs σ k

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.esymm_summand_to_weight
code: private theorem esymm_summand_to_weight (k : ℕ) (A : Finset σ) (h : A ∈ powersetCard k univ) :
    ∑ j ∈ A, weight σ R k (A, j) = k * (-1) ^ k * (∏ i ∈ A, X i : MvPolynomial σ R) 
goal: ∑ j ∈ A, MvPolynomial.NewtonIdentities.weight σ R k (A, j) = ↑k * (-1) ^ k * ∏ i ∈ A, MvPolynomial.X i

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.esymm_to_weight
code: private theorem esymm_to_weight (k : ℕ) : k * esymm σ R k =
    (-1) ^ k * ∑ t ∈ filter (fun t ↦ card t.fst = k) (pairs σ k), weight σ R k t 
goal: ↑k * MvPolynomial.esymm σ R k =
  (-1) ^ k *
    ∑ t ∈ Finset.filter (fun t => t.1.card = k) (MvPolynomial.NewtonIdentities.pairs σ k),
      MvPolynomial.NewtonIdentities.weight σ R k t

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.esymm_mul_psum_summand_to_weight
code: private 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 
goal: ∑ A ∈ Finset.powersetCard a.1 Finset.univ, ∑ j : σ, MvPolynomial.NewtonIdentities.weight σ R k (A, j) =
  (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2

full_name: _private.Mathlib.RingTheory.MvPolynomial.NewtonIdentities.0.MvPolynomial.NewtonIdentities.esymm_mul_psum_to_weight
code: private theorem esymm_mul_psum_to_weight (k : ℕ) :
    ∑ a ∈ (antidiagonal k).filter (fun a ↦ a.fst < k),
    (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd =
    ∑ t ∈ filter (fun t ↦ card t.fst < k) (pairs σ k), weight σ R k t 
goal: ∑ a ∈ Finset.filter (fun a => a.1 < k) (Finset.antidiagonal k),
    (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2 =
  ∑ t ∈ Finset.filter (fun t => t.1.card < k) (MvPolynomial.NewtonIdentities.pairs σ k),
    MvPolynomial.NewtonIdentities.weight σ R k t

full_name: MvPolynomial.mul_esymm_eq_sum
code: /-- **Newton's identities** give a recurrence relation for the kth elementary symmetric polynomial
in terms of lower degree elementary symmetric polynomials and power sums. -/
theorem mul_esymm_eq_sum (k : ℕ) : k * esymm σ R k =
    (-1) ^ (k + 1) * ∑ a ∈ (antidiagonal k).filter (fun a ↦ a.fst < k),
    (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd 
goal: ↑k * MvPolynomial.esymm σ R k =
  (-1) ^ (k + 1) *
    ∑ a ∈ Finset.filter (fun a => a.1 < k) (Finset.antidiagonal k),
      (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2

full_name: MvPolynomial.sum_antidiagonal_card_esymm_psum_eq_zero
code: theorem sum_antidiagonal_card_esymm_psum_eq_zero :
    ∑ a ∈ antidiagonal (Fintype.card σ), (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd = 0 
goal: ∑ a ∈ Finset.antidiagonal (Fintype.card σ), (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2 = 0

full_name: MvPolynomial.psum_eq_mul_esymm_sub_sum
code: /-- A version of Newton's identities which may be more useful in the case that we know the values of
the elementary symmetric polynomials and would like to calculate the values of the power sums. -/
theorem psum_eq_mul_esymm_sub_sum (k : ℕ) (h : 0 < k) : psum σ R k =
    (-1) ^ (k + 1) * k * esymm σ R k -
    ∑ a ∈ (antidiagonal k).filter (fun a ↦ a.fst ∈ Set.Ioo 0 k),
    (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd 
goal: MvPolynomial.psum σ R k =
  (-1) ^ (k + 1) * ↑k * MvPolynomial.esymm σ R k -
    ∑ a ∈ Finset.filter (fun a => a.1 ∈ Set.Ioo 0 k) (Finset.antidiagonal k),
      (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2