l3lab/ntp-mathlib huggingface dataset:
theorem quasiSeparatedOfComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [H : QuasiSeparated (f ≫ g)] :
    QuasiSeparated f := by
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE f).out 0 1` directly fails, but
  -- give it a name works
  have h01 := (QuasiSeparated.affine_openCover_TFAE f).out 0 1
  rw [h01]; clear h01
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE ...).out 0 2` directly fails, but
  -- give it a name works
  have h02 := (QuasiSeparated.affine_openCover_TFAE (f ≫ g)).out 0 2
  rw [h02] at H; clear h02
  refine ⟨(Z.affineCover.pullbackCover g).bind fun x => Scheme.affineCover _, ?_, ?_⟩
  -- constructor
  · intro i; dsimp; infer_instance
  rintro ⟨i, j⟩; dsimp at i j
  -- replace H := H (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i
  specialize H _ i
  -- rw [← isQuasiSeparated_iff_quasiSeparatedSpace] at H
  

Proof state:
case refine_2.mk
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
H :
  QuasiSeparatedSpace
    ↑↑(pullback (f ≫ g)
                (Scheme.OpenCover.map (Scheme.affineCover Z) i)).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ QuasiSeparatedSpace
    ↑↑(pullback f
                (Scheme.OpenCover.map
                  (Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun x =>
                    Scheme.affineCover
                      (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) x))
                  { fst := i, snd := j })).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace

Next tactic:
refine @quasiSeparatedSpace_of_quasiSeparated _ _ ?_ H ?_
theorem quasiSeparatedOfComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [H : QuasiSeparated (f ≫ g)] :
    QuasiSeparated f := by
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE f).out 0 1` directly fails, but
  -- give it a name works
  have h01 := (QuasiSeparated.affine_openCover_TFAE f).out 0 1
  rw [h01]; clear h01
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE ...).out 0 2` directly fails, but
  -- give it a name works
  have h02 := (QuasiSeparated.affine_openCover_TFAE (f ≫ g)).out 0 2
  rw [h02] at H; clear h02
  refine ⟨(Z.affineCover.pullbackCover g).bind fun x => Scheme.affineCover _, ?_, ?_⟩
  -- constructor
  · intro i; dsimp; infer_instance
  rintro ⟨i, j⟩; dsimp at i j
  -- replace H := H (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i
  specialize H _ i
  -- rw [← isQuasiSeparated_iff_quasiSeparatedSpace] at H
  refine @quasiSeparatedSpace_of_quasiSeparated _ _ ?_ H ?_
  · 

Proof state:
case refine_2.mk.refine_1
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
H :
  QuasiSeparatedSpace
    ↑↑(pullback (f ≫ g)
                (Scheme.OpenCover.map (Scheme.affineCover Z) i)).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ pullback f
      (Scheme.OpenCover.map
        (Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun x =>
          Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) x))
        { fst := i, snd := j }) ⟶
    pullback (f ≫ g) (Scheme.OpenCover.map (Scheme.affineCover Z) i)

Next tactic:
exact pullback.map _ _ _ _ (𝟙 _) _ _ (by simp) (Category.comp_id _) ≫
      (pullbackRightPullbackFstIso g (Z.affineCover.map i) f).hom
theorem quasiSeparatedOfComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [H : QuasiSeparated (f ≫ g)] :
    QuasiSeparated f := by
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE f).out 0 1` directly fails, but
  -- give it a name works
  have h01 := (QuasiSeparated.affine_openCover_TFAE f).out 0 1
  rw [h01]; clear h01
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE ...).out 0 2` directly fails, but
  -- give it a name works
  have h02 := (QuasiSeparated.affine_openCover_TFAE (f ≫ g)).out 0 2
  rw [h02] at H; clear h02
  refine ⟨(Z.affineCover.pullbackCover g).bind fun x => Scheme.affineCover _, ?_, ?_⟩
  -- constructor
  · intro i; dsimp; infer_instance
  rintro ⟨i, j⟩; dsimp at i j
  -- replace H := H (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i
  specialize H _ i
  -- rw [← isQuasiSeparated_iff_quasiSeparatedSpace] at H
  refine @quasiSeparatedSpace_of_quasiSeparated _ _ ?_ H ?_
  · exact pullback.map _ _ _ _ (𝟙 _) _ _ (by 

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
H :
  QuasiSeparatedSpace
    ↑↑(pullback (f ≫ g)
                (Scheme.OpenCover.map (Scheme.affineCover Z) i)).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ f ≫ 𝟙 Y = 𝟙 X ≫ f

Next tactic:
simp
theorem quasiSeparatedOfComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [H : QuasiSeparated (f ≫ g)] :
    QuasiSeparated f := by
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE f).out 0 1` directly fails, but
  -- give it a name works
  have h01 := (QuasiSeparated.affine_openCover_TFAE f).out 0 1
  rw [h01]; clear h01
  -- Porting note: rewrite `(QuasiSeparated.affine_openCover_TFAE ...).out 0 2` directly fails, but
  -- give it a name works
  have h02 := (QuasiSeparated.affine_openCover_TFAE (f ≫ g)).out 0 2
  rw [h02] at H; clear h02
  refine ⟨(Z.affineCover.pullbackCover g).bind fun x => Scheme.affineCover _, ?_, ?_⟩
  -- constructor
  · intro i; dsimp; infer_instance
  rintro ⟨i, j⟩; dsimp at i j
  -- replace H := H (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i
  specialize H _ i
  -- rw [← isQuasiSeparated_iff_quasiSeparatedSpace] at H
  refine @quasiSeparatedSpace_of_quasiSeparated _ _ ?_ H ?_
  · exact pullback.map _ _ _ _ (𝟙 _) _ _ (by simp) (Category.comp_id _) ≫
      (pullbackRightPullbackFstIso g (Z.affineCover.map i) f).hom
  · 

Proof state:
case refine_2.mk.refine_2
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
H :
  QuasiSeparatedSpace
    ↑↑(pullback (f ≫ g)
                (Scheme.OpenCover.map (Scheme.affineCover Z) i)).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ QuasiSeparated
    (pullback.map f
        (Scheme.OpenCover.map
          (Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun x =>
            Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) x))
          { fst := i, snd := j })
        f (Scheme.OpenCover.map (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) { fst := i, snd := j }.fst)
        (𝟙 X)
        (Scheme.OpenCover.map
          ((fun x =>
              Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) x))
            { fst := i, snd := j }.fst)
          { fst := i, snd := j }.snd)
        (𝟙 Y) (_ : f ≫ 𝟙 Y = 𝟙 X ≫ f)
        (_ :
          Scheme.OpenCover.map
                (Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun x =>
                  Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) x))
                { fst := i, snd := j } ≫
              𝟙 Y =
            Scheme.OpenCover.map
              (Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun x =>
                Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) x))
              { fst := i, snd := j }) ≫
      (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)

Next tactic:
exact inferInstance
theorem exists_eq_pow_mul_of_isAffineOpen (X : Scheme) (U : Opens X.carrier) (hU : IsAffineOpen U)
    (f : X.presheaf.obj (op U)) (x : X.presheaf.obj (op <| X.basicOpen f)) :
    ∃ (n : ℕ) (y : X.presheaf.obj (op U)), y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x := by
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑(X.presheaf.obj (op U))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
⊢ ∃ n y, y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x

Next tactic:
have := (hU.isLocalization_basicOpen f).2
theorem exists_eq_pow_mul_of_isAffineOpen (X : Scheme) (U : Opens X.carrier) (hU : IsAffineOpen U)
    (f : X.presheaf.obj (op U)) (x : X.presheaf.obj (op <| X.basicOpen f)) :
    ∃ (n : ℕ) (y : X.presheaf.obj (op U)), y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x := by
  have := (hU.isLocalization_basicOpen f).2
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑(X.presheaf.obj (op U))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
this :
  ∀ (z : ↑(X.presheaf.obj (op (X.basicOpen f)))),
    ∃ x,
      z * (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) ↑x.2 =
        (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) x.1
⊢ ∃ n y, y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x

Next tactic:
obtain ⟨⟨y, _, n, rfl⟩, d⟩ := this x
theorem exists_eq_pow_mul_of_isAffineOpen (X : Scheme) (U : Opens X.carrier) (hU : IsAffineOpen U)
    (f : X.presheaf.obj (op U)) (x : X.presheaf.obj (op <| X.basicOpen f)) :
    ∃ (n : ℕ) (y : X.presheaf.obj (op U)), y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x := by
  have := (hU.isLocalization_basicOpen f).2
  obtain ⟨⟨y, _, n, rfl⟩, d⟩ := this x
  

Proof state:
case intro.mk.mk.intro
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑(X.presheaf.obj (op U))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
this :
  ∀ (z : ↑(X.presheaf.obj (op (X.basicOpen f)))),
    ∃ x,
      z * (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) ↑x.2 =
        (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) x.1
y : ↑(X.presheaf.obj (op U))
n : ℕ
d :
  x *
      (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f))))
        ↑(y, { val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) }).2 =
    (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f))))
      (y, { val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) }).1
⊢ ∃ n y, y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x

Next tactic:
use n, y
theorem exists_eq_pow_mul_of_isAffineOpen (X : Scheme) (U : Opens X.carrier) (hU : IsAffineOpen U)
    (f : X.presheaf.obj (op U)) (x : X.presheaf.obj (op <| X.basicOpen f)) :
    ∃ (n : ℕ) (y : X.presheaf.obj (op U)), y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x := by
  have := (hU.isLocalization_basicOpen f).2
  obtain ⟨⟨y, _, n, rfl⟩, d⟩ := this x
  use n, y
  

Proof state:
case h
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑(X.presheaf.obj (op U))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
this :
  ∀ (z : ↑(X.presheaf.obj (op (X.basicOpen f)))),
    ∃ x,
      z * (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) ↑x.2 =
        (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) x.1
y : ↑(X.presheaf.obj (op U))
n : ℕ
d :
  x *
      (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f))))
        ↑(y, { val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) }).2 =
    (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f))))
      (y, { val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) }).1
⊢ y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x

Next tactic:
delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict
theorem exists_eq_pow_mul_of_isAffineOpen (X : Scheme) (U : Opens X.carrier) (hU : IsAffineOpen U)
    (f : X.presheaf.obj (op U)) (x : X.presheaf.obj (op <| X.basicOpen f)) :
    ∃ (n : ℕ) (y : X.presheaf.obj (op U)), y |_ X.basicOpen f = (f |_ X.basicOpen f) ^ n * x := by
  have := (hU.isLocalization_basicOpen f).2
  obtain ⟨⟨y, _, n, rfl⟩, d⟩ := this x
  use n, y
  delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict
  

Proof state:
case h
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
f : ↑(X.presheaf.obj (op U))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
this :
  ∀ (z : ↑(X.presheaf.obj (op (X.basicOpen f)))),
    ∃ x,
      z * (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) ↑x.2 =
        (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f)))) x.1
y : ↑(X.presheaf.obj (op U))
n : ℕ
d :
  x *
      (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f))))
        ↑(y, { val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) }).2 =
    (algebraMap ↑(X.presheaf.obj (op U)) ↑(X.presheaf.obj (op (X.basicOpen f))))
      (y, { val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) }).1
⊢ (X.presheaf.map (homOfLE (_ : X.basicOpen f ≤ U)).op) y =
    (X.presheaf.map (homOfLE (_ : X.basicOpen f ≤ U)).op) f ^ n * x

Next tactic:
simpa [mul_comm x] using d.symm
theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux {X : TopCat}
    (F : X.Presheaf CommRingCat) {U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens X} {n₁ n₂ : ℕ}
  {y₁ : F.obj (op U₁)} {y₂ : F.obj (op U₂)} {f : F.obj (op <| U₁ ⊔ U₂)}
  {x : F.obj (op U₃)} (h₄₁ : U₄ ≤ U₁) (h₄₂ : U₄ ≤ U₂) (h₅₁ : U₅ ≤ U₁) (h₅₃ : U₅ ≤ U₃)
  (h₆₂ : U₆ ≤ U₂) (h₆₃ : U₆ ≤ U₃) (h₇₄ : U₇ ≤ U₄) (h₇₅ : U₇ ≤ U₅) (h₇₆ : U₇ ≤ U₆)
  (e₁ : y₁ |_ U₅ = (f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅)
  (e₂ : y₂ |_ U₆ = (f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆) :
    (((f |_ U₁) ^ n₂ * y₁) |_ U₄) |_ U₇ = (((f |_ U₂) ^ n₁ * y₂) |_ U₄) |_ U₇ := by
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : TopCat
F : TopCat.Presheaf CommRingCat X
U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens ↑X
n₁ n₂ : ℕ
y₁ : ↑(F.obj (op U₁))
y₂ : ↑(F.obj (op U₂))
f : ↑(F.obj (op (U₁ ⊔ U₂)))
x : ↑(F.obj (op U₃))
h₄₁ : U₄ ≤ U₁
h₄₂ : U₄ ≤ U₂
h₅₁ : U₅ ≤ U₁
h₅₃ : U₅ ≤ U₃
h₆₂ : U₆ ≤ U₂
h₆₃ : U₆ ≤ U₃
h₇₄ : U₇ ≤ U₄
h₇₅ : U₇ ≤ U₅
h₇₆ : U₇ ≤ U₆
e₁ : y₁ |_ U₅ = (f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅
e₂ : y₂ |_ U₆ = (f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆
⊢ ((f |_ U₁) ^ n₂ * y₁) |_ U₄ |_ U₇ = ((f |_ U₂) ^ n₁ * y₂) |_ U₄ |_ U₇

Next tactic:
apply_fun (fun x : F.obj (op U₅) ↦ x |_ U₇) at e₁
theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux {X : TopCat}
    (F : X.Presheaf CommRingCat) {U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens X} {n₁ n₂ : ℕ}
  {y₁ : F.obj (op U₁)} {y₂ : F.obj (op U₂)} {f : F.obj (op <| U₁ ⊔ U₂)}
  {x : F.obj (op U₃)} (h₄₁ : U₄ ≤ U₁) (h₄₂ : U₄ ≤ U₂) (h₅₁ : U₅ ≤ U₁) (h₅₃ : U₅ ≤ U₃)
  (h₆₂ : U₆ ≤ U₂) (h₆₃ : U₆ ≤ U₃) (h₇₄ : U₇ ≤ U₄) (h₇₅ : U₇ ≤ U₅) (h₇₆ : U₇ ≤ U₆)
  (e₁ : y₁ |_ U₅ = (f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅)
  (e₂ : y₂ |_ U₆ = (f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆) :
    (((f |_ U₁) ^ n₂ * y₁) |_ U₄) |_ U₇ = (((f |_ U₂) ^ n₁ * y₂) |_ U₄) |_ U₇ := by
  apply_fun (fun x : F.obj (op U₅) ↦ x |_ U₇) at e₁
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : TopCat
F : TopCat.Presheaf CommRingCat X
U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens ↑X
n₁ n₂ : ℕ
y₁ : ↑(F.obj (op U₁))
y₂ : ↑(F.obj (op U₂))
f : ↑(F.obj (op (U₁ ⊔ U₂)))
x : ↑(F.obj (op U₃))
h₄₁ : U₄ ≤ U₁
h₄₂ : U₄ ≤ U₂
h₅₁ : U₅ ≤ U₁
h₅₃ : U₅ ≤ U₃
h₆₂ : U₆ ≤ U₂
h₆₃ : U₆ ≤ U₃
h₇₄ : U₇ ≤ U₄
h₇₅ : U₇ ≤ U₅
h₇₆ : U₇ ≤ U₆
e₂ : y₂ |_ U₆ = (f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆
e₁ : y₁ |_ U₅ |_ U₇ = ((f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅) |_ U₇
⊢ ((f |_ U₁) ^ n₂ * y₁) |_ U₄ |_ U₇ = ((f |_ U₂) ^ n₁ * y₂) |_ U₄ |_ U₇

Next tactic:
apply_fun (fun x : F.obj (op U₆) ↦ x |_ U₇) at e₂
theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux {X : TopCat}
    (F : X.Presheaf CommRingCat) {U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens X} {n₁ n₂ : ℕ}
  {y₁ : F.obj (op U₁)} {y₂ : F.obj (op U₂)} {f : F.obj (op <| U₁ ⊔ U₂)}
  {x : F.obj (op U₃)} (h₄₁ : U₄ ≤ U₁) (h₄₂ : U₄ ≤ U₂) (h₅₁ : U₅ ≤ U₁) (h₅₃ : U₅ ≤ U₃)
  (h₆₂ : U₆ ≤ U₂) (h₆₃ : U₆ ≤ U₃) (h₇₄ : U₇ ≤ U₄) (h₇₅ : U₇ ≤ U₅) (h₇₆ : U₇ ≤ U₆)
  (e₁ : y₁ |_ U₅ = (f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅)
  (e₂ : y₂ |_ U₆ = (f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆) :
    (((f |_ U₁) ^ n₂ * y₁) |_ U₄) |_ U₇ = (((f |_ U₂) ^ n₁ * y₂) |_ U₄) |_ U₇ := by
  apply_fun (fun x : F.obj (op U₅) ↦ x |_ U₇) at e₁
  apply_fun (fun x : F.obj (op U₆) ↦ x |_ U₇) at e₂
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : TopCat
F : TopCat.Presheaf CommRingCat X
U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens ↑X
n₁ n₂ : ℕ
y₁ : ↑(F.obj (op U₁))
y₂ : ↑(F.obj (op U₂))
f : ↑(F.obj (op (U₁ ⊔ U₂)))
x : ↑(F.obj (op U₃))
h₄₁ : U₄ ≤ U₁
h₄₂ : U₄ ≤ U₂
h₅₁ : U₅ ≤ U₁
h₅₃ : U₅ ≤ U₃
h₆₂ : U₆ ≤ U₂
h₆₃ : U₆ ≤ U₃
h₇₄ : U₇ ≤ U₄
h₇₅ : U₇ ≤ U₅
h₇₆ : U₇ ≤ U₆
e₁ : y₁ |_ U₅ |_ U₇ = ((f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅) |_ U₇
e₂ : y₂ |_ U₆ |_ U₇ = ((f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆) |_ U₇
⊢ ((f |_ U₁) ^ n₂ * y₁) |_ U₄ |_ U₇ = ((f |_ U₂) ^ n₁ * y₂) |_ U₄ |_ U₇

Next tactic:
dsimp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict] at e₁ e₂ ⊢
theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux {X : TopCat}
    (F : X.Presheaf CommRingCat) {U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens X} {n₁ n₂ : ℕ}
  {y₁ : F.obj (op U₁)} {y₂ : F.obj (op U₂)} {f : F.obj (op <| U₁ ⊔ U₂)}
  {x : F.obj (op U₃)} (h₄₁ : U₄ ≤ U₁) (h₄₂ : U₄ ≤ U₂) (h₅₁ : U₅ ≤ U₁) (h₅₃ : U₅ ≤ U₃)
  (h₆₂ : U₆ ≤ U₂) (h₆₃ : U₆ ≤ U₃) (h₇₄ : U₇ ≤ U₄) (h₇₅ : U₇ ≤ U₅) (h₇₆ : U₇ ≤ U₆)
  (e₁ : y₁ |_ U₅ = (f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅)
  (e₂ : y₂ |_ U₆ = (f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆) :
    (((f |_ U₁) ^ n₂ * y₁) |_ U₄) |_ U₇ = (((f |_ U₂) ^ n₁ * y₂) |_ U₄) |_ U₇ := by
  apply_fun (fun x : F.obj (op U₅) ↦ x |_ U₇) at e₁
  apply_fun (fun x : F.obj (op U₆) ↦ x |_ U₇) at e₂
  dsimp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict] at e₁ e₂ ⊢
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : TopCat
F : TopCat.Presheaf CommRingCat X
U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens ↑X
n₁ n₂ : ℕ
y₁ : ↑(F.obj (op U₁))
y₂ : ↑(F.obj (op U₂))
f : ↑(F.obj (op (U₁ ⊔ U₂)))
x : ↑(F.obj (op U₃))
h₄₁ : U₄ ≤ U₁
h₄₂ : U₄ ≤ U₂
h₅₁ : U₅ ≤ U₁
h₅₃ : U₅ ≤ U₃
h₆₂ : U₆ ≤ U₂
h₆₃ : U₆ ≤ U₃
h₇₄ : U₇ ≤ U₄
h₇₅ : U₇ ≤ U₅
h₇₆ : U₇ ≤ U₆
e₁ :
  (F.map (homOfLE h₇₅).op) ((F.map (homOfLE h₅₁).op) y₁) =
    (F.map (homOfLE h₇₅).op)
      ((F.map (homOfLE h₅₁).op) ((F.map (homOfLE (_ : U₁ ≤ U₁ ⊔ U₂)).op) f) ^ n₁ * (F.map (homOfLE h₅₃).op) x)
e₂ :
  (F.map (homOfLE h₇₆).op) ((F.map (homOfLE h₆₂).op) y₂) =
    (F.map (homOfLE h₇₆).op)
      ((F.map (homOfLE h₆₂).op) ((F.map (homOfLE (_ : U₂ ≤ U₁ ⊔ U₂)).op) f) ^ n₂ * (F.map (homOfLE h₆₃).op) x)
⊢ (F.map (homOfLE h₇₄).op) ((F.map (homOfLE h₄₁).op) ((F.map (homOfLE (_ : U₁ ≤ U₁ ⊔ U₂)).op) f ^ n₂ * y₁)) =
    (F.map (homOfLE h₇₄).op) ((F.map (homOfLE h₄₂).op) ((F.map (homOfLE (_ : U₂ ≤ U₁ ⊔ U₂)).op) f ^ n₁ * y₂))

Next tactic:
simp only [map_mul, map_pow, ← comp_apply, ← op_comp, ← F.map_comp, homOfLE_comp] at e₁ e₂ ⊢
theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux {X : TopCat}
    (F : X.Presheaf CommRingCat) {U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens X} {n₁ n₂ : ℕ}
  {y₁ : F.obj (op U₁)} {y₂ : F.obj (op U₂)} {f : F.obj (op <| U₁ ⊔ U₂)}
  {x : F.obj (op U₃)} (h₄₁ : U₄ ≤ U₁) (h₄₂ : U₄ ≤ U₂) (h₅₁ : U₅ ≤ U₁) (h₅₃ : U₅ ≤ U₃)
  (h₆₂ : U₆ ≤ U₂) (h₆₃ : U₆ ≤ U₃) (h₇₄ : U₇ ≤ U₄) (h₇₅ : U₇ ≤ U₅) (h₇₆ : U₇ ≤ U₆)
  (e₁ : y₁ |_ U₅ = (f |_ U₁ |_ U₅) ^ n₁ * x |_ U₅)
  (e₂ : y₂ |_ U₆ = (f |_ U₂ |_ U₆) ^ n₂ * x |_ U₆) :
    (((f |_ U₁) ^ n₂ * y₁) |_ U₄) |_ U₇ = (((f |_ U₂) ^ n₁ * y₂) |_ U₄) |_ U₇ := by
  apply_fun (fun x : F.obj (op U₅) ↦ x |_ U₇) at e₁
  apply_fun (fun x : F.obj (op U₆) ↦ x |_ U₇) at e₂
  dsimp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict] at e₁ e₂ ⊢
  simp only [map_mul, map_pow, ← comp_apply, ← op_comp, ← F.map_comp, homOfLE_comp] at e₁ e₂ ⊢
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : TopCat
F : TopCat.Presheaf CommRingCat X
U₁ U₂ U₃ U₄ U₅ U₆ U₇ : Opens ↑X
n₁ n₂ : ℕ
y₁ : ↑(F.obj (op U₁))
y₂ : ↑(F.obj (op U₂))
f : ↑(F.obj (op (U₁ ⊔ U₂)))
x : ↑(F.obj (op U₃))
h₄₁ : U₄ ≤ U₁
h₄₂ : U₄ ≤ U₂
h₅₁ : U₅ ≤ U₁
h₅₃ : U₅ ≤ U₃
h₆₂ : U₆ ≤ U₂
h₆₃ : U₆ ≤ U₃
h₇₄ : U₇ ≤ U₄
h₇₅ : U₇ ≤ U₅
h₇₆ : U₇ ≤ U₆
e₁ :
  (F.map (homOfLE (_ : U₇ ≤ U₁)).op) y₁ =
    (F.map (homOfLE (_ : U₇ ≤ U₁ ⊔ U₂)).op) f ^ n₁ * (F.map (homOfLE (_ : U₇ ≤ U₃)).op) x
e₂ :
  (F.map (homOfLE (_ : U₇ ≤ U₂)).op) y₂ =
    (F.map (homOfLE (_ : U₇ ≤ U₁ ⊔ U₂)).op) f ^ n₂ * (F.map (homOfLE (_ : U₇ ≤ U₃)).op) x
⊢ (F.map (homOfLE (_ : U₇ ≤ U₁ ⊔ U₂)).op) f ^ n₂ * (F.map (homOfLE (_ : U₇ ≤ U₁)).op) y₁ =
    (F.map (homOfLE (_ : U₇ ≤ U₁ ⊔ U₂)).op) f ^ n₁ * (F.map (homOfLE (_ : U₇ ≤ U₂)).op) y₂

Next tactic:
rw [e₁, e₂, mul_left_comm]
theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux (X : Scheme)
    (S : X.affineOpens) (U₁ U₂ : Opens X.carrier) {n₁ n₂ : ℕ} {y₁ : X.presheaf.obj (op U₁)}
    {y₂ : X.presheaf.obj (op U₂)} {f : X.presheaf.obj (op <| U₁ ⊔ U₂)}
    {x : X.presheaf.obj (op <| X.basicOpen f)} (h₁ : S.1 ≤ U₁) (h₂ : S.1 ≤ U₂)
    (e₁ : y₁ |_ X.basicOpen (f |_ U₁) = ((f |_ U₁ |_ X.basicOpen _) ^ n₁) * x |_ X.basicOpen _)
    (e₂ : y₂ |_ X.basicOpen (f |_ U₂) = ((f |_ U₂ |_ X.basicOpen _) ^ n₂) * x |_ X.basicOpen _) :
    ∃ n : ℕ, ∀ m, n ≤ m →
      ((f |_ U₁) ^ (m + n₂) * y₁) |_ S.1 = ((f |_ U₂) ^ (m + n₁) * y₂) |_ S.1 := by
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
S : ↑(Scheme.affineOpens X)
U₁ U₂ : Opens ↑↑X.toPresheafedSpace
n₁ n₂ : ℕ
y₁ : ↑(X.presheaf.obj (op U₁))
y₂ : ↑(X.presheaf.obj (op U₂))
f : ↑(X.presheaf.obj (op (U₁ ⊔ U₂)))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
h₁ : ↑S ≤ U₁
h₂ : ↑S ≤ U₂
e₁ : y₁ |_ X.basicOpen (f |_ U₁) = (f |_ U₁ |_ X.basicOpen (f |_ U₁)) ^ n₁ * x |_ X.basicOpen (f |_ U₁)
e₂ : y₂ |_ X.basicOpen (f |_ U₂) = (f |_ U₂ |_ X.basicOpen (f |_ U₂)) ^ n₂ * x |_ X.basicOpen (f |_ U₂)
⊢ ∃ n, ∀ (m : ℕ), n ≤ m → ((f |_ U₁) ^ (m + n₂) * y₁) |_ ↑S = ((f |_ U₂) ^ (m + n₁) * y₂) |_ ↑S

Next tactic:
obtain ⟨⟨_, n, rfl⟩, e⟩ :=
    (@IsLocalization.eq_iff_exists _ _ _ _ _ _
      (S.2.isLocalization_basicOpen (f |_ S.1))
        (((f |_ U₁) ^ n₂ * y₁) |_ S.1)
        (((f |_ U₂) ^ n₁ * y₂) |_ S.1)).mp <| by
    apply exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux (e₁ := e₁) (e₂ := e₂)
    · show X.basicOpen _ ≤ _
      simp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict, Scheme.basicOpen_res]
      exact inf_le_inf h₁ le_rfl
    · show X.basicOpen _ ≤ _
      simp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict, Scheme.basicOpen_res]
      exact inf_le_inf h₂ le_rfl
theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux (X : Scheme)
    (S : X.affineOpens) (U₁ U₂ : Opens X.carrier) {n₁ n₂ : ℕ} {y₁ : X.presheaf.obj (op U₁)}
    {y₂ : X.presheaf.obj (op U₂)} {f : X.presheaf.obj (op <| U₁ ⊔ U₂)}
    {x : X.presheaf.obj (op <| X.basicOpen f)} (h₁ : S.1 ≤ U₁) (h₂ : S.1 ≤ U₂)
    (e₁ : y₁ |_ X.basicOpen (f |_ U₁) = ((f |_ U₁ |_ X.basicOpen _) ^ n₁) * x |_ X.basicOpen _)
    (e₂ : y₂ |_ X.basicOpen (f |_ U₂) = ((f |_ U₂ |_ X.basicOpen _) ^ n₂) * x |_ X.basicOpen _) :
    ∃ n : ℕ, ∀ m, n ≤ m →
      ((f |_ U₁) ^ (m + n₂) * y₁) |_ S.1 = ((f |_ U₂) ^ (m + n₁) * y₂) |_ S.1 := by
  obtain ⟨⟨_, n, rfl⟩, e⟩ :=
    (@IsLocalization.eq_iff_exists _ _ _ _ _ _
      (S.2.isLocalization_basicOpen (f |_ S.1))
        (((f |_ U₁) ^ n₂ * y₁) |_ S.1)
        (((f |_ U₂) ^ n₁ * y₂) |_ S.1)).mp <| by
    

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
S : ↑(Scheme.affineOpens X)
U₁ U₂ : Opens ↑↑X.toPresheafedSpace
n₁ n₂ : ℕ
y₁ : ↑(X.presheaf.obj (op U₁))
y₂ : ↑(X.presheaf.obj (op U₂))
f : ↑(X.presheaf.obj (op (U₁ ⊔ U₂)))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
h₁ : ↑S ≤ U₁
h₂ : ↑S ≤ U₂
e₁ : y₁ |_ X.basicOpen (f |_ U₁) = (f |_ U₁ |_ X.basicOpen (f |_ U₁)) ^ n₁ * x |_ X.basicOpen (f |_ U₁)
e₂ : y₂ |_ X.basicOpen (f |_ U₂) = (f |_ U₂ |_ X.basicOpen (f |_ U₂)) ^ n₂ * x |_ X.basicOpen (f |_ U₂)
⊢ (algebraMap ↑(X.presheaf.obj (op ↑S)) ↑(X.presheaf.obj (op (X.basicOpen (f |_ ↑S))))) (((f |_ U₁) ^ n₂ * y₁) |_ ↑S) =
    (algebraMap ↑(X.presheaf.obj (op ↑S)) ↑(X.presheaf.obj (op (X.basicOpen (f |_ ↑S))))) (((f |_ U₂) ^ n₁ * y₂) |_ ↑S)

Next tactic:
apply exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux (e₁ := e₁) (e₂ := e₂)