l3lab/ntp-mathlib huggingface dataset:
/-- Given a submonoid at each of the stalks, we may define a submonoid presheaf consisting of
sections whose restriction onto each stalk falls in the given submonoid. -/
@[simps]
noncomputable def submonoidPresheafOfStalk (S : ∀ x : X, Submonoid (F.stalk x)) :
    F.SubmonoidPresheaf where
  obj U := ⨅ x : U.unop, Submonoid.comap (F.germ x) (S x)
  map {U V} i := by
    

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F : Presheaf CommRingCat X
G : SubmonoidPresheaf F
S : (x : ↑X) → Submonoid ↑(stalk F x)
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
⊢ (fun U => ⨅ x, Submonoid.comap (germ F x) (S ↑x)) U ≤
    Submonoid.comap (F.map i) ((fun U => ⨅ x, Submonoid.comap (germ F x) (S ↑x)) V)

Next tactic:
intro s hs
/-- Given a submonoid at each of the stalks, we may define a submonoid presheaf consisting of
sections whose restriction onto each stalk falls in the given submonoid. -/
@[simps]
noncomputable def submonoidPresheafOfStalk (S : ∀ x : X, Submonoid (F.stalk x)) :
    F.SubmonoidPresheaf where
  obj U := ⨅ x : U.unop, Submonoid.comap (F.germ x) (S x)
  map {U V} i := by
    intro s hs
    

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F : Presheaf CommRingCat X
G : SubmonoidPresheaf F
S : (x : ↑X) → Submonoid ↑(stalk F x)
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
s : (forget CommRingCat).obj (F.obj U)
hs : s ∈ (fun U => ⨅ x, Submonoid.comap (germ F x) (S ↑x)) U
⊢ s ∈ Submonoid.comap (F.map i) ((fun U => ⨅ x, Submonoid.comap (germ F x) (S ↑x)) V)

Next tactic:
simp only [Submonoid.mem_comap, Submonoid.mem_iInf] at hs ⊢
/-- Given a submonoid at each of the stalks, we may define a submonoid presheaf consisting of
sections whose restriction onto each stalk falls in the given submonoid. -/
@[simps]
noncomputable def submonoidPresheafOfStalk (S : ∀ x : X, Submonoid (F.stalk x)) :
    F.SubmonoidPresheaf where
  obj U := ⨅ x : U.unop, Submonoid.comap (F.germ x) (S x)
  map {U V} i := by
    intro s hs
    simp only [Submonoid.mem_comap, Submonoid.mem_iInf] at hs ⊢
    

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F : Presheaf CommRingCat X
G : SubmonoidPresheaf F
S : (x : ↑X) → Submonoid ↑(stalk F x)
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
s : (forget CommRingCat).obj (F.obj U)
hs : ∀ (i : ↥U.unop), (germ F i) s ∈ S ↑i
⊢ ∀ (i_1 : ↥V.unop), (germ F i_1) ((F.map i) s) ∈ S ↑i_1

Next tactic:
intro x
/-- Given a submonoid at each of the stalks, we may define a submonoid presheaf consisting of
sections whose restriction onto each stalk falls in the given submonoid. -/
@[simps]
noncomputable def submonoidPresheafOfStalk (S : ∀ x : X, Submonoid (F.stalk x)) :
    F.SubmonoidPresheaf where
  obj U := ⨅ x : U.unop, Submonoid.comap (F.germ x) (S x)
  map {U V} i := by
    intro s hs
    simp only [Submonoid.mem_comap, Submonoid.mem_iInf] at hs ⊢
    intro x
    

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F : Presheaf CommRingCat X
G : SubmonoidPresheaf F
S : (x : ↑X) → Submonoid ↑(stalk F x)
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
s : (forget CommRingCat).obj (F.obj U)
hs : ∀ (i : ↥U.unop), (germ F i) s ∈ S ↑i
x : ↥V.unop
⊢ (germ F x) ((F.map i) s) ∈ S ↑x

Next tactic:
change (F.map i.unop.op ≫ F.germ x) s ∈ _
/-- Given a submonoid at each of the stalks, we may define a submonoid presheaf consisting of
sections whose restriction onto each stalk falls in the given submonoid. -/
@[simps]
noncomputable def submonoidPresheafOfStalk (S : ∀ x : X, Submonoid (F.stalk x)) :
    F.SubmonoidPresheaf where
  obj U := ⨅ x : U.unop, Submonoid.comap (F.germ x) (S x)
  map {U V} i := by
    intro s hs
    simp only [Submonoid.mem_comap, Submonoid.mem_iInf] at hs ⊢
    intro x
    change (F.map i.unop.op ≫ F.germ x) s ∈ _
    

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F : Presheaf CommRingCat X
G : SubmonoidPresheaf F
S : (x : ↑X) → Submonoid ↑(stalk F x)
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
s : (forget CommRingCat).obj (F.obj U)
hs : ∀ (i : ↥U.unop), (germ F i) s ∈ S ↑i
x : ↥V.unop
⊢ (F.map i.unop.op ≫ germ F x) s ∈ S ↑x

Next tactic:
rw [F.germ_res]
/-- Given a submonoid at each of the stalks, we may define a submonoid presheaf consisting of
sections whose restriction onto each stalk falls in the given submonoid. -/
@[simps]
noncomputable def submonoidPresheafOfStalk (S : ∀ x : X, Submonoid (F.stalk x)) :
    F.SubmonoidPresheaf where
  obj U := ⨅ x : U.unop, Submonoid.comap (F.germ x) (S x)
  map {U V} i := by
    intro s hs
    simp only [Submonoid.mem_comap, Submonoid.mem_iInf] at hs ⊢
    intro x
    change (F.map i.unop.op ≫ F.germ x) s ∈ _
    rw [F.germ_res]
    

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F : Presheaf CommRingCat X
G : SubmonoidPresheaf F
S : (x : ↑X) → Submonoid ↑(stalk F x)
U V : (Opens ↑X)ᵒᵖ
i : U ⟶ V
s : (forget CommRingCat).obj (F.obj U)
hs : ∀ (i : ↥U.unop), (germ F i) s ∈ S ↑i
x : ↥V.unop
⊢ (germ F ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑U.unop) }) x)) s ∈ S ↑x

Next tactic:
exact hs _
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
⊢ Mono (toTotalQuotientPresheaf (Sheaf.presheaf F))

Next tactic:
suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · 

Proof state:
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
this : ∀ (U : (Opens ↑X)ᵒᵖ), Mono ((toTotalQuotientPresheaf (Sheaf.presheaf F)).app U)
⊢ Mono (toTotalQuotientPresheaf (Sheaf.presheaf F))

Next tactic:
apply NatTrans.mono_of_mono_app
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  

Proof state:
case this
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
⊢ ∀ (U : (Opens ↑X)ᵒᵖ), Mono ((toTotalQuotientPresheaf (Sheaf.presheaf F)).app U)

Next tactic:
intro U
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  

Proof state:
case this
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
⊢ Mono ((toTotalQuotientPresheaf (Sheaf.presheaf F)).app U)

Next tactic:
apply ConcreteCategory.mono_of_injective
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
⊢ Function.Injective ⇑((toTotalQuotientPresheaf (Sheaf.presheaf F)).app U)

Next tactic:
dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
⊢ Function.Injective
    ⇑(algebraMap (↑((Sheaf.presheaf F).obj U))
        (Localization (⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰)))

Next tactic:
set m := _
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : ?m.64484 := ?m.64485
⊢ Function.Injective
    ⇑(algebraMap (↑((Sheaf.presheaf F).obj U))
        (Localization (⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰)))

Next tactic:
change Function.Injective (algebraMap _ (Localization m))
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
⊢ Function.Injective ⇑(algebraMap ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) (Localization m))

Next tactic:
change Function.Injective (algebraMap (F.presheaf.obj U) _)
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
⊢ Function.Injective ⇑(algebraMap (↑((Sheaf.presheaf F).obj U)) (Localization m))

Next tactic:
haveI : IsLocalization _ (Localization m) := Localization.isLocalization
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
⊢ Function.Injective ⇑(algebraMap (↑((Sheaf.presheaf F).obj U)) (Localization m))

Next tactic:
refine IsLocalization.injective (M := m) (S := Localization m) ?_
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  refine IsLocalization.injective (M := m) (S := Localization m) ?_
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
⊢ m ≤ ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U))⁰

Next tactic:
intro s hs t e
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  refine IsLocalization.injective (M := m) (S := Localization m) ?_
  intro s hs t e
  

Proof state:
case this.i
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
s : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
hs : s ∈ m
t : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
e : t * s = 0
⊢ t = 0

Next tactic:
apply section_ext F (unop U)
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  refine IsLocalization.injective (M := m) (S := Localization m) ?_
  intro s hs t e
  apply section_ext F (unop U)
  

Proof state:
case this.i.h
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
s : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
hs : s ∈ m
t : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
e : t * s = 0
⊢ ∀ (x : ↥U.unop), (germ (Sheaf.presheaf F) x) t = (germ (Sheaf.presheaf F) x) 0

Next tactic:
intro x
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  refine IsLocalization.injective (M := m) (S := Localization m) ?_
  intro s hs t e
  apply section_ext F (unop U)
  intro x
  

Proof state:
case this.i.h
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
s : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
hs : s ∈ m
t : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
e : t * s = 0
x : ↥U.unop
⊢ (germ (Sheaf.presheaf F) x) t = (germ (Sheaf.presheaf F) x) 0

Next tactic:
rw [map_zero]
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  refine IsLocalization.injective (M := m) (S := Localization m) ?_
  intro s hs t e
  apply section_ext F (unop U)
  intro x
  rw [map_zero]
  

Proof state:
case this.i.h
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
s : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
hs : s ∈ m
t : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
e : t * s = 0
x : ↥U.unop
⊢ (germ (Sheaf.presheaf F) x) t = 0

Next tactic:
apply Submonoid.mem_iInf.mp hs x
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  refine IsLocalization.injective (M := m) (S := Localization m) ?_
  intro s hs t e
  apply section_ext F (unop U)
  intro x
  rw [map_zero]
  apply Submonoid.mem_iInf.mp hs x
  -- Porting note : added `dsimp` to make `rw [← map_mul]` work
  

Proof state:
case this.i.h.a
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
s : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
hs : s ∈ m
t : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
e : t * s = 0
x : ↥U.unop
⊢ (germ (Sheaf.presheaf F) x) t * (germ (Sheaf.presheaf F) x) s = 0

Next tactic:
dsimp