l3lab/ntp-mathlib huggingface dataset:
/--
The predicate `IsFraction` is "prelocal", in the sense that if it holds on `U` it holds on any open
subset `V` of `U`.
-/
def isFractionPrelocal : PrelocalPredicate fun x : ProjectiveSpectrum.top 𝒜 => at x where
  pred f := IsFraction f
  res := by 

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 V : Opens ↑(ProjectiveSpectrum.top 𝒜)} (i : U ⟶ V) (f : (x : ↥V) → at ↑x),
    (fun {U} f => IsFraction f) f →
      (fun {U} f => IsFraction f) fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)

Next tactic:
rintro V U i f ⟨j, r, s, w⟩
/--
The predicate `IsFraction` is "prelocal", in the sense that if it holds on `U` it holds on any open
subset `V` of `U`.
-/
def isFractionPrelocal : PrelocalPredicate fun x : ProjectiveSpectrum.top 𝒜 => at x where
  pred f := IsFraction f
  res := by rintro V U i f ⟨j, r, s, w⟩; 

Proof state:
case intro.intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
V U : Opens ↑(ProjectiveSpectrum.top 𝒜)
i : V ⟶ U
f : (x : ↥U) → at ↑x
j : ℕ
r s : ↥(𝒜 j)
w :
  ∀ (x : ↥U),
    ∃ (s_nin : ↑s ∉ (↑x).asHomogeneousIdeal), f x = Quotient.mk'' { deg := j, num := r, den := s, den_mem := s_nin }
⊢ IsFraction fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U) }) x)

Next tactic:
exact ⟨j, r, s, fun y => w (i y)⟩
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  

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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
⊢ ∃ V,
    ∃ (_ : ↑x ∈ V),
      ∃ i,
        PrelocalPredicate.pred (isFractionPrelocal 𝒜) fun x =>
          (a + b) ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)

Next tactic:
rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk
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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
⊢ ∃ V,
    ∃ (_ : ↑x ∈ V),
      ∃ i,
        PrelocalPredicate.pred (isFractionPrelocal 𝒜) fun x =>
          (a + b) ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)

Next tactic:
rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk
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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
⊢ ∃ V,
    ∃ (_ : ↑x ∈ V),
      ∃ i,
        PrelocalPredicate.pred (isFractionPrelocal 𝒜) fun x =>
          (a + b) ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)

Next tactic:
refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
  · 

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk.refine'_1
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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
y : ↥(Va ⊓ Vb)
h : ↑{ val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) } ∈ (↑y).asHomogeneousIdeal
⊢ False

Next tactic:
cases' (y : ProjectiveSpectrum.top 𝒜).isPrime.mem_or_mem h with h h
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
  · cases' (y : ProjectiveSpectrum.top 𝒜).isPrime.mem_or_mem h with h h
    · 

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk.refine'_1.inl
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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
y : ↥(Va ⊓ Vb)
h✝ : ↑{ val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) } ∈ (↑y).asHomogeneousIdeal
h : sa ∈ HomogeneousIdeal.toIdeal (↑y).asHomogeneousIdeal
⊢ False

Next tactic:
obtain ⟨nin, -⟩ := wa ⟨y, (Opens.infLELeft Va Vb y).2⟩
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
  · cases' (y : ProjectiveSpectrum.top 𝒜).isPrime.mem_or_mem h with h h
    · obtain ⟨nin, -⟩ := wa ⟨y, (Opens.infLELeft Va Vb y).2⟩; 

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk.refine'_1.inl.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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
y : ↥(Va ⊓ Vb)
h✝ : ↑{ val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) } ∈ (↑y).asHomogeneousIdeal
h : sa ∈ HomogeneousIdeal.toIdeal (↑y).asHomogeneousIdeal
nin :
  ↑{ val := sa, property := sa_mem } ∉
    (↑{ val := ↑y,
          property := (_ : ↑((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑Va) }) y) ∈ Va) }).asHomogeneousIdeal
⊢ False

Next tactic:
exact nin h
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
  · cases' (y : ProjectiveSpectrum.top 𝒜).isPrime.mem_or_mem h with h h
    · obtain ⟨nin, -⟩ := wa ⟨y, (Opens.infLELeft Va Vb y).2⟩; exact nin h
    · 

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk.refine'_1.inr
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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
y : ↥(Va ⊓ Vb)
h✝ : ↑{ val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) } ∈ (↑y).asHomogeneousIdeal
h : sb ∈ HomogeneousIdeal.toIdeal (↑y).asHomogeneousIdeal
⊢ False

Next tactic:
obtain ⟨nin, -⟩ := wb ⟨y, (Opens.infLERight Va Vb y).2⟩
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
  · cases' (y : ProjectiveSpectrum.top 𝒜).isPrime.mem_or_mem h with h h
    · obtain ⟨nin, -⟩ := wa ⟨y, (Opens.infLELeft Va Vb y).2⟩; exact nin h
    · obtain ⟨nin, -⟩ := wb ⟨y, (Opens.infLERight Va Vb y).2⟩; 

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk.refine'_1.inr.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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
y : ↥(Va ⊓ Vb)
h✝ : ↑{ val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) } ∈ (↑y).asHomogeneousIdeal
h : sb ∈ HomogeneousIdeal.toIdeal (↑y).asHomogeneousIdeal
nin :
  ↑{ val := sb, property := sb_mem } ∉
    (↑{ val := ↑y,
          property := (_ : ↑((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑Vb) }) y) ∈ Vb) }).asHomogeneousIdeal
⊢ False

Next tactic:
exact nin h
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
  · cases' (y : ProjectiveSpectrum.top 𝒜).isPrime.mem_or_mem h with h h
    · obtain ⟨nin, -⟩ := wa ⟨y, (Opens.infLELeft Va Vb y).2⟩; exact nin h
    · obtain ⟨nin, -⟩ := wb ⟨y, (Opens.infLERight Va Vb y).2⟩; exact nin h
  · 

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk.refine'_2
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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
y : ↥(Va ⊓ Vb)
⊢ (fun x => (a + b) ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) y =
    Quotient.mk''
      { deg := ja + jb, num := { val := sb * ra + sa * rb, property := (_ : sb * ra + sa * rb ∈ 𝒜 (ja + jb)) },
        den := { val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) },
        den_mem :=
          (_ : ↑{ val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) } ∈ (↑y).asHomogeneousIdeal → False) }

Next tactic:
simp only [add_mul, map_add, Pi.add_apply, RingHom.map_mul, ext_iff_val, add_val]
theorem addMem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b) := fun x => by
  rcases ha x with ⟨Va, ma, ia, ja, ⟨ra, ra_mem⟩, ⟨sa, sa_mem⟩, wa⟩
  rcases hb x with ⟨Vb, mb, ib, jb, ⟨rb, rb_mem⟩, ⟨sb, sb_mem⟩, wb⟩
  refine'
    ⟨Va ⊓ Vb, ⟨ma, mb⟩, Opens.infLELeft _ _ ≫ ia, ja + jb,
      ⟨sb * ra + sa * rb,
        add_mem (add_comm jb ja ▸ mul_mem_graded sb_mem ra_mem : sb * ra ∈ 𝒜 (ja + jb))
          (mul_mem_graded sa_mem rb_mem)⟩,
      ⟨sa * sb, mul_mem_graded sa_mem sb_mem⟩, fun y => ⟨fun h => _, _⟩⟩
  · cases' (y : ProjectiveSpectrum.top 𝒜).isPrime.mem_or_mem h with h h
    · obtain ⟨nin, -⟩ := wa ⟨y, (Opens.infLELeft Va Vb y).2⟩; exact nin h
    · obtain ⟨nin, -⟩ := wb ⟨y, (Opens.infLERight Va Vb y).2⟩; exact nin h
  · simp only [add_mul, map_add, Pi.add_apply, RingHom.map_mul, ext_iff_val, add_val]
    

Proof state:
case intro.intro.intro.intro.intro.mk.intro.mk.intro.intro.intro.intro.intro.mk.intro.mk.refine'_2
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 b : (x : ↥U.unop) → at ↑x
ha : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate a
hb : PrelocalPredicate.pred (isLocallyFraction 𝒜).toPrelocalPredicate b
x : ↥U.unop
Va : Opens ↑(ProjectiveSpectrum.top 𝒜)
ma : ↑x ∈ Va
ia : Va ⟶ U.unop
ja : ℕ
ra : A
ra_mem : ra ∈ 𝒜 ja
sa : A
sa_mem : sa ∈ 𝒜 ja
wa :
  ∀ (x : ↥Va),
    ∃ (s_nin : ↑{ val := sa, property := sa_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => a ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := ja, num := { val := ra, property := ra_mem }, den := { val := sa, property := sa_mem },
            den_mem := s_nin }
Vb : Opens ↑(ProjectiveSpectrum.top 𝒜)
mb : ↑x ∈ Vb
ib : Vb ⟶ U.unop
jb : ℕ
rb : A
rb_mem : rb ∈ 𝒜 jb
sb : A
sb_mem : sb ∈ 𝒜 jb
wb :
  ∀ (x : ↥Vb),
    ∃ (s_nin : ↑{ val := sb, property := sb_mem } ∉ (↑x).asHomogeneousIdeal),
      (fun x => b ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) x =
        Quotient.mk''
          { deg := jb, num := { val := rb, property := rb_mem }, den := { val := sb, property := sb_mem },
            den_mem := s_nin }
y : ↥(Va ⊓ Vb)
⊢ val (a { val := ↑y, property := (_ : ↑y ∈ ↑U.unop) }) + val (b { val := ↑y, property := (_ : ↑y ∈ ↑U.unop) }) =
    val
      (Quotient.mk''
        { deg := ja + jb, num := { val := sb * ra + sa * rb, property := (_ : sb * ra + sa * rb ∈ 𝒜 (ja + jb)) },
          den := { val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) },
          den_mem :=
            (_ : ↑{ val := sa * sb, property := (_ : sa * sb ∈ 𝒜 (ja + jb)) } ∈ (↑y).asHomogeneousIdeal → False) })

Next tactic:
obtain ⟨nin1, hy1⟩ := wa (Opens.infLELeft Va Vb y)