Theorem: AlgebraicGeometry.HasAffineProperty.iff_of_isAffine
File: Mathlib/AlgebraicGeometry/Morphisms/Basic.lean

Proof steps:
state_before: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
⊢ P f ↔ Q f
state_after: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this : Q.IsLocal := isLocal_affineProperty P
⊢ P f ↔ Q f
tactic: letI := isLocal_affineProperty P
state_before: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this : Q.IsLocal := isLocal_affineProperty P
⊢ P f ↔ Q f
state_after: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this✝ : Q.IsLocal := isLocal_affineProperty P
this : ∀ (i : (Scheme.openCoverOfIsIso (𝟙 Y)).J), IsAffine ((Scheme.openCoverOfIsIso (𝟙 Y)).obj i)
⊢ P f ↔ Q f
tactic: haveI : ∀ i, IsAffine (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 Y)) i) := fun i => by
    dsimp; infer_instance
state_before: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this✝ : Q.IsLocal := isLocal_affineProperty P
this : ∀ (i : (Scheme.openCoverOfIsIso (𝟙 Y)).J), IsAffine ((Scheme.openCoverOfIsIso (𝟙 Y)).obj i)
⊢ P f ↔ Q f
state_after: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this✝ : Q.IsLocal := isLocal_affineProperty P
this : ∀ (i : (Scheme.openCoverOfIsIso (𝟙 Y)).J), IsAffine ((Scheme.openCoverOfIsIso (𝟙 Y)).obj i)
⊢ (∀ (i : ((Scheme.openCoverOfIsIso (𝟙 Y)).pullbackCover f).J), Q ((Scheme.openCoverOfIsIso (𝟙 Y)).pullbackHom f i)) ↔
    Q f
tactic: rw [iff_of_openCover (P := P) (Scheme.openCoverOfIsIso.{0} (𝟙 Y))]
state_before: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this✝ : Q.IsLocal := isLocal_affineProperty P
this : ∀ (i : (Scheme.openCoverOfIsIso (𝟙 Y)).J), IsAffine ((Scheme.openCoverOfIsIso (𝟙 Y)).obj i)
⊢ (∀ (i : ((Scheme.openCoverOfIsIso (𝟙 Y)).pullbackCover f).J), Q ((Scheme.openCoverOfIsIso (𝟙 Y)).pullbackHom f i)) ↔
    Q f
state_after: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this✝ : Q.IsLocal := isLocal_affineProperty P
this : ∀ (i : (Scheme.openCoverOfIsIso (𝟙 Y)).J), IsAffine ((Scheme.openCoverOfIsIso (𝟙 Y)).obj i)
⊢ (∀ (i : ((Scheme.openCoverOfIsIso (𝟙 Y)).pullbackCover f).J), Q ((Scheme.openCoverOfIsIso (𝟙 Y)).pullbackHom f i)) ↔
    Q (pullback.snd f (𝟙 Y))

P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this✝ : Q.IsLocal := isLocal_affineProperty P
this : ∀ (i : (Scheme.openCoverOfIsIso (𝟙 Y)).J), IsAffine ((Scheme.openCoverOfIsIso (𝟙 Y)).obj i)
⊢ Q (pullback.snd f (𝟙 Y)) ↔ Q f
tactic: trans Q (pullback.snd f (𝟙 _))
state_before: P : MorphismProperty Scheme
Q : AffineTargetMorphismProperty
inst✝¹ : HasAffineProperty P Q
X Y : Scheme
f : X ⟶ Y
inst✝ : IsAffine Y
this✝ : Q.IsLocal := isLocal_affineProperty P
this : ∀ (i : (Scheme.openCoverOfIsIso (𝟙 Y)).J), IsAffine ((Scheme.openCoverOfIsIso (𝟙 Y)).obj i)
⊢ Q (pullback.snd f (𝟙 Y)) ↔ Q f
state_after: no goals
tactic: rw [← Category.comp_id (pullback.snd _ _), ← pullback.condition,
    Q.cancel_left_of_respectsIso]