Theorem: RingHom.RespectsIso.ofRestrict_morphismRestrict_iff
File: Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean

tactic: subst e
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
V : Opens ↑↑(X ∣_ᵤ f ⁻¹ᵁ Y.basicOpen r).toPresheafedSpace
e : V = Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U
⊢ P (Scheme.Γ.map (Scheme.ιOpens V ≫ f ∣_ Y.basicOpen r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r)
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
⊢ P (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r)

tactic: refine (hP.cancel_right_isIso _
  (Scheme.Γ.mapIso (Scheme.restrictRestrictComm _ _ _).op).inv).symm.trans ?_
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
⊢ P (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r)
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
⊢ P
      (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
        (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r)

tactic: haveI : IsAffine _ := hU
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
⊢ P
      (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
        (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r)
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ P
      (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
        (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r)

tactic: rw [← hP.basicOpen_iff_localization, iff_iff_eq]
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ P
      (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
        (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r)
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ P
      (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
        (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv) =
    P (Scheme.Γ.map ((Scheme.ιOpens U ≫ f) ∣_ Y.basicOpen r).op)

tactic: congr 1
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ P
      (Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
        (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv) =
    P (Scheme.Γ.map ((Scheme.ιOpens U ≫ f) ∣_ Y.basicOpen r).op)
state_after: case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
      (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv =
    Scheme.Γ.map ((Scheme.ιOpens U ≫ f) ∣_ Y.basicOpen r).op

tactic: simp only [Functor.mapIso_inv, Iso.op_inv, ← Functor.map_comp, ← op_comp, morphismRestrict_comp]
state_before: case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ Scheme.Γ.map (Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op ≫
      (Scheme.Γ.mapIso (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).op).inv =
    Scheme.Γ.map ((Scheme.ιOpens U ≫ f) ∣_ Y.basicOpen r).op
state_after: case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ Scheme.Γ.map
      ((X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).inv ≫
          Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op =
    Scheme.Γ.map (Scheme.ιOpens U ∣_ f ⁻¹ᵁ Y.basicOpen r ≫ f ∣_ Y.basicOpen r).op

tactic: rw [← Category.assoc]
state_before: case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ Scheme.Γ.map
      ((X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).inv ≫
          Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) ≫ f ∣_ Y.basicOpen r).op =
    Scheme.Γ.map (Scheme.ιOpens U ∣_ f ⁻¹ᵁ Y.basicOpen r ≫ f ∣_ Y.basicOpen r).op
state_after: case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ Scheme.Γ.map
      (((X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).inv ≫
            Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U)) ≫
          f ∣_ Y.basicOpen r).op =
    Scheme.Γ.map (Scheme.ιOpens U ∣_ f ⁻¹ᵁ Y.basicOpen r ≫ f ∣_ Y.basicOpen r).op

tactic: congr 3
state_before: case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ Scheme.Γ.map
      (((X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).inv ≫
            Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U)) ≫
          f ∣_ Y.basicOpen r).op =
    Scheme.Γ.map (Scheme.ιOpens U ∣_ f ⁻¹ᵁ Y.basicOpen r ≫ f ∣_ Y.basicOpen r).op
state_after: case e_a.e_a.e_f.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).inv ≫ Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) =
    Scheme.ιOpens U ∣_ f ⁻¹ᵁ Y.basicOpen r

tactic: rw [← cancel_mono (Scheme.ιOpens _), Category.assoc, Scheme.restrictRestrictComm,
  IsOpenImmersion.isoOfRangeEq_inv_fac, morphismRestrict_ι]
state_before: case e_a.e_a.e_f.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑Γ(Y, ⊤)
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
this : IsAffine (X.restrict ⋯)
⊢ (X.restrictRestrictComm (f ⁻¹ᵁ Y.basicOpen r) U).inv ≫ Scheme.ιOpens (Scheme.ιOpens (f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) =
    Scheme.ιOpens U ∣_ f ⁻¹ᵁ Y.basicOpen r
state_after: no goals