Theorem: MaximalSpectrum.iInf_localization_eq_bot
File: Mathlib/AlgebraicGeometry/PrimeSpectrum/Maximal.lean

tactic: ext x
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
⊢ (⨅ (v : MaximalSpectrum R),
      Localization.subalgebra.ofField K (Ideal.primeCompl v.asIdeal)
        (_ : Ideal.primeCompl v.asIdeal ≤ nonZeroDivisors R)) =
    ⊥

tactic: rw [Algebra.mem_bot, Algebra.mem_iInf]
state_before: case h
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
⊢ (x ∈
      ⨅ (v : MaximalSpectrum R),
        Localization.subalgebra.ofField K (Ideal.primeCompl v.asIdeal)
          (_ : Ideal.primeCompl v.asIdeal ≤ nonZeroDivisors R)) ↔
    x ∈ ⊥

tactic: constructor
state_before: case h
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
⊢ (∀ (i : MaximalSpectrum R),
      x ∈
        Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
          (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)) ↔
    x ∈ range ↑(algebraMap R K)

tactic: contrapose
state_before: case h.mp
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
⊢ (∀ (i : MaximalSpectrum R),
      x ∈
        Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
          (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)) →
    x ∈ range ↑(algebraMap R K)

tactic: intro hrange hlocal
state_before: case h.mp
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
⊢ ¬x ∈ range ↑(algebraMap R K) →
    ¬∀ (i : MaximalSpectrum R),
        x ∈
          Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
            (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)

tactic: let denom : Ideal R := (Submodule.span R {1} : Submodule R K).colon (Submodule.span R {x})
state_before: case h.mp
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
⊢ False

tactic: have hdenom : (1 : R) ∉ denom := by
  intro hdenom
  rcases Submodule.mem_span_singleton.mp
    (Submodule.mem_colon.mp hdenom x <| Submodule.mem_span_singleton_self x) with ⟨y, hy⟩
  exact hrange ⟨y, by rw [← mul_one <| algebraMap R K y, ← Algebra.smul_def, hy, one_smul]⟩
state_before: case h.mp
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R := Submodule.colon (Submodule.span R {1}) (Submodule.span R {x})
⊢ False

tactic: rcases denom.exists_le_maximal fun h => (h ▸ hdenom) Submodule.mem_top with ⟨max, hmax, hle⟩
state_before: case h.mp
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R := Submodule.colon (Submodule.span R {1}) (Submodule.span R {x})
hdenom : ¬1 ∈ denom
⊢ False

tactic: rcases hlocal ⟨max, hmax⟩ with ⟨n, d, hd, rfl⟩
state_before: case h.mp.intro.intro
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R := Submodule.colon (Submodule.span R {1}) (Submodule.span R {x})
hdenom : ¬1 ∈ denom
max : Ideal R
hmax : Ideal.IsMaximal max
hle : denom ≤ max
⊢ False

tactic: apply hd (hle <| Submodule.mem_colon.mpr fun _ hy => _)
state_before: case h.mp.intro.intro.intro.intro.intro
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
max : Ideal R
hmax : Ideal.IsMaximal max
n d : R
hd : d ∈ Ideal.primeCompl { asIdeal := max, IsMaximal := hmax }.asIdeal
hrange : ¬↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    ↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R :=
  Submodule.colon (Submodule.span R {1}) (Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹})
hdenom : ¬1 ∈ denom
hle : denom ≤ max
⊢ False

tactic: intro _ hy
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
max : Ideal R
hmax : Ideal.IsMaximal max
n d : R
hd : d ∈ Ideal.primeCompl { asIdeal := max, IsMaximal := hmax }.asIdeal
hrange : ¬↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    ↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R :=
  Submodule.colon (Submodule.span R {1}) (Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹})
hdenom : ¬1 ∈ denom
hle : denom ≤ max
⊢ ∀ (x : K), x ∈ Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹} → d • x ∈ Submodule.span R {1}

tactic: rcases Submodule.mem_span_singleton.mp hy with ⟨y, rfl⟩
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
max : Ideal R
hmax : Ideal.IsMaximal max
n d : R
hd : d ∈ Ideal.primeCompl { asIdeal := max, IsMaximal := hmax }.asIdeal
hrange : ¬↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    ↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R :=
  Submodule.colon (Submodule.span R {1}) (Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹})
hdenom : ¬1 ∈ denom
hle : denom ≤ max
x✝ : K
hy : x✝ ∈ Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹}
⊢ d • x✝ ∈ Submodule.span R {1}

tactic: exact Submodule.mem_span_singleton.mpr ⟨y * n, by
  rw [Algebra.smul_def, mul_one, map_mul, smul_comm, Algebra.smul_def, Algebra.smul_def,
    mul_comm <| algebraMap R K d,
    inv_mul_cancel_right₀ <|
      (map_ne_zero_iff _ <| NoZeroSMulDivisors.algebraMap_injective R K).mpr fun h =>
        (h ▸ hd) max.zero_mem]⟩
state_before: case intro
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
max : Ideal R
hmax : Ideal.IsMaximal max
n d : R
hd : d ∈ Ideal.primeCompl { asIdeal := max, IsMaximal := hmax }.asIdeal
hrange : ¬↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    ↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R :=
  Submodule.colon (Submodule.span R {1}) (Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹})
hdenom : ¬1 ∈ denom
hle : denom ≤ max
y : R
hy :
  y • (↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹) ∈ Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹}
⊢ d • y • (↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹) ∈ Submodule.span R {1}

tactic: intro hdenom
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R := Submodule.colon (Submodule.span R {1}) (Submodule.span R {x})
⊢ ¬1 ∈ denom

tactic: rcases Submodule.mem_span_singleton.mp
  (Submodule.mem_colon.mp hdenom x <| Submodule.mem_span_singleton_self x) with ⟨y, hy⟩
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R := Submodule.colon (Submodule.span R {1}) (Submodule.span R {x})
hdenom : 1 ∈ denom
⊢ False

tactic: exact hrange ⟨y, by rw [← mul_one <| algebraMap R K y, ← Algebra.smul_def, hy, one_smul]⟩
state_before: case intro
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R := Submodule.colon (Submodule.span R {1}) (Submodule.span R {x})
hdenom : 1 ∈ denom
y : R
hy : y • 1 = 1 • x
⊢ False

tactic: rw [← mul_one <| algebraMap R K y, ← Algebra.smul_def, hy, one_smul]
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
hrange : ¬x ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    x ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R := Submodule.colon (Submodule.span R {1}) (Submodule.span R {x})
hdenom : 1 ∈ denom
y : R
hy : y • 1 = 1 • x
⊢ ↑(algebraMap R K) y = x

tactic: rw [Algebra.smul_def, mul_one, map_mul, smul_comm, Algebra.smul_def, Algebra.smul_def,
  mul_comm <| algebraMap R K d,
  inv_mul_cancel_right₀ <|
    (map_ne_zero_iff _ <| NoZeroSMulDivisors.algebraMap_injective R K).mpr fun h =>
      (h ▸ hd) max.zero_mem]
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
max : Ideal R
hmax : Ideal.IsMaximal max
n d : R
hd : d ∈ Ideal.primeCompl { asIdeal := max, IsMaximal := hmax }.asIdeal
hrange : ¬↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈ range ↑(algebraMap R K)
hlocal :
  ∀ (i : MaximalSpectrum R),
    ↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹ ∈
      Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
        (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)
denom : Ideal R :=
  Submodule.colon (Submodule.span R {1}) (Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹})
hdenom : ¬1 ∈ denom
hle : denom ≤ max
y : R
hy :
  y • (↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹) ∈ Submodule.span R {↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹}
⊢ (y * n) • 1 = d • y • (↑(algebraMap R K) n * (↑(algebraMap R K) d)⁻¹)

tactic: rintro ⟨y, rfl⟩ ⟨v, hv⟩
state_before: case h.mpr
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x : K
⊢ x ∈ range ↑(algebraMap R K) →
    ∀ (i : MaximalSpectrum R),
      x ∈
        Localization.subalgebra.ofField K (Ideal.primeCompl i.asIdeal)
          (_ : Ideal.primeCompl i.asIdeal ≤ nonZeroDivisors R)

tactic: exact ⟨y, 1, v.ne_top_iff_one.mp hv.ne_top, by rw [map_one, inv_one, mul_one]⟩
state_before: case h.mpr.intro.mk
R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
y : R
v : Ideal R
hv : Ideal.IsMaximal v
⊢ ↑(algebraMap R K) y ∈
    Localization.subalgebra.ofField K (Ideal.primeCompl { asIdeal := v, IsMaximal := hv }.asIdeal)
      (_ : Ideal.primeCompl { asIdeal := v, IsMaximal := hv }.asIdeal ≤ nonZeroDivisors R)

tactic: rw [map_one, inv_one, mul_one]
state_before: R : Type u
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
y : R
v : Ideal R
hv : Ideal.IsMaximal v
⊢ ↑(algebraMap R K) y = ↑(algebraMap R K) y * (↑(algebraMap R K) 1)⁻¹