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 : (of p).IsSupported s
⊢ p ∈ s
state_after: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
⊢ p ∈ s

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

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

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

case neg
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this✝ : DecidablePred s
h : p ∉ s
this : ∃ n, X = ↑n
⊢ p ∈ s

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

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

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

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

tactic: have : Polynomial.X.coeff 1 = (Polynomial.C ↑w).coeff 1 := by rw [H]; rfl
state_before: case neg.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
h : p ∉ s
w : ℤ
H : X = C ↑w
⊢ 1 = 0
state_after: case neg.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this✝ : DecidablePred s
h : p ∉ s
w : ℤ
H : X = C ↑w
this : X.coeff 1 = (C w).coeff 1
⊢ 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 neg.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this✝ : DecidablePred s
h : p ∉ s
w : ℤ
H : X = C ↑w
this : X.coeff 1 = (C w).coeff 1
⊢ 1 = 0
state_after: no goals

tactic: intro x hx
state_before: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
⊢ ∀ (x : FreeCommRing α), x.IsSupported s → ∃ n, (lift fun a => if a ∈ s then 0 else X) x = ↑n
state_after: α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported 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 : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
⊢ ∃ n, (lift fun a => if a ∈ s then 0 else X) x = ↑n
state_after: case refine_1
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
⊢ ∃ n, (lift fun a => if a ∈ s then 0 else X) 1 = ↑n

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

case refine_3
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
⊢ ∀ 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

case refine_4
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported 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: use 1
state_before: case refine_1
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
⊢ ∃ n, (lift fun a => if a ∈ s then 0 else X) 1 = ↑n
state_after: case h
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
⊢ (lift fun a => if a ∈ s then 0 else X) 1 = ↑1

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

tactic: norm_cast
state_before: case h
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
⊢ 1 = ↑1
state_after: no goals

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

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

tactic: rintro _ ⟨z, hzs, rfl⟩ _ _
state_before: case refine_3
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
⊢ ∀ 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
state_after: case refine_3.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported 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: use 0
state_before: case refine_3.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported 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
state_after: case h
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported 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: rw [RingHom.map_mul, lift_of, if_pos hzs, zero_mul]
state_before: case h
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported 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
state_after: case h
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported s
z : α
hzs : z ∈ s
n✝ : FreeCommRing α
a✝ : ∃ n, (lift fun a => if a ∈ s then 0 else X) n✝ = ↑n
⊢ 0 = ↑0

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

tactic: rintro x y ⟨q, hq⟩ ⟨r, hr⟩
state_before: case refine_4
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x : FreeCommRing α
hx : x.IsSupported 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
state_after: case refine_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x✝ : FreeCommRing α
hx : x✝.IsSupported 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: refine ⟨q + r, ?_⟩
state_before: case refine_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x✝ : FreeCommRing α
hx : x✝.IsSupported 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
state_after: case refine_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x✝ : FreeCommRing α
hx : x✝.IsSupported 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: rw [RingHom.map_add, hq, hr]
state_before: case refine_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x✝ : FreeCommRing α
hx : x✝.IsSupported 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)
state_after: case refine_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x✝ : FreeCommRing α
hx : x✝.IsSupported 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: norm_cast
state_before: case refine_4.intro.intro
α : Type u
β : Type v
f : α → β
p : α
s : Set α
hps : (of p).IsSupported s
this : DecidablePred s
x✝ : FreeCommRing α
hx : x✝.IsSupported 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)
state_after: no goals

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

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

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