Theorem: RingHom.PropertyIsLocal.source_openCover_iff
File: Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean

tactic: constructor
state_before: P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
⊢ affineLocally P f ↔ ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
state_after: case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
⊢ affineLocally P f → ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)

case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
⊢ (∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)) → affineLocally P f

tactic: intro H i U
state_before: case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
⊢ affineLocally P f → ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
state_after: case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : affineLocally P f
i : 𝒰.J
U : ↑Y.affineOpens
⊢ sourceAffineLocally P ((𝒰.map i ≫ f) ∣_ ↑U)

tactic: rw [morphismRestrict_comp]
state_before: case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : affineLocally P f
i : 𝒰.J
U : ↑Y.affineOpens
⊢ sourceAffineLocally P ((𝒰.map i ≫ f) ∣_ ↑U)
state_after: case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : affineLocally P f
i : 𝒰.J
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (𝒰.map i ∣_ f ⁻¹ᵁ ↑U ≫ f ∣_ ↑U)

tactic: apply hP.sourceAffineLocally_comp_of_isOpenImmersion
state_before: case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : affineLocally P f
i : 𝒰.J
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (𝒰.map i ∣_ f ⁻¹ᵁ ↑U ≫ f ∣_ ↑U)
state_after: case mp.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : affineLocally P f
i : 𝒰.J
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (f ∣_ ↑U)

tactic: apply H
state_before: case mp.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : affineLocally P f
i : 𝒰.J
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (f ∣_ ↑U)
state_after: no goals

tactic: intro H U
state_before: case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
⊢ (∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)) → affineLocally P f
state_after: case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (f ∣_ ↑U)

tactic: haveI : IsAffine _ := U.2
state_before: case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
⊢ sourceAffineLocally P (f ∣_ ↑U)
state_after: case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
⊢ sourceAffineLocally P (f ∣_ ↑U)

tactic: apply ((hP.openCover_TFAE (f ∣_ U.1)).out 1 0).mp
state_before: case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
⊢ sourceAffineLocally P (f ∣_ ↑U)
state_after: case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
⊢ ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (𝒰.map i ≫ f ∣_ ↑U)

tactic: use 𝒰.pullbackCover (X.ofRestrict _)
state_before: case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
⊢ ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (𝒰.map i ≫ f ∣_ ↑U)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
⊢ ∀ (i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J),
    sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)

tactic: intro i
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
⊢ ∀ (i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J),
    sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)

tactic: specialize H i U
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
H : ∀ (i : 𝒰.J), affineLocally P (𝒰.map i ≫ f)
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H : sourceAffineLocally P ((𝒰.map i ≫ f) ∣_ ↑U)
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)

tactic: rw [morphismRestrict_comp] at H
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H : sourceAffineLocally P ((𝒰.map i ≫ f) ∣_ ↑U)
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H : sourceAffineLocally P (𝒰.map i ∣_ f ⁻¹ᵁ ↑U ≫ f ∣_ ↑U)
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)

tactic: delta morphismRestrict at H
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H : sourceAffineLocally P (𝒰.map i ∣_ f ⁻¹ᵁ ↑U ≫ f ∣_ ↑U)
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H :
  sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (𝒰.map i) (f ⁻¹ᵁ ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)

tactic: have := sourceAffineLocally_respectsIso hP.respectsIso
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H :
  sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (𝒰.map i) (f ⁻¹ᵁ ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this✝ : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H :
  sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (𝒰.map i) (f ⁻¹ᵁ ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
this : (sourceAffineLocally P).toProperty.RespectsIso
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)

tactic: rw [Category.assoc, affine_cancel_left_isIso this, ←
  affine_cancel_left_isIso this (pullbackSymmetry _ _).hom,
  pullbackSymmetry_hom_comp_snd_assoc] at H
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this✝ : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H :
  sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (𝒰.map i) (f ⁻¹ᵁ ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
this : (sourceAffineLocally P).toProperty.RespectsIso
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)
state_after: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this✝ : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H : sourceAffineLocally P (pullback.fst ≫ (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
this : (sourceAffineLocally P).toProperty.RespectsIso
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)

tactic: exact H
state_before: case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : X.OpenCover
U : ↑Y.affineOpens
this✝ : IsAffine (Y.restrict ⋯)
i : (𝒰.pullbackCover (X.ofRestrict ⋯)).J
H : sourceAffineLocally P (pullback.fst ≫ (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
this : (sourceAffineLocally P).toProperty.RespectsIso
⊢ sourceAffineLocally P ((𝒰.pullbackCover (X.ofRestrict ⋯)).map i ≫ f ∣_ ↑U)
state_after: no goals