Theorem: MvPolynomial.exists_rename_eq_of_vars_subset_range
File: Mathlib/Data/MvPolynomial/Variables.lean

tactic: show (rename f).toRingHom.comp _ p = RingHom.id _ p
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
⊢ ↑(rename f) (↑(aeval fun i => Option.elim' 0 X (partialInv f i)) p) = p

tactic: refine' hom_congr_vars _ _ _
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
⊢ ↑(RingHom.comp ↑(rename f) ↑(aeval fun i => Option.elim' 0 X (partialInv f i))) p = ↑(RingHom.id (MvPolynomial σ R)) p

tactic: ext1
state_before: case refine'_1
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
⊢ RingHom.comp (RingHom.comp ↑(rename f) ↑(aeval fun i => Option.elim' 0 X (partialInv f i))) C =
    RingHom.comp (RingHom.id (MvPolynomial σ R)) C

tactic: simp [algebraMap_eq]
state_before: case refine'_1.a
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
x✝ : R
⊢ ↑(RingHom.comp (RingHom.comp ↑(rename f) ↑(aeval fun i => Option.elim' 0 X (partialInv f i))) C) x✝ =
    ↑(RingHom.comp (RingHom.id (MvPolynomial σ R)) C) x✝

tactic: intro i hip _
state_before: case refine'_2
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
⊢ ∀ (i : σ),
    i ∈ vars p →
      i ∈ vars p →
        ↑(RingHom.comp ↑(rename f) ↑(aeval fun i => Option.elim' 0 X (partialInv f i))) (X i) =
          ↑(RingHom.id (MvPolynomial σ R)) (X i)

tactic: rcases hf hip with ⟨i, rfl⟩
state_before: case refine'_2
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
i : σ
hip a✝ : i ∈ vars p
⊢ ↑(RingHom.comp ↑(rename f) ↑(aeval fun i => Option.elim' 0 X (partialInv f i))) (X i) =
    ↑(RingHom.id (MvPolynomial σ R)) (X i)

tactic: simp [partialInv_left hfi]
state_before: case refine'_2.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
i : τ
hip a✝ : f i ∈ vars p
⊢ ↑(RingHom.comp ↑(rename f) ↑(aeval fun i => Option.elim' 0 X (partialInv f i))) (X (f i)) =
    ↑(RingHom.id (MvPolynomial σ R)) (X (f i))

tactic: rfl
state_before: case refine'_3
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
p✝ q : MvPolynomial σ R
inst✝ : CommSemiring S
p : MvPolynomial σ R
f : τ → σ
hfi : Injective f
hf : ↑(vars p) ⊆ range f
⊢ p = p