Theorem: LaurentPolynomial.toLaurent_support
File: Mathlib/Data/Polynomial/Laurent.lean

tactic: generalize hd : f.support = s
state_before: R : Type u_1
inst✝ : Semiring R
f : R[X]
⊢ (↑toLaurent f).support = Finset.map Nat.castEmbedding (Polynomial.support f)

tactic: revert f
state_before: R : Type u_1
inst✝ : Semiring R
f : R[X]
s : Finset ℕ
hd : Polynomial.support f = s
⊢ (↑toLaurent f).support = Finset.map Nat.castEmbedding s

tactic: refine' Finset.induction_on s _ _ <;> clear s
state_before: R : Type u_1
inst✝ : Semiring R
s : Finset ℕ
⊢ ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s

tactic: simp (config := { contextual := true }) only [Polynomial.support_eq_empty, map_zero,
  Finsupp.support_zero, eq_self_iff_true, imp_true_iff, Finset.map_empty,
  Finsupp.support_eq_empty]
state_before: case refine'_1
R : Type u_1
inst✝ : Semiring R
⊢ ∀ (f : R[X]), Polynomial.support f = ∅ → (↑toLaurent f).support = Finset.map Nat.castEmbedding ∅

tactic: intro a s as hf f fs
state_before: case refine'_2
R : Type u_1
inst✝ : Semiring R
⊢ ∀ ⦃a : ℕ⦄ {s : Finset ℕ},
    ¬a ∈ s →
      (∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s) →
        ∀ (f : R[X]),
          Polynomial.support f = insert a s → (↑toLaurent f).support = Finset.map Nat.castEmbedding (insert a s)

tactic: have : (erase a f).toLaurent.support = s.map Nat.castEmbedding := by
  refine' hf (f.erase a) _
  simp only [fs, Finset.erase_eq_of_not_mem as, Polynomial.support_erase,
    Finset.erase_insert_eq_erase]
state_before: case refine'_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
⊢ (↑toLaurent f).support = Finset.map Nat.castEmbedding (insert a s)

tactic: rw [← monomial_add_erase f a, Finset.map_insert, ← this, map_add, Polynomial.toLaurent_C_mul_T,
  support_add_eq, Finset.insert_eq]
state_before: case refine'_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
this : (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ (↑toLaurent f).support = Finset.map Nat.castEmbedding (insert a s)

tactic: refine' hf (f.erase a) _
state_before: R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
⊢ (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s

tactic: simp only [fs, Finset.erase_eq_of_not_mem as, Polynomial.support_erase,
  Finset.erase_insert_eq_erase]
state_before: R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
⊢ Polynomial.support (Polynomial.erase a f) = s

tactic: congr
state_before: case refine'_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
this : (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ (↑C (coeff f a) * T ↑a).support ∪ (↑toLaurent (Polynomial.erase a f)).support =
    {↑Nat.castEmbedding a} ∪ (↑toLaurent (Polynomial.erase a f)).support

tactic: exact support_C_mul_T_of_ne_zero (Polynomial.mem_support_iff.mp (by simp [fs])) _
state_before: case refine'_2.e_a
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
this : (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ (↑C (coeff f a) * T ↑a).support = {↑Nat.castEmbedding a}

tactic: simp [fs]
state_before: R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
this : (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ a ∈ Polynomial.support f

tactic: rw [this]
state_before: case refine'_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
this : (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ Disjoint (↑C (coeff f a) * T ↑a).support (↑toLaurent (Polynomial.erase a f)).support

tactic: exact Disjoint.mono_left (support_C_mul_T _ _) (by simpa)
state_before: case refine'_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
this : (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ Disjoint (↑C (coeff f a) * T ↑a).support (Finset.map Nat.castEmbedding s)

tactic: simpa
state_before: R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : ¬a ∈ s
hf : ∀ (f : R[X]), Polynomial.support f = s → (↑toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : Polynomial.support f = insert a s
this : (↑toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ Disjoint {↑a} (Finset.map Nat.castEmbedding s)