l3lab/ntp-mathlib huggingface dataset:
theorem MemCarrier.clear_denominator' [DecidableEq (Away f)] {z : Localization.Away f}
    (hz : z ∈ span (algebraMap A (Away f) '' x.val.asHomogeneousIdeal)) :
    ∃ (c : algebraMap A (Away f) '' x.1.asHomogeneousIdeal →₀ Away f) (N : ℕ) (acd :
      ∀ y ∈ c.support.image c, A),
      f ^ N • z =
        algebraMap A (Away f)
          (∑ i in c.support.attach,
            acd (c i) (Finset.mem_image.mpr ⟨i, ⟨i.2, rfl⟩⟩) * i.1.2.choose) := by
  rw [← submodule_span_eq, Finsupp.span_eq_range_total, LinearMap.mem_range] at hz
  rcases hz with ⟨c, eq1⟩
  rw [Finsupp.total_apply, Finsupp.sum] at eq1
  obtain ⟨⟨_, N, rfl⟩, hN⟩ :=
    IsLocalization.exist_integer_multiples_of_finset (Submonoid.powers f) (c.support.image c)
  choose acd hacd using hN
  refine' ⟨c, N, acd, _⟩
  rw [← eq1, smul_sum, map_sum, ← sum_attach]
  

Proof state:
case intro.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝¹ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
inst✝ : DecidableEq (Away f)
z : Away f
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
eq1 : ∑ a in c.support, c a • ↑a = z
N : ℕ
acd : (a : Away f) → a ∈ image (⇑c) c.support → A
hacd :
  ∀ (a : Away f) (a_1 : a ∈ image (⇑c) c.support),
    (algebraMap A (Away f)) (acd a a_1) =
      ↑{ val := (fun x => f ^ x) N, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) N) } • a
⊢ ∑ x_1 in attach c.support, f ^ N • c ↑x_1 • ↑↑x_1 =
    ∑ x_1 in attach c.support,
      (algebraMap A (Away f))
        (acd (c ↑x_1) (_ : c ↑x_1 ∈ image (⇑c) c.support) *
          Exists.choose (_ : ↑↑x_1 ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal))

Next tactic:
congr 1
theorem MemCarrier.clear_denominator' [DecidableEq (Away f)] {z : Localization.Away f}
    (hz : z ∈ span (algebraMap A (Away f) '' x.val.asHomogeneousIdeal)) :
    ∃ (c : algebraMap A (Away f) '' x.1.asHomogeneousIdeal →₀ Away f) (N : ℕ) (acd :
      ∀ y ∈ c.support.image c, A),
      f ^ N • z =
        algebraMap A (Away f)
          (∑ i in c.support.attach,
            acd (c i) (Finset.mem_image.mpr ⟨i, ⟨i.2, rfl⟩⟩) * i.1.2.choose) := by
  rw [← submodule_span_eq, Finsupp.span_eq_range_total, LinearMap.mem_range] at hz
  rcases hz with ⟨c, eq1⟩
  rw [Finsupp.total_apply, Finsupp.sum] at eq1
  obtain ⟨⟨_, N, rfl⟩, hN⟩ :=
    IsLocalization.exist_integer_multiples_of_finset (Submonoid.powers f) (c.support.image c)
  choose acd hacd using hN
  refine' ⟨c, N, acd, _⟩
  rw [← eq1, smul_sum, map_sum, ← sum_attach]
  congr 1
  

Proof state:
case intro.intro.mk.intro.e_f
R : Type u_1
A : Type u_2
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝¹ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
inst✝ : DecidableEq (Away f)
z : Away f
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
eq1 : ∑ a in c.support, c a • ↑a = z
N : ℕ
acd : (a : Away f) → a ∈ image (⇑c) c.support → A
hacd :
  ∀ (a : Away f) (a_1 : a ∈ image (⇑c) c.support),
    (algebraMap A (Away f)) (acd a a_1) =
      ↑{ val := (fun x => f ^ x) N, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) N) } • a
⊢ (fun x_1 => f ^ N • c ↑x_1 • ↑↑x_1) = fun x_1 =>
    (algebraMap A (Away f))
      (acd (c ↑x_1) (_ : c ↑x_1 ∈ image (⇑c) c.support) *
        Exists.choose (_ : ↑↑x_1 ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal))

Next tactic:
ext i
theorem MemCarrier.clear_denominator' [DecidableEq (Away f)] {z : Localization.Away f}
    (hz : z ∈ span (algebraMap A (Away f) '' x.val.asHomogeneousIdeal)) :
    ∃ (c : algebraMap A (Away f) '' x.1.asHomogeneousIdeal →₀ Away f) (N : ℕ) (acd :
      ∀ y ∈ c.support.image c, A),
      f ^ N • z =
        algebraMap A (Away f)
          (∑ i in c.support.attach,
            acd (c i) (Finset.mem_image.mpr ⟨i, ⟨i.2, rfl⟩⟩) * i.1.2.choose) := by
  rw [← submodule_span_eq, Finsupp.span_eq_range_total, LinearMap.mem_range] at hz
  rcases hz with ⟨c, eq1⟩
  rw [Finsupp.total_apply, Finsupp.sum] at eq1
  obtain ⟨⟨_, N, rfl⟩, hN⟩ :=
    IsLocalization.exist_integer_multiples_of_finset (Submonoid.powers f) (c.support.image c)
  choose acd hacd using hN
  refine' ⟨c, N, acd, _⟩
  rw [← eq1, smul_sum, map_sum, ← sum_attach]
  congr 1
  ext i
  

Proof state:
case intro.intro.mk.intro.e_f.h
R : Type u_1
A : Type u_2
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝¹ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
inst✝ : DecidableEq (Away f)
z : Away f
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
eq1 : ∑ a in c.support, c a • ↑a = z
N : ℕ
acd : (a : Away f) → a ∈ image (⇑c) c.support → A
hacd :
  ∀ (a : Away f) (a_1 : a ∈ image (⇑c) c.support),
    (algebraMap A (Away f)) (acd a a_1) =
      ↑{ val := (fun x => f ^ x) N, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) N) } • a
i : { x_1 // x_1 ∈ c.support }
⊢ f ^ N • c ↑i • ↑↑i =
    (algebraMap A (Away f))
      (acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
        Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal))

Next tactic:
rw [_root_.map_mul, hacd, (Classical.choose_spec i.1.2).2, smul_eq_mul, smul_mul_assoc]
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
⊢ Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
by_contra rid
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
rid : ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)
⊢ False

Next tactic:
rw [Set.not_disjoint_iff] at rid
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
rid : ∃ x_1 ∈ ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal), x_1 ∈ ↑(Submonoid.powers f)
⊢ False

Next tactic:
choose g hg using rid
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
g : A
hg : g ∈ ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ∧ g ∈ ↑(Submonoid.powers f)
⊢ False

Next tactic:
obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  

Proof state:
case intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : (fun x => f ^ x) k ∈ ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal)
⊢ False

Next tactic:
by_cases k_ineq : 0 < k
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  by_cases k_ineq : 0 < k
  · 

Proof state:
case pos
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : (fun x => f ^ x) k ∈ ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal)
k_ineq : 0 < k
⊢ False

Next tactic:
erw [x.1.isPrime.pow_mem_iff_mem _ k_ineq] at hg1
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  by_cases k_ineq : 0 < k
  · erw [x.1.isPrime.pow_mem_iff_mem _ k_ineq] at hg1
    

Proof state:
case pos
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : f ∈ HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal
k_ineq : 0 < k
⊢ False

Next tactic:
exact x.2 hg1
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  by_cases k_ineq : 0 < k
  · erw [x.1.isPrime.pow_mem_iff_mem _ k_ineq] at hg1
    exact x.2 hg1
  · 

Proof state:
case neg
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : (fun x => f ^ x) k ∈ ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal)
k_ineq : ¬0 < k
⊢ False

Next tactic:
dsimp at hg1
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  by_cases k_ineq : 0 < k
  · erw [x.1.isPrime.pow_mem_iff_mem _ k_ineq] at hg1
    exact x.2 hg1
  · dsimp at hg1
    

Proof state:
case neg
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : f ^ k ∈ ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal)
k_ineq : ¬0 < k
⊢ False

Next tactic:
erw [show k = 0 by linarith, pow_zero, ← Ideal.eq_top_iff_one] at hg1
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  by_cases k_ineq : 0 < k
  · erw [x.1.isPrime.pow_mem_iff_mem _ k_ineq] at hg1
    exact x.2 hg1
  · dsimp at hg1
    erw [show k = 0 by 

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : f ^ k ∈ ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal)
k_ineq : ¬0 < k
⊢ k = 0

Next tactic:
linarith
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  by_cases k_ineq : 0 < k
  · erw [x.1.isPrime.pow_mem_iff_mem _ k_ineq] at hg1
    exact x.2 hg1
  · dsimp at hg1
    erw [show k = 0 by linarith, pow_zero, ← Ideal.eq_top_iff_one] at hg1
    

Proof state:
case neg
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal = ⊤
k_ineq : ¬0 < k
⊢ False

Next tactic:
apply x.1.isPrime.1
theorem disjoint :
    Disjoint (x.1.asHomogeneousIdeal.toIdeal : Set A) (Submonoid.powers f : Set A) := by
  by_contra rid
  rw [Set.not_disjoint_iff] at rid
  choose g hg using rid
  obtain ⟨hg1, ⟨k, rfl⟩⟩ := hg
  by_cases k_ineq : 0 < k
  · erw [x.1.isPrime.pow_mem_iff_mem _ k_ineq] at hg1
    exact x.2 hg1
  · dsimp at hg1
    erw [show k = 0 by linarith, pow_zero, ← Ideal.eq_top_iff_one] at hg1
    apply x.1.isPrime.1
    

Proof state:
case neg
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
k : ℕ
hg1 : HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal = ⊤
k_ineq : ¬0 < k
⊢ HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal = ⊤

Next tactic:
exact hg1
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
⊢ carrier x ≠ ⊤

Next tactic:
have eq_top := disjoint x
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)
⊢ carrier x ≠ ⊤

Next tactic:
classical
  contrapose! eq_top
  obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
  rw [Algebra.smul_def, HomogeneousLocalization.one_val, mul_one] at eq1
  change Localization.mk (f ^ N) 1 = Localization.mk _ 1 at eq1
  simp only [mk_eq_mk', IsLocalization.eq] at eq1
  rcases eq1 with ⟨⟨_, ⟨M, rfl⟩⟩, eq1⟩
  dsimp at eq1
  erw [one_mul, one_mul] at eq1
  change f ^ _ * f ^ _ = f ^ _ * _ at eq1
  rw [Set.not_disjoint_iff_nonempty_inter]
  refine'
    ⟨f ^ M * f ^ N, eq1.symm ▸ mul_mem_left _ _ (sum_mem _ fun i _ => mul_mem_left _ _ _),
      ⟨M + N, by dsimp; rw [pow_add]⟩⟩
  generalize_proofs h₁ h₂
  exact (Classical.choose_spec h₂).1
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)
⊢ carrier x ≠ ⊤

Next tactic:
contrapose! eq_top
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  contrapose! eq_top
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : carrier x = ⊤
⊢ ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  contrapose! eq_top
  obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
  

Proof state:
case intro.intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : carrier x = ⊤
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y : Away f) → y ∈ image (⇑c) c.support → A
eq1 :
  f ^ N • HomogeneousLocalization.val 1 =
    (algebraMap A (Away f))
      (∑ i in attach c.support,
        acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
          Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal))
⊢ ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
rw [Algebra.smul_def, HomogeneousLocalization.one_val, mul_one] at eq1
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  contrapose! eq_top
  obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
  rw [Algebra.smul_def, HomogeneousLocalization.one_val, mul_one] at eq1
  

Proof state:
case intro.intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : carrier x = ⊤
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y : Away f) → y ∈ image (⇑c) c.support → A
eq1 :
  (algebraMap A (Localization (Submonoid.powers f))) (f ^ N) =
    (algebraMap A (Away f))
      (∑ i in attach c.support,
        acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
          Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal))
⊢ ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
change Localization.mk (f ^ N) 1 = Localization.mk _ 1 at eq1
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  contrapose! eq_top
  obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
  rw [Algebra.smul_def, HomogeneousLocalization.one_val, mul_one] at eq1
  change Localization.mk (f ^ N) 1 = Localization.mk _ 1 at eq1
  

Proof state:
case intro.intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : carrier x = ⊤
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y : Away f) → y ∈ image (⇑c) c.support → A
eq1 :
  Localization.mk (f ^ N) 1 =
    Localization.mk
      ((algebraMap A A)
        (∑ i in attach c.support,
          acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
            Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal)))
      1
⊢ ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
simp only [mk_eq_mk', IsLocalization.eq] at eq1
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  contrapose! eq_top
  obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
  rw [Algebra.smul_def, HomogeneousLocalization.one_val, mul_one] at eq1
  change Localization.mk (f ^ N) 1 = Localization.mk _ 1 at eq1
  simp only [mk_eq_mk', IsLocalization.eq] at eq1
  

Proof state:
case intro.intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : carrier x = ⊤
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y : Away f) → y ∈ image (⇑c) c.support → A
eq1 :
  ∃ c_1,
    ↑c_1 * (↑1 * f ^ N) =
      ↑c_1 *
        (↑1 *
          (algebraMap A A)
            (∑ i in attach c.support,
              acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
                Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal)))
⊢ ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
rcases eq1 with ⟨⟨_, ⟨M, rfl⟩⟩, eq1⟩
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  contrapose! eq_top
  obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
  rw [Algebra.smul_def, HomogeneousLocalization.one_val, mul_one] at eq1
  change Localization.mk (f ^ N) 1 = Localization.mk _ 1 at eq1
  simp only [mk_eq_mk', IsLocalization.eq] at eq1
  rcases eq1 with ⟨⟨_, ⟨M, rfl⟩⟩, eq1⟩
  

Proof state:
case intro.intro.intro.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : carrier x = ⊤
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y : Away f) → y ∈ image (⇑c) c.support → A
M : ℕ
eq1 :
  ↑{ val := (fun x => f ^ x) M, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) M) } * (↑1 * f ^ N) =
    ↑{ val := (fun x => f ^ x) M, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) M) } *
      (↑1 *
        (algebraMap A A)
          (∑ i in attach c.support,
            acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
              Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal)))
⊢ ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
dsimp at eq1
theorem carrier_ne_top : carrier x ≠ ⊤ := by
  have eq_top := disjoint x
  classical
  contrapose! eq_top
  obtain ⟨c, N, acd, eq1⟩ := MemCarrier.clear_denominator x ((Ideal.eq_top_iff_one _).mp eq_top)
  rw [Algebra.smul_def, HomogeneousLocalization.one_val, mul_one] at eq1
  change Localization.mk (f ^ N) 1 = Localization.mk _ 1 at eq1
  simp only [mk_eq_mk', IsLocalization.eq] at eq1
  rcases eq1 with ⟨⟨_, ⟨M, rfl⟩⟩, eq1⟩
  dsimp at eq1
  

Proof state:
case intro.intro.intro.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
eq_top : carrier x = ⊤
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y : Away f) → y ∈ image (⇑c) c.support → A
M : ℕ
eq1 :
  f ^ M * (1 * f ^ N) =
    f ^ M *
      (1 *
        ∑ i in attach c.support,
          acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
            Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal))
⊢ ¬Disjoint ↑(HomogeneousIdeal.toIdeal (↑x).asHomogeneousIdeal) ↑(Submonoid.powers f)

Next tactic:
erw [one_mul, one_mul] at eq1