/-
Copyright (c) 2019 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau

! This file was ported from Lean 3 source module ring_theory.adjoin.fg
! leanprover-community/mathlib commit c4658a649d216f57e99621708b09dcb3dcccbd23
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.RingTheory.Polynomial.Basic
import Mathbin.RingTheory.PrincipalIdealDomain
import Mathbin.Data.MvPolynomial.Basic

/-!
# Adjoining elements to form subalgebras

This file develops the basic theory of finitely-generated subalgebras.

## Definitions

* `fg (S : subalgebra R A)` : A predicate saying that the subalgebra is finitely-generated
as an A-algebra

## Tags

adjoin, algebra, finitely-generated algebra

-/

universe u v w

open Subsemiring Ring Submodule

open Pointwise

namespace Algebra

variable {R : Type u} {A : Type v} {B : Type w} [CommSemiring R] [CommSemiring A] [Algebra R A]
  {s t : Set A}

/- warning: algebra.fg_trans -> Algebra.fg_trans is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2)] {s : Set.{u2} A} {t : Set.{u2} A}, (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))))))) (fun (_x : RelEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))))) (LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))))))) => (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) -> (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))) (RelEmbedding.hasCoeToFun.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))))) (LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))))))) (Subalgebra.toSubmodule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) -> (Submodule.Fg.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Preorder.toLE.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (PartialOrder.toPreorder.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.setLike.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))))) (Preorder.toLE.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (PartialOrder.toPreorder.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Submodule.completeLattice.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))))))))) (fun (_x : RelEmbedding.{u2, u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (LE.le.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Preorder.toLE.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (PartialOrder.toPreorder.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.setLike.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))))))) (LE.le.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Preorder.toLE.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (PartialOrder.toPreorder.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Submodule.completeLattice.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))))))))) => (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) -> (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))))) (RelEmbedding.hasCoeToFun.{u2, u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (LE.le.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Preorder.toLE.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (PartialOrder.toPreorder.{u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.setLike.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))))))) (LE.le.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Preorder.toLE.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (PartialOrder.toPreorder.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Submodule.completeLattice.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (CommSemiring.toSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))))))))) (Subalgebra.toSubmodule.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Algebra.adjoin.{u2, u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) t))) -> (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))))))) (fun (_x : RelEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))))) (LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))))))) => (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) -> (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))) (RelEmbedding.hasCoeToFun.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))))) (LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))))))) (Subalgebra.toSubmodule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Union.union.{u2} (Set.{u2} A) (Set.hasUnion.{u2} A) s t))))
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2)] {s : Set.{u2} A} {t : Set.{u2} A}, (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (FunLike.coe.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))) (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (fun (_x : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) => Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) _x) (EmbeddingLike.toFunLike.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))) (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Function.instEmbeddingLikeEmbedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))) (RelEmbedding.toEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) => LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instPartialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))) x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) => LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (OmegaCompletePartialOrder.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.instOmegaCompletePartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))))) x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Subalgebra.toSubmodule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) -> (Submodule.Fg.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (FunLike.coe.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))))) (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (fun (_x : Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) => Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) _x) (EmbeddingLike.toFunLike.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))))) (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Function.instEmbeddingLikeEmbedding.{succ u2, succ u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))))) (RelEmbedding.toEmbedding.{u2, u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) => LE.le.{u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Preorder.toLE.{u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (PartialOrder.toPreorder.{u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (SetLike.instPartialOrder.{u2, u2} (Subalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.instSetLikeSubalgebra.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))))) x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) => LE.le.{u2} (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Preorder.toLE.{u2} (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (PartialOrder.toPreorder.{u2} (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (OmegaCompletePartialOrder.toPartialOrder.{u2} (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (CompleteLattice.instOmegaCompletePartialOrder.{u2} (Submodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Submodule.completeLattice.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (CommSemiring.toSemiring.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))))))) x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Subalgebra.toSubmodule.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)))) (Algebra.adjoin.{u2, u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) x (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s))) A (Subalgebra.toCommSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) (CommSemiring.toSemiring.{u2} A _inst_2) (Subalgebra.toAlgebra.{u2, u1, u2} A R A _inst_1 _inst_2 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Algebra.id.{u2} A _inst_2) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 s)) t))) -> (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (FunLike.coe.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))) (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (fun (_x : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) => Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) _x) (EmbeddingLike.toFunLike.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3))) (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Function.instEmbeddingLikeEmbedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))) (RelEmbedding.toEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) => LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) (SetLike.instPartialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))) x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) => LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (OmegaCompletePartialOrder.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (CompleteLattice.instOmegaCompletePartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A (CommSemiring.toSemiring.{u2} A _inst_2)))) (Algebra.toModule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)))))) x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Subalgebra.toSubmodule.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3)) (Algebra.adjoin.{u1, u2} R A _inst_1 (CommSemiring.toSemiring.{u2} A _inst_2) _inst_3 (Union.union.{u2} (Set.{u2} A) (Set.instUnionSet.{u2} A) s t))))
Case conversion may be inaccurate. Consider using '#align algebra.fg_trans Algebra.fg_transₓ'. -/
theorem fg_trans (h1 : (adjoin R s).toSubmodule.Fg) (h2 : (adjoin (adjoin R s) t).toSubmodule.Fg) :
    (adjoin R (s ∪ t)).toSubmodule.Fg :=
  by
  rcases fg_def.1 h1 with ⟨p, hp, hp'⟩
  rcases fg_def.1 h2 with ⟨q, hq, hq'⟩
  refine' fg_def.2 ⟨p * q, hp.mul hq, le_antisymm _ _⟩
  · rw [span_le]
    rintro _ ⟨x, y, hx, hy, rfl⟩
    change x * y ∈ _
    refine' Subalgebra.mul_mem _ _ _
    · have : x ∈ (adjoin R s).toSubmodule := by
        rw [← hp']
        exact subset_span hx
      exact adjoin_mono (Set.subset_union_left _ _) this
    have : y ∈ (adjoin (adjoin R s) t).toSubmodule :=
      by
      rw [← hq']
      exact subset_span hy
    change y ∈ adjoin R (s ∪ t)
    rwa [adjoin_union_eq_adjoin_adjoin]
  · intro r hr
    change r ∈ adjoin R (s ∪ t) at hr
    rw [adjoin_union_eq_adjoin_adjoin] at hr
    change r ∈ (adjoin (adjoin R s) t).toSubmodule at hr
    rw [← hq', ← Set.image_id q, Finsupp.mem_span_image_iff_total (adjoin R s)] at hr
    rcases hr with ⟨l, hlq, rfl⟩
    have := @Finsupp.total_apply A A (adjoin R s)
    rw [this, Finsupp.sum]
    refine' sum_mem _
    intro z hz
    change (l z).1 * _ ∈ _
    have : (l z).1 ∈ (adjoin R s).toSubmodule := (l z).2
    rw [← hp', ← Set.image_id p, Finsupp.mem_span_image_iff_total R] at this
    rcases this with ⟨l2, hlp, hl⟩
    have := @Finsupp.total_apply A A R
    rw [this] at hl
    rw [← hl, Finsupp.sum_mul]
    refine' sum_mem _
    intro t ht
    change _ * _ ∈ _
    rw [smul_mul_assoc]
    refine' smul_mem _ _ _
    exact subset_span ⟨t, z, hlp ht, hlq hz, rfl⟩
#align algebra.fg_trans Algebra.fg_trans

end Algebra

namespace Subalgebra

variable {R : Type u} {A : Type v} {B : Type w}

variable [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B]

#print Subalgebra.Fg /-
/-- A subalgebra `S` is finitely generated if there exists `t : finset A` such that
`algebra.adjoin R t = S`. -/
def Fg (S : Subalgebra R A) : Prop :=
  ∃ t : Finset A, Algebra.adjoin R ↑t = S
#align subalgebra.fg Subalgebra.Fg
-/

#print Subalgebra.fg_adjoin_finset /-
theorem fg_adjoin_finset (s : Finset A) : (Algebra.adjoin R (↑s : Set A)).Fg :=
  ⟨s, rfl⟩
#align subalgebra.fg_adjoin_finset Subalgebra.fg_adjoin_finset
-/

#print Subalgebra.fg_def /-
theorem fg_def {S : Subalgebra R A} : S.Fg ↔ ∃ t : Set A, Set.Finite t ∧ Algebra.adjoin R t = S :=
  Iff.symm Set.exists_finite_iff_finset
#align subalgebra.fg_def Subalgebra.fg_def
-/

/- warning: subalgebra.fg_bot -> Subalgebra.fg_bot is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2], Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Bot.bot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (CompleteLattice.toHasBot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.Subalgebra.completeLattice.{u1, u2} R A _inst_1 _inst_2 _inst_3)))
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2], Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Bot.bot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (CompleteLattice.toBot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.instCompleteLatticeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3)))
Case conversion may be inaccurate. Consider using '#align subalgebra.fg_bot Subalgebra.fg_botₓ'. -/
theorem fg_bot : (⊥ : Subalgebra R A).Fg :=
  ⟨∅, Algebra.adjoin_empty R A⟩
#align subalgebra.fg_bot Subalgebra.fg_bot

/- warning: subalgebra.fg_of_fg_to_submodule -> Subalgebra.fg_of_fg_toSubmodule is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] {S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3}, (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3) (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))))) (fun (_x : RelEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)))))))) => (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) -> (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))) (RelEmbedding.hasCoeToFun.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.partialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (CompleteSemilatticeInf.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)))))))) (Subalgebra.toSubmodule.{u1, u2} R A _inst_1 _inst_2 _inst_3) S)) -> (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] {S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3}, (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3) (FunLike.coe.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))) (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (fun (_x : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) => Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) _x) (EmbeddingLike.toFunLike.{succ u2, succ u2, succ u2} (Function.Embedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))) (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Function.instEmbeddingLikeEmbedding.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) (RelEmbedding.toEmbedding.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) => LE.le.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Preorder.toLE.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (PartialOrder.toPreorder.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.instPartialOrder.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) => LE.le.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Preorder.toLE.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (PartialOrder.toPreorder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (OmegaCompletePartialOrder.toPartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (CompleteLattice.instOmegaCompletePartialOrder.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Submodule.completeLattice.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)))))) x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Subalgebra.toSubmodule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) S)) -> (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)
Case conversion may be inaccurate. Consider using '#align subalgebra.fg_of_fg_to_submodule Subalgebra.fg_of_fg_toSubmoduleₓ'. -/
theorem fg_of_fg_toSubmodule {S : Subalgebra R A} : S.toSubmodule.Fg → S.Fg := fun ⟨t, ht⟩ =>
  ⟨t,
    le_antisymm (Algebra.adjoin_le fun x hx => show x ∈ S.toSubmodule from ht ▸ subset_span hx) <|
      show S.toSubmodule ≤ (Algebra.adjoin R ↑t).toSubmodule from fun x hx =>
        span_le.mpr (fun x hx => Algebra.subset_adjoin hx)
          (show x ∈ span R ↑t by
            rw [ht]
            exact hx)⟩
#align subalgebra.fg_of_fg_to_submodule Subalgebra.fg_of_fg_toSubmodule

#print Subalgebra.fg_of_noetherian /-
theorem fg_of_noetherian [IsNoetherian R A] (S : Subalgebra R A) : S.Fg :=
  fg_of_fg_toSubmodule (IsNoetherian.noetherian S.toSubmodule)
#align subalgebra.fg_of_noetherian Subalgebra.fg_of_noetherian
-/

/- warning: subalgebra.fg_of_submodule_fg -> Subalgebra.fg_of_submodule_fg is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2], (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Top.top.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Submodule.hasTop.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) -> (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Top.top.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (CompleteLattice.toHasTop.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.Subalgebra.completeLattice.{u1, u2} R A _inst_1 _inst_2 _inst_3))))
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2], (Submodule.Fg.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Top.top.{u2} (Submodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Submodule.instTopSubmodule.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) -> (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Top.top.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (CompleteLattice.toTop.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.instCompleteLatticeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3))))
Case conversion may be inaccurate. Consider using '#align subalgebra.fg_of_submodule_fg Subalgebra.fg_of_submodule_fgₓ'. -/
theorem fg_of_submodule_fg (h : (⊤ : Submodule R A).Fg) : (⊤ : Subalgebra R A).Fg :=
  let ⟨s, hs⟩ := h
  ⟨s,
    toSubmodule.Injective <|
      by
      rw [Algebra.top_toSubmodule, eq_top_iff, ← hs, span_le]
      exact Algebra.subset_adjoin⟩
#align subalgebra.fg_of_submodule_fg Subalgebra.fg_of_submodule_fg

/- warning: subalgebra.fg.prod -> Subalgebra.Fg.prod is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} {B : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : Semiring.{u3} B] [_inst_5 : Algebra.{u1, u3} R B _inst_1 _inst_4] {S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3} {T : Subalgebra.{u1, u3} R B _inst_1 _inst_4 _inst_5}, (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) -> (Subalgebra.Fg.{u1, u3} R B _inst_1 _inst_4 _inst_5 T) -> (Subalgebra.Fg.{u1, max u2 u3} R (Prod.{u2, u3} A B) _inst_1 (Prod.semiring.{u2, u3} A B _inst_2 _inst_4) (Prod.algebra.{u1, u2, u3} R A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5) (Subalgebra.prod.{u1, u2, u3} R A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 S T))
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} {B : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : Semiring.{u3} B] [_inst_5 : Algebra.{u1, u3} R B _inst_1 _inst_4] {S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3} {T : Subalgebra.{u1, u3} R B _inst_1 _inst_4 _inst_5}, (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) -> (Subalgebra.Fg.{u1, u3} R B _inst_1 _inst_4 _inst_5 T) -> (Subalgebra.Fg.{u1, max u2 u3} R (Prod.{u2, u3} A B) _inst_1 (Prod.instSemiringProd.{u2, u3} A B _inst_2 _inst_4) (Prod.algebra.{u1, u2, u3} R A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5) (Subalgebra.prod.{u1, u2, u3} R A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 S T))
Case conversion may be inaccurate. Consider using '#align subalgebra.fg.prod Subalgebra.Fg.prodₓ'. -/
theorem Fg.prod {S : Subalgebra R A} {T : Subalgebra R B} (hS : S.Fg) (hT : T.Fg) : (S.Prod T).Fg :=
  by
  obtain ⟨s, hs⟩ := fg_def.1 hS
  obtain ⟨t, ht⟩ := fg_def.1 hT
  rw [← hs.2, ← ht.2]
  exact
    fg_def.2
      ⟨LinearMap.inl R A B '' (s ∪ {1}) ∪ LinearMap.inr R A B '' (t ∪ {1}),
        Set.Finite.union (Set.Finite.image _ (Set.Finite.union hs.1 (Set.finite_singleton _)))
          (Set.Finite.image _ (Set.Finite.union ht.1 (Set.finite_singleton _))),
        Algebra.adjoin_inl_union_inr_eq_prod R s t⟩
#align subalgebra.fg.prod Subalgebra.Fg.prod

section

open Classical

#print Subalgebra.Fg.map /-
theorem Fg.map {S : Subalgebra R A} (f : A →ₐ[R] B) (hs : S.Fg) : (S.map f).Fg :=
  let ⟨s, hs⟩ := hs
  ⟨s.image f, by rw [Finset.coe_image, Algebra.adjoin_image, hs]⟩
#align subalgebra.fg.map Subalgebra.Fg.map
-/

end

#print Subalgebra.fg_of_fg_map /-
theorem fg_of_fg_map (S : Subalgebra R A) (f : A →ₐ[R] B) (hf : Function.Injective f)
    (hs : (S.map f).Fg) : S.Fg :=
  let ⟨s, hs⟩ := hs
  ⟨s.Preimage f fun _ _ _ _ h => hf h,
    map_injective hf <|
      by
      rw [← Algebra.adjoin_image, Finset.coe_preimage, Set.image_preimage_eq_of_subset, hs]
      rw [← AlgHom.coe_range, ← Algebra.adjoin_le_iff, hs, ← Algebra.map_top]
      exact map_mono le_top⟩
#align subalgebra.fg_of_fg_map Subalgebra.fg_of_fg_map
-/

/- warning: subalgebra.fg_top -> Subalgebra.fg_top is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] (S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3), Iff (Subalgebra.Fg.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3)) S) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.algebra.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Top.top.{u2} (Subalgebra.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3)) S) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.algebra.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)) (CompleteLattice.toHasTop.{u2} (Subalgebra.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3)) S) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.algebra.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)) (Algebra.Subalgebra.completeLattice.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3)) S) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.algebra.{u1, u2} R A _inst_1 _inst_2 _inst_3 S))))) (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] (S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3), Iff (Subalgebra.Fg.{u1, u2} R (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3)) x S)) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.instAlgebraSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebraToSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Top.top.{u2} (Subalgebra.{u1, u2} R (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3)) x S)) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.instAlgebraSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebraToSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)) (CompleteLattice.toTop.{u2} (Subalgebra.{u1, u2} R (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3)) x S)) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.instAlgebraSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebraToSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)) (Algebra.instCompleteLatticeSubalgebra.{u1, u2} R (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3)) x S)) _inst_1 (Subalgebra.toSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S) (Subalgebra.instAlgebraSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebraToSemiring.{u1, u2} R A _inst_1 _inst_2 _inst_3 S))))) (Subalgebra.Fg.{u1, u2} R A _inst_1 _inst_2 _inst_3 S)
Case conversion may be inaccurate. Consider using '#align subalgebra.fg_top Subalgebra.fg_topₓ'. -/
theorem fg_top (S : Subalgebra R A) : (⊤ : Subalgebra R S).Fg ↔ S.Fg :=
  ⟨fun h => by
    rw [← S.range_val, ← Algebra.map_top]
    exact fg.map _ h, fun h =>
    fg_of_fg_map _ S.val Subtype.val_injective <|
      by
      rw [Algebra.map_top, range_val]
      exact h⟩
#align subalgebra.fg_top Subalgebra.fg_top

/- warning: subalgebra.induction_on_adjoin -> Subalgebra.induction_on_adjoin is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_6 : IsNoetherian.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)] (P : (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) -> Prop), (P (Bot.bot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (CompleteLattice.toHasBot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.Subalgebra.completeLattice.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) -> (forall (S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (x : A), (P S) -> (P (Algebra.adjoin.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Insert.insert.{u2, u2} A (Set.{u2} A) (Set.hasInsert.{u2} A) x ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Set.{u2} A) (HasLiftT.mk.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Set.{u2} A) (CoeTCₓ.coe.{succ u2, succ u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Set.{u2} A) (SetLike.Set.hasCoeT.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.setLike.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) S))))) -> (forall (S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3), P S)
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_6 : IsNoetherian.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)] (P : (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) -> Prop), (P (Bot.bot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (CompleteLattice.toBot.{u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.instCompleteLatticeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3)))) -> (forall (S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) (x : A), (P S) -> (P (Algebra.adjoin.{u1, u2} R A _inst_1 _inst_2 _inst_3 (Insert.insert.{u2, u2} A (Set.{u2} A) (Set.instInsertSet.{u2} A) x (SetLike.coe.{u2, u2} (Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3) S))))) -> (forall (S : Subalgebra.{u1, u2} R A _inst_1 _inst_2 _inst_3), P S)
Case conversion may be inaccurate. Consider using '#align subalgebra.induction_on_adjoin Subalgebra.induction_on_adjoinₓ'. -/
theorem induction_on_adjoin [IsNoetherian R A] (P : Subalgebra R A → Prop) (base : P ⊥)
    (ih : ∀ (S : Subalgebra R A) (x : A), P S → P (Algebra.adjoin R (insert x S)))
    (S : Subalgebra R A) : P S := by
  classical
    obtain ⟨t, rfl⟩ := S.fg_of_noetherian
    refine' Finset.induction_on t _ _
    · simpa using base
    intro x t hxt h
    rw [Finset.coe_insert]
    simpa only [Algebra.adjoin_insert_adjoin] using ih _ x h
#align subalgebra.induction_on_adjoin Subalgebra.induction_on_adjoin

end Subalgebra

section Semiring

variable {R : Type u} {A : Type v} {B : Type w}

variable [CommSemiring R] [CommRing A] [CommRing B] [Algebra R A] [Algebra R B]

/- warning: alg_hom.is_noetherian_ring_range -> AlgHom.isNoetherianRing_range is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} {B : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommRing.{u2} A] [_inst_3 : CommRing.{u3} B] [_inst_4 : Algebra.{u1, u2} R A _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2))] [_inst_5 : Algebra.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3))] (f : AlgHom.{u1, u2, u3} R A B _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_4 _inst_5) [_inst_6 : IsNoetherianRing.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2))], IsNoetherianRing.{u3} (coeSort.{succ u3, succ (succ u3)} (Subalgebra.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5) Type.{u3} (SetLike.hasCoeToSort.{u3, u3} (Subalgebra.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5) B (Subalgebra.setLike.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5)) (AlgHom.range.{u1, u2, u3} R A B _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5 f)) (Subalgebra.toSemiring.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5 (AlgHom.range.{u1, u2, u3} R A B _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5 f))
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} {B : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommRing.{u2} A] [_inst_3 : CommRing.{u3} B] [_inst_4 : Algebra.{u1, u2} R A _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2))] [_inst_5 : Algebra.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3))] (f : AlgHom.{u1, u2, u3} R A B _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_4 _inst_5) [_inst_6 : IsNoetherianRing.{u2} A (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2))], IsNoetherianRing.{u3} (Subtype.{succ u3} B (fun (x : B) => Membership.mem.{u3, u3} B (Subalgebra.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5) (SetLike.instMembership.{u3, u3} (Subalgebra.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5) B (Subalgebra.instSetLikeSubalgebra.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5)) x (AlgHom.range.{u1, u2, u3} R A B _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5 f))) (Subalgebra.toSemiring.{u1, u3} R B _inst_1 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5 (AlgHom.range.{u1, u2, u3} R A B _inst_1 (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 (Ring.toSemiring.{u3} B (CommRing.toRing.{u3} B _inst_3)) _inst_5 f))
Case conversion may be inaccurate. Consider using '#align alg_hom.is_noetherian_ring_range AlgHom.isNoetherianRing_rangeₓ'. -/
/-- The image of a Noetherian R-algebra under an R-algebra map is a Noetherian ring. -/
instance AlgHom.isNoetherianRing_range (f : A →ₐ[R] B) [IsNoetherianRing A] :
    IsNoetherianRing f.range :=
  isNoetherianRing_range f.toRingHom
#align alg_hom.is_noetherian_ring_range AlgHom.isNoetherianRing_range

end Semiring

section Ring

variable {R : Type u} {A : Type v} {B : Type w}

variable [CommRing R] [CommRing A] [CommRing B] [Algebra R A] [Algebra R B]

/- warning: is_noetherian_ring_of_fg -> isNoetherianRing_of_fg is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommRing.{u1} R] [_inst_2 : CommRing.{u2} A] [_inst_4 : Algebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2))] {S : Subalgebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4}, (Subalgebra.Fg.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 S) -> (forall [_inst_6 : IsNoetherianRing.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))], IsNoetherianRing.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4) A (Subalgebra.setLike.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4)) S) (Subalgebra.toSemiring.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 S))
but is expected to have type
  forall {R : Type.{u1}} {A : Type.{u2}} [_inst_1 : CommRing.{u1} R] [_inst_2 : CommRing.{u2} A] [_inst_4 : Algebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2))] {S : Subalgebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4}, (Subalgebra.Fg.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 S) -> (forall [_inst_6 : IsNoetherianRing.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))], IsNoetherianRing.{u2} (Subtype.{succ u2} A (fun (x : A) => Membership.mem.{u2, u2} A (Subalgebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4) A (Subalgebra.instSetLikeSubalgebra.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4)) x S)) (Subalgebra.toSemiring.{u1, u2} R A (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} A (CommRing.toRing.{u2} A _inst_2)) _inst_4 S))
Case conversion may be inaccurate. Consider using '#align is_noetherian_ring_of_fg isNoetherianRing_of_fgₓ'. -/
theorem isNoetherianRing_of_fg {S : Subalgebra R A} (HS : S.Fg) [IsNoetherianRing R] :
    IsNoetherianRing S :=
  let ⟨t, ht⟩ := HS
  ht ▸
    (Algebra.adjoin_eq_range R (↑t : Set A)).symm ▸ by
      haveI : IsNoetherianRing (MvPolynomial (↑t : Set A) R) := MvPolynomial.isNoetherianRing <;>
          convert AlgHom.isNoetherianRing_range _ <;>
        infer_instance
#align is_noetherian_ring_of_fg isNoetherianRing_of_fg

/- warning: is_noetherian_subring_closure -> is_noetherian_subring_closure is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (s : Set.{u1} R), (Set.Finite.{u1} R s) -> (IsNoetherianRing.{u1} (coeSort.{succ u1, succ (succ u1)} (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) R (Subring.setLike.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Subring.closure.{u1} R (CommRing.toRing.{u1} R _inst_1) s)) (Ring.toSemiring.{u1} (coeSort.{succ u1, succ (succ u1)} (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) R (Subring.setLike.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Subring.closure.{u1} R (CommRing.toRing.{u1} R _inst_1) s)) (Subring.toRing.{u1} R (CommRing.toRing.{u1} R _inst_1) (Subring.closure.{u1} R (CommRing.toRing.{u1} R _inst_1) s))))
but is expected to have type
  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (s : Set.{u1} R), (Set.Finite.{u1} R s) -> (IsNoetherianRing.{u1} (Subtype.{succ u1} R (fun (x : R) => Membership.mem.{u1, u1} R (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (SetLike.instMembership.{u1, u1} (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) R (Subring.instSetLikeSubring.{u1} R (CommRing.toRing.{u1} R _inst_1))) x (Subring.closure.{u1} R (CommRing.toRing.{u1} R _inst_1) s))) (Ring.toSemiring.{u1} (Subtype.{succ u1} R (fun (x : R) => Membership.mem.{u1, u1} R (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (SetLike.instMembership.{u1, u1} (Subring.{u1} R (CommRing.toRing.{u1} R _inst_1)) R (Subring.instSetLikeSubring.{u1} R (CommRing.toRing.{u1} R _inst_1))) x (Subring.closure.{u1} R (CommRing.toRing.{u1} R _inst_1) s))) (Subring.toRing.{u1} R (CommRing.toRing.{u1} R _inst_1) (Subring.closure.{u1} R (CommRing.toRing.{u1} R _inst_1) s))))
Case conversion may be inaccurate. Consider using '#align is_noetherian_subring_closure is_noetherian_subring_closureₓ'. -/
theorem is_noetherian_subring_closure (s : Set R) (hs : s.Finite) :
    IsNoetherianRing (Subring.closure s) :=
  show IsNoetherianRing (subalgebraOfSubring (Subring.closure s)) from
    Algebra.adjoin_int s ▸ isNoetherianRing_of_fg (Subalgebra.fg_def.2 ⟨s, hs, rfl⟩)
#align is_noetherian_subring_closure is_noetherian_subring_closure

end Ring