Theorem: AlgebraicGeometry.affineLocally_iff_affineOpens_le
File: Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean

tactic: apply forall_congr'
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
⊢ affineLocally P f ↔
    ∀ (U : ↑Y.affineOpens) (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
⊢ ∀ (a : ↑Y.affineOpens),
    sourceAffineLocally P (f ∣_ ↑a) ↔ ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑a), P (Scheme.Hom.appLE f (↑a) (↑V) e)

tactic: intro U
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
⊢ ∀ (a : ↑Y.affineOpens),
    sourceAffineLocally P (f ∣_ ↑a) ↔ ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑a), P (Scheme.Hom.appLE f (↑a) (↑V) e)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (f ∣_ ↑U) ↔ ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: delta sourceAffineLocally
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (f ∣_ ↑U) ↔ ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (U_1 : ↑(X.restrict ⋯).affineOpens), P (Scheme.Γ.map ((X.restrict ⋯).ofRestrict ⋯ ≫ f ∣_ ↑U).op)) ↔
    ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: simp_rw [op_comp, Scheme.Γ.map_comp, Γ_map_morphismRestrict, Category.assoc, Scheme.Γ_map_op,
  hP.cancel_left_isIso (Y.presheaf.map (eqToHom _).op)]
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (U_1 : ↑(X.restrict ⋯).affineOpens), P (Scheme.Γ.map ((X.restrict ⋯).ofRestrict ⋯ ≫ f ∣_ ↑U).op)) ↔
    ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
      P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)) ↔
    ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: constructor
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
      P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)) ↔
    ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
      P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)) →
    ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)

case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)) →
    ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
      P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)

tactic: intro H V e
state_before: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
      P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)) →
    ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: let U' := (Opens.map f.val.base).obj U.1
state_before: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: have e'' : (Scheme.Hom.opensFunctor (X.ofRestrict U'.openEmbedding)).obj
    (X.ofRestrict U'.openEmbedding⁻¹ᵁ V) = V := by
  ext1; refine Set.image_preimage_eq_inter_range.trans (Set.inter_eq_left.mpr ?_)
  erw [Subtype.range_val]
  exact e
state_before: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: have h : X.ofRestrict U'.openEmbedding ⁻¹ᵁ ↑V ∈ Scheme.affineOpens (X.restrict _) := by
  apply (X.ofRestrict U'.openEmbedding).isAffineOpen_iff_of_isOpenImmersion.mp
  rw [e'']
  convert V.2
state_before: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: have := H ⟨(Opens.map (X.ofRestrict U'.openEmbedding).1.base).obj V.1, h⟩
state_before: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)

tactic: rw [← hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Scheme.Hom.appLE,
  Category.assoc, ← X.presheaf.map_comp]
state_before: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ P (Scheme.Hom.appLE f (↑U) (↑V) e)
state_after: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ P (Scheme.Hom.app f ↑U ≫ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418))

P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ (Opens ↑↑X.toPresheafedSpace)ᵒᵖ

P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ { unop := ↑V } = ?m.63280

tactic: ext1
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ ↑(X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V) = ↑↑V

tactic: refine Set.image_preimage_eq_inter_range.trans (Set.inter_eq_left.mpr ?_)
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ ↑(X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V) = ↑↑V
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ (↑V).1 ⊆ Set.range ⇑(X.ofRestrict ⋯).val.base

tactic: erw [Subtype.range_val]
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ (↑V).1 ⊆ Set.range ⇑(X.ofRestrict ⋯).val.base
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ (↑V).1 ⊆ ↑U'

tactic: exact e
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
⊢ (↑V).1 ⊆ ↑U'
state_after: no goals

tactic: apply (X.ofRestrict U'.openEmbedding).isAffineOpen_iff_of_isOpenImmersion.mp
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
⊢ X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
⊢ IsAffineOpen (X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V)

tactic: rw [e'']
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
⊢ IsAffineOpen (X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V)
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
⊢ IsAffineOpen ↑V

tactic: convert V.2
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
⊢ IsAffineOpen ↑V
state_after: no goals

tactic: convert this using 1
state_before: case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ P (Scheme.Hom.app f ↑U ≫ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418))
state_after: case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ Scheme.Hom.app f ↑U ≫ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418) =
    Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤

tactic: congr 1
state_before: case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ Scheme.Hom.app f ↑U ≫ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418) =
    Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤
state_after: case h.e'_5.h.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418) =
    X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤

tactic: rw [X.presheaf.map_comp]
state_before: case h.e'_5.h.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418) =
    X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤
state_after: case h.e'_5.h.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ X.presheaf.map (homOfLE e).op ≫ X.presheaf.map (eqToHom ?m.62418) =
    X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤

tactic: simp only [Scheme.ofRestrict_val_c_app, Scheme.restrict_presheaf_map, ← X.presheaf.map_comp]
state_before: case h.e'_5.h.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ X.presheaf.map (homOfLE e).op ≫ X.presheaf.map (eqToHom ?m.62418) =
    X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤
state_after: case h.e'_5.h.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418) = X.presheaf.map ((eqToHom ⋯).op ≫ (homOfLE ⋯).op)

tactic: congr 1
state_before: case h.e'_5.h.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
e_4✝ :
  (X.presheaf.obj (⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }))).instCommRingα =
    (Scheme.Γ.obj { unop := (X.restrict ⋯).restrict ⋯ }).instCommRingα
⊢ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.62418) = X.presheaf.map ((eqToHom ⋯).op ≫ (homOfLE ⋯).op)
state_after: no goals

tactic: dsimp only [Functor.op, unop_op]
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ { unop := ↑V } = ⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ })
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ { unop := ↑V } = { unop := ⋯.functor.obj (⋯.functor.obj ⊤) }

tactic: rw [Opens.openEmbedding_obj_top]
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ { unop := ↑V } = { unop := ⋯.functor.obj (⋯.functor.obj ⊤) }
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ { unop := ↑V } = { unop := ⋯.functor.obj (X.ofRestrict ⋯ ⁻¹ᵁ ↑V) }

tactic: congr 1
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ { unop := ↑V } = { unop := ⋯.functor.obj (X.ofRestrict ⋯ ⁻¹ᵁ ↑V) }
state_after: case e_unop
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ ↑V = ⋯.functor.obj (X.ofRestrict ⋯ ⁻¹ᵁ ↑V)

tactic: exact e''.symm
state_before: case e_unop
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H :
  ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
    P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
V : ↑X.affineOpens
e : ↑V ≤ f ⁻¹ᵁ ↑U
U' : Opens ↑↑X.toPresheafedSpace := f ⁻¹ᵁ ↑U
e'' : X.ofRestrict ⋯ ''ᵁ X.ofRestrict ⋯ ⁻¹ᵁ ↑V = ↑V
h : X.ofRestrict ⋯ ⁻¹ᵁ ↑V ∈ (X ∣_ᵤ U').affineOpens
this : P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
⊢ ↑V = ⋯.functor.obj (X.ofRestrict ⋯ ⁻¹ᵁ ↑V)
state_after: no goals

tactic: intro H V
state_before: case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
⊢ (∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)) →
    ∀ (U_1 : ↑(X.restrict ⋯).affineOpens),
      P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
state_after: case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H : ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)
V : ↑(X.restrict ⋯).affineOpens
⊢ P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)

tactic: specialize H ⟨_, V.2.image_of_isOpenImmersion (X.ofRestrict _)⟩ (Subtype.coe_image_subset _ _)
state_before: case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
H : ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), P (Scheme.Hom.appLE f (↑U) (↑V) e)
V : ↑(X.restrict ⋯).affineOpens
⊢ P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
state_after: case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)

tactic: rw [← hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Category.assoc]
state_before: case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ P (Scheme.Hom.app f ↑U ≫ X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤)
state_after: case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ P
    (Scheme.Hom.app f ↑U ≫
      (X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤) ≫
        X.presheaf.map (eqToHom ?m.65583))

P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ (Opens ↑↑X.toPresheafedSpace)ᵒᵖ

P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ (Opens ↑↑X.toPresheafedSpace)ᵒᵖ

P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ ⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }) = ?m.65582

tactic: convert H
state_before: case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ P
    (Scheme.Hom.app f ↑U ≫
      (X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤) ≫
        X.presheaf.map (eqToHom ?m.65583))
state_after: case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ Scheme.Hom.app f ↑U ≫
      (X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤) ≫
        X.presheaf.map (eqToHom ?m.65583) =
    Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯

tactic: simp only [Scheme.ofRestrict_val_c_app, Scheme.restrict_presheaf_map, ← X.presheaf.map_comp]
state_before: case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ Scheme.Hom.app f ↑U ≫
      (X.presheaf.map (eqToHom ⋯).op ≫ Scheme.Hom.app ((X.restrict ⋯).ofRestrict ⋯) ⊤) ≫
        X.presheaf.map (eqToHom ?m.65583) =
    Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯
state_after: case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ Scheme.Hom.app f ↑U ≫ X.presheaf.map (((eqToHom ⋯).op ≫ (homOfLE ⋯).op) ≫ eqToHom ?m.65583) =
    Scheme.Hom.appLE f (↑U) (X.ofRestrict ⋯ ''ᵁ ↑V) ⋯

tactic: congr 1
state_before: case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ Scheme.Hom.app f ↑U ≫ X.presheaf.map (((eqToHom ⋯).op ≫ (homOfLE ⋯).op) ≫ eqToHom ?m.65583) =
    Scheme.Hom.appLE f (↑U) (X.ofRestrict ⋯ ''ᵁ ↑V) ⋯
state_after: no goals

tactic: dsimp only [Functor.op, unop_op]
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ ⋯.functor.op.obj (⋯.functor.op.obj { unop := ⊤ }) = { unop := ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ }
state_after: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ { unop := ⋯.functor.obj (⋯.functor.obj ⊤) } = { unop := X.ofRestrict ⋯ ''ᵁ ↑V }

tactic: rw [Opens.openEmbedding_obj_top]
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑Y.affineOpens
V : ↑(X.restrict ⋯).affineOpens
H : P (Scheme.Hom.appLE f ↑U ↑⟨X.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩ ⋯)
⊢ { unop := ⋯.functor.obj (⋯.functor.obj ⊤) } = { unop := X.ofRestrict ⋯ ''ᵁ ↑V }
state_after: no goals