l3lab/ntp-mathlib huggingface dataset:
theorem mul_slash (k1 k2 : ℤ) (A : GL(2, ℝ)⁺) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
  ext1 x
  simp only [slash_def, slash, Matrix.GeneralLinearGroup.val_det_apply,
    Pi.mul_apply, Pi.smul_apply, Algebra.smul_mul_assoc, real_smul]
  set d : ℂ := ↑((↑ₘA).det : ℝ)
  have h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1) := by
    have : d ≠ 0 := by
      dsimp
      norm_cast
      exact Matrix.GLPos.det_ne_zero A
    rw [← zpow_one_add₀ this, ← zpow_add₀ this]
    congr; 

Proof state:
case e_a
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : ↥GL(2, ℝ)⁺
f g : ℍ → ℂ
x : ℍ
d : ℂ := ↑(Matrix.det ↑↑A)
this : d ≠ 0
⊢ k1 + k2 - 1 = 1 + (k1 - 1) + (k2 - 1)

Next tactic:
ring
theorem mul_slash (k1 k2 : ℤ) (A : GL(2, ℝ)⁺) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
  ext1 x
  simp only [slash_def, slash, Matrix.GeneralLinearGroup.val_det_apply,
    Pi.mul_apply, Pi.smul_apply, Algebra.smul_mul_assoc, real_smul]
  set d : ℂ := ↑((↑ₘA).det : ℝ)
  have h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1) := by
    have : d ≠ 0 := by
      dsimp
      norm_cast
      exact Matrix.GLPos.det_ne_zero A
    rw [← zpow_one_add₀ this, ← zpow_add₀ this]
    congr; ring
  

Proof state:
case h
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : ↥GL(2, ℝ)⁺
f g : ℍ → ℂ
x : ℍ
d : ℂ := ↑(Matrix.det ↑↑A)
h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1)
⊢ f (A • x) * g (A • x) * d ^ (k1 + k2 - 1) * denom A x ^ (-(k1 + k2)) =
    d * (f (A • x) * d ^ (k1 - 1) * denom A x ^ (-k1)) * (g (A • x) * d ^ (k2 - 1) * denom A x ^ (-k2))

Next tactic:
have h22 : denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2) := by
    rw [Int.neg_add, zpow_add₀]
    exact UpperHalfPlane.denom_ne_zero A x
theorem mul_slash (k1 k2 : ℤ) (A : GL(2, ℝ)⁺) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
  ext1 x
  simp only [slash_def, slash, Matrix.GeneralLinearGroup.val_det_apply,
    Pi.mul_apply, Pi.smul_apply, Algebra.smul_mul_assoc, real_smul]
  set d : ℂ := ↑((↑ₘA).det : ℝ)
  have h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1) := by
    have : d ≠ 0 := by
      dsimp
      norm_cast
      exact Matrix.GLPos.det_ne_zero A
    rw [← zpow_one_add₀ this, ← zpow_add₀ this]
    congr; ring
  have h22 : denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2) := by
    

Proof state:
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : ↥GL(2, ℝ)⁺
f g : ℍ → ℂ
x : ℍ
d : ℂ := ↑(Matrix.det ↑↑A)
h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1)
⊢ denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2)

Next tactic:
rw [Int.neg_add, zpow_add₀]
theorem mul_slash (k1 k2 : ℤ) (A : GL(2, ℝ)⁺) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
  ext1 x
  simp only [slash_def, slash, Matrix.GeneralLinearGroup.val_det_apply,
    Pi.mul_apply, Pi.smul_apply, Algebra.smul_mul_assoc, real_smul]
  set d : ℂ := ↑((↑ₘA).det : ℝ)
  have h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1) := by
    have : d ≠ 0 := by
      dsimp
      norm_cast
      exact Matrix.GLPos.det_ne_zero A
    rw [← zpow_one_add₀ this, ← zpow_add₀ this]
    congr; ring
  have h22 : denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2) := by
    rw [Int.neg_add, zpow_add₀]
    

Proof state:
case ha
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : ↥GL(2, ℝ)⁺
f g : ℍ → ℂ
x : ℍ
d : ℂ := ↑(Matrix.det ↑↑A)
h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1)
⊢ denom A x ≠ 0

Next tactic:
exact UpperHalfPlane.denom_ne_zero A x
theorem mul_slash (k1 k2 : ℤ) (A : GL(2, ℝ)⁺) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
  ext1 x
  simp only [slash_def, slash, Matrix.GeneralLinearGroup.val_det_apply,
    Pi.mul_apply, Pi.smul_apply, Algebra.smul_mul_assoc, real_smul]
  set d : ℂ := ↑((↑ₘA).det : ℝ)
  have h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1) := by
    have : d ≠ 0 := by
      dsimp
      norm_cast
      exact Matrix.GLPos.det_ne_zero A
    rw [← zpow_one_add₀ this, ← zpow_add₀ this]
    congr; ring
  have h22 : denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2) := by
    rw [Int.neg_add, zpow_add₀]
    exact UpperHalfPlane.denom_ne_zero A x
  

Proof state:
case h
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : ↥GL(2, ℝ)⁺
f g : ℍ → ℂ
x : ℍ
d : ℂ := ↑(Matrix.det ↑↑A)
h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1)
h22 : denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2)
⊢ f (A • x) * g (A • x) * d ^ (k1 + k2 - 1) * denom A x ^ (-(k1 + k2)) =
    d * (f (A • x) * d ^ (k1 - 1) * denom A x ^ (-k1)) * (g (A • x) * d ^ (k2 - 1) * denom A x ^ (-k2))

Next tactic:
rw [h1, h22]
theorem mul_slash (k1 k2 : ℤ) (A : GL(2, ℝ)⁺) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
  ext1 x
  simp only [slash_def, slash, Matrix.GeneralLinearGroup.val_det_apply,
    Pi.mul_apply, Pi.smul_apply, Algebra.smul_mul_assoc, real_smul]
  set d : ℂ := ↑((↑ₘA).det : ℝ)
  have h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1) := by
    have : d ≠ 0 := by
      dsimp
      norm_cast
      exact Matrix.GLPos.det_ne_zero A
    rw [← zpow_one_add₀ this, ← zpow_add₀ this]
    congr; ring
  have h22 : denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2) := by
    rw [Int.neg_add, zpow_add₀]
    exact UpperHalfPlane.denom_ne_zero A x
  rw [h1, h22]
  

Proof state:
case h
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : ↥GL(2, ℝ)⁺
f g : ℍ → ℂ
x : ℍ
d : ℂ := ↑(Matrix.det ↑↑A)
h1 : d ^ (k1 + k2 - 1) = d * d ^ (k1 - 1) * d ^ (k2 - 1)
h22 : denom A x ^ (-(k1 + k2)) = denom A x ^ (-k1) * denom A x ^ (-k2)
⊢ f (A • x) * g (A • x) * (d * d ^ (k1 - 1) * d ^ (k2 - 1)) * (denom A x ^ (-k1) * denom A x ^ (-k2)) =
    d * (f (A • x) * d ^ (k1 - 1) * denom A x ^ (-k1)) * (g (A • x) * d ^ (k2 - 1) * denom A x ^ (-k2))

Next tactic:
ring
theorem mul_slash_SL2 (k1 k2 : ℤ) (A : SL(2, ℤ)) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = f ∣[k1] A * g ∣[k2] A :=
  calc
    (f * g) ∣[k1 + k2] (A : GL(2, ℝ)⁺) =
        ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
      

Proof state:
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : SL(2, ℤ)
f g : ℍ → ℂ
⊢ (f * g) ∣[k1 + k2] ↑A = Matrix.det ↑↑↑A • f ∣[k1] A * g ∣[k2] A

Next tactic:
apply mul_slash
theorem mul_slash_SL2 (k1 k2 : ℤ) (A : SL(2, ℤ)) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = f ∣[k1] A * g ∣[k2] A :=
  calc
    (f * g) ∣[k1 + k2] (A : GL(2, ℝ)⁺) =
        ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
      apply mul_slash
    _ = (1 : ℝ) • f ∣[k1] A * g ∣[k2] A := by 

Proof state:
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : SL(2, ℤ)
f g : ℍ → ℂ
⊢ Matrix.det ↑↑↑A • f ∣[k1] A * g ∣[k2] A = 1 • f ∣[k1] A * g ∣[k2] A

Next tactic:
rw [det_coe']
theorem mul_slash_SL2 (k1 k2 : ℤ) (A : SL(2, ℤ)) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = f ∣[k1] A * g ∣[k2] A :=
  calc
    (f * g) ∣[k1 + k2] (A : GL(2, ℝ)⁺) =
        ((↑ₘA).det : ℝ) • f ∣[k1] A * g ∣[k2] A := by
      apply mul_slash
    _ = (1 : ℝ) • f ∣[k1] A * g ∣[k2] A := by rw [det_coe']
    _ = f ∣[k1] A * g ∣[k2] A := by 

Proof state:
Γ : Subgroup SL(2, ℤ)
k : ℤ
f✝ : ℍ → ℂ
k1 k2 : ℤ
A : SL(2, ℤ)
f g : ℍ → ℂ
⊢ 1 • f ∣[k1] A * g ∣[k2] A = f ∣[k1] A * g ∣[k2] A

Next tactic:
rw [one_smul]
/-- The complement of a prime ideal `P ⊆ R` is a submonoid of `R`. -/
def primeCompl : Submonoid R where
  carrier := (Pᶜ : Set R)
  one_mem' := by 

Proof state:
R : Type u_1
inst✝³ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝² : CommSemiring S
inst✝¹ : Algebra R S
P✝ : Type u_3
inst✝ : CommSemiring P✝
P : Ideal R
hp : IsPrime P
⊢ 1 ∈ { carrier := (↑P)ᶜ, mul_mem' := (_ : ∀ {x y : R}, x ∈ (↑P)ᶜ → y ∈ (↑P)ᶜ → x * y ∈ ↑P → False) }.carrier

Next tactic:
convert P.ne_top_iff_one.1 hp.1
theorem AtPrime.Nontrivial [IsLocalization.AtPrime S P] : Nontrivial S :=
  nontrivial_of_ne (0 : S) 1 fun hze => by
    

Proof state:
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
hze : 0 = 1
⊢ False

Next tactic:
rw [← (algebraMap R S).map_one, ← (algebraMap R S).map_zero] at hze
theorem AtPrime.Nontrivial [IsLocalization.AtPrime S P] : Nontrivial S :=
  nontrivial_of_ne (0 : S) 1 fun hze => by
    rw [← (algebraMap R S).map_one, ← (algebraMap R S).map_zero] at hze
    

Proof state:
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
hze : (algebraMap R S) 0 = (algebraMap R S) 1
⊢ False

Next tactic:
obtain ⟨t, ht⟩ := (eq_iff_exists P.primeCompl S).1 hze
theorem AtPrime.Nontrivial [IsLocalization.AtPrime S P] : Nontrivial S :=
  nontrivial_of_ne (0 : S) 1 fun hze => by
    rw [← (algebraMap R S).map_one, ← (algebraMap R S).map_zero] at hze
    obtain ⟨t, ht⟩ := (eq_iff_exists P.primeCompl S).1 hze
    

Proof state:
case intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
hze : (algebraMap R S) 0 = (algebraMap R S) 1
t : ↥(Ideal.primeCompl P)
ht : ↑t * 0 = ↑t * 1
⊢ False

Next tactic:
have htz : (t : R) = 0 := by simpa using ht.symm
theorem AtPrime.Nontrivial [IsLocalization.AtPrime S P] : Nontrivial S :=
  nontrivial_of_ne (0 : S) 1 fun hze => by
    rw [← (algebraMap R S).map_one, ← (algebraMap R S).map_zero] at hze
    obtain ⟨t, ht⟩ := (eq_iff_exists P.primeCompl S).1 hze
    have htz : (t : R) = 0 := by 

Proof state:
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
hze : (algebraMap R S) 0 = (algebraMap R S) 1
t : ↥(Ideal.primeCompl P)
ht : ↑t * 0 = ↑t * 1
⊢ ↑t = 0

Next tactic:
simpa using ht.symm
theorem AtPrime.Nontrivial [IsLocalization.AtPrime S P] : Nontrivial S :=
  nontrivial_of_ne (0 : S) 1 fun hze => by
    rw [← (algebraMap R S).map_one, ← (algebraMap R S).map_zero] at hze
    obtain ⟨t, ht⟩ := (eq_iff_exists P.primeCompl S).1 hze
    have htz : (t : R) = 0 := by simpa using ht.symm
    

Proof state:
case intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
hze : (algebraMap R S) 0 = (algebraMap R S) 1
t : ↥(Ideal.primeCompl P)
ht : ↑t * 0 = ↑t * 1
htz : ↑t = 0
⊢ False

Next tactic:
exact t.2 (htz.symm ▸ P.zero_mem : ↑t ∈ P)
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      

Proof state:
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this : _root_.Nontrivial S := Nontrivial S P
⊢ ∀ (a b : S), a ∈ nonunits S → b ∈ nonunits S → a + b ∈ nonunits S

Next tactic:
intro x y hx hy hu
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      

Proof state:
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this : _root_.Nontrivial S := Nontrivial S P
x y : S
hx : x ∈ nonunits S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
⊢ False

Next tactic:
cases' isUnit_iff_exists_inv.1 hu with z hxyz
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      

Proof state:
case intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this : _root_.Nontrivial S := Nontrivial S P
x y : S
hx : x ∈ nonunits S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
z : S
hxyz : (x + y) * z = 1
⊢ False

Next tactic:
have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
      

Proof state:
case intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this✝ : _root_.Nontrivial S := Nontrivial S P
x y : S
hx : x ∈ nonunits S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
z : S
hxyz : (x + y) * z = 1
this : ∀ {r : R} {s : ↥(Ideal.primeCompl P)}, mk' S r s ∈ nonunits S → r ∈ P
⊢ False

Next tactic:
rcases mk'_surjective P.primeCompl x with ⟨rx, sx, hrx⟩
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
      rcases mk'_surjective P.primeCompl x with ⟨rx, sx, hrx⟩
      

Proof state:
case intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this✝ : _root_.Nontrivial S := Nontrivial S P
x y : S
hx : x ∈ nonunits S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
z : S
hxyz : (x + y) * z = 1
this : ∀ {r : R} {s : ↥(Ideal.primeCompl P)}, mk' S r s ∈ nonunits S → r ∈ P
rx : R
sx : ↥(Ideal.primeCompl P)
hrx : mk' S rx sx = x
⊢ False

Next tactic:
rcases mk'_surjective P.primeCompl y with ⟨ry, sy, hry⟩
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
      rcases mk'_surjective P.primeCompl x with ⟨rx, sx, hrx⟩
      rcases mk'_surjective P.primeCompl y with ⟨ry, sy, hry⟩
      

Proof state:
case intro.intro.intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this✝ : _root_.Nontrivial S := Nontrivial S P
x y : S
hx : x ∈ nonunits S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
z : S
hxyz : (x + y) * z = 1
this : ∀ {r : R} {s : ↥(Ideal.primeCompl P)}, mk' S r s ∈ nonunits S → r ∈ P
rx : R
sx : ↥(Ideal.primeCompl P)
hrx : mk' S rx sx = x
ry : R
sy : ↥(Ideal.primeCompl P)
hry : mk' S ry sy = y
⊢ False

Next tactic:
rcases mk'_surjective P.primeCompl z with ⟨rz, sz, hrz⟩
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
      rcases mk'_surjective P.primeCompl x with ⟨rx, sx, hrx⟩
      rcases mk'_surjective P.primeCompl y with ⟨ry, sy, hry⟩
      rcases mk'_surjective P.primeCompl z with ⟨rz, sz, hrz⟩
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this✝ : _root_.Nontrivial S := Nontrivial S P
x y : S
hx : x ∈ nonunits S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
z : S
hxyz : (x + y) * z = 1
this : ∀ {r : R} {s : ↥(Ideal.primeCompl P)}, mk' S r s ∈ nonunits S → r ∈ P
rx : R
sx : ↥(Ideal.primeCompl P)
hrx : mk' S rx sx = x
ry : R
sy : ↥(Ideal.primeCompl P)
hry : mk' S ry sy = y
rz : R
sz : ↥(Ideal.primeCompl P)
hrz : mk' S rz sz = z
⊢ False

Next tactic:
rw [← hrx, ← hry, ← hrz, ← mk'_add, ← mk'_mul, ← mk'_self S P.primeCompl.one_mem] at hxyz
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
      rcases mk'_surjective P.primeCompl x with ⟨rx, sx, hrx⟩
      rcases mk'_surjective P.primeCompl y with ⟨ry, sy, hry⟩
      rcases mk'_surjective P.primeCompl z with ⟨rz, sz, hrz⟩
      rw [← hrx, ← hry, ← hrz, ← mk'_add, ← mk'_mul, ← mk'_self S P.primeCompl.one_mem] at hxyz
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this✝ : _root_.Nontrivial S := Nontrivial S P
x y : S
hx : x ∈ nonunits S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
z : S
this : ∀ {r : R} {s : ↥(Ideal.primeCompl P)}, mk' S r s ∈ nonunits S → r ∈ P
rx : R
sx : ↥(Ideal.primeCompl P)
hrx : mk' S rx sx = x
ry : R
sy : ↥(Ideal.primeCompl P)
hry : mk' S ry sy = y
rz : R
sz : ↥(Ideal.primeCompl P)
hxyz :
  mk' S ((rx * ↑sy + ry * ↑sx) * rz) (sx * sy * sz) = mk' S 1 { val := 1, property := (_ : 1 ∈ Ideal.primeCompl P) }
hrz : mk' S rz sz = z
⊢ False

Next tactic:
rw [← hrx] at hx
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
      rcases mk'_surjective P.primeCompl x with ⟨rx, sx, hrx⟩
      rcases mk'_surjective P.primeCompl y with ⟨ry, sy, hry⟩
      rcases mk'_surjective P.primeCompl z with ⟨rz, sz, hrz⟩
      rw [← hrx, ← hry, ← hrz, ← mk'_add, ← mk'_mul, ← mk'_self S P.primeCompl.one_mem] at hxyz
      rw [← hrx] at hx
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this✝ : _root_.Nontrivial S := Nontrivial S P
x y : S
hy : y ∈ nonunits S
hu : IsUnit (x + y)
z : S
this : ∀ {r : R} {s : ↥(Ideal.primeCompl P)}, mk' S r s ∈ nonunits S → r ∈ P
rx : R
sx : ↥(Ideal.primeCompl P)
hx : mk' S rx sx ∈ nonunits S
hrx : mk' S rx sx = x
ry : R
sy : ↥(Ideal.primeCompl P)
hry : mk' S ry sy = y
rz : R
sz : ↥(Ideal.primeCompl P)
hxyz :
  mk' S ((rx * ↑sy + ry * ↑sx) * rz) (sx * sy * sz) = mk' S 1 { val := 1, property := (_ : 1 ∈ Ideal.primeCompl P) }
hrz : mk' S rz sz = z
⊢ False

Next tactic:
rw [← hry] at hy
theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S :=
  -- Porting Note : since I couldn't get local instance running, I just specify it manually
  letI := AtPrime.Nontrivial S P
  LocalRing.of_nonunits_add
    (by
      intro x y hx hy hu
      cases' isUnit_iff_exists_inv.1 hu with z hxyz
      have : ∀ {r : R} {s : P.primeCompl}, mk' S r s ∈ nonunits S → r ∈ P := fun {r s} =>
        not_imp_comm.1 fun nr => isUnit_iff_exists_inv.2 ⟨mk' S ↑s (⟨r, nr⟩ : P.primeCompl),
          mk'_mul_mk'_eq_one' _ _ <| show r ∈ P.primeCompl from nr⟩
      rcases mk'_surjective P.primeCompl x with ⟨rx, sx, hrx⟩
      rcases mk'_surjective P.primeCompl y with ⟨ry, sy, hry⟩
      rcases mk'_surjective P.primeCompl z with ⟨rz, sz, hrz⟩
      rw [← hrx, ← hry, ← hrz, ← mk'_add, ← mk'_mul, ← mk'_self S P.primeCompl.one_mem] at hxyz
      rw [← hrx] at hx
      rw [← hry] at hy
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
M : Submonoid R
S : Type u_2
inst✝³ : CommSemiring S
inst✝² : Algebra R S
P✝ : Type u_3
inst✝¹ : CommSemiring P✝
P : Ideal R
hp : Ideal.IsPrime P
inst✝ : IsLocalization.AtPrime S P
this✝ : _root_.Nontrivial S := Nontrivial S P
x y : S
hu : IsUnit (x + y)
z : S
this : ∀ {r : R} {s : ↥(Ideal.primeCompl P)}, mk' S r s ∈ nonunits S → r ∈ P
rx : R
sx : ↥(Ideal.primeCompl P)
hx : mk' S rx sx ∈ nonunits S
hrx : mk' S rx sx = x
ry : R
sy : ↥(Ideal.primeCompl P)
hy : mk' S ry sy ∈ nonunits S
hry : mk' S ry sy = y
rz : R
sz : ↥(Ideal.primeCompl P)
hxyz :
  mk' S ((rx * ↑sy + ry * ↑sx) * rz) (sx * sy * sz) = mk' S 1 { val := 1, property := (_ : 1 ∈ Ideal.primeCompl P) }
hrz : mk' S rz sz = z
⊢ False

Next tactic:
obtain ⟨t, ht⟩ := IsLocalization.eq.1 hxyz