Theorem: IsLocalization.finiteType_of_monoid_fg
File: Mathlib/RingTheory/Localization/InvSubmonoid.lean

tactic: have := Monoid.fg_of_surjective _ (toInvSubmonoid_surjective M S)
state_before: R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
⊢ Algebra.FiniteType R S

tactic: rw [Monoid.fg_iff_submonoid_fg] at this
state_before: R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
this : Monoid.FG { x // x ∈ invSubmonoid M S }
⊢ Algebra.FiniteType R S

tactic: rcases this with ⟨s, hs⟩
state_before: R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
this : Submonoid.FG (invSubmonoid M S)
⊢ Algebra.FiniteType R S

tactic: refine' ⟨⟨s, _⟩⟩
state_before: case intro
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
s : Finset S
hs : Submonoid.closure ↑s = invSubmonoid M S
⊢ Algebra.FiniteType R S

tactic: rw [eq_top_iff]
state_before: case intro
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
s : Finset S
hs : Submonoid.closure ↑s = invSubmonoid M S
⊢ Algebra.adjoin R ↑s = ⊤

tactic: rintro x -
state_before: case intro
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
s : Finset S
hs : Submonoid.closure ↑s = invSubmonoid M S
⊢ ⊤ ≤ Algebra.adjoin R ↑s

tactic: change x ∈ (Subalgebra.toSubmodule (Algebra.adjoin R _ : Subalgebra R S) : Set S)
state_before: case intro
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
s : Finset S
hs : Submonoid.closure ↑s = invSubmonoid M S
x : S
⊢ x ∈ Algebra.adjoin R ↑s

tactic: rw [Algebra.adjoin_eq_span, hs, span_invSubmonoid]
state_before: case intro
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
s : Finset S
hs : Submonoid.closure ↑s = invSubmonoid M S
x : S
⊢ x ∈ ↑(↑Subalgebra.toSubmodule (Algebra.adjoin R ↑s))

tactic: trivial
state_before: case intro
R : Type u_1
inst✝⁵ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁴ : CommRing S
inst✝³ : Algebra R S
P : Type ?u.287534
inst✝² : CommRing P
inst✝¹ : IsLocalization M S
inst✝ : Monoid.FG { x // x ∈ M }
s : Finset S
hs : Submonoid.closure ↑s = invSubmonoid M S
x : S
⊢ x ∈ ↑⊤