Theorem: LaurentPolynomial.toLaurent_support
File: Mathlib/Algebra/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 f.support
state_after: R : Type u_1
inst✝ : Semiring R
f : R[X]
s : Finset ℕ
hd : f.support = s
⊢ (toLaurent f).support = Finset.map Nat.castEmbedding s

tactic: revert f
state_before: R : Type u_1
inst✝ : Semiring R
f : R[X]
s : Finset ℕ
hd : f.support = s
⊢ (toLaurent f).support = Finset.map Nat.castEmbedding s
state_after: R : Type u_1
inst✝ : Semiring R
s : Finset ℕ
⊢ ∀ (f : R[X]), f.support = 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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
state_after: case refine_1
R : Type u_1
inst✝ : Semiring R
⊢ ∀ (f : R[X]), f.support = ∅ → (toLaurent f).support = Finset.map Nat.castEmbedding ∅

case refine_2
R : Type u_1
inst✝ : Semiring R
⊢ ∀ ⦃a : ℕ⦄ {s : Finset ℕ},
    a ∉ s →
      (∀ (f : R[X]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s) →
        ∀ (f : R[X]), f.support = insert a s → (toLaurent f).support = Finset.map Nat.castEmbedding (insert a 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]), f.support = ∅ → (toLaurent f).support = Finset.map Nat.castEmbedding ∅
state_after: no goals

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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s) →
        ∀ (f : R[X]), f.support = insert a s → (toLaurent f).support = Finset.map Nat.castEmbedding (insert a s)
state_after: case refine_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : a ∉ s
hf : ∀ (f : R[X]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = 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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
⊢ (toLaurent f).support = Finset.map Nat.castEmbedding (insert a s)
state_after: case refine_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : a ∉ s
hf : ∀ (f : R[X]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = 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: 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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = 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)
state_after: case refine_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : a ∉ s
hf : ∀ (f : R[X]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
this : (toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ (C (f.coeff a) * T ↑a).support ∪ (toLaurent (Polynomial.erase a f)).support =
    {Nat.castEmbedding a} ∪ (toLaurent (Polynomial.erase a f)).support

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

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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
⊢ (toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
state_after: R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : a ∉ s
hf : ∀ (f : R[X]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
⊢ (Polynomial.erase a f).support = 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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
⊢ (Polynomial.erase a f).support = s
state_after: no goals

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

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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
this : (toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ (C (f.coeff a) * T ↑a).support = {Nat.castEmbedding a}
state_after: no goals

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

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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
this : (toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ Disjoint (C (f.coeff a) * T ↑a).support (toLaurent (Polynomial.erase a f)).support
state_after: case refine_2
R : Type u_1
inst✝ : Semiring R
a : ℕ
s : Finset ℕ
as : a ∉ s
hf : ∀ (f : R[X]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
this : (toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ Disjoint (C (f.coeff a) * T ↑a).support (Finset.map Nat.castEmbedding s)

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]), f.support = s → (toLaurent f).support = Finset.map Nat.castEmbedding s
f : R[X]
fs : f.support = insert a s
this : (toLaurent (Polynomial.erase a f)).support = Finset.map Nat.castEmbedding s
⊢ Disjoint (C (f.coeff a) * T ↑a).support (Finset.map Nat.castEmbedding s)
state_after: no goals

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