Theorem: FreeCommRing.isSupported_of
File: Mathlib/RingTheory/FreeCommRing.lean

tactic: haveI := Classical.decPred s
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
⊢ p ∈ s

tactic: specialize this (of p) hps
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
this : ∀ (x : FreeCommRing α), IsSupported x s → ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) x = ↑n
⊢ p ∈ s

tactic: rw [lift_of] at this
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
this : ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) (of p) = ↑n
⊢ p ∈ s

tactic: split_ifs  at this with h
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
this : ∃ n, (if p ∈ s then 0 else X) = ↑n
⊢ p ∈ s

tactic: exfalso
state_before: case inr
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
h : ¬p ∈ s
this : ∃ n, X = ↑n
⊢ p ∈ s

tactic: apply Ne.symm Int.zero_ne_one
state_before: case inr.h
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
h : ¬p ∈ s
this : ∃ n, X = ↑n
⊢ False

tactic: rcases this with ⟨w, H⟩
state_before: case inr.h
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
h : ¬p ∈ s
this : ∃ n, X = ↑n
⊢ 1 = 0

tactic: rw [← Polynomial.C_eq_int_cast] at H
state_before: case inr.h.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
h : ¬p ∈ s
w : ℤ
H : X = ↑w
⊢ 1 = 0

tactic: have : Polynomial.X.coeff 1 = (Polynomial.C ↑w).coeff 1 := by rw [H]; rfl
state_before: case inr.h.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
h : ¬p ∈ s
w : ℤ
H : X = ↑C ↑w
⊢ 1 = 0

tactic: rwa [Polynomial.coeff_C, if_neg (one_ne_zero : 1 ≠ 0), Polynomial.coeff_X, if_pos rfl] at this
state_before: case inr.h.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
h : ¬p ∈ s
w : ℤ
H : X = ↑C ↑w
this : coeff X 1 = coeff (↑C w) 1
⊢ 1 = 0

tactic: intro x hx
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
⊢ ∀ (x : FreeCommRing α), IsSupported x s → ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) x = ↑n

tactic: refine' Subring.InClosure.recOn hx _ _ _ _
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) x = ↑n

tactic: use 1
state_before: case refine'_1
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) 1 = ↑n

tactic: rw [RingHom.map_one]
state_before: case refine'_1
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ ↑(↑lift fun a => if a ∈ s then 0 else X) 1 = ↑1

tactic: norm_cast
state_before: case refine'_1
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ 1 = ↑1

tactic: use -1
state_before: case refine'_2
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) (-1) = ↑n

tactic: rw [RingHom.map_neg, RingHom.map_one, Int.cast_neg, Int.cast_one]
state_before: case refine'_2
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ ↑(↑lift fun a => if a ∈ s then 0 else X) (-1) = ↑(-1)

tactic: rintro _ ⟨z, hzs, rfl⟩ _ _
state_before: case refine'_3
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ ∀ (z : FreeCommRing α),
    z ∈ of '' s →
      ∀ (n : FreeCommRing α),
        (∃ n_1, ↑(↑lift fun a => if a ∈ s then 0 else X) n = ↑n_1) →
          ∃ n_1, ↑(↑lift fun a => if a ∈ s then 0 else X) (z * n) = ↑n_1

tactic: use 0
state_before: case refine'_3.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
z : α
hzs : z ∈ s
n✝ : FreeCommRing α
a✝ : ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) n✝ = ↑n
⊢ ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) (of z * n✝) = ↑n

tactic: rw [RingHom.map_mul, lift_of, if_pos hzs, MulZeroClass.zero_mul]
state_before: case refine'_3.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
z : α
hzs : z ∈ s
n✝ : FreeCommRing α
a✝ : ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) n✝ = ↑n
⊢ ↑(↑lift fun a => if a ∈ s then 0 else X) (of z * n✝) = ↑0

tactic: norm_cast
state_before: case refine'_3.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
z : α
hzs : z ∈ s
n✝ : FreeCommRing α
a✝ : ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) n✝ = ↑n
⊢ 0 = ↑0

tactic: rintro x y ⟨q, hq⟩ ⟨r, hr⟩
state_before: case refine'_4
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x : FreeCommRing α
hx : IsSupported x s
⊢ ∀ {x y : FreeCommRing α},
    (∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) x = ↑n) →
      (∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) y = ↑n) →
        ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) (x + y) = ↑n

tactic: refine' ⟨q + r, _⟩
state_before: case refine'_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x✝ : FreeCommRing α
hx : IsSupported x✝ s
x y : FreeCommRing α
q : ℤ
hq : ↑(↑lift fun a => if a ∈ s then 0 else X) x = ↑q
r : ℤ
hr : ↑(↑lift fun a => if a ∈ s then 0 else X) y = ↑r
⊢ ∃ n, ↑(↑lift fun a => if a ∈ s then 0 else X) (x + y) = ↑n

tactic: rw [RingHom.map_add, hq, hr]
state_before: case refine'_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x✝ : FreeCommRing α
hx : IsSupported x✝ s
x y : FreeCommRing α
q : ℤ
hq : ↑(↑lift fun a => if a ∈ s then 0 else X) x = ↑q
r : ℤ
hr : ↑(↑lift fun a => if a ∈ s then 0 else X) y = ↑r
⊢ ↑(↑lift fun a => if a ∈ s then 0 else X) (x + y) = ↑(q + r)

tactic: norm_cast
state_before: case refine'_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
x✝ : FreeCommRing α
hx : IsSupported x✝ s
x y : FreeCommRing α
q : ℤ
hq : ↑(↑lift fun a => if a ∈ s then 0 else X) x = ↑q
r : ℤ
hr : ↑(↑lift fun a => if a ∈ s then 0 else X) y = ↑r
⊢ ↑q + ↑r = ↑(q + r)

tactic: exact h
state_before: case inl
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this✝ : DecidablePred s
h : p ∈ s
this : ∃ n, 0 = ↑n
⊢ p ∈ s

tactic: rw [H]
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
h : ¬p ∈ s
w : ℤ
H : X = ↑C ↑w
⊢ coeff X 1 = coeff (↑C w) 1

tactic: rfl
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : IsSupported (of p) s
this : DecidablePred s
h : ¬p ∈ s
w : ℤ
H : X = ↑C ↑w
⊢ coeff (↑C ↑w) 1 = coeff (↑C w) 1