-- Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean
theorem neg_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) : (isLocallyFraction 𝒜).pred (-a) := fun x => by
  rcases ha x with ⟨V, m, i, j, ⟨r, r_mem⟩, ⟨s, s_mem⟩, nin, hy⟩
  refine ⟨V, m, i, j, ⟨-r, Submodule.neg_mem _ r_mem⟩, ⟨s, s_mem⟩, nin, fun y => ?_⟩
  simp only [ext_iff_val, val_mk] at hy
  simp only [Pi.neg_apply, ext_iff_val, val_neg, hy, val_mk, neg_mk]

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
U : (Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ
a : (x : ↥(unop U)) → at ↑x
ha : (isLocallyFraction 𝒜).pred a
x : ↥(unop U)
V : Opens ↑(ProjectiveSpectrum.top 𝒜)
m : ↑x ∈ V
i : V ⟶ unop U
j : ℕ
r : A
r_mem : r ∈ 𝒜 j
s : A
s_mem : s ∈ 𝒜 j
nin : ∀ (x : ↥V), ↑⟨s, s_mem⟩ ∉ (↑x).asHomogeneousIdeal
y : ↥V
hy : ∀ (x : ↥V), val (a (i x)) = Localization.mk r ⟨s, ⋯⟩
⊢ (fun x => (-a) (i x)) y = HomogeneousLocalization.mk { deg := j, num := ⟨-r, ⋯⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }

Tactic:
simp only [Pi.neg_apply, ext_iff_val, val_neg, hy, val_mk, neg_mk]

Result:
no goals

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
U : (Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ
a : (x : ↥(unop U)) → at ↑x
ha : (isLocallyFraction 𝒜).pred a
x : ↥(unop U)
V : Opens ↑(ProjectiveSpectrum.top 𝒜)
m : ↑x ∈ V
i : V ⟶ unop U
j : ℕ
r : A
r_mem : r ∈ 𝒜 j
s : A
s_mem : s ∈ 𝒜 j
nin : ∀ (x : ↥V), ↑⟨s, s_mem⟩ ∉ (↑x).asHomogeneousIdeal
hy :
  ∀ (x : ↥V),
    (fun x => a (i x)) x = HomogeneousLocalization.mk { deg := j, num := ⟨r, r_mem⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }
y : ↥V
⊢ (fun x => (-a) (i x)) y = HomogeneousLocalization.mk { deg := j, num := ⟨-r, ⋯⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }

Tactic:
simp only [ext_iff_val, val_mk] at hy

Result:
case intro.intro.intro.intro.intro.mk.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
U : (Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ
a : (x : ↥(unop U)) → at ↑x
ha : (isLocallyFraction 𝒜).pred a
x : ↥(unop U)
V : Opens ↑(ProjectiveSpectrum.top 𝒜)
m : ↑x ∈ V
i : V ⟶ unop U
j : ℕ
r : A
r_mem : r ∈ 𝒜 j
s : A
s_mem : s ∈ 𝒜 j
nin : ∀ (x : ↥V), ↑⟨s, s_mem⟩ ∉ (↑x).asHomogeneousIdeal
y : ↥V
hy : ∀ (x : ↥V), val (a (i x)) = Localization.mk r ⟨s, ⋯⟩
⊢ (fun x => (-a) (i x)) y = HomogeneousLocalization.mk { deg := j, num := ⟨-r, ⋯⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
U : (Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ
a : (x : ↥(unop U)) → at ↑x
ha : (isLocallyFraction 𝒜).pred a
x : ↥(unop U)
⊢ ∃ V, ∃ (_ : ↑x ∈ V), ∃ i, (isFractionPrelocal 𝒜).pred fun x => (-a) (i x)

Tactic:
rcases ha x with ⟨V, m, i, j, ⟨r, r_mem⟩, ⟨s, s_mem⟩, nin, hy⟩

Result:
case intro.intro.intro.intro.intro.mk.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
U : (Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ
a : (x : ↥(unop U)) → at ↑x
ha : (isLocallyFraction 𝒜).pred a
x : ↥(unop U)
V : Opens ↑(ProjectiveSpectrum.top 𝒜)
m : ↑x ∈ V
i : V ⟶ unop U
j : ℕ
r : A
r_mem : r ∈ 𝒜 j
s : A
s_mem : s ∈ 𝒜 j
nin : ∀ (x : ↥V), ↑⟨s, s_mem⟩ ∉ (↑x).asHomogeneousIdeal
hy :
  ∀ (x : ↥V),
    (fun x => a (i x)) x = HomogeneousLocalization.mk { deg := j, num := ⟨r, r_mem⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }
⊢ ∃ V, ∃ (_ : ↑x ∈ V), ∃ i, (isFractionPrelocal 𝒜).pred fun x => (-a) (i x)

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
U : (Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ
a : (x : ↥(unop U)) → at ↑x
ha : (isLocallyFraction 𝒜).pred a
x : ↥(unop U)
V : Opens ↑(ProjectiveSpectrum.top 𝒜)
m : ↑x ∈ V
i : V ⟶ unop U
j : ℕ
r : A
r_mem : r ∈ 𝒜 j
s : A
s_mem : s ∈ 𝒜 j
nin : ∀ (x : ↥V), ↑⟨s, s_mem⟩ ∉ (↑x).asHomogeneousIdeal
hy :
  ∀ (x : ↥V),
    (fun x => a (i x)) x = HomogeneousLocalization.mk { deg := j, num := ⟨r, r_mem⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }
⊢ ∃ V, ∃ (_ : ↑x ∈ V), ∃ i, (isFractionPrelocal 𝒜).pred fun x => (-a) (i x)

Tactic:
refine ⟨V, m, i, j, ⟨-r, Submodule.neg_mem _ r_mem⟩, ⟨s, s_mem⟩, nin, fun y => ?_⟩

Result:
case intro.intro.intro.intro.intro.mk.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
U : (Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ
a : (x : ↥(unop U)) → at ↑x
ha : (isLocallyFraction 𝒜).pred a
x : ↥(unop U)
V : Opens ↑(ProjectiveSpectrum.top 𝒜)
m : ↑x ∈ V
i : V ⟶ unop U
j : ℕ
r : A
r_mem : r ∈ 𝒜 j
s : A
s_mem : s ∈ 𝒜 j
nin : ∀ (x : ↥V), ↑⟨s, s_mem⟩ ∉ (↑x).asHomogeneousIdeal
hy :
  ∀ (x : ↥V),
    (fun x => a (i x)) x = HomogeneousLocalization.mk { deg := j, num := ⟨r, r_mem⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }
y : ↥V
⊢ (fun x => (-a) (i x)) y = HomogeneousLocalization.mk { deg := j, num := ⟨-r, ⋯⟩, den := ⟨s, s_mem⟩, den_mem := ⋯ }