/-
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.tower
! leanprover-community/mathlib commit 832f7b9162039c28b9361289c8681f155cae758f
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Algebra.Algebra.Equiv
import Mathbin.LinearAlgebra.Span

/-!
# 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 basic facts about 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)`.

An important definition is `to_alg_hom R S A`, the canonical `R`-algebra homomorphism `S →ₐ[R] A`.

-/

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}

/- warning: algebra.lsmul -> Algebra.lsmul is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) {A : Type.{u2}} (M : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (SMulZeroClass.toHasSmul.{u1, u2} R A (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} 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.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (SMulZeroClass.toHasSmul.{u2, u3} A M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (MulZeroOneClass.toMulZeroClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toHasSmul.{u1, u3} R M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u1, u3} R M (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} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))], AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 _inst_4 _inst_5)
but is expected to have type
  forall (R : Type.{u1}) {A : Type.{u2}} (M : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (Algebra.toSMul.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SMulZeroClass.toSMul.{u2, u3} A M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toSMul.{u1, u3} R M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} R M (CommMonoidWithZero.toZero.{u1} R (CommSemiring.toCommMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))], AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)
Case conversion may be inaccurate. Consider using '#align algebra.lsmul Algebra.lsmulₓ'. -/
/-- The `R`-algebra morphism `A → End (M)` corresponding to the representation of the algebra `A`
on the `R`-module `M`.

This is a stronger version of `distrib_mul_action.to_linear_map`, and could also have been
called `algebra.to_module_End`. -/
def lsmul : A →ₐ[R] Module.End R M
    where
  toFun := DistribMulAction.toLinearMap R M
  map_one' := LinearMap.ext fun _ => one_smul A _
  map_mul' a b := LinearMap.ext <| smul_assoc a b
  map_zero' := LinearMap.ext fun _ => zero_smul A _
  map_add' a b := LinearMap.ext fun _ => add_smul _ _ _
  commutes' r := LinearMap.ext <| algebraMap_smul A r
#align algebra.lsmul Algebra.lsmul

/- warning: algebra.lsmul_coe -> Algebra.lsmul_coe is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) {A : Type.{u2}} (M : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (SMulZeroClass.toHasSmul.{u1, u2} R A (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} 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.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (SMulZeroClass.toHasSmul.{u2, u3} A M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (MulZeroOneClass.toMulZeroClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toHasSmul.{u1, u3} R M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u1, u3} R M (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} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))] (a : A), Eq.{succ u3} ((fun (_x : LinearMap.{u1, u1, u3, u3} R R (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) M M _inst_4 _inst_4 _inst_5 _inst_5) => M -> M) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 _inst_4 _inst_5)) (fun (_x : AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 _inst_4 _inst_5)) => A -> (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)) ([anonymous].{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 _inst_4 _inst_5)) (Algebra.lsmul.{u1, u2, u3} R A M _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7) a)) (coeFn.{succ u3, succ u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (fun (_x : LinearMap.{u1, u1, u3, u3} R R (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) M M _inst_4 _inst_4 _inst_5 _inst_5) => M -> M) (LinearMap.hasCoeToFun.{u1, u1, u3, u3} R R M M (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_4 _inst_5 _inst_5 (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 _inst_4 _inst_5)) (fun (_x : AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 _inst_4 _inst_5)) => A -> (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)) ([anonymous].{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 _inst_4 _inst_5)) (Algebra.lsmul.{u1, u2, u3} R A M _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7) a)) (SMul.smul.{u2, u3} A M (SMulZeroClass.toHasSmul.{u2, u3} A M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (MulZeroOneClass.toMulZeroClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) a)
but is expected to have type
  forall (R : Type.{u1}) {A : Type.{u2}} (M : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (Algebra.toSMul.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SMulZeroClass.toSMul.{u2, u3} A M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toSMul.{u1, u3} R M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} R M (CommMonoidWithZero.toZero.{u1} R (CommSemiring.toCommMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))] (a : A), Eq.{succ u3} (forall (a : M), (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : M) => M) a) (FunLike.coe.{succ u3, succ u3, succ u3} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) a) M (fun (_x : M) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : M) => M) _x) (LinearMap.instFunLikeLinearMap.{u1, u1, u3, u3} R R M M (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_4 _inst_5 _inst_5 (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (FunLike.coe.{max (succ u3) (succ u2), succ u2, succ u3} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _x) (SMulHomClass.toFunLike.{max u3 u2, u1, u2, u3} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)) R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (SMulZeroClass.toSMul.{u1, u2} R A (AddMonoid.toZero.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))))) (DistribSMul.toSMulZeroClass.{u1, u2} R A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))))) (DistribMulAction.toDistribSMul.{u1, u2} R A (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))) (Module.toDistribMulAction.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (SMulZeroClass.toSMul.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (AddMonoid.toZero.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)))))) (DistribSMul.toSMulZeroClass.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (AddMonoid.toAddZeroClass.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)))))) (DistribMulAction.toDistribSMul.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))) (Module.toDistribMulAction.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)))) (Algebra.toModule.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)))))) (DistribMulActionHomClass.toSMulHomClass.{max u3 u2, u1, u2, u3} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)) R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))) (Module.toDistribMulAction.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Module.toDistribMulAction.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)))) (Algebra.toModule.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5))) (SemilinearMapClass.distribMulActionHomClass.{u1, u2, u3, max u3 u2} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.toModule.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)) (AlgHomClass.linearMapClass.{u1, u2, u3, max u3 u2} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5) (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)) (AlgHom.algHomClass.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 _inst_4 _inst_5)))))) (Algebra.lsmul.{u1, u2, u3} R A M _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7) a)) ((fun (x._@.Mathlib.Algebra.Algebra.Tower._hyg.253 : A) (x._@.Mathlib.Algebra.Algebra.Tower._hyg.255 : M) => HSMul.hSMul.{u2, u3, u3} A M M (instHSMul.{u2, u3} A M (SMulZeroClass.toSMul.{u2, u3} A M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6))))) x._@.Mathlib.Algebra.Algebra.Tower._hyg.253 x._@.Mathlib.Algebra.Algebra.Tower._hyg.255) a)
Case conversion may be inaccurate. Consider using '#align algebra.lsmul_coe Algebra.lsmul_coeₓ'. -/
@[simp]
theorem lsmul_coe (a : A) : (lsmul R M a : M → M) = (· • ·) a :=
  rfl
#align algebra.lsmul_coe Algebra.lsmul_coe

end Algebra

namespace IsScalarTower

section Module

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

variable [SMul R M] [MulAction A M] [IsScalarTower R A M]

variable {R} (A) {M}

/- warning: is_scalar_tower.algebra_map_smul -> IsScalarTower.algebraMap_smul is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} (A : Type.{u2}) {M : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : SMul.{u1, u3} R M] [_inst_5 : MulAction.{u2, u3} A M (MonoidWithZero.toMonoid.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2))] [_inst_6 : IsScalarTower.{u1, u2, u3} R A M (SMulZeroClass.toHasSmul.{u1, u2} R A (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} 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.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (MulAction.toHasSmul.{u2, u3} A M (MonoidWithZero.toMonoid.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) _inst_5) _inst_4] (r : R) (x : M), Eq.{succ u3} M (SMul.smul.{u2, u3} A M (MulAction.toHasSmul.{u2, u3} A M (MonoidWithZero.toMonoid.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) _inst_5) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (fun (_x : RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) => R -> A) (RingHom.hasCoeToFun.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (algebraMap.{u1, u2} R A _inst_1 _inst_2 _inst_3) r) x) (SMul.smul.{u1, u3} R M _inst_4 r x)
but is expected to have type
  forall {R : Type.{u1}} (A : Type.{u2}) {M : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : SMul.{u1, u3} R M] [_inst_5 : MulAction.{u2, u3} A M (MonoidWithZero.toMonoid.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2))] [_inst_6 : IsScalarTower.{u1, u2, u3} R A M (Algebra.toSMul.{u1, u2} R A _inst_1 _inst_2 _inst_3) (MulAction.toSMul.{u2, u3} A M (MonoidWithZero.toMonoid.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) _inst_5) _inst_4] (r : R) (x : M), Eq.{succ u3} M (HSMul.hSMul.{u2, u3, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) r) M M (instHSMul.{u2, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) r) M (MulAction.toSMul.{u2, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) r) M (MonoidWithZero.toMonoid.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) r) (Semiring.toMonoidWithZero.{u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) r) _inst_2)) _inst_5)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2))))) (algebraMap.{u1, u2} R A _inst_1 _inst_2 _inst_3) r) x) (HSMul.hSMul.{u1, u3, u3} R M M (instHSMul.{u1, u3} R M _inst_4) r x)
Case conversion may be inaccurate. Consider using '#align is_scalar_tower.algebra_map_smul IsScalarTower.algebraMap_smulₓ'. -/
theorem algebraMap_smul (r : R) (x : M) : algebraMap R A r • x = r • x := by
  rw [Algebra.algebraMap_eq_smul_one, smul_assoc, one_smul]
#align is_scalar_tower.algebra_map_smul IsScalarTower.algebraMap_smul

end Module

section Semiring

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

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

variable {R S A}

/- warning: is_scalar_tower.of_algebra_map_eq -> IsScalarTower.of_algebraMap_eq 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_8 : Algebra.{u1, u3} R A _inst_1 _inst_3], (forall (x : R), Eq.{succ u3} A (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (fun (_x : RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) => R -> A) (RingHom.hasCoeToFun.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (algebraMap.{u1, u3} R A _inst_1 _inst_3 _inst_8) x) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (fun (_x : RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) => S -> A) (RingHom.hasCoeToFun.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (algebraMap.{u2, u3} S A _inst_2 _inst_3 _inst_6) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (fun (_x : RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) => R -> S) (RingHom.hasCoeToFun.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (algebraMap.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) x))) -> (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_8))))))
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_8 : Algebra.{u1, u3} R A _inst_1 _inst_3], (forall (x : R), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) x) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R A (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (RingHom.instRingHomClassRingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (algebraMap.{u1, u3} R A _inst_1 _inst_3 _inst_8) x) (FunLike.coe.{max (succ u2) (succ u3), succ u2, succ u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S (fun (_x : S) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : S) => A) _x) (MulHomClass.toFunLike.{max u2 u3, u2, u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S A (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u3, u2, u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u3, u2, u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (RingHom.instRingHomClassRingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (algebraMap.{u2, u3} S A _inst_2 _inst_3 _inst_6) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => S) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R S (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))))) (algebraMap.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) x))) -> (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_8))
Case conversion may be inaccurate. Consider using '#align is_scalar_tower.of_algebra_map_eq IsScalarTower.of_algebraMap_eqₓ'. -/
theorem of_algebraMap_eq [Algebra R A]
    (h : ∀ x, algebraMap R A x = algebraMap S A (algebraMap R S x)) : IsScalarTower R S A :=
  ⟨fun x y z => by simp_rw [Algebra.smul_def, RingHom.map_mul, mul_assoc, h]⟩
#align is_scalar_tower.of_algebra_map_eq IsScalarTower.of_algebraMap_eq

#print IsScalarTower.of_algebraMap_eq' /-
/-- See note [partially-applied ext lemmas]. -/
theorem of_algebraMap_eq' [Algebra R A]
    (h : algebraMap R A = (algebraMap S A).comp (algebraMap R S)) : IsScalarTower R S A :=
  of_algebraMap_eq <| RingHom.ext_iff.1 h
#align is_scalar_tower.of_algebra_map_eq' IsScalarTower.of_algebraMap_eq'
-/

variable (R S A)

variable [Algebra R A] [Algebra R B]

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

#print IsScalarTower.algebraMap_eq /-
theorem algebraMap_eq : algebraMap R A = (algebraMap S A).comp (algebraMap R S) :=
  RingHom.ext fun x => by
    simp_rw [RingHom.comp_apply, Algebra.algebraMap_eq_smul_one, smul_assoc, one_smul]
#align is_scalar_tower.algebra_map_eq IsScalarTower.algebraMap_eq
-/

/- warning: is_scalar_tower.algebra_map_apply -> IsScalarTower.algebraMap_apply 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_8 : 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_8)))))] (x : R), Eq.{succ u3} A (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (fun (_x : RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) => R -> A) (RingHom.hasCoeToFun.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (algebraMap.{u1, u3} R A _inst_1 _inst_3 _inst_8) x) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (fun (_x : RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) => S -> A) (RingHom.hasCoeToFun.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (algebraMap.{u2, u3} S A _inst_2 _inst_3 _inst_6) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (fun (_x : RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) => R -> S) (RingHom.hasCoeToFun.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (algebraMap.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) x))
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_8 : 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_8)] (x : R), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) x) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R A (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (RingHom.instRingHomClassRingHom.{u1, u3} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (algebraMap.{u1, u3} R A _inst_1 _inst_3 _inst_8) x) (FunLike.coe.{max (succ u2) (succ u3), succ u2, succ u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S (fun (_x : S) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : S) => A) _x) (MulHomClass.toFunLike.{max u2 u3, u2, u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S A (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u3, u2, u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u3, u2, u3} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (RingHom.instRingHomClassRingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (algebraMap.{u2, u3} S A _inst_2 _inst_3 _inst_6) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => S) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R S (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)))))) (algebraMap.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_5) x))
Case conversion may be inaccurate. Consider using '#align is_scalar_tower.algebra_map_apply IsScalarTower.algebraMap_applyₓ'. -/
theorem algebraMap_apply (x : R) : algebraMap R A x = algebraMap S A (algebraMap R S x) := by
  rw [algebra_map_eq R S A, RingHom.comp_apply]
#align is_scalar_tower.algebra_map_apply IsScalarTower.algebraMap_apply

#print IsScalarTower.Algebra.ext /-
@[ext]
theorem Algebra.ext {S : Type u} {A : Type v} [CommSemiring S] [Semiring A] (h1 h2 : Algebra S A)
    (h :
      ∀ (r : S) (x : A),
        (haveI := h1
          r • x) =
          r • x) :
    h1 = h2 :=
  Algebra.algebra_ext _ _ fun r => by
    simpa only [@Algebra.smul_def _ _ _ _ h1, @Algebra.smul_def _ _ _ _ h2, mul_one] using h r 1
#align is_scalar_tower.algebra.ext IsScalarTower.Algebra.ext
-/

#print IsScalarTower.toAlgHom /-
/-- In a tower, the canonical map from the middle element to the top element is an
algebra homomorphism over the bottom element. -/
def toAlgHom : S →ₐ[R] A :=
  { algebraMap S A with commutes' := fun _ => (algebraMap_apply _ _ _ _).symm }
#align is_scalar_tower.to_alg_hom IsScalarTower.toAlgHom
-/

#print IsScalarTower.toAlgHom_apply /-
theorem toAlgHom_apply (y : S) : toAlgHom R S A y = algebraMap S A y :=
  rfl
#align is_scalar_tower.to_alg_hom_apply IsScalarTower.toAlgHom_apply
-/

/- warning: is_scalar_tower.coe_to_alg_hom -> IsScalarTower.coe_toAlgHom 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_8 : 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_8)))))], Eq.{max (succ u2) (succ u3)} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) ((fun (a : Sort.{max (succ u2) (succ u3)}) (b : Sort.{max (succ u2) (succ u3)}) [self : HasLiftT.{max (succ u2) (succ u3), max (succ u2) (succ u3)} a b] => self.0) (AlgHom.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8) (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (HasLiftT.mk.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8) (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (CoeTCₓ.coe.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8) (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (RingHom.hasCoeT.{max u2 u3, u2, u3} (AlgHom.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8) S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max u2 u3, u1, u2, u3} (AlgHom.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8) R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8 (AlgHom.algHomClass.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8))))) (IsScalarTower.toAlgHom.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_8 _inst_10)) (algebraMap.{u2, u3} S A _inst_2 _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_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_8 : 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_8)], Eq.{max (succ u2) (succ u3)} (RingHom.{u2, u3} S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (RingHomClass.toRingHom.{max u2 u3, u2, u3} (AlgHom.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8) S A (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max u2 u3, u1, u2, u3} (AlgHom.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8) R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8 (AlgHom.algHomClass.{u1, u2, u3} R S A _inst_1 (CommSemiring.toSemiring.{u2} S _inst_2) _inst_3 _inst_5 _inst_8)) (IsScalarTower.toAlgHom.{u1, u2, u3} R S A _inst_1 _inst_2 _inst_3 _inst_5 _inst_6 _inst_8 _inst_10)) (algebraMap.{u2, u3} S A _inst_2 _inst_3 _inst_6)
Case conversion may be inaccurate. Consider using '#align is_scalar_tower.coe_to_alg_hom IsScalarTower.coe_toAlgHomₓ'. -/
@[simp]
theorem coe_toAlgHom : ↑(toAlgHom R S A) = algebraMap S A :=
  RingHom.ext fun _ => rfl
#align is_scalar_tower.coe_to_alg_hom IsScalarTower.coe_toAlgHom

#print IsScalarTower.coe_to_alg_hom' /-
@[simp]
theorem coe_to_alg_hom' : (toAlgHom R S A : S → A) = algebraMap S A :=
  rfl
#align is_scalar_tower.coe_to_alg_hom' IsScalarTower.coe_to_alg_hom'
-/

variable {R S A B}

#print IsScalarTower.AlgHom.map_algebraMap /-
@[simp]
theorem IsScalarTower.AlgHom.map_algebraMap (f : A →ₐ[S] B) (r : R) :
    f (algebraMap R A r) = algebraMap R B r := by
  rw [algebra_map_apply R S A r, f.commutes, ← algebra_map_apply R S B]
#align alg_hom.map_algebra_map IsScalarTower.AlgHom.map_algebraMap
-/

variable (R)

/- warning: alg_hom.comp_algebra_map_of_tower -> IsScalarTower.AlgHom.comp_algebraMap_of_tower 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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)))))] [_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_7))))) (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)))))] (f : AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u1) (succ u4)} (RingHom.{u1, u4} R B (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (RingHom.comp.{u1, u3, u4} R A B (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) ((fun (a : Sort.{max (succ u3) (succ u4)}) (b : Sort.{max (succ u3) (succ u4)}) [self : HasLiftT.{max (succ u3) (succ u4), max (succ u3) (succ u4)} a b] => self.0) (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (HasLiftT.mk.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (CoeTCₓ.coe.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (RingHom.hasCoeT.{max u3 u4, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) (AlgHomClass.toRingHomClass.{max u3 u4, u2, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgHom.algHomClass.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7))))) f) (algebraMap.{u1, u3} R A _inst_1 _inst_3 _inst_8)) (algebraMap.{u1, u4} R B _inst_1 _inst_4 _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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)] [_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_7) (Algebra.toSMul.{u1, u4} R B _inst_1 _inst_4 _inst_9)] (f : AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u1) (succ u4)} (RingHom.{u1, u4} R B (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (RingHom.comp.{u1, u3, u4} R A B (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) (RingHomClass.toRingHom.{max u4 u3, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) (AlgHomClass.toRingHomClass.{max u4 u3, u2, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgHom.algHomClass.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7)) f) (algebraMap.{u1, u3} R A _inst_1 _inst_3 _inst_8)) (algebraMap.{u1, u4} R B _inst_1 _inst_4 _inst_9)
Case conversion may be inaccurate. Consider using '#align alg_hom.comp_algebra_map_of_tower IsScalarTower.AlgHom.comp_algebraMap_of_towerₓ'. -/
@[simp]
theorem IsScalarTower.AlgHom.comp_algebraMap_of_tower (f : A →ₐ[S] B) :
    (f : A →+* B).comp (algebraMap R A) = algebraMap R B :=
  RingHom.ext f.map_algebraMap
#align alg_hom.comp_algebra_map_of_tower IsScalarTower.AlgHom.comp_algebraMap_of_tower

variable (R) {S A B}

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

#print IsScalarTower.of_ring_hom /-
@[nolint instance_priority]
instance of_ring_hom {R A B : Type _} [CommSemiring R] [CommSemiring A] [CommSemiring B]
    [Algebra R A] [Algebra R B] (f : A →ₐ[R] B) :
    @IsScalarTower R A B _ f.toRingHom.toAlgebra.toSMul _ :=
  letI := (f : A →+* B).toAlgebra
  of_algebra_map_eq fun x => (f.commutes x).symm
#align is_scalar_tower.of_ring_hom IsScalarTower.of_ring_hom
-/

end Semiring

end IsScalarTower

section Homs

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

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

variable [Algebra R A] [Algebra R B]

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

variable (R) {A S B}

open IsScalarTower

namespace AlgHom

#print AlgHom.restrictScalars /-
/-- R ⟶ S induces S-Alg ⥤ R-Alg -/
def restrictScalars (f : A →ₐ[S] B) : A →ₐ[R] B :=
  { (f : A →+* B) with
    commutes' := fun r =>
      by
      rw [algebra_map_apply R S A, algebra_map_apply R S B]
      exact f.commutes (algebraMap R S r) }
#align alg_hom.restrict_scalars AlgHom.restrictScalars
-/

#print AlgHom.restrictScalars_apply /-
theorem restrictScalars_apply (f : A →ₐ[S] B) (x : A) : f.restrictScalars R x = f x :=
  rfl
#align alg_hom.restrict_scalars_apply AlgHom.restrictScalars_apply
-/

/- warning: alg_hom.coe_restrict_scalars -> AlgHom.coe_restrictScalars 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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)))))] [_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_7))))) (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)))))] (f : AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u3) (succ u4)} (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) ((fun (a : Sort.{max (succ u3) (succ u4)}) (b : Sort.{max (succ u3) (succ u4)}) [self : HasLiftT.{max (succ u3) (succ u4), max (succ u3) (succ u4)} a b] => self.0) (AlgHom.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (HasLiftT.mk.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (CoeTCₓ.coe.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (RingHom.hasCoeT.{max u3 u4, u3, u4} (AlgHom.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) (AlgHomClass.toRingHomClass.{max u3 u4, u1, u3, u4} (AlgHom.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgHom.algHomClass.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9))))) (AlgHom.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f)) ((fun (a : Sort.{max (succ u3) (succ u4)}) (b : Sort.{max (succ u3) (succ u4)}) [self : HasLiftT.{max (succ u3) (succ u4), max (succ u3) (succ u4)} a b] => self.0) (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (HasLiftT.mk.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (CoeTCₓ.coe.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (RingHom.hasCoeT.{max u3 u4, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) (AlgHomClass.toRingHomClass.{max u3 u4, u2, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgHom.algHomClass.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7))))) f)
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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)] [_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_7) (Algebra.toSMul.{u1, u4} R B _inst_1 _inst_4 _inst_9)] (f : AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u4) (succ u3)} (RingHom.{u3, u4} A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4)) (RingHomClass.toRingHom.{max u4 u3, u3, u4} (AlgHom.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) (AlgHomClass.toRingHomClass.{max u4 u3, u1, u3, u4} (AlgHom.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgHom.algHomClass.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9)) (AlgHom.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f)) (RingHomClass.toRingHom.{max u4 u3, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A B (Semiring.toNonAssocSemiring.{u3} A _inst_3) (Semiring.toNonAssocSemiring.{u4} B _inst_4) (AlgHomClass.toRingHomClass.{max u4 u3, u2, u3, u4} (AlgHom.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgHom.algHomClass.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7)) f)
Case conversion may be inaccurate. Consider using '#align alg_hom.coe_restrict_scalars AlgHom.coe_restrictScalarsₓ'. -/
@[simp]
theorem coe_restrictScalars (f : A →ₐ[S] B) : (f.restrictScalars R : A →+* B) = f :=
  rfl
#align alg_hom.coe_restrict_scalars AlgHom.coe_restrictScalars

#print AlgHom.coe_restrict_scalars' /-
@[simp]
theorem coe_restrict_scalars' (f : A →ₐ[S] B) : (restrictScalars R f : A → B) = f :=
  rfl
#align alg_hom.coe_restrict_scalars' AlgHom.coe_restrict_scalars'
-/

#print AlgHom.restrictScalars_injective /-
theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : (A →ₐ[S] B) → A →ₐ[R] B) := fun f g h =>
  AlgHom.ext (AlgHom.congr_fun h : _)
#align alg_hom.restrict_scalars_injective AlgHom.restrictScalars_injective
-/

end AlgHom

namespace AlgEquiv

#print AlgEquiv.restrictScalars /-
/-- R ⟶ S induces S-Alg ⥤ R-Alg -/
def restrictScalars (f : A ≃ₐ[S] B) : A ≃ₐ[R] B :=
  { (f : A ≃+* B) with
    commutes' := fun r =>
      by
      rw [algebra_map_apply R S A, algebra_map_apply R S B]
      exact f.commutes (algebraMap R S r) }
#align alg_equiv.restrict_scalars AlgEquiv.restrictScalars
-/

/- warning: alg_equiv.restrict_scalars_apply -> AlgEquiv.restrictScalars_apply 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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)))))] [_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_7))))) (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)))))] (f : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (x : A), Eq.{succ u4} B (coeFn.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (fun (_x : AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) => A -> B) (AlgEquiv.hasCoeToFun.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (AlgEquiv.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f) x) (coeFn.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (fun (_x : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) => A -> B) (AlgEquiv.hasCoeToFun.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) f x)
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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)] [_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_7) (Algebra.toSMul.{u1, u4} R B _inst_1 _inst_4 _inst_9)] (f : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (x : A), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) (FunLike.coe.{max (succ u4) (succ u3), succ u3, succ u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) _x) (SMulHomClass.toFunLike.{max u4 u3, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u1, u3} R A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u1, u3} R A (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{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_8))))) (SMulZeroClass.toSMul.{u1, u4} R B (AddMonoid.toZero.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribSMul.toSMulZeroClass.{u1, u4} R B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribMulAction.toDistribSMul.{u1, u4} R B (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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))))) (DistribMulActionHomClass.toSMulHomClass.{max u4 u3, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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_8)) (Module.toDistribMulAction.{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)) (SemilinearMapClass.distribMulActionHomClass.{u1, u3, u4, max u4 u3} R A B (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_8) (Algebra.toModule.{u1, u4} R B _inst_1 _inst_4 _inst_9) (AlgHomClass.linearMapClass.{u1, u3, u4, max u4 u3} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (AlgEquivClass.toAlgHomClass.{max u4 u3, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgEquiv.instAlgEquivClassAlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9)))))) (AlgEquiv.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f) x) (FunLike.coe.{max (succ u4) (succ u3), succ u3, succ u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) _x) (SMulHomClass.toFunLike.{max u4 u3, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u2, u3} S A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u2, u3} S A (MonoidWithZero.toMonoid.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{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.toSMul.{u2, u4} S B (AddMonoid.toZero.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribSMul.toSMulZeroClass.{u2, u4} S B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribMulAction.toDistribSMul.{u2, u4} S B (MonoidWithZero.toMonoid.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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_7))))) (DistribMulActionHomClass.toSMulHomClass.{max u4 u3, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B (MonoidWithZero.toMonoid.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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)) (Module.toDistribMulAction.{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_7)) (SemilinearMapClass.distribMulActionHomClass.{u2, u3, u4, max u4 u3} S A B (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toModule.{u2, u4} S B _inst_2 _inst_4 _inst_7) (AlgHomClass.linearMapClass.{u2, u3, u4, max u4 u3} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (AlgEquivClass.toAlgHomClass.{max u4 u3, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgEquiv.instAlgEquivClassAlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7)))))) f x)
Case conversion may be inaccurate. Consider using '#align alg_equiv.restrict_scalars_apply AlgEquiv.restrictScalars_applyₓ'. -/
theorem restrictScalars_apply (f : A ≃ₐ[S] B) (x : A) : f.restrictScalars R x = f x :=
  rfl
#align alg_equiv.restrict_scalars_apply AlgEquiv.restrictScalars_apply

/- warning: alg_equiv.coe_restrict_scalars -> AlgEquiv.coe_restrictScalars 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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)))))] [_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_7))))) (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)))))] (f : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u3) (succ u4)} (RingEquiv.{u3, u4} A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) ((fun (a : Sort.{max (succ u3) (succ u4)}) (b : Sort.{max (succ u3) (succ u4)}) [self : HasLiftT.{max (succ u3) (succ u4), max (succ u3) (succ u4)} a b] => self.0) (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (RingEquiv.{u3, u4} A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (HasLiftT.mk.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (RingEquiv.{u3, u4} A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (CoeTCₓ.coe.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (RingEquiv.{u3, u4} A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (RingEquiv.hasCoeT.{max u3 u4, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (AlgEquivClass.toRingEquivClass.{max u3 u4, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgEquiv.algEquivClass.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9))))) (AlgEquiv.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f)) ((fun (a : Sort.{max (succ u3) (succ u4)}) (b : Sort.{max (succ u3) (succ u4)}) [self : HasLiftT.{max (succ u3) (succ u4), max (succ u3) (succ u4)} a b] => self.0) (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingEquiv.{u3, u4} A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (HasLiftT.mk.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingEquiv.{u3, u4} A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (CoeTCₓ.coe.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (RingEquiv.{u3, u4} A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (RingEquiv.hasCoeT.{max u3 u4, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A B (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Distrib.toHasAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (AlgEquivClass.toRingEquivClass.{max u3 u4, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgEquiv.algEquivClass.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7))))) f)
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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)] [_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_7) (Algebra.toSMul.{u1, u4} R B _inst_1 _inst_4 _inst_9)] (f : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u4) (succ u3)} (RingEquiv.{u3, u4} A B (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalNonAssocSemiring.toMul.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Distrib.toAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Distrib.toAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (RingEquivClass.toRingEquiv.{max u4 u3, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) A B (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Distrib.toAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (NonUnitalNonAssocSemiring.toMul.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Distrib.toAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (AlgEquivClass.toRingEquivClass.{max u4 u3, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgEquiv.instAlgEquivClassAlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9)) (AlgEquiv.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f)) (RingEquivClass.toRingEquiv.{max u4 u3, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A B (NonUnitalNonAssocSemiring.toMul.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Distrib.toAdd.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (NonUnitalNonAssocSemiring.toMul.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Distrib.toAdd.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (AlgEquivClass.toRingEquivClass.{max u4 u3, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgEquiv.instAlgEquivClassAlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7)) f)
Case conversion may be inaccurate. Consider using '#align alg_equiv.coe_restrict_scalars AlgEquiv.coe_restrictScalarsₓ'. -/
@[simp]
theorem coe_restrictScalars (f : A ≃ₐ[S] B) : (f.restrictScalars R : A ≃+* B) = f :=
  rfl
#align alg_equiv.coe_restrict_scalars AlgEquiv.coe_restrictScalars

/- warning: alg_equiv.coe_restrict_scalars' -> AlgEquiv.coe_restrict_scalars' 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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)))))] [_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_7))))) (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)))))] (f : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u3) (succ u4)} ((fun (_x : AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) => A -> B) (AlgEquiv.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f)) (coeFn.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (fun (_x : AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) => A -> B) (AlgEquiv.hasCoeToFun.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (AlgEquiv.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f)) (coeFn.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (fun (_x : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) => A -> B) (AlgEquiv.hasCoeToFun.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) f)
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.{u2, u4} S B _inst_2 _inst_4] [_inst_8 : Algebra.{u1, u3} R A _inst_1 _inst_3] [_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_8)] [_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_7) (Algebra.toSMul.{u1, u4} R B _inst_1 _inst_4 _inst_9)] (f : AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7), Eq.{max (succ u4) (succ u3)} (forall (a : A), (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) a) (FunLike.coe.{max (succ u4) (succ u3), succ u3, succ u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) _x) (SMulHomClass.toFunLike.{max u4 u3, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u1, u3} R A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u1, u3} R A (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{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_8))))) (SMulZeroClass.toSMul.{u1, u4} R B (AddMonoid.toZero.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribSMul.toSMulZeroClass.{u1, u4} R B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribMulAction.toDistribSMul.{u1, u4} R B (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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))))) (DistribMulActionHomClass.toSMulHomClass.{max u4 u3, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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_8)) (Module.toDistribMulAction.{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)) (SemilinearMapClass.distribMulActionHomClass.{u1, u3, u4, max u4 u3} R A B (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Algebra.toModule.{u1, u3} R A _inst_1 _inst_3 _inst_8) (Algebra.toModule.{u1, u4} R B _inst_1 _inst_4 _inst_9) (AlgHomClass.linearMapClass.{u1, u3, u4, max u4 u3} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) (AlgEquivClass.toAlgHomClass.{max u4 u3, u1, u3, u4} (AlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9) R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9 (AlgEquiv.instAlgEquivClassAlgEquiv.{u1, u3, u4} R A B _inst_1 _inst_3 _inst_4 _inst_8 _inst_9)))))) (AlgEquiv.restrictScalars.{u1, u2, u3, u4} R S A B _inst_1 _inst_2 _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 _inst_11 f)) (FunLike.coe.{max (succ u4) (succ u3), succ u3, succ u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) _x) (SMulHomClass.toFunLike.{max u4 u3, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u2, u3} S A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u2, u3} S A (MonoidWithZero.toMonoid.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{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.toSMul.{u2, u4} S B (AddMonoid.toZero.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribSMul.toSMulZeroClass.{u2, u4} S B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))))) (DistribMulAction.toDistribSMul.{u2, u4} S B (MonoidWithZero.toMonoid.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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_7))))) (DistribMulActionHomClass.toSMulHomClass.{max u4 u3, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B (MonoidWithZero.toMonoid.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_2))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4)))) (Module.toDistribMulAction.{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)) (Module.toDistribMulAction.{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_7)) (SemilinearMapClass.distribMulActionHomClass.{u2, u3, u4, max u4 u3} S A B (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (CommSemiring.toSemiring.{u2} S _inst_2) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_4))) (Algebra.toModule.{u2, u3} S A _inst_2 _inst_3 _inst_6) (Algebra.toModule.{u2, u4} S B _inst_2 _inst_4 _inst_7) (AlgHomClass.linearMapClass.{u2, u3, u4, max u4 u3} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) (AlgEquivClass.toAlgHomClass.{max u4 u3, u2, u3, u4} (AlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7) S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7 (AlgEquiv.instAlgEquivClassAlgEquiv.{u2, u3, u4} S A B _inst_2 _inst_3 _inst_4 _inst_6 _inst_7)))))) f)
Case conversion may be inaccurate. Consider using '#align alg_equiv.coe_restrict_scalars' AlgEquiv.coe_restrict_scalars'ₓ'. -/
@[simp]
theorem coe_restrict_scalars' (f : A ≃ₐ[S] B) : (restrictScalars R f : A → B) = f :=
  rfl
#align alg_equiv.coe_restrict_scalars' AlgEquiv.coe_restrict_scalars'

#print AlgEquiv.restrictScalars_injective /-
theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : (A ≃ₐ[S] B) → A ≃ₐ[R] B) := fun f g h =>
  AlgEquiv.ext (AlgEquiv.congr_fun h : _)
#align alg_equiv.restrict_scalars_injective AlgEquiv.restrictScalars_injective
-/

end AlgEquiv

end Homs

namespace Submodule

variable (R A) {M}

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

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

/- warning: submodule.restrict_scalars_span -> Submodule.restrictScalars_span is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (A : Type.{u2}) {M : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (SMulZeroClass.toHasSmul.{u1, u2} R A (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} 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.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (SMulZeroClass.toHasSmul.{u2, u3} A M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (MulZeroOneClass.toMulZeroClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toHasSmul.{u1, u3} R M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u1, u3} R M (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} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))], (Function.Surjective.{succ u1, succ u2} R A (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (fun (_x : RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) => R -> A) (RingHom.hasCoeToFun.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (algebraMap.{u1, u2} R A _inst_1 _inst_2 _inst_3))) -> (forall (X : Set.{u3} M), Eq.{succ u3} (Submodule.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Submodule.restrictScalars.{u1, u2, u3} R A M _inst_2 _inst_4 (CommSemiring.toSemiring.{u1} R _inst_1) _inst_5 _inst_6 (SMulZeroClass.toHasSmul.{u1, u2} R A (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} 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.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) _inst_7 (Submodule.span.{u2, u3} A M _inst_2 _inst_4 _inst_6 X)) (Submodule.span.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5 X))
but is expected to have type
  forall (R : Type.{u1}) (A : Type.{u2}) {M : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (Algebra.toSMul.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SMulZeroClass.toSMul.{u2, u3} A M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toSMul.{u1, u3} R M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} R M (CommMonoidWithZero.toZero.{u1} R (CommSemiring.toCommMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))], (Function.Surjective.{succ u1, succ u2} R A (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2))))) (algebraMap.{u1, u2} R A _inst_1 _inst_2 _inst_3))) -> (forall (X : Set.{u3} M), Eq.{succ u3} (Submodule.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Submodule.restrictScalars.{u1, u2, u3} R A M _inst_2 _inst_4 (CommSemiring.toSemiring.{u1} R _inst_1) _inst_5 _inst_6 (Algebra.toSMul.{u1, u2} R A _inst_1 _inst_2 _inst_3) _inst_7 (Submodule.span.{u2, u3} A M _inst_2 _inst_4 _inst_6 X)) (Submodule.span.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5 X))
Case conversion may be inaccurate. Consider using '#align submodule.restrict_scalars_span Submodule.restrictScalars_spanₓ'. -/
/-- If `A` is an `R`-algebra such that the induced morphism `R →+* A` is surjective, then the
`R`-module generated by a set `X` equals the `A`-module generated by `X`. -/
theorem restrictScalars_span (hsur : Function.Surjective (algebraMap R A)) (X : Set M) :
    restrictScalars R (span A X) = span R X :=
  by
  refine' ((span_le_restrict_scalars R A X).antisymm fun m hm => _).symm
  refine' span_induction hm subset_span (zero_mem _) (fun _ _ => add_mem) fun a m hm => _
  obtain ⟨r, rfl⟩ := hsur a
  simpa [algebraMap_smul] using smul_mem _ r hm
#align submodule.restrict_scalars_span Submodule.restrictScalars_span

/- warning: submodule.coe_span_eq_span_of_surjective -> Submodule.coe_span_eq_span_of_surjective is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (A : Type.{u2}) {M : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (SMulZeroClass.toHasSmul.{u1, u2} R A (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} 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.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (SMulZeroClass.toHasSmul.{u2, u3} A M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (MulZeroOneClass.toMulZeroClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toHasSmul.{u1, u3} R M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (SMulWithZero.toSmulZeroClass.{u1, u3} R M (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} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4))) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))], (Function.Surjective.{succ u1, succ u2} R A (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (fun (_x : RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) => R -> A) (RingHom.hasCoeToFun.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (algebraMap.{u1, u2} R A _inst_1 _inst_2 _inst_3))) -> (forall (s : Set.{u3} M), Eq.{succ u3} (Set.{u3} M) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Submodule.{u2, u3} A M _inst_2 _inst_4 _inst_6) (Set.{u3} M) (HasLiftT.mk.{succ u3, succ u3} (Submodule.{u2, u3} A M _inst_2 _inst_4 _inst_6) (Set.{u3} M) (CoeTCₓ.coe.{succ u3, succ u3} (Submodule.{u2, u3} A M _inst_2 _inst_4 _inst_6) (Set.{u3} M) (SetLike.Set.hasCoeT.{u3, u3} (Submodule.{u2, u3} A M _inst_2 _inst_4 _inst_6) M (Submodule.setLike.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (Submodule.span.{u2, u3} A M _inst_2 _inst_4 _inst_6 s)) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Submodule.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Set.{u3} M) (HasLiftT.mk.{succ u3, succ u3} (Submodule.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Set.{u3} M) (CoeTCₓ.coe.{succ u3, succ u3} (Submodule.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Set.{u3} M) (SetLike.Set.hasCoeT.{u3, u3} (Submodule.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) M (Submodule.setLike.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5)))) (Submodule.span.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5 s)))
but is expected to have type
  forall (R : Type.{u1}) (A : Type.{u2}) {M : Type.{u3}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommMonoid.{u3} M] [_inst_5 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4] [_inst_6 : Module.{u2, u3} A M _inst_2 _inst_4] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (Algebra.toSMul.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SMulZeroClass.toSMul.{u2, u3} A M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 _inst_4 _inst_6)))) (SMulZeroClass.toSMul.{u1, u3} R M (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} R M (CommMonoidWithZero.toZero.{u1} R (CommSemiring.toCommMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddMonoid.toZero.{u3} M (AddCommMonoid.toAddMonoid.{u3} M _inst_4)) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5))))], (Function.Surjective.{succ u1, succ u2} R A (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => A) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2)) R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} R A (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} A _inst_2))))) (algebraMap.{u1, u2} R A _inst_1 _inst_2 _inst_3))) -> (forall (s : Set.{u3} M), Eq.{succ u3} (Set.{u3} M) (SetLike.coe.{u3, u3} (Submodule.{u2, u3} A M _inst_2 _inst_4 _inst_6) M (Submodule.setLike.{u2, u3} A M _inst_2 _inst_4 _inst_6) (Submodule.span.{u2, u3} A M _inst_2 _inst_4 _inst_6 s)) (SetLike.coe.{u3, u3} (Submodule.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) M (Submodule.setLike.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5) (Submodule.span.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) _inst_4 _inst_5 s)))
Case conversion may be inaccurate. Consider using '#align submodule.coe_span_eq_span_of_surjective Submodule.coe_span_eq_span_of_surjectiveₓ'. -/
theorem coe_span_eq_span_of_surjective (h : Function.Surjective (algebraMap R A)) (s : Set M) :
    (Submodule.span A s : Set M) = Submodule.span R s :=
  congr_arg coe (Submodule.restrictScalars_span R A h s)
#align submodule.coe_span_eq_span_of_surjective Submodule.coe_span_eq_span_of_surjective

end Submodule

section Semiring

variable {R S A}

namespace Submodule

section Module

variable [Semiring R] [Semiring S] [AddCommMonoid A]

variable [Module R S] [Module S A] [Module R A] [IsScalarTower R S A]

open IsScalarTower

#print Submodule.smul_mem_span_smul_of_mem /-
theorem smul_mem_span_smul_of_mem {s : Set S} {t : Set A} {k : S} (hks : k ∈ span R s) {x : A}
    (hx : x ∈ t) : k • x ∈ span R (s • t) :=
  span_induction hks (fun c hc => subset_span <| Set.mem_smul.2 ⟨c, x, hc, hx, rfl⟩)
    (by
      rw [zero_smul]
      exact zero_mem _)
    (fun c₁ c₂ ih₁ ih₂ => by
      rw [add_smul]
      exact add_mem ih₁ ih₂)
    fun b c hc => by
    rw [IsScalarTower.smul_assoc]
    exact smul_mem _ _ hc
#align submodule.smul_mem_span_smul_of_mem Submodule.smul_mem_span_smul_of_mem
-/

variable [SMulCommClass R S A]

/- warning: submodule.smul_mem_span_smul -> Submodule.smul_mem_span_smul is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : Semiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_3 : AddCommMonoid.{u3} A] [_inst_4 : Module.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2)))] [_inst_5 : Module.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Module.{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 _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{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 _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{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 _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{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 _inst_3))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6))))] [_inst_8 : SMulCommClass.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6)))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))] {s : Set.{u2} S}, (Eq.{succ u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.span.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4 s) (Top.top.{u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.hasTop.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4))) -> (forall {t : Set.{u3} A} {k : S} {x : A}, (Membership.Mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.hasMem.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) x (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 t)) -> (Membership.Mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.hasMem.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) (SMul.smul.{u2, u3} S A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))) k x) (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (SMul.smul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) s t))))
but is expected to have type
  forall {R : Type.{u1}} {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : Semiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_3 : AddCommMonoid.{u3} A] [_inst_4 : Module.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2)))] [_inst_5 : Module.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Module.{u1, u3} R A _inst_1 _inst_3] [_inst_7 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toSMul.{u1, u2} R S (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (SMulWithZero.toSMulZeroClass.{u1, u2} R S (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R _inst_1) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))) (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} R A (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6))))] [_inst_8 : SMulCommClass.{u1, u2, u3} R S A (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} R A (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6)))) (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))] {s : Set.{u2} S}, (Eq.{succ u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.span.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4 s) (Top.top.{u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.instTopSubmodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4))) -> (forall {t : Set.{u3} A} {k : S} {x : A}, (Membership.mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.instMembership.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) x (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 t)) -> (Membership.mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.instMembership.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) (HSMul.hSMul.{u2, u3, u3} S A A (instHSMul.{u2, u3} S A (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) k x) (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (HSMul.hSMul.{u2, u3, u3} (Set.{u2} S) (Set.{u3} A) (Set.{u3} A) (instHSMul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))))) s t))))
Case conversion may be inaccurate. Consider using '#align submodule.smul_mem_span_smul Submodule.smul_mem_span_smulₓ'. -/
theorem smul_mem_span_smul {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R t) : k • x ∈ span R (s • t) :=
  span_induction hx (fun x hx => smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hx)
    (by
      rw [smul_zero]
      exact zero_mem _)
    (fun x y ihx ihy => by
      rw [smul_add]
      exact add_mem ihx ihy)
    fun c x hx => smul_comm c k x ▸ smul_mem _ _ hx
#align submodule.smul_mem_span_smul Submodule.smul_mem_span_smul

/- warning: submodule.smul_mem_span_smul' -> Submodule.smul_mem_span_smul' is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : Semiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_3 : AddCommMonoid.{u3} A] [_inst_4 : Module.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2)))] [_inst_5 : Module.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Module.{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 _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{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 _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{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 _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{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 _inst_3))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6))))] [_inst_8 : SMulCommClass.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6)))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))] {s : Set.{u2} S}, (Eq.{succ u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.span.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4 s) (Top.top.{u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.hasTop.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4))) -> (forall {t : Set.{u3} A} {k : S} {x : A}, (Membership.Mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.hasMem.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) x (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (SMul.smul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) s t))) -> (Membership.Mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.hasMem.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) (SMul.smul.{u2, u3} S A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))) k x) (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (SMul.smul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) s t))))
but is expected to have type
  forall {R : Type.{u1}} {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : Semiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_3 : AddCommMonoid.{u3} A] [_inst_4 : Module.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2)))] [_inst_5 : Module.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Module.{u1, u3} R A _inst_1 _inst_3] [_inst_7 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toSMul.{u1, u2} R S (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (SMulWithZero.toSMulZeroClass.{u1, u2} R S (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R _inst_1) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))) (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} R A (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6))))] [_inst_8 : SMulCommClass.{u1, u2, u3} R S A (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} R A (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6)))) (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))] {s : Set.{u2} S}, (Eq.{succ u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.span.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4 s) (Top.top.{u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.instTopSubmodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4))) -> (forall {t : Set.{u3} A} {k : S} {x : A}, (Membership.mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.instMembership.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) x (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (HSMul.hSMul.{u2, u3, u3} (Set.{u2} S) (Set.{u3} A) (Set.{u3} A) (instHSMul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))))) s t))) -> (Membership.mem.{u3, u3} A (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (SetLike.instMembership.{u3, u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) A (Submodule.setLike.{u1, u3} R A _inst_1 _inst_3 _inst_6)) (HSMul.hSMul.{u2, u3, u3} S A A (instHSMul.{u2, u3} S A (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) k x) (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (HSMul.hSMul.{u2, u3, u3} (Set.{u2} S) (Set.{u3} A) (Set.{u3} A) (instHSMul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))))) s t))))
Case conversion may be inaccurate. Consider using '#align submodule.smul_mem_span_smul' Submodule.smul_mem_span_smul'ₓ'. -/
theorem smul_mem_span_smul' {s : Set S} (hs : span R s = ⊤) {t : Set A} {k : S} {x : A}
    (hx : x ∈ span R (s • t)) : k • x ∈ span R (s • t) :=
  span_induction hx
    (fun x hx => by
      let ⟨p, q, hp, hq, hpq⟩ := Set.mem_smul.1 hx
      rw [← hpq, smul_smul]
      exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq)
    (by
      rw [smul_zero]
      exact zero_mem _)
    (fun x y ihx ihy => by
      rw [smul_add]
      exact add_mem ihx ihy)
    fun c x hx => smul_comm c k x ▸ smul_mem _ _ hx
#align submodule.smul_mem_span_smul' Submodule.smul_mem_span_smul'

/- warning: submodule.span_smul_of_span_eq_top -> Submodule.span_smul_of_span_eq_top is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : Semiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_3 : AddCommMonoid.{u3} A] [_inst_4 : Module.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2)))] [_inst_5 : Module.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Module.{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 _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{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 _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{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 _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{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 _inst_3))) (SMulWithZero.toSmulZeroClass.{u1, u3} R A (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6))))] [_inst_8 : SMulCommClass.{u1, u2, u3} R S A (SMulZeroClass.toHasSmul.{u1, u3} R A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6)))) (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))] {s : Set.{u2} S}, (Eq.{succ u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.span.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4 s) (Top.top.{u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.hasTop.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4))) -> (forall (t : Set.{u3} A), Eq.{succ u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (SMul.smul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toHasSmul.{u2, u3} S A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{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 _inst_2)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3))) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))) s t)) (Submodule.restrictScalars.{u1, u2, u3} R S A _inst_2 _inst_3 _inst_1 _inst_6 _inst_5 (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 _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R S (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{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 _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{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 _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) _inst_7 (Submodule.span.{u2, u3} S A _inst_2 _inst_3 _inst_5 t)))
but is expected to have type
  forall {R : Type.{u1}} {S : Type.{u2}} {A : Type.{u3}} [_inst_1 : Semiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_3 : AddCommMonoid.{u3} A] [_inst_4 : Module.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2)))] [_inst_5 : Module.{u2, u3} S A _inst_2 _inst_3] [_inst_6 : Module.{u1, u3} R A _inst_1 _inst_3] [_inst_7 : IsScalarTower.{u1, u2, u3} R S A (SMulZeroClass.toSMul.{u1, u2} R S (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (SMulWithZero.toSMulZeroClass.{u1, u2} R S (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R _inst_1) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))) (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} R A (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6))))] [_inst_8 : SMulCommClass.{u1, u2, u3} R S A (SMulZeroClass.toSMul.{u1, u3} R A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} R A (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} R A (Semiring.toMonoidWithZero.{u1} R _inst_1) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u1, u3} R A _inst_1 _inst_3 _inst_6)))) (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5))))] {s : Set.{u2} S}, (Eq.{succ u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.span.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4 s) (Top.top.{u2} (Submodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4) (Submodule.instTopSubmodule.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4))) -> (forall (t : Set.{u3} A), Eq.{succ u3} (Submodule.{u1, u3} R A _inst_1 _inst_3 _inst_6) (Submodule.span.{u1, u3} R A _inst_1 _inst_3 _inst_6 (HSMul.hSMul.{u2, u3, u3} (Set.{u2} S) (Set.{u3} A) (Set.{u3} A) (instHSMul.{u2, u3} (Set.{u2} S) (Set.{u3} A) (Set.smul.{u2, u3} S A (SMulZeroClass.toSMul.{u2, u3} S A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (SMulWithZero.toSMulZeroClass.{u2, u3} S A (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (MulActionWithZero.toSMulWithZero.{u2, u3} S A (Semiring.toMonoidWithZero.{u2} S _inst_2) (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A _inst_3)) (Module.toMulActionWithZero.{u2, u3} S A _inst_2 _inst_3 _inst_5)))))) s t)) (Submodule.restrictScalars.{u1, u2, u3} R S A _inst_2 _inst_3 _inst_1 _inst_6 _inst_5 (SMulZeroClass.toSMul.{u1, u2} R S (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (SMulWithZero.toSMulZeroClass.{u1, u2} R S (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_1)) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (MulActionWithZero.toSMulWithZero.{u1, u2} R S (Semiring.toMonoidWithZero.{u1} R _inst_1) (MonoidWithZero.toZero.{u2} S (Semiring.toMonoidWithZero.{u2} S _inst_2)) (Module.toMulActionWithZero.{u1, u2} R S _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) _inst_4)))) _inst_7 (Submodule.span.{u2, u3} S A _inst_2 _inst_3 _inst_5 t)))
Case conversion may be inaccurate. Consider using '#align submodule.span_smul_of_span_eq_top Submodule.span_smul_of_span_eq_topₓ'. -/
theorem span_smul_of_span_eq_top {s : Set S} (hs : span R s = ⊤) (t : Set A) :
    span R (s • t) = (span S t).restrictScalars R :=
  le_antisymm
    (span_le.2 fun x hx =>
      let ⟨p, q, hps, hqt, hpqx⟩ := Set.mem_smul.1 hx
      hpqx ▸ (span S t).smul_mem p (subset_span hqt))
    fun p hp =>
    span_induction hp (fun x hx => one_smul S x ▸ smul_mem_span_smul hs (subset_span hx))
      (zero_mem _) (fun _ _ => add_mem) fun k x hx => smul_mem_span_smul' hs hx
#align submodule.span_smul_of_span_eq_top Submodule.span_smul_of_span_eq_top

end Module

section Algebra

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

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

/- warning: submodule.span_algebra_map_image -> Submodule.span_algebraMap_image is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} {S : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_4 : Algebra.{u1, u2} R S _inst_1 _inst_2] (a : Set.{u1} R), Eq.{succ u2} (Submodule.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4)) (Submodule.span.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4) (Set.image.{u1, u2} R S (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2)) (fun (_x : RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2)) => R -> S) (RingHom.hasCoeToFun.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2)) (algebraMap.{u1, u2} R S _inst_1 _inst_2 _inst_4)) a)) (Submodule.map.{u1, u1, u1, u2, max u1 u2} R R R S (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (RingHomSurjective.ids.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (LinearMap.{u1, u1, u1, u2} R R (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) R S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4)) (LinearMap.semilinearMapClass.{u1, u1, u1, u2} R R R S (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (Algebra.linearMap.{u1, u2} R S _inst_1 _inst_2 _inst_4) (Submodule.span.{u1, u1} R R (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) a))
but is expected to have type
  forall {R : Type.{u1}} {S : Type.{u2}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} S] [_inst_4 : Algebra.{u1, u2} R S _inst_1 _inst_2] (a : Set.{u1} R), Eq.{succ u2} (Submodule.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4)) (Submodule.span.{u1, u2} R S (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4) (Set.image.{u1, u2} R S (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2)) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => S) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2)) R S (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2)) R S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2)) R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} R S (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} S _inst_2))))) (algebraMap.{u1, u2} R S _inst_1 _inst_2 _inst_4)) a)) (Submodule.map.{u1, u1, u1, u2, max u1 u2} R R R S (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (RingHomSurjective.ids.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (LinearMap.{u1, u1, u1, u2} R R (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) R S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4)) (LinearMap.instSemilinearMapClassLinearMap.{u1, u1, u1, u2} R R R S (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S _inst_2))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Algebra.toModule.{u1, u2} R S _inst_1 _inst_2 _inst_4) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (Algebra.linearMap.{u1, u2} R S _inst_1 _inst_2 _inst_4) (Submodule.span.{u1, u1} R R (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (Semiring.toModule.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) a))
Case conversion may be inaccurate. Consider using '#align submodule.span_algebra_map_image Submodule.span_algebraMap_imageₓ'. -/
/-- A variant of `submodule.span_image` for `algebra_map`. -/
theorem span_algebraMap_image (a : Set R) :
    Submodule.span R (algebraMap R S '' a) = (Submodule.span R a).map (Algebra.linearMap R S) :=
  (Submodule.span_image <| Algebra.linearMap R S).trans rfl
#align submodule.span_algebra_map_image Submodule.span_algebraMap_image

/- warning: submodule.span_algebra_map_image_of_tower -> Submodule.span_algebraMap_image_of_tower is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} [_inst_1 : CommSemiring.{u1} R] {S : Type.{u2}} {T : Type.{u3}} [_inst_8 : CommSemiring.{u2} S] [_inst_9 : Semiring.{u3} T] [_inst_10 : Module.{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_8))))] [_inst_11 : IsScalarTower.{u1, u2, u2} R S S (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_8))))))) (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_8))))))) (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_8))))))) (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_8)))) _inst_10)))) (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_8)))))) (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_8))))))) (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_8))))))) (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_8))))))) (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_8)))) _inst_10))))] [_inst_12 : Algebra.{u1, u3} R T _inst_1 _inst_9] [_inst_13 : Algebra.{u2, u3} S T _inst_8 _inst_9] [_inst_14 : IsScalarTower.{u1, u2, u3} R S T (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_8))))))) (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_8))))))) (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_8))))))) (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_8)))) _inst_10)))) (SMulZeroClass.toHasSmul.{u2, u3} S T (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S T (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8))))) (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S T (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (Module.toMulActionWithZero.{u2, u3} S T (CommSemiring.toSemiring.{u2} S _inst_8) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u2, u3} S T _inst_8 _inst_9 _inst_13))))) (SMulZeroClass.toHasSmul.{u1, u3} R T (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R T (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} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R T (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (Module.toMulActionWithZero.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12)))))] (a : Set.{u2} S), Eq.{succ u3} (Submodule.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12)) (Submodule.span.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12) (Set.image.{u2, u3} S T (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RingHom.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) (fun (_x : RingHom.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) => S -> T) (RingHom.hasCoeToFun.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) (algebraMap.{u2, u3} S T _inst_8 _inst_9 _inst_13)) a)) (Submodule.map.{u1, u1, u2, u3, max u2 u3} R R S T (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) _inst_10 (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (RingHomSurjective.ids.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (LinearMap.{u1, u1, u2, u3} R R (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) S T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) _inst_10 (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12)) (LinearMap.semilinearMapClass.{u1, u1, u2, u3} R R S T (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) _inst_10 (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (LinearMap.restrictScalars.{u1, u2, u2, u3} R S S T (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u2} S _inst_8) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) _inst_10 (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12) (Semiring.toModule.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Algebra.toModule.{u2, u3} S T _inst_8 _inst_9 _inst_13) (LinearMap.IsScalarTower.compatibleSMul.{u2, u3, u1, u2} S T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) R S (CommSemiring.toSemiring.{u2} S _inst_8) (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_8))))))) (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_8))))))) (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_8))))))) (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_8)))) _inst_10)))) (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_8))))))) (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_8))))))) (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_8))))))) (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_8)))) _inst_10)))) (Semiring.toModule.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) _inst_11 (SMulZeroClass.toHasSmul.{u1, u3} R T (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R T (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} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R T (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (Module.toMulActionWithZero.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_12))))) (Algebra.toModule.{u2, u3} S T _inst_8 _inst_9 _inst_13) _inst_14) (Algebra.linearMap.{u2, u3} S T _inst_8 _inst_9 _inst_13)) (Submodule.span.{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_8)))) _inst_10 a))
but is expected to have type
  forall {R : Type.{u3}} [_inst_1 : CommSemiring.{u3} R] {S : Type.{u2}} {T : Type.{u1}} [_inst_8 : CommSemiring.{u2} S] [_inst_9 : Semiring.{u1} T] [_inst_10 : Module.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8))))] [_inst_11 : IsScalarTower.{u3, u2, u2} R S S (SMulZeroClass.toSMul.{u3, u2} R S (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (SMulWithZero.toSMulZeroClass.{u3, u2} R S (CommMonoidWithZero.toZero.{u3} R (CommSemiring.toCommMonoidWithZero.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (MulActionWithZero.toSMulWithZero.{u3, u2} R S (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (Module.toMulActionWithZero.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) _inst_10)))) (Algebra.toSMul.{u2, u2} S S _inst_8 (CommSemiring.toSemiring.{u2} S _inst_8) (Algebra.id.{u2} S _inst_8)) (SMulZeroClass.toSMul.{u3, u2} R S (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (SMulWithZero.toSMulZeroClass.{u3, u2} R S (CommMonoidWithZero.toZero.{u3} R (CommSemiring.toCommMonoidWithZero.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (MulActionWithZero.toSMulWithZero.{u3, u2} R S (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (Module.toMulActionWithZero.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) _inst_10))))] [_inst_12 : Algebra.{u3, u1} R T _inst_1 _inst_9] [_inst_13 : Algebra.{u2, u1} S T _inst_8 _inst_9] [_inst_14 : IsScalarTower.{u3, u2, u1} R S T (SMulZeroClass.toSMul.{u3, u2} R S (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (SMulWithZero.toSMulZeroClass.{u3, u2} R S (CommMonoidWithZero.toZero.{u3} R (CommSemiring.toCommMonoidWithZero.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (MulActionWithZero.toSMulWithZero.{u3, u2} R S (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (Module.toMulActionWithZero.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) _inst_10)))) (Algebra.toSMul.{u2, u1} S T _inst_8 _inst_9 _inst_13) (Algebra.toSMul.{u3, u1} R T _inst_1 _inst_9 _inst_12)] (a : Set.{u2} S), Eq.{succ u1} (Submodule.{u3, u1} R T (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_12)) (Submodule.span.{u3, u1} R T (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_12) (Set.image.{u2, u1} S T (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S (fun (_x : S) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : S) => T) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toMul.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9) (RingHom.instRingHomClassRingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9))))) (algebraMap.{u2, u1} S T _inst_8 _inst_9 _inst_13)) a)) (Submodule.map.{u3, u3, u2, u1, max u2 u1} R R S T (CommSemiring.toSemiring.{u3} R _inst_1) (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) _inst_10 (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_12) (RingHom.id.{u3} R (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1))) (RingHomSurjective.ids.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (LinearMap.{u3, u3, u2, u1} R R (CommSemiring.toSemiring.{u3} R _inst_1) (CommSemiring.toSemiring.{u3} R _inst_1) (RingHom.id.{u3} R (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1))) S T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) _inst_10 (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_12)) (LinearMap.instSemilinearMapClassLinearMap.{u3, u3, u2, u1} R R S T (CommSemiring.toSemiring.{u3} R _inst_1) (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) _inst_10 (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_12) (RingHom.id.{u3} R (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)))) (LinearMap.restrictScalars.{u3, u2, u2, u1} R S S T (CommSemiring.toSemiring.{u3} R _inst_1) (CommSemiring.toSemiring.{u2} S _inst_8) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) _inst_10 (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_12) (Semiring.toModule.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Algebra.toModule.{u2, u1} S T _inst_8 _inst_9 _inst_13) (LinearMap.IsScalarTower.compatibleSMul.{u2, u1, u3, u2} S T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) R S (CommSemiring.toSemiring.{u2} S _inst_8) (SMulZeroClass.toSMul.{u3, u2} R S (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (SMulWithZero.toSMulZeroClass.{u3, u2} R S (CommMonoidWithZero.toZero.{u3} R (CommSemiring.toCommMonoidWithZero.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (MulActionWithZero.toSMulWithZero.{u3, u2} R S (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (CommMonoidWithZero.toZero.{u2} S (CommSemiring.toCommMonoidWithZero.{u2} S _inst_8)) (Module.toMulActionWithZero.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) _inst_10)))) (SMulZeroClass.toSMul.{u3, u2} R S (AddMonoid.toZero.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))))) (SMulWithZero.toSMulZeroClass.{u3, u2} R S (MonoidWithZero.toZero.{u3} R (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1))) (AddMonoid.toZero.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))))) (MulActionWithZero.toSMulWithZero.{u3, u2} R S (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (AddMonoid.toZero.{u2} S (AddCommMonoid.toAddMonoid.{u2} S (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))))) (Module.toMulActionWithZero.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) _inst_10)))) (Semiring.toModule.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) _inst_11 (SMulZeroClass.toSMul.{u3, u1} R T (AddMonoid.toZero.{u1} T (AddCommMonoid.toAddMonoid.{u1} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))))) (SMulWithZero.toSMulZeroClass.{u3, u1} R T (MonoidWithZero.toZero.{u3} R (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1))) (AddMonoid.toZero.{u1} T (AddCommMonoid.toAddMonoid.{u1} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))))) (MulActionWithZero.toSMulWithZero.{u3, u1} R T (Semiring.toMonoidWithZero.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (AddMonoid.toZero.{u1} T (AddCommMonoid.toAddMonoid.{u1} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))))) (Module.toMulActionWithZero.{u3, u1} R T (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_12))))) (Algebra.toModule.{u2, u1} S T _inst_8 _inst_9 _inst_13) _inst_14) (Algebra.linearMap.{u2, u1} S T _inst_8 _inst_9 _inst_13)) (Submodule.span.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) _inst_10 a))
Case conversion may be inaccurate. Consider using '#align submodule.span_algebra_map_image_of_tower Submodule.span_algebraMap_image_of_towerₓ'. -/
theorem span_algebraMap_image_of_tower {S T : Type _} [CommSemiring S] [Semiring T] [Module R S]
    [IsScalarTower R S S] [Algebra R T] [Algebra S T] [IsScalarTower R S T] (a : Set S) :
    Submodule.span R (algebraMap S T '' a) =
      (Submodule.span R a).map ((Algebra.linearMap S T).restrictScalars R) :=
  (Submodule.span_image <| (Algebra.linearMap S T).restrictScalars R).trans rfl
#align submodule.span_algebra_map_image_of_tower Submodule.span_algebraMap_image_of_tower

/- warning: submodule.map_mem_span_algebra_map_image -> Submodule.map_mem_span_algebraMap_image is a dubious translation:
lean 3 declaration is
  forall {R : Type.{u1}} [_inst_1 : CommSemiring.{u1} R] {S : Type.{u2}} {T : Type.{u3}} [_inst_8 : CommSemiring.{u2} S] [_inst_9 : Semiring.{u3} T] [_inst_10 : Algebra.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8)] [_inst_11 : Algebra.{u1, u3} R T _inst_1 _inst_9] [_inst_12 : Algebra.{u2, u3} S T _inst_8 _inst_9] [_inst_13 : IsScalarTower.{u1, u2, u3} R S T (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_8))))))) (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_8))))))) (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_8))))))) (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_8)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10))))) (SMulZeroClass.toHasSmul.{u2, u3} S T (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (SMulWithZero.toSmulZeroClass.{u2, u3} S T (MulZeroClass.toHasZero.{u2} S (MulZeroOneClass.toMulZeroClass.{u2} S (MonoidWithZero.toMulZeroOneClass.{u2} S (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8))))) (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (MulActionWithZero.toSMulWithZero.{u2, u3} S T (Semiring.toMonoidWithZero.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (Module.toMulActionWithZero.{u2, u3} S T (CommSemiring.toSemiring.{u2} S _inst_8) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u2, u3} S T _inst_8 _inst_9 _inst_12))))) (SMulZeroClass.toHasSmul.{u1, u3} R T (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R T (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} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R T (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} T (AddMonoid.toAddZeroClass.{u3} T (AddCommMonoid.toAddMonoid.{u3} T (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9)))))) (Module.toMulActionWithZero.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_11)))))] (x : S) (a : Set.{u2} S), (Membership.Mem.{u2, u2} S (Submodule.{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_8)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10)) (SetLike.hasMem.{u2, u2} (Submodule.{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_8)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10)) S (Submodule.setLike.{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_8)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10))) x (Submodule.span.{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_8)))) (Algebra.toModule.{u1, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10) a)) -> (Membership.Mem.{u3, u3} T (Submodule.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_11)) (SetLike.hasMem.{u3, u3} (Submodule.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_11)) T (Submodule.setLike.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_11))) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RingHom.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) (fun (_x : RingHom.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) => S -> T) (RingHom.hasCoeToFun.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) (algebraMap.{u2, u3} S T _inst_8 _inst_9 _inst_12) x) (Submodule.span.{u1, u3} R T (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} T (Semiring.toNonAssocSemiring.{u3} T _inst_9))) (Algebra.toModule.{u1, u3} R T _inst_1 _inst_9 _inst_11) (Set.image.{u2, u3} S T (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RingHom.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) (fun (_x : RingHom.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) => S -> T) (RingHom.hasCoeToFun.{u2, u3} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u3} T _inst_9)) (algebraMap.{u2, u3} S T _inst_8 _inst_9 _inst_12)) a)))
but is expected to have type
  forall {R : Type.{u3}} [_inst_1 : CommSemiring.{u3} R] {S : Type.{u2}} {T : Type.{u1}} [_inst_8 : CommSemiring.{u2} S] [_inst_9 : Semiring.{u1} T] [_inst_10 : Algebra.{u3, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8)] [_inst_11 : Algebra.{u3, u1} R T _inst_1 _inst_9] [_inst_12 : Algebra.{u2, u1} S T _inst_8 _inst_9] [_inst_13 : IsScalarTower.{u3, u2, u1} R S T (Algebra.toSMul.{u3, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10) (Algebra.toSMul.{u2, u1} S T _inst_8 _inst_9 _inst_12) (Algebra.toSMul.{u3, u1} R T _inst_1 _inst_9 _inst_11)] (x : S) (a : Set.{u2} S), (Membership.mem.{u2, u2} S (Submodule.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (Algebra.toModule.{u3, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10)) (SetLike.instMembership.{u2, u2} (Submodule.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (Algebra.toModule.{u3, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10)) S (Submodule.setLike.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (Algebra.toModule.{u3, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10))) x (Submodule.span.{u3, u2} R S (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (Algebra.toModule.{u3, u2} R S _inst_1 (CommSemiring.toSemiring.{u2} S _inst_8) _inst_10) a)) -> (Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : S) => T) x) (Submodule.{u3, u1} R T (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_11)) (SetLike.instMembership.{u1, u1} (Submodule.{u3, u1} R T (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_11)) T (Submodule.setLike.{u3, u1} R T (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_11))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S (fun (_x : S) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : S) => T) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toMul.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9) (RingHom.instRingHomClassRingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9))))) (algebraMap.{u2, u1} S T _inst_8 _inst_9 _inst_12) x) (Submodule.span.{u3, u1} R T (CommSemiring.toSemiring.{u3} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (Algebra.toModule.{u3, u1} R T _inst_1 _inst_9 _inst_11) (Set.image.{u2, u1} S T (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S (fun (_x : S) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : S) => T) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (NonUnitalNonAssocSemiring.toMul.{u2} S (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)))) (NonUnitalNonAssocSemiring.toMul.{u1} T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} S (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} T (Semiring.toNonAssocSemiring.{u1} T _inst_9)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9)) S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9) (RingHom.instRingHomClassRingHom.{u2, u1} S T (Semiring.toNonAssocSemiring.{u2} S (CommSemiring.toSemiring.{u2} S _inst_8)) (Semiring.toNonAssocSemiring.{u1} T _inst_9))))) (algebraMap.{u2, u1} S T _inst_8 _inst_9 _inst_12)) a)))
Case conversion may be inaccurate. Consider using '#align submodule.map_mem_span_algebra_map_image Submodule.map_mem_span_algebraMap_imageₓ'. -/
theorem map_mem_span_algebraMap_image {S T : Type _} [CommSemiring S] [Semiring T] [Algebra R S]
    [Algebra R T] [Algebra S T] [IsScalarTower R S T] (x : S) (a : Set S)
    (hx : x ∈ Submodule.span R a) : algebraMap S T x ∈ Submodule.span R (algebraMap S T '' a) :=
  by
  rw [span_algebra_map_image_of_tower, mem_map]
  exact ⟨x, hx, rfl⟩
#align submodule.map_mem_span_algebra_map_image Submodule.map_mem_span_algebraMap_image

end Algebra

end Submodule

end Semiring

section Ring

namespace Algebra

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

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

/- warning: algebra.lsmul_injective -> Algebra.lsmul_injective is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (A : Type.{u2}) (M : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommGroup.{u3} M] [_inst_5 : Module.{u2, u3} A M _inst_2 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)] [_inst_6 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (SMulZeroClass.toHasSmul.{u1, u2} R A (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (SMulWithZero.toSmulZeroClass.{u1, u2} 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.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R A (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u2} A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))) (Module.toMulActionWithZero.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (SMulZeroClass.toHasSmul.{u2, u3} A M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (SMulWithZero.toSmulZeroClass.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (MulZeroOneClass.toMulZeroClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_5)))) (SMulZeroClass.toHasSmul.{u1, u3} R M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (SMulWithZero.toSmulZeroClass.{u1, u3} R M (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} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6))))] [_inst_8 : NoZeroSMulDivisors.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (SubNegMonoid.toAddMonoid.{u3} M (AddGroup.toSubNegMonoid.{u3} M (AddCommGroup.toAddGroup.{u3} M _inst_4))))) (SMulZeroClass.toHasSmul.{u2, u3} A M (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (SMulWithZero.toSmulZeroClass.{u2, u3} A M (MulZeroClass.toHasZero.{u2} A (MulZeroOneClass.toMulZeroClass.{u2} A (MonoidWithZero.toMulZeroOneClass.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)))) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (AddZeroClass.toHasZero.{u3} M (AddMonoid.toAddZeroClass.{u3} M (AddCommMonoid.toAddMonoid.{u3} M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_5))))] {x : A}, (Ne.{succ u2} A x (OfNat.ofNat.{u2} A 0 (OfNat.mk.{u2} A 0 (Zero.zero.{u2} A (MulZeroClass.toHasZero.{u2} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))))))) -> (Function.Injective.{succ u3, succ u3} M M (coeFn.{succ u3, succ u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (fun (_x : LinearMap.{u1, u1, u3, u3} R R (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) M M (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6 _inst_6) => M -> M) (LinearMap.hasCoeToFun.{u1, u1, u3, u3} R R M M (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6 _inst_6 (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) (fun (_x : AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) => A -> (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) ([anonymous].{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.End.algebra.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) (Algebra.lsmul.{u1, u2, u3} R A M _inst_1 _inst_2 _inst_3 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6 _inst_5 _inst_7) x)))
but is expected to have type
  forall (R : Type.{u1}) (A : Type.{u2}) (M : Type.{u3}) [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} A] [_inst_3 : Algebra.{u1, u2} R A _inst_1 _inst_2] [_inst_4 : AddCommGroup.{u3} M] [_inst_5 : Module.{u2, u3} A M _inst_2 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)] [_inst_6 : Module.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4)] [_inst_7 : IsScalarTower.{u1, u2, u3} R A M (Algebra.toSMul.{u1, u2} R A _inst_1 _inst_2 _inst_3) (SMulZeroClass.toSMul.{u2, u3} A M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (SMulWithZero.toSMulZeroClass.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_5)))) (SMulZeroClass.toSMul.{u1, u3} R M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (SMulWithZero.toSMulZeroClass.{u1, u3} R M (CommMonoidWithZero.toZero.{u1} R (CommSemiring.toCommMonoidWithZero.{u1} R _inst_1)) (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R M (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (Module.toMulActionWithZero.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6))))] [_inst_8 : NoZeroSMulDivisors.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (SMulZeroClass.toSMul.{u2, u3} A M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (SMulWithZero.toSMulZeroClass.{u2, u3} A M (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2)) (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (MulActionWithZero.toSMulWithZero.{u2, u3} A M (Semiring.toMonoidWithZero.{u2} A _inst_2) (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_4))))) (Module.toMulActionWithZero.{u2, u3} A M _inst_2 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_5))))] {x : A}, (Ne.{succ u2} A x (OfNat.ofNat.{u2} A 0 (Zero.toOfNat0.{u2} A (MonoidWithZero.toZero.{u2} A (Semiring.toMonoidWithZero.{u2} A _inst_2))))) -> (Function.Injective.{succ u3, succ u3} M M (FunLike.coe.{succ u3, succ u3, succ u3} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) x) M (fun (_x : M) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : M) => M) _x) (LinearMap.instFunLikeLinearMap.{u1, u1, u3, u3} R R M M (CommSemiring.toSemiring.{u1} R _inst_1) (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6 _inst_6 (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (FunLike.coe.{max (succ u3) (succ u2), succ u2, succ u3} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _x) (SMulHomClass.toFunLike.{max u3 u2, u1, u2, u3} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (SMulZeroClass.toSMul.{u1, u2} R A (AddMonoid.toZero.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))))) (DistribSMul.toSMulZeroClass.{u1, u2} R A (AddMonoid.toAddZeroClass.{u2} A (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))))) (DistribMulAction.toDistribSMul.{u1, u2} R A (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))) (Module.toDistribMulAction.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3))))) (SMulZeroClass.toSMul.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (AddMonoid.toZero.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)))))) (DistribSMul.toSMulZeroClass.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (AddMonoid.toAddZeroClass.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)))))) (DistribMulAction.toDistribSMul.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6))))) (Module.toDistribMulAction.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)))) (Algebra.toModule.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)))))) (DistribMulActionHomClass.toSMulHomClass.{max u3 u2, u1, u2, u3} (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (AddCommMonoid.toAddMonoid.{u2} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2)))) (AddCommMonoid.toAddMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6))))) (Module.toDistribMulAction.{u1, u2} R A (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3)) (Module.toDistribMulAction.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)))) (Algebra.toModule.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6))) (SemilinearMapClass.distribMulActionHomClass.{u1, u2, u3, max u3 u2} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) (CommSemiring.toSemiring.{u1} R _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} A (Semiring.toNonAssocSemiring.{u2} A _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Semiring.toNonAssocSemiring.{u3} (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)))) (Algebra.toModule.{u1, u2} R A _inst_1 _inst_2 _inst_3) (Algebra.toModule.{u1, u3} R (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) (AlgHomClass.linearMapClass.{u1, u2, u3, max u3 u2} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) (AlgHom.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)) (AlgHom.algHomClass.{u1, u2, u3} R A (Module.End.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_1 _inst_2 (Module.End.semiring.{u1, u3} R M (CommSemiring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6) _inst_3 (Module.instAlgebraEndToSemiringSemiring.{u1, u3} R M _inst_1 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6)))))) (Algebra.lsmul.{u1, u2, u3} R A M _inst_1 _inst_2 _inst_3 (AddCommGroup.toAddCommMonoid.{u3} M _inst_4) _inst_6 _inst_5 _inst_7) x)))
Case conversion may be inaccurate. Consider using '#align algebra.lsmul_injective Algebra.lsmul_injectiveₓ'. -/
theorem lsmul_injective [NoZeroSMulDivisors A M] {x : A} (hx : x ≠ 0) :
    Function.Injective (lsmul R M x) :=
  smul_right_injective _ hx
#align algebra.lsmul_injective Algebra.lsmul_injective

end Algebra

end Ring