/-- The functions satisfying `isLocallyFraction` form a subring.
-/
def sectionsSubring (U : (Opens (PrimeSpectrum.Top R))ᵒᵖ) :
    Subring (∀ x : U.unop, Localizations R x) where
  carrier := { f | (isLocallyFraction R).pred f }
  zero_mem' := by
    refine' fun x => ⟨unop U, x.2, 𝟙 _, 0, 1, fun y => ⟨_, _⟩⟩
    · rw [← Ideal.ne_top_iff_one]; exact y.1.IsPrime.1
    · simp
  one_mem' := by
    refine' fun x => ⟨unop U, x.2, 𝟙 _, 1, 1, fun y => ⟨_, _⟩⟩
    · rw [← Ideal.ne_top_iff_one]; exact y.1.IsPrime.1
    · simp
  add_mem' := by
    

Proof state:
R : Type u
inst✝ : CommRing R
U : (Opens ↑(PrimeSpectrum.Top R))ᵒᵖ
⊢ ∀ {a b : (x : ↥U.unop) → Localizations R ↑x},
    a ∈
        {
              toSubsemigroup :=
                { carrier := {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f},
                  mul_mem' :=
                    (_ :
                      ∀ {a b : (x : ↥U.unop) → Localizations R ↑x},
                        a ∈ {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f} →
                          b ∈ {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f} →
                            ∀ (x : ↥U.unop),
                              ∃ V,
                                ∃ (_ : ↑x ∈ V),
                                  ∃ i,
                                    PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
                                      (a * b) ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) },
              one_mem' :=
                (_ :
                  ∀ (x : ↥U.unop),
                    ∃ V,
                      ∃ (_ : ↑x ∈ V),
                        ∃ i,
                          PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
                            OfNat.ofNat 1
                              ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) }.toSubsemigroup.carrier →
      b ∈
          {
                toSubsemigroup :=
                  { carrier := {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f},
                    mul_mem' :=
                      (_ :
                        ∀ {a b : (x : ↥U.unop) → Localizations R ↑x},
                          a ∈ {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f} →
                            b ∈ {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f} →
                              ∀ (x : ↥U.unop),
                                ∃ V,
                                  ∃ (_ : ↑x ∈ V),
                                    ∃ i,
                                      PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
                                        (a * b) ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) },
                one_mem' :=
                  (_ :
                    ∀ (x : ↥U.unop),
                      ∃ V,
                        ∃ (_ : ↑x ∈ V),
                          ∃ i,
                            PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
                              OfNat.ofNat 1
                                ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) }.toSubsemigroup.carrier →
        a + b ∈
          {
                toSubsemigroup :=
                  { carrier := {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f},
                    mul_mem' :=
                      (_ :
                        ∀ {a b : (x : ↥U.unop) → Localizations R ↑x},
                          a ∈ {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f} →
                            b ∈ {f | PrelocalPredicate.pred (isLocallyFraction R).toPrelocalPredicate f} →
                              ∀ (x : ↥U.unop),
                                ∃ V,
                                  ∃ (_ : ↑x ∈ V),
                                    ∃ i,
                                      PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
                                        (a * b) ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) },
                one_mem' :=
                  (_ :
                    ∀ (x : ↥U.unop),
                      ∃ V,
                        ∃ (_ : ↑x ∈ V),
                          ∃ i,
                            PrelocalPredicate.pred (isFractionPrelocal R) fun x =>
                              OfNat.ofNat 1
                                ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) }.toSubsemigroup.carrier

Next tactic:
intro a b ha hb x