Theorem: AlgebraicGeometry.Polynomial.imageOfDf_eq_comap_C_compl_zeroLocus
File: Mathlib/AlgebraicGeometry/PrimeSpectrum/IsOpenComapC.lean

tactic: ext x
state_before: R : Type u_1
inst✝ : CommRing R
f : R[X]
⊢ imageOfDf f = ⇑(PrimeSpectrum.comap C) '' (zeroLocus {f})ᶜ
state_after: case h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
⊢ x ∈ imageOfDf f ↔ x ∈ ⇑(PrimeSpectrum.comap C) '' (zeroLocus {f})ᶜ

tactic: refine ⟨fun hx => ⟨⟨map C x.asIdeal, isPrime_map_C_of_isPrime x.isPrime⟩, ⟨?_, ?_⟩⟩, ?_⟩
state_before: case h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
⊢ x ∈ imageOfDf f ↔ x ∈ ⇑(PrimeSpectrum.comap C) '' (zeroLocus {f})ᶜ
state_after: case h.refine_1
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
hx : x ∈ imageOfDf f
⊢ { asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ } ∈ (zeroLocus {f})ᶜ

case h.refine_2
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
hx : x ∈ imageOfDf f
⊢ (PrimeSpectrum.comap C) { asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ } = x

case h.refine_3
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
⊢ x ∈ ⇑(PrimeSpectrum.comap C) '' (zeroLocus {f})ᶜ → x ∈ imageOfDf f

tactic: rw [mem_compl_iff, mem_zeroLocus, singleton_subset_iff]
state_before: case h.refine_1
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
hx : x ∈ imageOfDf f
⊢ { asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ } ∈ (zeroLocus {f})ᶜ
state_after: case h.refine_1
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
hx : x ∈ imageOfDf f
⊢ f ∉ ↑{ asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ }.asIdeal

tactic: cases' hx with i hi
state_before: case h.refine_1
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
hx : x ∈ imageOfDf f
⊢ f ∉ ↑{ asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ }.asIdeal
state_after: case h.refine_1.intro
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
i : ℕ
hi : f.coeff i ∉ x.asIdeal
⊢ f ∉ ↑{ asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ }.asIdeal

tactic: exact fun a => hi (mem_map_C_iff.mp a i)
state_before: case h.refine_1.intro
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
i : ℕ
hi : f.coeff i ∉ x.asIdeal
⊢ f ∉ ↑{ asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ }.asIdeal
state_after: no goals

tactic: ext x
state_before: case h.refine_2
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
hx : x ∈ imageOfDf f
⊢ (PrimeSpectrum.comap C) { asIdeal := Ideal.map C x.asIdeal, isPrime := ⋯ } = x
state_after: case h.refine_2.asIdeal.h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x✝ : PrimeSpectrum R
hx : x✝ ∈ imageOfDf f
x : R
⊢ x ∈ ((PrimeSpectrum.comap C) { asIdeal := Ideal.map C x✝.asIdeal, isPrime := ⋯ }).asIdeal ↔ x ∈ x✝.asIdeal

tactic: refine ⟨fun h => ?_, fun h => subset_span (mem_image_of_mem C.1 h)⟩
state_before: case h.refine_2.asIdeal.h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x✝ : PrimeSpectrum R
hx : x✝ ∈ imageOfDf f
x : R
⊢ x ∈ ((PrimeSpectrum.comap C) { asIdeal := Ideal.map C x✝.asIdeal, isPrime := ⋯ }).asIdeal ↔ x ∈ x✝.asIdeal
state_after: case h.refine_2.asIdeal.h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x✝ : PrimeSpectrum R
hx : x✝ ∈ imageOfDf f
x : R
h : x ∈ ((PrimeSpectrum.comap C) { asIdeal := Ideal.map C x✝.asIdeal, isPrime := ⋯ }).asIdeal
⊢ x ∈ x✝.asIdeal

tactic: rw [← @coeff_C_zero R x _]
state_before: case h.refine_2.asIdeal.h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x✝ : PrimeSpectrum R
hx : x✝ ∈ imageOfDf f
x : R
h : x ∈ ((PrimeSpectrum.comap C) { asIdeal := Ideal.map C x✝.asIdeal, isPrime := ⋯ }).asIdeal
⊢ x ∈ x✝.asIdeal
state_after: case h.refine_2.asIdeal.h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x✝ : PrimeSpectrum R
hx : x✝ ∈ imageOfDf f
x : R
h : x ∈ ((PrimeSpectrum.comap C) { asIdeal := Ideal.map C x✝.asIdeal, isPrime := ⋯ }).asIdeal
⊢ (C x).coeff 0 ∈ x✝.asIdeal

tactic: exact mem_map_C_iff.mp h 0
state_before: case h.refine_2.asIdeal.h
R : Type u_1
inst✝ : CommRing R
f : R[X]
x✝ : PrimeSpectrum R
hx : x✝ ∈ imageOfDf f
x : R
h : x ∈ ((PrimeSpectrum.comap C) { asIdeal := Ideal.map C x✝.asIdeal, isPrime := ⋯ }).asIdeal
⊢ (C x).coeff 0 ∈ x✝.asIdeal
state_after: no goals

tactic: rintro ⟨xli, complement, rfl⟩
state_before: case h.refine_3
R : Type u_1
inst✝ : CommRing R
f : R[X]
x : PrimeSpectrum R
⊢ x ∈ ⇑(PrimeSpectrum.comap C) '' (zeroLocus {f})ᶜ → x ∈ imageOfDf f
state_after: case h.refine_3.intro.intro
R : Type u_1
inst✝ : CommRing R
f : R[X]
xli : PrimeSpectrum R[X]
complement : xli ∈ (zeroLocus {f})ᶜ
⊢ (PrimeSpectrum.comap C) xli ∈ imageOfDf f

tactic: exact comap_C_mem_imageOfDf complement
state_before: case h.refine_3.intro.intro
R : Type u_1
inst✝ : CommRing R
f : R[X]
xli : PrimeSpectrum R[X]
complement : xli ∈ (zeroLocus {f})ᶜ
⊢ (PrimeSpectrum.comap C) xli ∈ imageOfDf f
state_after: no goals