Theorem: MvPolynomial.exists_finset_rename
File: Mathlib/Data/MvPolynomial/Rename.lean

tactic: apply induction_on p
state_before: σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p : MvPolynomial σ R
⊢ ∃ s q, p = ↑(rename Subtype.val) q

tactic: intro r
state_before: case h_C
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p : MvPolynomial σ R
⊢ ∀ (a : R), ∃ s q, ↑C a = ↑(rename Subtype.val) q

tactic: exact ⟨∅, C r, by rw [rename_C]⟩
state_before: case h_C
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p : MvPolynomial σ R
r : R
⊢ ∃ s q, ↑C r = ↑(rename Subtype.val) q

tactic: rw [rename_C]
state_before: σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p : MvPolynomial σ R
r : R
⊢ ↑C r = ↑(rename Subtype.val) (↑C r)

tactic: rintro p q ⟨s, p, rfl⟩ ⟨t, q, rfl⟩
state_before: case h_add
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p : MvPolynomial σ R
⊢ ∀ (p q : MvPolynomial σ R),
    (∃ s q, p = ↑(rename Subtype.val) q) →
      (∃ s q_1, q = ↑(rename Subtype.val) q_1) → ∃ s q_1, p + q = ↑(rename Subtype.val) q_1

tactic: refine' ⟨s ∪ t, ⟨_, _⟩⟩
state_before: case h_add.intro.intro.intro.intro
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
⊢ ∃ s_1 q_1, ↑(rename Subtype.val) p + ↑(rename Subtype.val) q = ↑(rename Subtype.val) q_1

tactic: refine' rename (Subtype.map id _) p + rename (Subtype.map id _) q <;>
  simp (config := { contextual := true }) only [id.def, true_or_iff, or_true_iff,
    Finset.mem_union, forall_true_iff]
state_before: case h_add.intro.intro.intro.intro.refine'_1
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
⊢ MvPolynomial { x // x ∈ s ∪ t } R

tactic: simp only [rename_rename, AlgHom.map_add]
state_before: case h_add.intro.intro.intro.intro.refine'_2
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
⊢ ↑(rename Subtype.val) p + ↑(rename Subtype.val) q =
    ↑(rename Subtype.val)
      (↑(rename (Subtype.map id (_ : ∀ (a : σ), a ∈ s → a ∈ s ∪ t))) p +
        ↑(rename (Subtype.map id (_ : ∀ (a : σ), a ∈ t → a ∈ s ∪ t))) q)

tactic: rfl
state_before: case h_add.intro.intro.intro.intro.refine'_2
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
⊢ ↑(rename Subtype.val) p + ↑(rename Subtype.val) q =
    ↑(rename (Subtype.val ∘ Subtype.map id (_ : ∀ (a : σ), a ∈ s → a ∈ s ∪ t))) p +
      ↑(rename (Subtype.val ∘ Subtype.map id (_ : ∀ (a : σ), a ∈ t → a ∈ s ∪ t))) q

tactic: rintro p n ⟨s, p, rfl⟩
state_before: case h_X
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p : MvPolynomial σ R
⊢ ∀ (p : MvPolynomial σ R) (n : σ), (∃ s q, p = ↑(rename Subtype.val) q) → ∃ s q, p * X n = ↑(rename Subtype.val) q

tactic: refine' ⟨insert n s, ⟨_, _⟩⟩
state_before: case h_X.intro.intro
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
n : σ
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
⊢ ∃ s_1 q, ↑(rename Subtype.val) p * X n = ↑(rename Subtype.val) q

tactic: refine' rename (Subtype.map id _) p * X ⟨n, s.mem_insert_self n⟩
state_before: case h_X.intro.intro.refine'_1
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
n : σ
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
⊢ MvPolynomial { x // x ∈ insert n s } R

tactic: simp (config := { contextual := true }) only [id.def, or_true_iff, Finset.mem_insert,
  forall_true_iff]
state_before: case h_X.intro.intro.refine'_1
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
n : σ
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
⊢ ∀ (a : σ), a ∈ s → id a ∈ insert n s

tactic: simp only [rename_rename, rename_X, Subtype.coe_mk, AlgHom.map_mul]
state_before: case h_X.intro.intro.refine'_2
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
n : σ
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
⊢ ↑(rename Subtype.val) p * X n =
    ↑(rename Subtype.val)
      (↑(rename (Subtype.map id (_ : ∀ (a : σ), a ∈ s → a ∈ insert n s))) p *
        X { val := n, property := (_ : n ∈ insert n s) })

tactic: rfl
state_before: case h_X.intro.intro.refine'_2
σ : Type u_1
τ : Type ?u.711231
α : Type ?u.711234
R : Type u_2
S : Type ?u.711240
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
p✝ : MvPolynomial σ R
n : σ
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
⊢ ↑(rename Subtype.val) p * X n =
    ↑(rename (Subtype.val ∘ Subtype.map id (_ : ∀ (a : σ), a ∈ s → a ∈ insert n s))) p * X n