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

! This file was ported from Lean 3 source module algebra.algebra.subalgebra.tower
! leanprover-community/mathlib commit 69c6a5a12d8a2b159f20933e60115a4f2de62b58
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Algebra.Algebra.Subalgebra.Basic
import Mathbin.Algebra.Algebra.Tower

/-!
# Subalgebras in towers of algebras

> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.

In this file we prove facts about subalgebras in towers of algebra.

An algebra tower A/S/R is expressed by having instances of `algebra A S`,
`algebra R S`, `algebra R A` and `is_scalar_tower R S A`, the later asserting the
compatibility condition `(r • s) • a = r • (s • a)`.

## Main results

 * `is_scalar_tower.subalgebra`: if `A/S/R` is a tower and `S₀` is a subalgebra
   between `S` and `R`, then `A/S/S₀` is a tower
 * `is_scalar_tower.subalgebra'`: if `A/S/R` is a tower and `S₀` is a subalgebra
   between `S` and `R`, then `A/S₀/R` is a tower
 * `subalgebra.restrict_scalars`: turn an `S`-subalgebra of `A` into an `R`-subalgebra of `A`,
   given that `A/S/R` is a tower

-/

open Pointwise

universe u v w u₁ v₁

variable (R : Type u) (S : Type v) (A : Type w) (B : Type u₁) (M : Type v₁)

namespace Algebra

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

variable [AddCommMonoid M] [Module R M] [Module A M] [IsScalarTower R A M]

variable {A}

#print Algebra.lmul_algebraMap /-
theorem lmul_algebraMap (x : R) :
    LinearMap.Algebra.lmul R A (algebraMap R A x) = Algebra.lsmul R A x :=
  Eq.symm <| LinearMap.ext <| smul_def x
#align algebra.lmul_algebra_map Algebra.lmul_algebraMap
-/

end Algebra

namespace IsScalarTower

section Semiring

variable [CommSemiring R] [CommSemiring S] [Semiring A]

variable [Algebra R S] [Algebra S A]

variable (R S A)

/- warning: is_scalar_tower.subalgebra -> IsScalarTower.subalgebra is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (S : Type.{u2}) (A : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_5 : Algebra.{u2, u3} S A _inst_2 _inst_3] (S₀ : Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4), IsScalarTower.{u2, u2, u3} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) S A (Subalgebra.hasSmul.{u1, u2, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S (Mul.toSMul.{u2} S (Distrib.toHasMul.{u2} S (NonUnitalNonAssocSemiring.toDistrib.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))))) S₀) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) (Subalgebra.hasSmul.{u1, u2, u3} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) S₀)
but is expected to have type
  forall (R : Type.{u1}) (S : Type.{u2}) (A : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_5 : Algebra.{u2, u3} S A _inst_2 _inst_3] (S₀ : Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4), IsScalarTower.{u2, u2, u3} (Subtype.{succ u2} S (fun (x : S) => Membership.mem.{u2, u2} S (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.instSetLikeSubalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) x S₀)) S A (Subalgebra.instSMulSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebra.{u1, u2, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S (Algebra.toSMul.{u2, u2} S S _inst_2 (CommSemiring.toSemiring.{u2} S _inst_2) (Algebra.id.{u2} S _inst_2)) S₀) (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_5) (Subalgebra.instSMulSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebra.{u1, u2, u3} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 A (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_5) S₀)
Case conversion may be inaccurate. Consider using '#align is_scalar_tower.subalgebra IsScalarTower.subalgebraₓ'. -/
instance subalgebra (S₀ : Subalgebra R S) : IsScalarTower S₀ S A :=
  of_algebraMap_eq fun x => rfl
#align is_scalar_tower.subalgebra IsScalarTower.subalgebra

variable [Algebra R A] [IsScalarTower R S A]

/- warning: is_scalar_tower.subalgebra' -> IsScalarTower.subalgebra' is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (S : Type.{u2}) (A : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_5 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_7 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4))))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_6)))))] (S₀ : Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4), IsScalarTower.{u1, u2, u3} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) A (SMulZeroClass.toHasSmul.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (AddZeroClass.toHasZero.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (AddMonoid.toAddZeroClass.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (AddCommMonoid.toAddMonoid.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Semiring.toNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Subalgebra.toSemiring.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S₀))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (AddMonoid.toAddZeroClass.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (AddCommMonoid.toAddMonoid.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Semiring.toNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Subalgebra.toSemiring.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S₀))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (AddMonoid.toAddZeroClass.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (AddCommMonoid.toAddMonoid.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Semiring.toNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Subalgebra.toSemiring.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S₀))))))) (Module.toMulActionWithZero.{u1, u2} R (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Semiring.toNonAssocSemiring.{u2} (coeSort.{succ u2, succ (succ u2)} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) Type.{u2} (SetLike.hasCoeToSort.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.setLike.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) S₀) (Subalgebra.toSemiring.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S₀)))) (Subalgebra.module.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S₀))))) (Subalgebra.hasSmul.{u1, u2, u3} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) S₀) (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_6)))))
but is expected to have type
  forall (R : Type.{u1}) (S : Type.{u2}) (A : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_5 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_7 : IsScalarTower.{u1, u2, u3} R S A (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_5) (Algebra.toSMul.{u1, u3} R A _inst_1 _inst_3 _inst_6)] (S₀ : Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4), IsScalarTower.{u1, u2, u3} R (Subtype.{succ u2} S (fun (x : S) => Membership.mem.{u2, u2} S (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.instSetLikeSubalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) x S₀)) A (Algebra.toSMul.{u1, u2} R (Subtype.{succ u2} S (fun (x : S) => Membership.mem.{u2, u2} S (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) (SetLike.instMembership.{u2, u2} (Subalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4) S (Subalgebra.instSetLikeSubalgebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4)) x S₀)) _inst_1 (Subalgebra.toSemiring.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S₀) (Subalgebra.instAlgebraSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebraToSemiring.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 S₀)) (Subalgebra.instSMulSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebra.{u1, u2, u3} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_4 A (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_5) S₀) (Algebra.toSMul.{u1, u3} R A _inst_1 _inst_3 _inst_6)
Case conversion may be inaccurate. Consider using '#align is_scalar_tower.subalgebra' IsScalarTower.subalgebra'ₓ'. -/
instance subalgebra' (S₀ : Subalgebra R S) : IsScalarTower R S₀ A :=
  @IsScalarTower.of_algebraMap_eq R S₀ A _ _ _ _ _ _ fun _ =>
    (IsScalarTower.algebraMap_apply R S A _ : _)
#align is_scalar_tower.subalgebra' IsScalarTower.subalgebra'

end Semiring

end IsScalarTower

namespace Subalgebra

open IsScalarTower

section Semiring

variable (R) {S A B} [CommSemiring R] [CommSemiring S] [Semiring A] [Semiring B]

variable [Algebra R S] [Algebra S A] [Algebra R A] [Algebra S B] [Algebra R B]

variable [IsScalarTower R S A] [IsScalarTower R S B]

#print Subalgebra.restrictScalars /-
/-- Given a tower `A / ↥U / S / R` of algebras, where `U` is an `S`-subalgebra of `A`, reinterpret
`U` as an `R`-subalgebra of `A`. -/
def restrictScalars (U : Subalgebra S A) : Subalgebra R A :=
  { U with
    algebraMap_mem' := fun x => by
      rw [algebra_map_apply R S A]
      exact U.algebra_map_mem _ }
#align subalgebra.restrict_scalars Subalgebra.restrictScalars
-/

/- warning: subalgebra.coe_restrict_scalars -> Subalgebra.coe_restrictScalars is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5))))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))))) (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))] {U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6}, Eq.{succ u3} (Set.{u3} A) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Set.{u3} A) (HasLiftT.mk.{succ u3, succ u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Set.{u3} A) (CoeTCₓ.coe.{succ u3, succ u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Set.{u3} A) (SetLike.Set.hasCoeT.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_7)))) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Set.{u3} A) (HasLiftT.mk.{succ u3, succ u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Set.{u3} A) (CoeTCₓ.coe.{succ u3, succ u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Set.{u3} A) (SetLike.Set.hasCoeT.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.setLike.{u2, u3} S A _inst_2 _inst_3 _inst_6)))) U)
but is expected to have type
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toSMul.{u1, u3} R A _inst_1 _inst_3 _inst_7)] {U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6}, Eq.{succ u3} (Set.{u3} A) (SetLike.coe.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.instSetLikeSubalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) (SetLike.coe.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.instSetLikeSubalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) U)
Case conversion may be inaccurate. Consider using '#align subalgebra.coe_restrict_scalars Subalgebra.coe_restrictScalarsₓ'. -/
@[simp]
theorem coe_restrictScalars {U : Subalgebra S A} : (restrictScalars R U : Set A) = (U : Set A) :=
  rfl
#align subalgebra.coe_restrict_scalars Subalgebra.coe_restrictScalars

/- warning: subalgebra.restrict_scalars_top -> Subalgebra.restrictScalars_top is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5))))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))))) (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))], Eq.{succ u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 (Top.top.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (CompleteLattice.toHasTop.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.Subalgebra.completeLattice.{u2, u3} S A _inst_2 _inst_3 _inst_6)))) (Top.top.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (CompleteLattice.toHasTop.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Algebra.Subalgebra.completeLattice.{u1, u3} R A _inst_1 _inst_3 _inst_7)))
but is expected to have type
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toSMul.{u1, u3} R A _inst_1 _inst_3 _inst_7)], Eq.{succ u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 (Top.top.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (CompleteLattice.toTop.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.instCompleteLatticeSubalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6)))) (Top.top.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (CompleteLattice.toTop.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Algebra.instCompleteLatticeSubalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7)))
Case conversion may be inaccurate. Consider using '#align subalgebra.restrict_scalars_top Subalgebra.restrictScalars_topₓ'. -/
@[simp]
theorem restrictScalars_top : restrictScalars R (⊤ : Subalgebra S A) = ⊤ :=
  SetLike.coe_injective rfl
#align subalgebra.restrict_scalars_top Subalgebra.restrictScalars_top

/- warning: subalgebra.restrict_scalars_to_submodule -> Subalgebra.restrictScalars_toSubmodule is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5))))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))))) (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))] {U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6}, Eq.{succ u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (coeFn.{succ u3, succ u3} (OrderEmbedding.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Preorder.toLE.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (PartialOrder.toPreorder.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (SetLike.partialOrder.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_7)))) (Preorder.toLE.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (PartialOrder.toPreorder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (CompleteSemilatticeInf.toPartialOrder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (CompleteLattice.toCompleteSemilatticeInf.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Submodule.completeLattice.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7))))))) (fun (_x : RelEmbedding.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (LE.le.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Preorder.toLE.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (PartialOrder.toPreorder.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (SetLike.partialOrder.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_7))))) (LE.le.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Preorder.toLE.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (PartialOrder.toPreorder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (CompleteSemilatticeInf.toPartialOrder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (CompleteLattice.toCompleteSemilatticeInf.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Submodule.completeLattice.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))))) => (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) -> (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7))) (RelEmbedding.hasCoeToFun.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (LE.le.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Preorder.toLE.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (PartialOrder.toPreorder.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (SetLike.partialOrder.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_7))))) (LE.le.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Preorder.toLE.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (PartialOrder.toPreorder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (CompleteSemilatticeInf.toPartialOrder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (CompleteLattice.toCompleteSemilatticeInf.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Submodule.completeLattice.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))))) (Subalgebra.toSubmodule.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) (Submodule.restrictScalars.{u1, u2, u3} R S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (CommSemiring.toSemiring.{u1} R _inst_1) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5))))) _inst_10 (coeFn.{succ u3, succ u3} (OrderEmbedding.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Preorder.toLE.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (PartialOrder.toPreorder.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SetLike.partialOrder.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.setLike.{u2, u3} S A _inst_2 _inst_3 _inst_6)))) (Preorder.toLE.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (PartialOrder.toPreorder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (CompleteSemilatticeInf.toPartialOrder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (CompleteLattice.toCompleteSemilatticeInf.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Submodule.completeLattice.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))))))) (fun (_x : RelEmbedding.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (LE.le.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Preorder.toLE.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (PartialOrder.toPreorder.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SetLike.partialOrder.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.setLike.{u2, u3} S A _inst_2 _inst_3 _inst_6))))) (LE.le.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Preorder.toLE.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (PartialOrder.toPreorder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (CompleteSemilatticeInf.toPartialOrder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (CompleteLattice.toCompleteSemilatticeInf.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Submodule.completeLattice.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)))))))) => (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) -> (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))) (RelEmbedding.hasCoeToFun.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (LE.le.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Preorder.toLE.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (PartialOrder.toPreorder.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SetLike.partialOrder.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.setLike.{u2, u3} S A _inst_2 _inst_3 _inst_6))))) (LE.le.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Preorder.toLE.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (PartialOrder.toPreorder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (CompleteSemilatticeInf.toPartialOrder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (CompleteLattice.toCompleteSemilatticeInf.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Submodule.completeLattice.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)))))))) (Subalgebra.toSubmodule.{u2, u3} S A _inst_2 _inst_3 _inst_6) U))
but is expected to have type
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toSMul.{u1, u3} R A _inst_1 _inst_3 _inst_7)] {U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6}, Eq.{succ u3} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) => Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) (FunLike.coe.{succ u3, succ u3, succ u3} (Function.Embedding.{succ u3, succ u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7))) (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (fun (_x : Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) => Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) _x) (EmbeddingLike.toFunLike.{succ u3, succ u3, succ u3} (Function.Embedding.{succ u3, succ u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7))) (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Function.instEmbeddingLikeEmbedding.{succ u3, succ u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))) (RelEmbedding.toEmbedding.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) => LE.le.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Preorder.toLE.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (PartialOrder.toPreorder.{u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (SetLike.instPartialOrder.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.instSetLikeSubalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7)))) x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) => LE.le.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Preorder.toLE.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (PartialOrder.toPreorder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (OmegaCompletePartialOrder.toPartialOrder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (CompleteLattice.instOmegaCompletePartialOrder.{u3} (Submodule.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Submodule.completeLattice.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))) x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Subalgebra.toSubmodule.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) (Submodule.restrictScalars.{u1, u2, u3} R S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (CommSemiring.toSemiring.{u1} R _inst_1) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) _inst_10 (FunLike.coe.{succ u3, succ u3, succ u3} (Function.Embedding.{succ u3, succ u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))) (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (fun (_x : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) => Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) _x) (EmbeddingLike.toFunLike.{succ u3, succ u3, succ u3} (Function.Embedding.{succ u3, succ u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))) (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Function.instEmbeddingLikeEmbedding.{succ u3, succ u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)))) (RelEmbedding.toEmbedding.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) => LE.le.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Preorder.toLE.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (PartialOrder.toPreorder.{u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SetLike.instPartialOrder.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.instSetLikeSubalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6)))) x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) => LE.le.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Preorder.toLE.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (PartialOrder.toPreorder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (OmegaCompletePartialOrder.toPartialOrder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (CompleteLattice.instOmegaCompletePartialOrder.{u3} (Submodule.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) (Submodule.completeLattice.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6)))))) x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Subalgebra.toSubmodule.{u2, u3} S A _inst_2 _inst_3 _inst_6)) U))
Case conversion may be inaccurate. Consider using '#align subalgebra.restrict_scalars_to_submodule Subalgebra.restrictScalars_toSubmoduleₓ'. -/
@[simp]
theorem restrictScalars_toSubmodule {U : Subalgebra S A} :
    (U.restrictScalars R).toSubmodule = U.toSubmodule.restrictScalars R :=
  SetLike.coe_injective rfl
#align subalgebra.restrict_scalars_to_submodule Subalgebra.restrictScalars_toSubmodule

/- warning: subalgebra.mem_restrict_scalars -> Subalgebra.mem_restrictScalars is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5))))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))))) (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))] {U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6} {x : A}, Iff (Membership.Mem.{u3, u3} A (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (SetLike.hasMem.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_7)) x (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) (Membership.Mem.{u3, u3} A (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SetLike.hasMem.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.setLike.{u2, u3} S A _inst_2 _inst_3 _inst_6)) x U)
but is expected to have type
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toSMul.{u1, u3} R A _inst_1 _inst_3 _inst_7)] {U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6} {x : A}, Iff (Membership.mem.{u3, u3} A (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (SetLike.instMembership.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.instSetLikeSubalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7)) x (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) (Membership.mem.{u3, u3} A (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SetLike.instMembership.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.instSetLikeSubalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6)) x U)
Case conversion may be inaccurate. Consider using '#align subalgebra.mem_restrict_scalars Subalgebra.mem_restrictScalarsₓ'. -/
@[simp]
theorem mem_restrictScalars {U : Subalgebra S A} {x : A} : x ∈ restrictScalars R U ↔ x ∈ U :=
  Iff.rfl
#align subalgebra.mem_restrict_scalars Subalgebra.mem_restrictScalars

#print Subalgebra.restrictScalars_injective /-
theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : Subalgebra S A → Subalgebra R A) := fun U V H =>
  ext fun x => by rw [← mem_restrict_scalars R, H, mem_restrict_scalars]
#align subalgebra.restrict_scalars_injective Subalgebra.restrictScalars_injective
-/

/- warning: subalgebra.of_restrict_scalars -> Subalgebra.ofRestrictScalars is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} {B : Type.{u4}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_4 : Semiring.{u4} B] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_8 : Algebra.{u2, u4} S B _inst_2 _inst_4] [_inst_9 : Algebra.{u1, u4} R B _inst_1 _inst_4] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5))))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S A (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u2, u3} S A (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6))))) (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (Module.toMulActionWithZero.{u1, u3} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_7)))))] [_inst_11 : IsScalarTower.{u1, u2, u4} R S B (SMulZeroClass.toHasSmul.{u1, u2} R S (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} S (AddMonoid.toAddZeroClass.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))))) (Module.toMulActionWithZero.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5))))) (SMulZeroClass.toHasSmul.{u2, u4} S B (AddZeroClass.toHasZero.{u4} B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))))) (SMulWithZero.toSmulZeroClass.{u2, u4} S B (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))))) (AddZeroClass.toHasZero.{u4} B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))))) (MulActionWithZero.toSMulWithZero.{u2, u4} S B (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (AddZeroClass.toHasZero.{u4} B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))))) (Module.toMulActionWithZero.{u2, u4} S B (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Algebra.toModule.{u2, u4} S B _inst_2 _inst_4 _inst_8))))) (SMulZeroClass.toHasSmul.{u1, u4} R B (AddZeroClass.toHasZero.{u4} B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))))) (SMulWithZero.toSmulZeroClass.{u1, u4} R B (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))))) (AddZeroClass.toHasZero.{u4} B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))))) (MulActionWithZero.toSMulWithZero.{u1, u4} R B (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u4} B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))))) (Module.toMulActionWithZero.{u1, u4} R B (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Algebra.toModule.{u1, u4} R B _inst_1 _inst_4 _inst_9)))))] (U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6), (AlgHom.{u2, u3, u4} S (coeSort.{succ u3, succ (succ u3)} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) Type.{u3} (SetLike.hasCoeToSort.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.setLike.{u2, u3} S A _inst_2 _inst_3 _inst_6)) U) B _inst_2 (Subalgebra.toSemiring.{u2, u3} S A _inst_2 _inst_3 _inst_6 U) _inst_4 (Subalgebra.algebra.{u2, u3} S A _inst_2 _inst_3 _inst_6 U) _inst_8) -> (AlgHom.{u1, u3, u4} R (coeSort.{succ u3, succ (succ u3)} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) Type.{u3} (SetLike.hasCoeToSort.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_7)) (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) B _inst_1 (Subalgebra.toSemiring.{u1, u3} R A _inst_1 _inst_3 _inst_7 (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) _inst_4 (Subalgebra.algebra.{u1, u3} R A _inst_1 _inst_3 _inst_7 (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) _inst_9)
but is expected to have type
  forall (R : Type.{u1}) {S : Type.{u2}} {A : Type.{u3}} {B : Type.{u4}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : CommSemiring.{u2} S] [_inst_3 : Semiring.{u3} A] [_inst_4 : Semiring.{u4} B] [_inst_5 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2)] [_inst_6 : Algebra.{u2, u3} S A _inst_2 _inst_3] [_inst_7 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_inst_8 : Algebra.{u2, u4} S B _inst_2 _inst_4] [_inst_9 : Algebra.{u1, u4} R B _inst_1 _inst_4] [_inst_10 : IsScalarTower.{u1, u2, u3} R S A (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) (Algebra.toSMul.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toSMul.{u1, u3} R A _inst_1 _inst_3 _inst_7)] [_inst_11 : IsScalarTower.{u1, u2, u4} R S B (Algebra.toSMul.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) (Algebra.toSMul.{u2, u4} S B _inst_2 _inst_4 _inst_8) (Algebra.toSMul.{u1, u4} R B _inst_1 _inst_4 _inst_9)] (U : Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6), (AlgHom.{u2, u3, u4} S (Subtype.{succ u3} A (fun (x : A) => Membership.mem.{u3, u3} A (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) (SetLike.instMembership.{u3, u3} (Subalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6) A (Subalgebra.instSetLikeSubalgebra.{u2, u3} S A _inst_2 _inst_3 _inst_6)) x U)) B _inst_2 (Subalgebra.toSemiring.{u2, u3} S A _inst_2 _inst_3 _inst_6 U) _inst_4 (Subalgebra.instAlgebraSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebraToSemiring.{u2, u3} S A _inst_2 _inst_3 _inst_6 U) _inst_8) -> (AlgHom.{u1, u3, u4} R (Subtype.{succ u3} A (fun (x : A) => Membership.mem.{u3, u3} A (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) (SetLike.instMembership.{u3, u3} (Subalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7) A (Subalgebra.instSetLikeSubalgebra.{u1, u3} R A _inst_1 _inst_3 _inst_7)) x (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U))) B _inst_1 (Subalgebra.toSemiring.{u1, u3} R A _inst_1 _inst_3 _inst_7 (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) _inst_4 (Subalgebra.instAlgebraSubtypeMemSubalgebraInstMembershipInstSetLikeSubalgebraToSemiring.{u1, u3} R A _inst_1 _inst_3 _inst_7 (Subalgebra.restrictScalars.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_7 _inst_10 U)) _inst_9)
Case conversion may be inaccurate. Consider using '#align subalgebra.of_restrict_scalars Subalgebra.ofRestrictScalarsₓ'. -/
/-- Produces an `R`-algebra map from `U.restrict_scalars R` given an `S`-algebra map from `U`.

This is a special case of `alg_hom.restrict_scalars` that can be helpful in elaboration. -/
@[simp]
def ofRestrictScalars (U : Subalgebra S A) (f : U →ₐ[S] B) : U.restrictScalars R →ₐ[R] B :=
  f.restrictScalars R
#align subalgebra.of_restrict_scalars Subalgebra.ofRestrictScalars

end Semiring

end Subalgebra

namespace IsScalarTower

open Subalgebra

variable [CommSemiring R] [CommSemiring S] [CommSemiring A]

variable [Algebra R S] [Algebra S A] [Algebra R A] [IsScalarTower R S A]

#print IsScalarTower.adjoin_range_toAlgHom /-
theorem adjoin_range_toAlgHom (t : Set A) :
    (Algebra.adjoin (toAlgHom R S A).range t).restrictScalars R =
      (Algebra.adjoin S t).restrictScalars R :=
  Subalgebra.ext fun z =>
    show
      z ∈ Subsemiring.closure (Set.range (algebraMap (toAlgHom R S A).range A) ∪ t : Set A) ↔
        z ∈ Subsemiring.closure (Set.range (algebraMap S A) ∪ t : Set A)
      by
      suffices Set.range (algebraMap (toAlgHom R S A).range A) = Set.range (algebraMap S A) by
        rw [this]
      ext z
      exact ⟨fun ⟨⟨x, y, h1⟩, h2⟩ => ⟨y, h2 ▸ h1⟩, fun ⟨y, hy⟩ => ⟨⟨z, y, hy⟩, rfl⟩⟩
#align is_scalar_tower.adjoin_range_to_alg_hom IsScalarTower.adjoin_range_toAlgHom
-/

end IsScalarTower