l3lab/ntp-mathlib huggingface dataset:
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
    apply exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux (e₁ := e₁) (e₂ := e₂)
    · 

Proof state:
case h₇₅
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₂)
⊢ X.basicOpen (f |_ ↑S) ≤ X.basicOpen (f |_ U₁)

Next tactic:
show X.basicOpen _ ≤ _
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
    apply exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux_aux (e₁ := e₁) (e₂ := e₂)
    · show X.basicOpen _ ≤ _
      

Proof state:
case h₇₅
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₂)
⊢ X.basicOpen (f |_ ↑S) ≤ X.basicOpen (f |_ U₁)

Next tactic:
simp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict, Scheme.basicOpen_res]
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
    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]
      

Proof state:
case h₇₅
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₂)
⊢ ↑S ⊓ X.basicOpen f ≤ U₁ ⊓ X.basicOpen f

Next tactic:
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
    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
    · 

Proof state:
case h₇₆
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₂)
⊢ X.basicOpen (f |_ ↑S) ≤ X.basicOpen (f |_ U₂)

Next tactic:
show X.basicOpen _ ≤ _
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
    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 _ ≤ _
      

Proof state:
case h₇₆
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₂)
⊢ X.basicOpen (f |_ ↑S) ≤ X.basicOpen (f |_ U₂)

Next tactic:
simp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict, Scheme.basicOpen_res]
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
    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]
      

Proof state:
case h₇₆
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₂)
⊢ ↑S ⊓ X.basicOpen f ≤ U₂ ⊓ X.basicOpen f

Next tactic:
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
    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
  

Proof state:
case intro.mk.intro
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 : ℕ
e :
  ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₁) ^ n₂ * y₁) |_ ↑S =
    ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₂) ^ n₁ * y₂) |_ ↑S
⊢ ∃ n, ∀ (m : ℕ), n ≤ m → ((f |_ U₁) ^ (m + n₂) * y₁) |_ ↑S = ((f |_ U₂) ^ (m + n₁) * y₂) |_ ↑S

Next tactic:
use n
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
    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
  use n
  

Proof state:
case h
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 : ℕ
e :
  ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₁) ^ n₂ * y₁) |_ ↑S =
    ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₂) ^ n₁ * y₂) |_ ↑S
⊢ ∀ (m : ℕ), n ≤ m → ((f |_ U₁) ^ (m + n₂) * y₁) |_ ↑S = ((f |_ U₂) ^ (m + n₁) * y₂) |_ ↑S

Next tactic:
intros m hm
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
    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
  use n
  intros m hm
  

Proof state:
case h
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 : ℕ
e :
  ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₁) ^ n₂ * y₁) |_ ↑S =
    ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₂) ^ n₁ * y₂) |_ ↑S
m : ℕ
hm : n ≤ m
⊢ ((f |_ U₁) ^ (m + n₂) * y₁) |_ ↑S = ((f |_ U₂) ^ (m + n₁) * y₂) |_ ↑S

Next tactic:
rw [← tsub_add_cancel_of_le hm]
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
    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
  use n
  intros m hm
  rw [← tsub_add_cancel_of_le hm]
  

Proof state:
case h
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 : ℕ
e :
  ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₁) ^ n₂ * y₁) |_ ↑S =
    ↑{ val := (fun x => (f |_ ↑S) ^ x) n,
          property := (_ : ∃ y, (fun x => (f |_ ↑S) ^ x) y = (fun x => (f |_ ↑S) ^ x) n) } *
      ((f |_ U₂) ^ n₁ * y₂) |_ ↑S
m : ℕ
hm : n ≤ m
⊢ ((f |_ U₁) ^ (m - n + n + n₂) * y₁) |_ ↑S = ((f |_ U₂) ^ (m - n + n + n₁) * y₂) |_ ↑S

Next tactic:
simp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict,
    pow_add, map_pow, map_mul, ← comp_apply, mul_assoc, ← Functor.map_comp, ← op_comp, homOfLE_comp,
    Subtype.coe_mk] at e ⊢
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
    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
  use n
  intros m hm
  rw [← tsub_add_cancel_of_le hm]
  simp only [TopCat.Presheaf.restrictOpen, TopCat.Presheaf.restrict,
    pow_add, map_pow, map_mul, ← comp_apply, mul_assoc, ← Functor.map_comp, ← op_comp, homOfLE_comp,
    Subtype.coe_mk] at e ⊢
  

Proof state:
case h
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 : ℕ
hm : n ≤ m
e :
  (X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n *
      ((X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n₂ * (X.presheaf.map (homOfLE h₁).op) y₁) =
    (X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n *
      ((X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n₁ * (X.presheaf.map (homOfLE h₂).op) y₂)
⊢ (X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ (m - n) *
      ((X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n *
        ((X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n₂ * (X.presheaf.map (homOfLE h₁).op) y₁)) =
    (X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ (m - n) *
      ((X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n *
        ((X.presheaf.map (homOfLE (_ : ↑S ≤ U₁ ⊔ U₂)).op) f ^ n₁ * (X.presheaf.map (homOfLE h₂).op) y₂))

Next tactic:
rw [e]
theorem exists_eq_pow_mul_of_isCompact_of_isQuasiSeparated (X : Scheme.{u}) (U : Opens X.carrier)
    (hU : IsCompact U.1) (hU' : IsQuasiSeparated U.1) (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 : IsCompact U.carrier
hU' : IsQuasiSeparated U.carrier
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:
delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict
theorem exists_eq_pow_mul_of_isCompact_of_isQuasiSeparated (X : Scheme.{u}) (U : Opens X.carrier)
    (hU : IsCompact U.1) (hU' : IsQuasiSeparated U.1) (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
  delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
hU' : IsQuasiSeparated U.carrier
f : ↑(X.presheaf.obj (op U))
x : ↑(X.presheaf.obj (op (X.basicOpen f)))
⊢ ∃ n y,
    (X.presheaf.map (homOfLE (_ : X.basicOpen f ≤ U)).op) y =
      (X.presheaf.map (homOfLE (_ : X.basicOpen f ≤ U)).op) f ^ n * x

Next tactic:
revert hU' f x