l3lab/ntp-mathlib huggingface dataset:
/-- The adjunction `Γ ⊣ Spec` from `CommRingᵒᵖ` to `LocallyRingedSpace`. -/
--Porting Note: `simps` cause a time out, so `Unit` and `counit` will be added manually
def locallyRingedSpaceAdjunction : Γ.rightOp ⊣ Spec.toLocallyRingedSpace.{u} :=
  Adjunction.mkOfUnitCounit
    { unit := identityToΓSpec
      counit := (NatIso.op SpecΓIdentity).inv
      left_triangle := by
        ext X; 

Proof state:
case w.h
X : LocallyRingedSpace
⊢ (whiskerRight identityToΓSpec Γ.rightOp ≫
          (Functor.associator Γ.rightOp Spec.toLocallyRingedSpace Γ.rightOp).hom ≫
            whiskerLeft Γ.rightOp (NatIso.op SpecΓIdentity).inv).app
      X =
    (NatTrans.id (𝟭 LocallyRingedSpace ⋙ Γ.rightOp)).app X

Next tactic:
erw [Category.id_comp]
/-- The adjunction `Γ ⊣ Spec` from `CommRingᵒᵖ` to `LocallyRingedSpace`. -/
--Porting Note: `simps` cause a time out, so `Unit` and `counit` will be added manually
def locallyRingedSpaceAdjunction : Γ.rightOp ⊣ Spec.toLocallyRingedSpace.{u} :=
  Adjunction.mkOfUnitCounit
    { unit := identityToΓSpec
      counit := (NatIso.op SpecΓIdentity).inv
      left_triangle := by
        ext X; erw [Category.id_comp]
        

Proof state:
case w.h
X : LocallyRingedSpace
⊢ (whiskerRight identityToΓSpec Γ.rightOp ≫ whiskerLeft Γ.rightOp (NatIso.op SpecΓIdentity).inv).app X =
    (NatTrans.id (𝟭 LocallyRingedSpace ⋙ Γ.rightOp)).app X

Next tactic:
exact congr_arg Quiver.Hom.op (left_triangle X)
/-- The adjunction `Γ ⊣ Spec` from `CommRingᵒᵖ` to `LocallyRingedSpace`. -/
--Porting Note: `simps` cause a time out, so `Unit` and `counit` will be added manually
def locallyRingedSpaceAdjunction : Γ.rightOp ⊣ Spec.toLocallyRingedSpace.{u} :=
  Adjunction.mkOfUnitCounit
    { unit := identityToΓSpec
      counit := (NatIso.op SpecΓIdentity).inv
      left_triangle := by
        ext X; erw [Category.id_comp]
        exact congr_arg Quiver.Hom.op (left_triangle X)
      right_triangle := by
        

Proof state:
⊢ whiskerLeft Spec.toLocallyRingedSpace identityToΓSpec ≫
      (Functor.associator Spec.toLocallyRingedSpace Γ.rightOp Spec.toLocallyRingedSpace).inv ≫
        whiskerRight (NatIso.op SpecΓIdentity).inv Spec.toLocallyRingedSpace =
    NatTrans.id (Spec.toLocallyRingedSpace ⋙ 𝟭 LocallyRingedSpace)

Next tactic:
ext R : 2
/-- The adjunction `Γ ⊣ Spec` from `CommRingᵒᵖ` to `LocallyRingedSpace`. -/
--Porting Note: `simps` cause a time out, so `Unit` and `counit` will be added manually
def locallyRingedSpaceAdjunction : Γ.rightOp ⊣ Spec.toLocallyRingedSpace.{u} :=
  Adjunction.mkOfUnitCounit
    { unit := identityToΓSpec
      counit := (NatIso.op SpecΓIdentity).inv
      left_triangle := by
        ext X; erw [Category.id_comp]
        exact congr_arg Quiver.Hom.op (left_triangle X)
      right_triangle := by
        ext R : 2
        -- Porting note : a little bit hand holding
        

Proof state:
case w.h
R : CommRingCatᵒᵖ
⊢ (whiskerLeft Spec.toLocallyRingedSpace identityToΓSpec ≫
          (Functor.associator Spec.toLocallyRingedSpace Γ.rightOp Spec.toLocallyRingedSpace).inv ≫
            whiskerRight (NatIso.op SpecΓIdentity).inv Spec.toLocallyRingedSpace).app
      R =
    (NatTrans.id (Spec.toLocallyRingedSpace ⋙ 𝟭 LocallyRingedSpace)).app R

Next tactic:
change identityToΓSpec.app _ ≫ 𝟙 _ ≫ Spec.toLocallyRingedSpace.map _ =
          𝟙 _
/-- The adjunction `Γ ⊣ Spec` from `CommRingᵒᵖ` to `LocallyRingedSpace`. -/
--Porting Note: `simps` cause a time out, so `Unit` and `counit` will be added manually
def locallyRingedSpaceAdjunction : Γ.rightOp ⊣ Spec.toLocallyRingedSpace.{u} :=
  Adjunction.mkOfUnitCounit
    { unit := identityToΓSpec
      counit := (NatIso.op SpecΓIdentity).inv
      left_triangle := by
        ext X; erw [Category.id_comp]
        exact congr_arg Quiver.Hom.op (left_triangle X)
      right_triangle := by
        ext R : 2
        -- Porting note : a little bit hand holding
        change identityToΓSpec.app _ ≫ 𝟙 _ ≫ Spec.toLocallyRingedSpace.map _ =
          𝟙 _
        

Proof state:
case w.h
R : CommRingCatᵒᵖ
⊢ identityToΓSpec.app (Spec.locallyRingedSpaceObj R.unop) ≫
      𝟙 ((Γ.rightOp ⋙ Spec.toLocallyRingedSpace).obj (Spec.locallyRingedSpaceObj R.unop)) ≫
        Spec.toLocallyRingedSpace.map ((NatIso.op SpecΓIdentity).inv.app R) =
    𝟙 ((𝟭 LocallyRingedSpace).obj (Spec.locallyRingedSpaceObj R.unop))

Next tactic:
simp_rw [Category.id_comp, show (NatIso.op SpecΓIdentity).inv.app R =
          (SpecΓIdentity.inv.app R.unop).op from rfl]
/-- The adjunction `Γ ⊣ Spec` from `CommRingᵒᵖ` to `LocallyRingedSpace`. -/
--Porting Note: `simps` cause a time out, so `Unit` and `counit` will be added manually
def locallyRingedSpaceAdjunction : Γ.rightOp ⊣ Spec.toLocallyRingedSpace.{u} :=
  Adjunction.mkOfUnitCounit
    { unit := identityToΓSpec
      counit := (NatIso.op SpecΓIdentity).inv
      left_triangle := by
        ext X; erw [Category.id_comp]
        exact congr_arg Quiver.Hom.op (left_triangle X)
      right_triangle := by
        ext R : 2
        -- Porting note : a little bit hand holding
        change identityToΓSpec.app _ ≫ 𝟙 _ ≫ Spec.toLocallyRingedSpace.map _ =
          𝟙 _
        simp_rw [Category.id_comp, show (NatIso.op SpecΓIdentity).inv.app R =
          (SpecΓIdentity.inv.app R.unop).op from rfl]
        

Proof state:
case w.h
R : CommRingCatᵒᵖ
⊢ identityToΓSpec.app (Spec.locallyRingedSpaceObj R.unop) ≫
      Spec.toLocallyRingedSpace.map (SpecΓIdentity.inv.app R.unop).op =
    𝟙 ((𝟭 LocallyRingedSpace).obj (Spec.locallyRingedSpaceObj R.unop))

Next tactic:
exact right_triangle R.unop
theorem adjunction_homEquiv_apply {X : Scheme} {R : CommRingCatᵒᵖ}
    (f : (op <| Scheme.Γ.obj <| op X) ⟶ R) :
    ΓSpec.adjunction.homEquiv X R f = locallyRingedSpaceAdjunction.homEquiv X.1 R f := by
  

Proof state:
X : Scheme
R : CommRingCatᵒᵖ
f : op (Scheme.Γ.obj (op X)) ⟶ R
⊢ (Adjunction.homEquiv adjunction X R) f = (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R) f

Next tactic:
dsimp [adjunction, Adjunction.restrictFullyFaithful]
theorem adjunction_homEquiv_apply {X : Scheme} {R : CommRingCatᵒᵖ}
    (f : (op <| Scheme.Γ.obj <| op X) ⟶ R) :
    ΓSpec.adjunction.homEquiv X R f = locallyRingedSpaceAdjunction.homEquiv X.1 R f := by
  dsimp [adjunction, Adjunction.restrictFullyFaithful]
  

Proof state:
X : Scheme
R : CommRingCatᵒᵖ
f : op (Scheme.Γ.obj (op X)) ⟶ R
⊢ (equivOfFullyFaithful Scheme.forgetToLocallyRingedSpace).symm
      (𝟙 X.toLocallyRingedSpace ≫
        (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R)
            (𝟙 (op (X.presheaf.obj (op ⊤))) ≫ (equivOfFullyFaithful (𝟭 CommRingCatᵒᵖ)) f ≫ 𝟙 R) ≫
          𝟙 (Spec.locallyRingedSpaceObj R.unop)) =
    (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R) f

Next tactic:
simp only [Category.comp_id, Category.id_comp]
theorem adjunction_homEquiv_apply {X : Scheme} {R : CommRingCatᵒᵖ}
    (f : (op <| Scheme.Γ.obj <| op X) ⟶ R) :
    ΓSpec.adjunction.homEquiv X R f = locallyRingedSpaceAdjunction.homEquiv X.1 R f := by
  dsimp [adjunction, Adjunction.restrictFullyFaithful]
  simp only [Category.comp_id, Category.id_comp]
  

Proof state:
X : Scheme
R : CommRingCatᵒᵖ
f : op (Scheme.Γ.obj (op X)) ⟶ R
⊢ (equivOfFullyFaithful Scheme.forgetToLocallyRingedSpace).symm
      ((Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R)
        ((equivOfFullyFaithful (𝟭 CommRingCatᵒᵖ)) f)) =
    (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R) f

Next tactic:
rfl
theorem adjunction_homEquiv_symm_apply {X : Scheme} {R : CommRingCatᵒᵖ}
    (f : X ⟶ Scheme.Spec.obj R) :
    (ΓSpec.adjunction.homEquiv X R).symm f = (locallyRingedSpaceAdjunction.homEquiv X.1 R).symm f :=
  by 

Proof state:
X : Scheme
R : CommRingCatᵒᵖ
f : X ⟶ Scheme.Spec.obj R
⊢ (Adjunction.homEquiv adjunction X R).symm f =
    (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R).symm f

Next tactic:
rw [adjunction_homEquiv]
theorem adjunction_homEquiv_symm_apply {X : Scheme} {R : CommRingCatᵒᵖ}
    (f : X ⟶ Scheme.Spec.obj R) :
    (ΓSpec.adjunction.homEquiv X R).symm f = (locallyRingedSpaceAdjunction.homEquiv X.1 R).symm f :=
  by rw [adjunction_homEquiv]; 

Proof state:
X : Scheme
R : CommRingCatᵒᵖ
f : X ⟶ Scheme.Spec.obj R
⊢ (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R).symm f =
    (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace R).symm f

Next tactic:
rfl
@[simp]
theorem adjunction_counit_app {R : CommRingCatᵒᵖ} :
    ΓSpec.adjunction.counit.app R = locallyRingedSpaceAdjunction.counit.app R := by
  

Proof state:
R : CommRingCatᵒᵖ
⊢ adjunction.counit.app R = locallyRingedSpaceAdjunction.counit.app R

Next tactic:
rw [← Adjunction.homEquiv_symm_id, ← Adjunction.homEquiv_symm_id,
    adjunction_homEquiv_symm_apply]
@[simp]
theorem adjunction_counit_app {R : CommRingCatᵒᵖ} :
    ΓSpec.adjunction.counit.app R = locallyRingedSpaceAdjunction.counit.app R := by
  rw [← Adjunction.homEquiv_symm_id, ← Adjunction.homEquiv_symm_id,
    adjunction_homEquiv_symm_apply]
  

Proof state:
R : CommRingCatᵒᵖ
⊢ (Adjunction.homEquiv locallyRingedSpaceAdjunction (Scheme.Spec.obj R).toLocallyRingedSpace R).symm
      (𝟙 (Scheme.Spec.obj R)) =
    (Adjunction.homEquiv locallyRingedSpaceAdjunction (Spec.toLocallyRingedSpace.obj R) R).symm
      (𝟙 (Spec.toLocallyRingedSpace.obj R))

Next tactic:
rfl
@[simp]
theorem adjunction_unit_app {X : Scheme} :
    ΓSpec.adjunction.unit.app X = locallyRingedSpaceAdjunction.unit.app X.1 := by
  

Proof state:
X : Scheme
⊢ adjunction.unit.app X = locallyRingedSpaceAdjunction.unit.app X.toLocallyRingedSpace

Next tactic:
rw [← Adjunction.homEquiv_id, ← Adjunction.homEquiv_id, adjunction_homEquiv_apply]
@[simp]
theorem adjunction_unit_app {X : Scheme} :
    ΓSpec.adjunction.unit.app X = locallyRingedSpaceAdjunction.unit.app X.1 := by
  rw [← Adjunction.homEquiv_id, ← Adjunction.homEquiv_id, adjunction_homEquiv_apply]; 

Proof state:
X : Scheme
⊢ (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace (Scheme.Γ.rightOp.obj X))
      (𝟙 (Scheme.Γ.rightOp.obj X)) =
    (Adjunction.homEquiv locallyRingedSpaceAdjunction X.toLocallyRingedSpace (Γ.rightOp.obj X.toLocallyRingedSpace))
      (𝟙 (Γ.rightOp.obj X.toLocallyRingedSpace))

Next tactic:
rfl
instance isIso_locallyRingedSpaceAdjunction_counit : IsIso locallyRingedSpaceAdjunction.counit := by
  

Proof state:
⊢ IsIso locallyRingedSpaceAdjunction.counit

Next tactic:
dsimp only [locallyRingedSpaceAdjunction, Adjunction.mkOfUnitCounit_counit]
instance isIso_locallyRingedSpaceAdjunction_counit : IsIso locallyRingedSpaceAdjunction.counit := by
  dsimp only [locallyRingedSpaceAdjunction, Adjunction.mkOfUnitCounit_counit]
  -- Porting Note: `dsimp` was unnecessary and had to make this explicit
  

Proof state:
⊢ IsIso (NatIso.op SpecΓIdentity).inv

Next tactic:
convert IsIso.of_iso_inv (NatIso.op SpecΓIdentity) using 1
instance isIso_adjunction_counit : IsIso ΓSpec.adjunction.counit := by
  

Proof state:
⊢ IsIso adjunction.counit

Next tactic:
apply (config := { allowSynthFailures := true }) NatIso.isIso_of_isIso_app
instance isIso_adjunction_counit : IsIso ΓSpec.adjunction.counit := by
  apply (config := { allowSynthFailures := true }) NatIso.isIso_of_isIso_app
  

Proof state:
case inst
⊢ ∀ (X : CommRingCatᵒᵖ), IsIso (adjunction.counit.app X)

Next tactic:
intro R
instance isIso_adjunction_counit : IsIso ΓSpec.adjunction.counit := by
  apply (config := { allowSynthFailures := true }) NatIso.isIso_of_isIso_app
  intro R
  

Proof state:
case inst
R : CommRingCatᵒᵖ
⊢ IsIso (adjunction.counit.app R)

Next tactic:
rw [adjunction_counit_app]
instance isIso_adjunction_counit : IsIso ΓSpec.adjunction.counit := by
  apply (config := { allowSynthFailures := true }) NatIso.isIso_of_isIso_app
  intro R
  rw [adjunction_counit_app]
  

Proof state:
case inst
R : CommRingCatᵒᵖ
⊢ IsIso (locallyRingedSpaceAdjunction.counit.app R)

Next tactic:
infer_instance
theorem adjunction_unit_app_app_top (X : Scheme) :
    (ΓSpec.adjunction.unit.app X).1.c.app (op ⊤) =
    SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤)) := by
  

Proof state:
X : Scheme
⊢ (adjunction.unit.app X).val.c.app (op ⊤) = SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤))

Next tactic:
have := congr_app ΓSpec.adjunction.left_triangle X
theorem adjunction_unit_app_app_top (X : Scheme) :
    (ΓSpec.adjunction.unit.app X).1.c.app (op ⊤) =
    SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤)) := by
  have := congr_app ΓSpec.adjunction.left_triangle X
  

Proof state:
X : Scheme
this :
  (whiskerRight adjunction.unit Scheme.Γ.rightOp ≫ whiskerLeft Scheme.Γ.rightOp adjunction.counit).app X =
    (𝟙 (𝟭 Scheme ⋙ Scheme.Γ.rightOp)).app X
⊢ (adjunction.unit.app X).val.c.app (op ⊤) = SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤))

Next tactic:
dsimp at this
theorem adjunction_unit_app_app_top (X : Scheme) :
    (ΓSpec.adjunction.unit.app X).1.c.app (op ⊤) =
    SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤)) := by
  have := congr_app ΓSpec.adjunction.left_triangle X
  dsimp at this
  -- Porting Notes: Slightly changed some rewrites.
  -- Originally:
  --  rw [← is_iso.eq_comp_inv] at this
  --  simp only [Γ_Spec.LocallyRingedSpace_adjunction_counit, nat_trans.op_app, category.id_comp,
  --    Γ_Spec.adjunction_counit_app] at this
  --  rw [← op_inv, nat_iso.inv_inv_app, quiver.hom.op_inj.eq_iff] at this
  

Proof state:
X : Scheme
this :
  ((adjunction.unit.app X).val.c.app (op ⊤)).op ≫ adjunction.counit.app (op (X.presheaf.obj (op ⊤))) =
    𝟙 (op (X.presheaf.obj (op ⊤)))
⊢ (adjunction.unit.app X).val.c.app (op ⊤) = SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤))

Next tactic:
rw [← IsIso.eq_comp_inv] at this
theorem adjunction_unit_app_app_top (X : Scheme) :
    (ΓSpec.adjunction.unit.app X).1.c.app (op ⊤) =
    SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤)) := by
  have := congr_app ΓSpec.adjunction.left_triangle X
  dsimp at this
  -- Porting Notes: Slightly changed some rewrites.
  -- Originally:
  --  rw [← is_iso.eq_comp_inv] at this
  --  simp only [Γ_Spec.LocallyRingedSpace_adjunction_counit, nat_trans.op_app, category.id_comp,
  --    Γ_Spec.adjunction_counit_app] at this
  --  rw [← op_inv, nat_iso.inv_inv_app, quiver.hom.op_inj.eq_iff] at this
  rw [← IsIso.eq_comp_inv] at this
  

Proof state:
X : Scheme
this :
  ((adjunction.unit.app X).val.c.app (op ⊤)).op =
    𝟙 (op (X.presheaf.obj (op ⊤))) ≫ inv (adjunction.counit.app (op (X.presheaf.obj (op ⊤))))
⊢ (adjunction.unit.app X).val.c.app (op ⊤) = SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤))

Next tactic:
simp only [adjunction_counit_app, locallyRingedSpaceAdjunction_counit, NatIso.op_inv,
    NatTrans.op_app, unop_op, Functor.id_obj, Functor.comp_obj, Functor.rightOp_obj,
    Spec.toLocallyRingedSpace_obj, Γ_obj, Spec.locallyRingedSpaceObj_toSheafedSpace,
    Spec.sheafedSpaceObj_carrier, Spec.sheafedSpaceObj_presheaf,
    SpecΓIdentity_inv_app, Category.id_comp] at this
theorem adjunction_unit_app_app_top (X : Scheme) :
    (ΓSpec.adjunction.unit.app X).1.c.app (op ⊤) =
    SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤)) := by
  have := congr_app ΓSpec.adjunction.left_triangle X
  dsimp at this
  -- Porting Notes: Slightly changed some rewrites.
  -- Originally:
  --  rw [← is_iso.eq_comp_inv] at this
  --  simp only [Γ_Spec.LocallyRingedSpace_adjunction_counit, nat_trans.op_app, category.id_comp,
  --    Γ_Spec.adjunction_counit_app] at this
  --  rw [← op_inv, nat_iso.inv_inv_app, quiver.hom.op_inj.eq_iff] at this
  rw [← IsIso.eq_comp_inv] at this
  simp only [adjunction_counit_app, locallyRingedSpaceAdjunction_counit, NatIso.op_inv,
    NatTrans.op_app, unop_op, Functor.id_obj, Functor.comp_obj, Functor.rightOp_obj,
    Spec.toLocallyRingedSpace_obj, Γ_obj, Spec.locallyRingedSpaceObj_toSheafedSpace,
    Spec.sheafedSpaceObj_carrier, Spec.sheafedSpaceObj_presheaf,
    SpecΓIdentity_inv_app, Category.id_comp] at this
  

Proof state:
X : Scheme
this : ((adjunction.unit.app X).val.c.app (op ⊤)).op = inv (toSpecΓ (X.presheaf.obj (op ⊤))).op
⊢ (adjunction.unit.app X).val.c.app (op ⊤) = SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤))

Next tactic:
rw [← op_inv, Quiver.Hom.op_inj.eq_iff] at this
theorem adjunction_unit_app_app_top (X : Scheme) :
    (ΓSpec.adjunction.unit.app X).1.c.app (op ⊤) =
    SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤)) := by
  have := congr_app ΓSpec.adjunction.left_triangle X
  dsimp at this
  -- Porting Notes: Slightly changed some rewrites.
  -- Originally:
  --  rw [← is_iso.eq_comp_inv] at this
  --  simp only [Γ_Spec.LocallyRingedSpace_adjunction_counit, nat_trans.op_app, category.id_comp,
  --    Γ_Spec.adjunction_counit_app] at this
  --  rw [← op_inv, nat_iso.inv_inv_app, quiver.hom.op_inj.eq_iff] at this
  rw [← IsIso.eq_comp_inv] at this
  simp only [adjunction_counit_app, locallyRingedSpaceAdjunction_counit, NatIso.op_inv,
    NatTrans.op_app, unop_op, Functor.id_obj, Functor.comp_obj, Functor.rightOp_obj,
    Spec.toLocallyRingedSpace_obj, Γ_obj, Spec.locallyRingedSpaceObj_toSheafedSpace,
    Spec.sheafedSpaceObj_carrier, Spec.sheafedSpaceObj_presheaf,
    SpecΓIdentity_inv_app, Category.id_comp] at this
  rw [← op_inv, Quiver.Hom.op_inj.eq_iff] at this
  -- Note: changed from `rw` to `simp_rw` to improve performance
  

Proof state:
X : Scheme
this : (adjunction.unit.app X).val.c.app (op ⊤) = inv (toSpecΓ (X.presheaf.obj (op ⊤)))
⊢ (adjunction.unit.app X).val.c.app (op ⊤) = SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤))

Next tactic:
simp_rw [SpecΓIdentity_hom_app]
theorem adjunction_unit_app_app_top (X : Scheme) :
    (ΓSpec.adjunction.unit.app X).1.c.app (op ⊤) =
    SpecΓIdentity.hom.app (X.presheaf.obj (op ⊤)) := by
  have := congr_app ΓSpec.adjunction.left_triangle X
  dsimp at this
  -- Porting Notes: Slightly changed some rewrites.
  -- Originally:
  --  rw [← is_iso.eq_comp_inv] at this
  --  simp only [Γ_Spec.LocallyRingedSpace_adjunction_counit, nat_trans.op_app, category.id_comp,
  --    Γ_Spec.adjunction_counit_app] at this
  --  rw [← op_inv, nat_iso.inv_inv_app, quiver.hom.op_inj.eq_iff] at this
  rw [← IsIso.eq_comp_inv] at this
  simp only [adjunction_counit_app, locallyRingedSpaceAdjunction_counit, NatIso.op_inv,
    NatTrans.op_app, unop_op, Functor.id_obj, Functor.comp_obj, Functor.rightOp_obj,
    Spec.toLocallyRingedSpace_obj, Γ_obj, Spec.locallyRingedSpaceObj_toSheafedSpace,
    Spec.sheafedSpaceObj_carrier, Spec.sheafedSpaceObj_presheaf,
    SpecΓIdentity_inv_app, Category.id_comp] at this
  rw [← op_inv, Quiver.Hom.op_inj.eq_iff] at this
  -- Note: changed from `rw` to `simp_rw` to improve performance
  simp_rw [SpecΓIdentity_hom_app]
  

Proof state:
X : Scheme
this : (adjunction.unit.app X).val.c.app (op ⊤) = inv (toSpecΓ (X.presheaf.obj (op ⊤)))
⊢ (adjunction.unit.app X).val.c.app (op ⊤) = inv (toSpecΓ (X.presheaf.obj (op ⊤)))

Next tactic:
convert this using 1
theorem SpecΓIdentity_hom_app_presheaf_obj {X : Scheme} (U : Opens X) :
    SpecΓIdentity.hom.app (X.presheaf.obj (op U)) =
      Scheme.Γ.map (Scheme.Spec.map (X.presheaf.map (eqToHom U.openEmbedding_obj_top).op).op).op ≫
      (ΓSpec.adjunction.unit.app (X ∣_ᵤ U)).val.c.app (op ⊤) ≫
      X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op := by
  

Proof state:
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
⊢ SpecΓIdentity.hom.app (X.presheaf.obj (op U)) =
    Scheme.Γ.map
        (Scheme.Spec.map
            (X.presheaf.map
                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion U))).obj ⊤ = U)).op).op).op ≫
      (ΓSpec.adjunction.unit.app (X ∣_ᵤ U)).val.c.app (op ⊤) ≫
        X.presheaf.map (eqToHom (_ : U = (IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion U))).obj ⊤)).op

Next tactic:
rw [ΓSpec.adjunction_unit_app_app_top]
theorem SpecΓIdentity_hom_app_presheaf_obj {X : Scheme} (U : Opens X) :
    SpecΓIdentity.hom.app (X.presheaf.obj (op U)) =
      Scheme.Γ.map (Scheme.Spec.map (X.presheaf.map (eqToHom U.openEmbedding_obj_top).op).op).op ≫
      (ΓSpec.adjunction.unit.app (X ∣_ᵤ U)).val.c.app (op ⊤) ≫
      X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op := by
  rw [ΓSpec.adjunction_unit_app_app_top]
  

Proof state:
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
⊢ SpecΓIdentity.hom.app (X.presheaf.obj (op U)) =
    Scheme.Γ.map
        (Scheme.Spec.map
            (X.presheaf.map
                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion U))).obj ⊤ = U)).op).op).op ≫
      SpecΓIdentity.hom.app ((X ∣_ᵤ U).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.obj (op ⊤)) ≫
        X.presheaf.map (eqToHom (_ : U = (IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion U))).obj ⊤)).op

Next tactic:
dsimp [-SpecΓIdentity_hom_app]
theorem SpecΓIdentity_hom_app_presheaf_obj {X : Scheme} (U : Opens X) :
    SpecΓIdentity.hom.app (X.presheaf.obj (op U)) =
      Scheme.Γ.map (Scheme.Spec.map (X.presheaf.map (eqToHom U.openEmbedding_obj_top).op).op).op ≫
      (ΓSpec.adjunction.unit.app (X ∣_ᵤ U)).val.c.app (op ⊤) ≫
      X.presheaf.map (eqToHom U.openEmbedding_obj_top.symm).op := by
  rw [ΓSpec.adjunction_unit_app_app_top]
  dsimp [-SpecΓIdentity_hom_app]
  

Proof state:
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
⊢ SpecΓIdentity.hom.app (X.presheaf.obj (op U)) =
    (Scheme.Spec.map
                (X.presheaf.map
                    (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion U))).obj ⊤ = U)).op).op).val.c.app
        (op ⊤) ≫
      SpecΓIdentity.hom.app (X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ⇑(Opens.inclusion U))).obj ⊤))) ≫
        X.presheaf.map (eqToHom (_ : U = (IsOpenMap.functor (_ : IsOpenMap Subtype.val)).obj ⊤)).op

Next tactic:
rw [SpecΓIdentity_naturality_assoc, ← Functor.map_comp, ← op_comp, eqToHom_trans, eqToHom_refl,
    op_id, CategoryTheory.Functor.map_id, Category.comp_id]
@[simp]
theorem inl_mul [Monoid R] [AddMonoid M] [DistribMulAction R M] [DistribMulAction Rᵐᵒᵖ M]
    (r₁ r₂ : R) : (inl (r₁ * r₂) : tsze R M) = inl r₁ * inl r₂ :=
  ext rfl <| show (0 : M) = r₁ • (0 : M) + op r₂ • (0 : M) by 

Proof state:
R : Type u
M : Type v
inst✝³ : Monoid R
inst✝² : AddMonoid M
inst✝¹ : DistribMulAction R M
inst✝ : DistribMulAction Rᵐᵒᵖ M
r₁ r₂ : R
⊢ 0 = r₁ • 0 + op r₂ • 0

Next tactic:
rw [smul_zero, zero_add, smul_zero]
@[simp]
theorem inr_mul_inr [Semiring R] [AddCommMonoid M] [Module R M] [Module Rᵐᵒᵖ M] (m₁ m₂ : M) :
    (inr m₁ * inr m₂ : tsze R M) = 0 :=
  ext (mul_zero _) <|
    show (0 : R) • m₂ + (0 : Rᵐᵒᵖ) • m₁ = 0 by 

Proof state:
R : Type u
M : Type v
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : Module Rᵐᵒᵖ M
m₁ m₂ : M
⊢ 0 • m₂ + 0 • m₁ = 0

Next tactic:
rw [zero_smul, zero_add, zero_smul]
theorem inl_mul_inr [Semiring R] [AddCommMonoid M] [Module R M] [Module Rᵐᵒᵖ M] (r : R) (m : M) :
    (inl r * inr m : tsze R M) = inr (r • m) :=
  ext (mul_zero r) <|
    show r • m + (0 : Rᵐᵒᵖ) • (0 : M) = r • m by 

Proof state:
R : Type u
M : Type v
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : Module Rᵐᵒᵖ M
r : R
m : M
⊢ r • m + 0 • 0 = r • m

Next tactic:
rw [smul_zero, add_zero]
theorem inr_mul_inl [Semiring R] [AddCommMonoid M] [Module R M] [Module Rᵐᵒᵖ M] (r : R) (m : M) :
    (inr m * inl r : tsze R M) = inr (op r • m) :=
  ext (zero_mul r) <|
    show (0 : R) • (0 : M) + op r • m = op r • m by 

Proof state:
R : Type u
M : Type v
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : Module Rᵐᵒᵖ M
r : R
m : M
⊢ 0 • 0 + op r • m = op r • m

Next tactic:
rw [smul_zero, zero_add]
theorem inl_mul_eq_smul [Semiring R] [AddCommMonoid M] [Module R M] [Module Rᵐᵒᵖ M]
    (r : R) (x : tsze R M) :
    inl r * x = r • x :=
  ext rfl (by 

Proof state:
R : Type u
M : Type v
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : Module Rᵐᵒᵖ M
r : R
x : tsze R M
⊢ snd (inl r * x) = snd (r • x)

Next tactic:
dsimp
theorem inl_mul_eq_smul [Semiring R] [AddCommMonoid M] [Module R M] [Module Rᵐᵒᵖ M]
    (r : R) (x : tsze R M) :
    inl r * x = r • x :=
  ext rfl (by dsimp; 

Proof state:
R : Type u
M : Type v
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : Module Rᵐᵒᵖ M
r : R
x : tsze R M
⊢ r • snd x + op (fst x) • 0 = r • snd x

Next tactic:
rw [smul_zero, add_zero]