Theorem: AlgebraicGeometry.LocallyRingedSpace.comp_ring_hom_ext
File: Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean

Proof steps:
state_before: X✝ : LocallyRingedSpace
r : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
⊢ X.toΓSpec ≫ Spec.locallyRingedSpaceMap f = β
state_after: case h
X✝ : LocallyRingedSpace
r : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
⊢ (X.toΓSpec ≫ Spec.locallyRingedSpaceMap f).val = β.val
tactic: ext1
state_before: case h
X✝ : LocallyRingedSpace
r : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
⊢ (X.toΓSpec ≫ Spec.locallyRingedSpaceMap f).val = β.val
state_after: case h
X✝ : LocallyRingedSpace
r : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
⊢ ∀ (r : ↑R),
    let U := basicOpen r;
    (toOpen (↑R) U ≫ (X.toΓSpec ≫ Spec.locallyRingedSpaceMap f).val.c.app (op U)) ≫ X.presheaf.map (eqToHom ⋯) =
      toOpen (↑R) U ≫ β.val.c.app (op U)
tactic: refine Spec.basicOpen_hom_ext w ?_
state_before: case h
X✝ : LocallyRingedSpace
r : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
⊢ ∀ (r : ↑R),
    let U := basicOpen r;
    (toOpen (↑R) U ≫ (X.toΓSpec ≫ Spec.locallyRingedSpaceMap f).val.c.app (op U)) ≫ X.presheaf.map (eqToHom ⋯) =
      toOpen (↑R) U ≫ β.val.c.app (op U)
state_after: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ (toOpen (↑R) U ≫ (X.toΓSpec ≫ Spec.locallyRingedSpaceMap f).val.c.app (op U)) ≫ X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
tactic: intro r U
state_before: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ (toOpen (↑R) U ≫ (X.toΓSpec ≫ Spec.locallyRingedSpaceMap f).val.c.app (op U)) ≫ X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
state_after: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ (toOpen (↑R) U ≫
        (Spec.locallyRingedSpaceMap f).val.c.app (op U) ≫
          X.toΓSpec.val.c.app (op ((Opens.map (Spec.locallyRingedSpaceMap f).val.base).obj (unop (op U))))) ≫
      X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
tactic: rw [LocallyRingedSpace.comp_val_c_app]
state_before: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ (toOpen (↑R) U ≫
        (Spec.locallyRingedSpaceMap f).val.c.app (op U) ≫
          X.toΓSpec.val.c.app (op ((Opens.map (Spec.locallyRingedSpaceMap f).val.base).obj (unop (op U))))) ≫
      X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
state_after: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ (CommRingCat.ofHom f ≫
        toOpen (↑(Γ.obj (op X))) ((Opens.comap (PrimeSpectrum.comap f)) U) ≫
          X.toΓSpec.val.c.app (op ((Opens.map (Spec.locallyRingedSpaceMap f).val.base).obj (unop (op U))))) ≫
      X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
tactic: erw [toOpen_comp_comap_assoc]
state_before: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ (CommRingCat.ofHom f ≫
        toOpen (↑(Γ.obj (op X))) ((Opens.comap (PrimeSpectrum.comap f)) U) ≫
          X.toΓSpec.val.c.app (op ((Opens.map (Spec.locallyRingedSpaceMap f).val.base).obj (unop (op U))))) ≫
      X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
state_after: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ CommRingCat.ofHom f ≫
      (toOpen (↑(Γ.obj (op X))) ((Opens.comap (PrimeSpectrum.comap f)) U) ≫
          X.toΓSpec.val.c.app (op ((Opens.map (Spec.locallyRingedSpaceMap f).val.base).obj (unop (op U))))) ≫
        X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
tactic: rw [Category.assoc]
state_before: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ CommRingCat.ofHom f ≫
      (toOpen (↑(Γ.obj (op X))) ((Opens.comap (PrimeSpectrum.comap f)) U) ≫
          X.toΓSpec.val.c.app (op ((Opens.map (Spec.locallyRingedSpaceMap f).val.base).obj (unop (op U))))) ≫
        X.presheaf.map (eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
state_after: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ CommRingCat.ofHom f ≫ X.presheaf.map ((X.toΓSpecMapBasicOpen (f r)).leTop.op ≫ eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
tactic: erw [toΓSpecSheafedSpace_app_spec, ← X.presheaf.map_comp]
state_before: case h
X✝ : LocallyRingedSpace
r✝ : ↑(Γ.obj (op X✝))
X : LocallyRingedSpace
R : CommRingCat
f : R ⟶ Γ.obj (op X)
β : X ⟶ Spec.locallyRingedSpaceObj R
w : X.toΓSpec.val.base ≫ (Spec.locallyRingedSpaceMap f).val.base = β.val.base
h : ∀ (r : ↑R), f ≫ X.presheaf.map (homOfLE ⋯).op = toOpen (↑R) (basicOpen r) ≫ β.val.c.app (op (basicOpen r))
r : ↑R
U : Opens (PrimeSpectrum ↑R) := basicOpen r
⊢ CommRingCat.ofHom f ≫ X.presheaf.map ((X.toΓSpecMapBasicOpen (f r)).leTop.op ≫ eqToHom ⋯) =
    toOpen (↑R) U ≫ β.val.c.app (op U)
state_after: no goals
tactic: exact h r