-- Mathlib/AlgebraicGeometry/Noetherian.lean
theorem isNoetherianRing_of_away : IsNoetherianRing R

Proof state:
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
⊢ ∃ n, ∀ (m : ℕ), n ≤ m → I n = I m

Tactic:
have hSuit : ∀ s : S, minN s ∈ suitableN s := by
  intro s
  apply Nat.sInf_mem
  let f : ℕ →o Ideal (Away (M := R) s) :=
    ⟨fun n ↦ Ideal.map (floc s) (I n), fun _ _ h ↦ Ideal.map_mono (I.monotone h)⟩
  exact monotone_stabilizes_iff_noetherian.mpr (hN s) f

Result:
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
⊢ ∃ n, ∀ (m : ℕ), n ≤ m → I n = I m

Proof state:
case h.h
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN✝ : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
N : ℕ := S.sup minN
hN : ∀ (s : { x // x ∈ S }), minN ↑s ≤ N
n : ℕ
hn : N ≤ n
s : Subtype (Membership.mem S)
⊢ Ideal.comap (algebraMap R (Localization.Away ↑s)) (Ideal.map (algebraMap R (Localization.Away ↑s)) (I N)) =
    Ideal.comap (algebraMap R (Localization.Away ↑s)) (Ideal.map (algebraMap R (Localization.Away ↑s)) (I n))

Tactic:
congr 1

Result:
case h.h.e_I
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN✝ : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
N : ℕ := S.sup minN
hN : ∀ (s : { x // x ∈ S }), minN ↑s ≤ N
n : ℕ
hn : N ≤ n
s : Subtype (Membership.mem S)
⊢ Ideal.map (algebraMap R (Localization.Away ↑s)) (I N) = Ideal.map (algebraMap R (Localization.Away ↑s)) (I n)

Proof state:
case h
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
s : { x // x ∈ S }
f : ℕ →o Ideal (Localization.Away ↑s) := { toFun := fun n => Ideal.map (floc ↑s) (I n), monotone' := ⋯ }
⊢ (suitableN ↑s).Nonempty

Tactic:
exact monotone_stabilizes_iff_noetherian.mpr (hN s) f

Result:
no goals

Proof state:
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
⊢ ∃ n, ∀ (m : ℕ), n ≤ m → I n = I m

Tactic:
let N := Finset.sup S minN

Result:
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
N : ℕ := S.sup minN
⊢ ∃ n, ∀ (m : ℕ), n ≤ m → I n = I m

Proof state:
case h
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN✝ : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
N : ℕ := S.sup minN
hN : ∀ (s : { x // x ∈ S }), minN ↑s ≤ N
n : ℕ
hn : N ≤ n
⊢ ⨅ x, Ideal.comap (algebraMap R (Localization.Away ↑x)) (Ideal.map (algebraMap R (Localization.Away ↑x)) (I N)) =
    ⨅ x, Ideal.comap (algebraMap R (Localization.Away ↑x)) (Ideal.map (algebraMap R (Localization.Away ↑x)) (I n))

Tactic:
apply iInf_congr

Result:
case h.h
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN✝ : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
N : ℕ := S.sup minN
hN : ∀ (s : { x // x ∈ S }), minN ↑s ≤ N
n : ℕ
hn : N ≤ n
⊢ ∀ (i : Subtype (Membership.mem S)),
    Ideal.comap (algebraMap R (Localization.Away ↑i)) (Ideal.map (algebraMap R (Localization.Away ↑i)) (I N)) =
      Ideal.comap (algebraMap R (Localization.Away ↑i)) (Ideal.map (algebraMap R (Localization.Away ↑i)) (I n))

Proof state:
case h.h.e_I
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN✝ : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
N : ℕ := S.sup minN
hN : ∀ (s : { x // x ∈ S }), minN ↑s ≤ N
n : ℕ
hn : N ≤ n
s : Subtype (Membership.mem S)
⊢ Ideal.map (algebraMap R (Localization.Away ↑s)) (I N) = Ideal.map (algebraMap R (Localization.Away ↑s)) (I n)

Tactic:
rw [← hSuit s N (hN s)]

Result:
case h.h.e_I
R : Type u
inst✝ : CommRing R
S : Finset R
hS : Ideal.span ↑S = ⊤
hN✝ : ∀ (s : { x // x ∈ S }), IsNoetherianRing (Localization.Away ↑s)
I : ℕ →o Submodule R R
floc : (s : R) → R →+* Localization.Away s := fun s => algebraMap R (Localization.Away s)
suitableN : R → Set ℕ := fun s => {n | ∀ (m : ℕ), n ≤ m → Ideal.map (floc s) (I n) = Ideal.map (floc s) (I m)}
minN : R → ℕ := fun s => sInf (suitableN s)
hSuit : ∀ (s : { x // x ∈ S }), minN ↑s ∈ suitableN ↑s
N : ℕ := S.sup minN
hN : ∀ (s : { x // x ∈ S }), minN ↑s ≤ N
n : ℕ
hn : N ≤ n
s : Subtype (Membership.mem S)
⊢ Ideal.map (floc ↑s) (I (minN ↑s)) = Ideal.map (algebraMap R (Localization.Away ↑s)) (I n)