File: Mathlib/RingTheory/FiniteType.lean

full_name: Algebra.FiniteType
code: /-- An algebra over a commutative semiring is of `FiniteType` if it is finitely generated
over the base ring as algebra. -/
class Algebra.FiniteType [CommSemiring R] [Semiring A] [Algebra R A] : Prop where
  out : (⊤ : Subalgebra R A).FG
goal: Prop

full_name: Algebra.FiniteType.out
code: /-- An algebra over a commutative semiring is of `FiniteType` if it is finitely generated
over the base ring as algebra. -/
class Algebra.FiniteType [CommSemiring R] [Semiring A] [Algebra R A] : Prop where
  out : (⊤ : Subalgebra R A).FG
goal: ⊤.FG

full_name: Module.Finite.finiteType
code: instance (priority := 100) finiteType {R : Type*} (A : Type*) [CommSemiring R] [Semiring A]
    [Algebra R A] [hRA : Finite R A] : Algebra.FiniteType R A 
goal: Algebra.FiniteType R A

full_name: Algebra.FiniteType.self
code: theorem self : FiniteType R R 
goal: Algebra.FiniteType R R

full_name: Algebra.FiniteType.polynomial
code: protected theorem polynomial : FiniteType R R[X] 
goal: Algebra.FiniteType R R[X]

full_name: Algebra.FiniteType.freeAlgebra
code: protected theorem freeAlgebra (ι : Type*) [Finite ι] : FiniteType R (FreeAlgebra R ι) 
goal: Algebra.FiniteType R (FreeAlgebra R ι)

full_name: Algebra.FiniteType.mvPolynomial
code: protected theorem mvPolynomial (ι : Type*) [Finite ι] : FiniteType R (MvPolynomial ι R) 
goal: Algebra.FiniteType R (MvPolynomial ι R)

full_name: Algebra.FiniteType.of_restrictScalars_finiteType
code: theorem of_restrictScalars_finiteType [Algebra S A] [IsScalarTower R S A] [hA : FiniteType R A] :
    FiniteType S A 
goal: Algebra.FiniteType S A

full_name: Algebra.FiniteType.of_surjective
code: theorem of_surjective (hRA : FiniteType R A) (f : A →ₐ[R] B) (hf : Surjective f) : FiniteType R B 
goal: Algebra.FiniteType R B

full_name: Algebra.FiniteType.equiv
code: theorem equiv (hRA : FiniteType R A) (e : A ≃ₐ[R] B) : FiniteType R B 
goal: Algebra.FiniteType R B

full_name: Algebra.FiniteType.trans
code: theorem trans [Algebra S A] [IsScalarTower R S A] (hRS : FiniteType R S) (hSA : FiniteType S A) :
    FiniteType R A 
goal: Algebra.FiniteType R A

full_name: Algebra.FiniteType.iff_quotient_freeAlgebra
code: /-- An algebra is finitely generated if and only if it is a quotient
of a free algebra whose variables are indexed by a finset. -/
theorem iff_quotient_freeAlgebra :
    FiniteType R A ↔
      ∃ (s : Finset A) (f : FreeAlgebra R s →ₐ[R] A), Surjective f 
goal: Algebra.FiniteType R A ↔ ∃ s f, Function.Surjective ⇑f

full_name: Algebra.FiniteType.iff_quotient_mvPolynomial
code: /-- A commutative algebra is finitely generated if and only if it is a quotient
of a polynomial ring whose variables are indexed by a finset. -/
theorem iff_quotient_mvPolynomial :
    FiniteType R S ↔
      ∃ (s : Finset S) (f : MvPolynomial { x // x ∈ s } R →ₐ[R] S), Surjective f 
goal: Algebra.FiniteType R S ↔ ∃ s f, Function.Surjective ⇑f

full_name: Algebra.FiniteType.iff_quotient_freeAlgebra'
code: /-- An algebra is finitely generated if and only if it is a quotient
of a polynomial ring whose variables are indexed by a fintype. -/
theorem iff_quotient_freeAlgebra' : FiniteType R A ↔
    ∃ (ι : Type uA) (_ : Fintype ι) (f : FreeAlgebra R ι →ₐ[R] A), Surjective f 
goal: Algebra.FiniteType R A ↔ ∃ ι x f, Function.Surjective ⇑f

full_name: Algebra.FiniteType.iff_quotient_mvPolynomial'
code: /-- A commutative algebra is finitely generated if and only if it is a quotient
of a polynomial ring whose variables are indexed by a fintype. -/
theorem iff_quotient_mvPolynomial' : FiniteType R S ↔
    ∃ (ι : Type uS) (_ : Fintype ι) (f : MvPolynomial ι R →ₐ[R] S), Surjective f 
goal: Algebra.FiniteType R S ↔ ∃ ι x f, Function.Surjective ⇑f

full_name: Algebra.FiniteType.iff_quotient_mvPolynomial''
code: /-- A commutative algebra is finitely generated if and only if it is a quotient of a polynomial ring
in `n` variables. -/
theorem iff_quotient_mvPolynomial'' :
    FiniteType R S ↔ ∃ (n : ℕ) (f : MvPolynomial (Fin n) R →ₐ[R] S), Surjective f 
goal: Algebra.FiniteType R S ↔ ∃ n f, Function.Surjective ⇑f

full_name: Algebra.FiniteType.prod
code: instance prod [hA : FiniteType R A] [hB : FiniteType R B] : FiniteType R (A × B) 
goal: Algebra.FiniteType R (A × B)

full_name: Algebra.FiniteType.isNoetherianRing
code: theorem isNoetherianRing (R S : Type*) [CommRing R] [CommRing S] [Algebra R S]
    [h : Algebra.FiniteType R S] [IsNoetherianRing R] : IsNoetherianRing S 
goal: IsNoetherianRing S

full_name: Subalgebra.fg_iff_finiteType
code: theorem _root_.Subalgebra.fg_iff_finiteType (S : Subalgebra R A) : S.FG ↔ Algebra.FiniteType R S 
goal: S.FG ↔ Algebra.FiniteType R ↥S

full_name: RingHom.FiniteType
code: /-- A ring morphism `A →+* B` is of `FiniteType` if `B` is finitely generated as `A`-algebra. -/
def FiniteType (f : A →+* B) : Prop 
goal: Prop

full_name: RingHom.Finite.finiteType
code: theorem finiteType {f : A →+* B} (hf : f.Finite) : FiniteType f 
goal: f.FiniteType

full_name: RingHom.FiniteType.id
code: theorem id : FiniteType (RingHom.id A) 
goal: (RingHom.id A).FiniteType

full_name: RingHom.FiniteType.comp_surjective
code: theorem comp_surjective {f : A →+* B} {g : B →+* C} (hf : f.FiniteType) (hg : Surjective g) :
    (g.comp f).FiniteType 
goal: (g.comp f).FiniteType

full_name: RingHom.FiniteType.of_surjective
code: theorem of_surjective (f : A →+* B) (hf : Surjective f) : f.FiniteType 
goal: f.FiniteType

full_name: RingHom.FiniteType.comp
code: theorem comp {g : B →+* C} {f : A →+* B} (hg : g.FiniteType) (hf : f.FiniteType) :
    (g.comp f).FiniteType 
goal: (g.comp f).FiniteType

full_name: RingHom.FiniteType.of_finite
code: theorem of_finite {f : A →+* B} (hf : f.Finite) : f.FiniteType 
goal: f.FiniteType

full_name: RingHom.FiniteType.of_comp_finiteType
code: theorem of_comp_finiteType {f : A →+* B} {g : B →+* C} (h : (g.comp f).FiniteType) :
    g.FiniteType 
goal: g.FiniteType

full_name: AlgHom.FiniteType
code: /-- An algebra morphism `A →ₐ[R] B` is of `FiniteType` if it is of finite type as ring morphism.
In other words, if `B` is finitely generated as `A`-algebra. -/
def FiniteType (f : A →ₐ[R] B) : Prop 
goal: Prop

full_name: AlgHom.Finite.finiteType
code: theorem finiteType {f : A →ₐ[R] B} (hf : f.Finite) : FiniteType f 
goal: f.FiniteType

full_name: AlgHom.FiniteType.id
code: theorem id : FiniteType (AlgHom.id R A) 
goal: (AlgHom.id R A).FiniteType

full_name: AlgHom.FiniteType.comp
code: theorem comp {g : B →ₐ[R] C} {f : A →ₐ[R] B} (hg : g.FiniteType) (hf : f.FiniteType) :
    (g.comp f).FiniteType 
goal: (g.comp f).FiniteType

full_name: AlgHom.FiniteType.comp_surjective
code: theorem comp_surjective {f : A →ₐ[R] B} {g : B →ₐ[R] C} (hf : f.FiniteType) (hg : Surjective g) :
    (g.comp f).FiniteType 
goal: (g.comp f).FiniteType

full_name: AlgHom.FiniteType.of_surjective
code: theorem of_surjective (f : A →ₐ[R] B) (hf : Surjective f) : f.FiniteType 
goal: f.FiniteType

full_name: AlgHom.FiniteType.of_comp_finiteType
code: theorem of_comp_finiteType {f : A →ₐ[R] B} {g : B →ₐ[R] C} (h : (g.comp f).FiniteType) :
    g.FiniteType 
goal: g.FiniteType

full_name: AddMonoidAlgebra.mem_adjoin_support
code: /-- An element of `R[M]` is in the subalgebra generated by its support. -/
theorem mem_adjoin_support (f : R[M]) : f ∈ adjoin R (of' R M '' f.support) 
goal: f ∈ Algebra.adjoin R (AddMonoidAlgebra.of' R M '' ↑f.support)

full_name: AddMonoidAlgebra.support_gen_of_gen
code: /-- If a set `S` generates, as algebra, `R[M]`, then the set of supports of
elements of `S` generates `R[M]`. -/
theorem support_gen_of_gen {S : Set R[M]} (hS : Algebra.adjoin R S = ⊤) :
    Algebra.adjoin R (⋃ f ∈ S, of' R M '' (f.support : Set M)) = ⊤ 
goal: Algebra.adjoin R (⋃ f ∈ S, AddMonoidAlgebra.of' R M '' ↑f.support) = ⊤

full_name: AddMonoidAlgebra.support_gen_of_gen'
code: /-- If a set `S` generates, as algebra, `R[M]`, then the image of the union of
the supports of elements of `S` generates `R[M]`. -/
theorem support_gen_of_gen' {S : Set R[M]} (hS : Algebra.adjoin R S = ⊤) :
    Algebra.adjoin R (of' R M '' ⋃ f ∈ S, (f.support : Set M)) = ⊤ 
goal: Algebra.adjoin R (AddMonoidAlgebra.of' R M '' ⋃ f ∈ S, ↑f.support) = ⊤

full_name: AddMonoidAlgebra.exists_finset_adjoin_eq_top
code: /-- If `R[M]` is of finite type, then there is a `G : Finset M` such that its
image generates, as algebra, `R[M]`. -/
theorem exists_finset_adjoin_eq_top [h : FiniteType R R[M]] :
    ∃ G : Finset M, Algebra.adjoin R (of' R M '' G) = ⊤ 
goal: ∃ G, Algebra.adjoin R (AddMonoidAlgebra.of' R M '' ↑G) = ⊤

full_name: AddMonoidAlgebra.of'_mem_span
code: /-- The image of an element `m : M` in `R[M]` belongs the submodule generated by
`S : Set M` if and only if `m ∈ S`. -/
theorem of'_mem_span [Nontrivial R] {m : M} {S : Set M} :
    of' R M m ∈ span R (of' R M '' S) ↔ m ∈ S 
goal: AddMonoidAlgebra.of' R M m ∈ Submodule.span R (AddMonoidAlgebra.of' R M '' S) ↔ m ∈ S

full_name: AddMonoidAlgebra.mem_closure_of_mem_span_closure
code: /--
If the image of an element `m : M` in `R[M]` belongs the submodule generated by
the closure of some `S : Set M` then `m ∈ closure S`. -/
theorem mem_closure_of_mem_span_closure [Nontrivial R] {m : M} {S : Set M}
    (h : of' R M m ∈ span R (Submonoid.closure (of' R M '' S) : Set R[M])) :
    m ∈ closure S 
goal: m ∈ AddSubmonoid.closure S

full_name: AddMonoidAlgebra.mvPolynomial_aeval_of_surjective_of_closure
code: /-- If a set `S` generates an additive monoid `M`, then the image of `M` generates, as algebra,
`R[M]`. -/
theorem mvPolynomial_aeval_of_surjective_of_closure [AddCommMonoid M] [CommSemiring R] {S : Set M}
    (hS : closure S = ⊤) :
    Function.Surjective
      (MvPolynomial.aeval fun s : S => of' R M ↑s : MvPolynomial S R → R[M]) 
goal: Function.Surjective ⇑(MvPolynomial.aeval fun s => AddMonoidAlgebra.of' R M ↑s)

full_name: AddMonoidAlgebra.freeAlgebra_lift_of_surjective_of_closure
code: /-- If a set `S` generates an additive monoid `M`, then the image of `M` generates, as algebra,
`R[M]`. -/
theorem freeAlgebra_lift_of_surjective_of_closure [CommSemiring R] {S : Set M}
    (hS : closure S = ⊤) :
    Function.Surjective
      (FreeAlgebra.lift R fun s : S => of' R M ↑s : FreeAlgebra R S → R[M]) 
goal: Function.Surjective ⇑((FreeAlgebra.lift R) fun s => AddMonoidAlgebra.of' R M ↑s)

full_name: AddMonoidAlgebra.finiteType_of_fg
code: /-- If an additive monoid `M` is finitely generated then `R[M]` is of finite
type. -/
instance finiteType_of_fg [CommRing R] [h : AddMonoid.FG M] :
    FiniteType R R[M] 
goal: Algebra.FiniteType R (AddMonoidAlgebra R M)

full_name: AddMonoidAlgebra.finiteType_iff_fg
code: /-- An additive monoid `M` is finitely generated if and only if `R[M]` is of
finite type. -/
theorem finiteType_iff_fg [CommRing R] [Nontrivial R] :
    FiniteType R R[M] ↔ AddMonoid.FG M 
goal: Algebra.FiniteType R (AddMonoidAlgebra R M) ↔ AddMonoid.FG M

full_name: AddMonoidAlgebra.fg_of_finiteType
code: /-- If `R[M]` is of finite type then `M` is finitely generated. -/
theorem fg_of_finiteType [CommRing R] [Nontrivial R] [h : FiniteType R R[M]] :
    AddMonoid.FG M 
goal: AddMonoid.FG M

full_name: AddMonoidAlgebra.finiteType_iff_group_fg
code: /-- An additive group `G` is finitely generated if and only if `R[G]` is of
finite type. -/
theorem finiteType_iff_group_fg {G : Type*} [AddCommGroup G] [CommRing R] [Nontrivial R] :
    FiniteType R R[G] ↔ AddGroup.FG G 
goal: Algebra.FiniteType R (AddMonoidAlgebra R G) ↔ AddGroup.FG G

full_name: MonoidAlgebra.mem_adjoin_support
code: /-- An element of `MonoidAlgebra R M` is in the subalgebra generated by its support. -/
theorem mem_adjoin_support (f : MonoidAlgebra R M) : f ∈ adjoin R (of R M '' f.support) 
goal: f ∈ Algebra.adjoin R (⇑(MonoidAlgebra.of R M) '' ↑f.support)

full_name: MonoidAlgebra.support_gen_of_gen
code: /-- If a set `S` generates, as algebra, `MonoidAlgebra R M`, then the set of supports of elements
of `S` generates `MonoidAlgebra R M`. -/
theorem support_gen_of_gen {S : Set (MonoidAlgebra R M)} (hS : Algebra.adjoin R S = ⊤) :
    Algebra.adjoin R (⋃ f ∈ S, of R M '' (f.support : Set M)) = ⊤ 
goal: Algebra.adjoin R (⋃ f ∈ S, ⇑(MonoidAlgebra.of R M) '' ↑f.support) = ⊤

full_name: MonoidAlgebra.support_gen_of_gen'
code: /-- If a set `S` generates, as algebra, `MonoidAlgebra R M`, then the image of the union of the
supports of elements of `S` generates `MonoidAlgebra R M`. -/
theorem support_gen_of_gen' {S : Set (MonoidAlgebra R M)} (hS : Algebra.adjoin R S = ⊤) :
    Algebra.adjoin R (of R M '' ⋃ f ∈ S, (f.support : Set M)) = ⊤ 
goal: Algebra.adjoin R (⇑(MonoidAlgebra.of R M) '' ⋃ f ∈ S, ↑f.support) = ⊤

full_name: MonoidAlgebra.exists_finset_adjoin_eq_top
code: /-- If `MonoidAlgebra R M` is of finite type, then there is a `G : Finset M` such that its image
generates, as algebra, `MonoidAlgebra R M`. -/
theorem exists_finset_adjoin_eq_top [h : FiniteType R (MonoidAlgebra R M)] :
    ∃ G : Finset M, Algebra.adjoin R (of R M '' G) = ⊤ 
goal: ∃ G, Algebra.adjoin R (⇑(MonoidAlgebra.of R M) '' ↑G) = ⊤

full_name: MonoidAlgebra.of_mem_span_of_iff
code: /-- The image of an element `m : M` in `MonoidAlgebra R M` belongs the submodule generated by
`S : Set M` if and only if `m ∈ S`. -/
theorem of_mem_span_of_iff [Nontrivial R] {m : M} {S : Set M} :
    of R M m ∈ span R (of R M '' S) ↔ m ∈ S 
goal: (MonoidAlgebra.of R M) m ∈ Submodule.span R (⇑(MonoidAlgebra.of R M) '' S) ↔ m ∈ S

full_name: MonoidAlgebra.mem_closure_of_mem_span_closure
code: /--
If the image of an element `m : M` in `MonoidAlgebra R M` belongs the submodule generated by the
closure of some `S : Set M` then `m ∈ closure S`. -/
theorem mem_closure_of_mem_span_closure [Nontrivial R] {m : M} {S : Set M}
    (h : of R M m ∈ span R (Submonoid.closure (of R M '' S) : Set (MonoidAlgebra R M))) :
    m ∈ closure S 
goal: m ∈ Submonoid.closure S

full_name: MonoidAlgebra.mvPolynomial_aeval_of_surjective_of_closure
code: /-- If a set `S` generates a monoid `M`, then the image of `M` generates, as algebra,
`MonoidAlgebra R M`. -/
theorem mvPolynomial_aeval_of_surjective_of_closure [CommMonoid M] [CommSemiring R] {S : Set M}
    (hS : closure S = ⊤) :
    Function.Surjective
      (MvPolynomial.aeval fun s : S => of R M ↑s : MvPolynomial S R → MonoidAlgebra R M) 
goal: Function.Surjective ⇑(MvPolynomial.aeval fun s => (MonoidAlgebra.of R M) ↑s)

full_name: MonoidAlgebra.freeAlgebra_lift_of_surjective_of_closure
code: /-- If a set `S` generates an additive monoid `M`, then the image of `M` generates, as algebra,
`R[M]`. -/
theorem freeAlgebra_lift_of_surjective_of_closure [CommSemiring R] {S : Set M}
    (hS : closure S = ⊤) :
    Function.Surjective
      (FreeAlgebra.lift R fun s : S => of R M ↑s : FreeAlgebra R S → MonoidAlgebra R M) 
goal: Function.Surjective ⇑((FreeAlgebra.lift R) fun s => (MonoidAlgebra.of R M) ↑s)

full_name: MonoidAlgebra.finiteType_of_fg
code: /-- If a monoid `M` is finitely generated then `MonoidAlgebra R M` is of finite type. -/
instance finiteType_of_fg [CommRing R] [Monoid.FG M] : FiniteType R (MonoidAlgebra R M) 
goal: Algebra.FiniteType R (MonoidAlgebra R M)

full_name: MonoidAlgebra.finiteType_iff_fg
code: /-- A monoid `M` is finitely generated if and only if `MonoidAlgebra R M` is of finite type. -/
theorem finiteType_iff_fg [CommRing R] [Nontrivial R] :
    FiniteType R (MonoidAlgebra R M) ↔ Monoid.FG M 
goal: Algebra.FiniteType R (MonoidAlgebra R M) ↔ Monoid.FG M

full_name: MonoidAlgebra.fg_of_finiteType
code: /-- If `MonoidAlgebra R M` is of finite type then `M` is finitely generated. -/
theorem fg_of_finiteType [CommRing R] [Nontrivial R] [h : FiniteType R (MonoidAlgebra R M)] :
    Monoid.FG M 
goal: Monoid.FG M

full_name: MonoidAlgebra.finiteType_iff_group_fg
code: /-- A group `G` is finitely generated if and only if `R[G]` is of finite type. -/
theorem finiteType_iff_group_fg {G : Type*} [Group G] [CommRing R] [Nontrivial R] :
    FiniteType R (MonoidAlgebra R G) ↔ Group.FG G 
goal: Algebra.FiniteType R (MonoidAlgebra R G) ↔ Group.FG G

full_name: CommRing.orzechProperty
code: /-- Any commutative ring `R` satisfies the `OrzechProperty`, that is, for any finitely generated
`R`-module `M`, any surjective homomorphism `f : N →ₗ[R] M` from a submodule `N` of `M` to `M`
is injective.

This is a consequence of Noetherian case
(`IsNoetherian.injective_of_surjective_of_injective`), which requires that `M` is a
Noetherian module, but allows `R` to be non-commutative. The reduction of this result to
Noetherian case is adapted from <https://math.stackexchange.com/a/1066110>:
suppose `{ m_j }` is a finite set of generator of `M`, for any `n : N` one can write
`i n = ∑ j, b_j * m_j` for `{ b_j }` in `R`, here `i : N →ₗ[R] M` is the standard inclusion.
We can choose `{ n_j }` which are preimages of `{ m_j }` under `f`, and can choose
`{ c_jl }` in `R` such that `i n_j = ∑ l, c_jl * m_l` for each `j`.
Now let `A` be the subring of `R` generated by `{ b_j }` and `{ c_jl }`, then it is
Noetherian. Let `N'` be the `A`-submodule of `N` generated by `n` and `{ n_j }`,
`M'` be the `A`-submodule of `M` generated by `{ m_j }`,
then it's easy to see that `i` and `f` restrict to `N' →ₗ[A] M'`,
and the restricted version of `f` is surjective, hence by Noetherian case,
it is also injective, in particular, if `f n = 0`, then `n = 0`.

See also Orzech's original paper: *Onto endomorphisms are isomorphisms* [orzech1971]. -/
instance (priority := 100) CommRing.orzechProperty
    (R : Type*) [CommRing R] : OrzechProperty R 
goal: OrzechProperty R

full_name: Module.Finite.injective_of_surjective_endomorphism
code: /-- A theorem by Vasconcelos, given a finite module `M` over a commutative ring, any
surjective endomorphism of `M` is also injective.
It is a consequence of the fact `CommRing.orzechProperty`
that any commutative ring `R` satisfies the `OrzechProperty`;
please use `OrzechProperty.injective_of_surjective_endomorphism` instead.
This is similar to `IsNoetherian.injective_of_surjective_endomorphism` but only applies in the
commutative case, but does not use a Noetherian hypothesis. -/
@[deprecated OrzechProperty.injective_of_surjective_endomorphism (since := "2024-05-30")]
theorem Module.Finite.injective_of_surjective_endomorphism {R : Type*} [CommRing R] {M : Type*}
    [AddCommGroup M] [Module R M] [Finite R M] (f : M →ₗ[R] M)
    (f_surj : Function.Surjective f) : Function.Injective f 
goal: Function.Injective ⇑f