R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ IsIntegral R x
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
⊢ IsIntegral R x
let A' : Subalgebra R A :=
  { carrier := { x | ∀ n ∈ N, x • n ∈ N }
    mul_mem' := fun {a b} ha hb n hn => smul_smul a b n ▸ ha _ (hb _ hn)
    one_mem' := fun n hn => (one_smul A n).symm ▸ hn
    add_mem' := fun {a b} ha hb n hn => (add_smul a b n).symm ▸ N.add_mem (ha _ hn) (hb _ hn)
    zero_mem' := fun n _hn => (zero_smul A n).symm ▸ N.zero_mem
    algebraMap_mem' := fun r n hn => (algebraMap_smul A r n).symm ▸ N.smul_mem r hn }
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
⊢ IsIntegral R x
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ IsIntegral R x
let f : A' →ₐ[R] Module.End R N :=
  AlgHom.ofLinearMap
    { toFun := fun x => (DistribMulAction.toLinearMap R M x).restrict x.prop
      map_add' := by intros x y; ext; exact add_smul _ _ _
      map_smul' := by intros r s; ext; apply smul_assoc }
    (by ext; apply one_smul)
    (by intros x y; ext; apply mul_smul)
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ IsIntegral R x
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
⊢ IsIntegral R x
obtain ⟨a, ha₁, ha₂⟩ : ∃ a ∈ N, a ≠ (0 : M) := by
  by_contra h'
  push_neg  at h'
  apply hN
  rwa [eq_bot_iff]
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R x
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ IsIntegral R x
have : Function.Injective f := by
  show Function.Injective f.toLinearMap
  rw [← LinearMap.ker_eq_bot, eq_bot_iff]
  intro s hs
  have : s.1 • a = 0 := congr_arg Subtype.val (LinearMap.congr_fun hs ⟨a, ha₁⟩)
  exact Subtype.ext ((eq_zero_or_eq_zero_of_smul_eq_zero this).resolve_right ha₂)
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R (↑(Subalgebra.val A') { val := x, property := hx })
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R x
show IsIntegral R (A'.val ⟨x, hx⟩)
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R (↑f { val := x, property := hx })
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R (↑(Subalgebra.val A') { val := x, property := hx })
rw [isIntegral_algHom_iff A'.val Subtype.val_injective, ← isIntegral_algHom_iff f this]
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this✝ : Function.Injective ↑f
this : Module.Finite R { x // x ∈ N }
⊢ IsIntegral R (↑f { val := x, property := hx })
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ IsIntegral R (↑f { val := x, property := hx })
haveI : Module.Finite R N := by rwa [Module.finite_def, Submodule.fg_top]
no goals
case intro.intro
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this✝ : Function.Injective ↑f
this : Module.Finite R { x // x ∈ N }
⊢ IsIntegral R (↑f { val := x, property := hx })
apply Module.End.isIntegral
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝ : A
hx : ∀ (n : M), n ∈ N → x✝ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
⊢ (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ∀ (x y : { x // x ∈ A' }),
    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y
intros x y
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝¹ : A
hx : ∀ (n : M), n ∈ N → x✝¹ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑((fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y)) x✝) =
    ↑(↑((fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y)
        x✝)
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝ : A
hx : ∀ (n : M), n ∈ N → x✝ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
⊢ (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y
ext
no goals
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝¹ : A
hx : ∀ (n : M), n ∈ N → x✝¹ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑((fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y)) x✝) =
    ↑(↑((fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y)
        x✝)
exact add_smul _ _ _
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
r : R
s : { x // x ∈ A' }
⊢ AddHom.toFun
      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
        map_add' :=
          (_ :
            ∀ (x y : { x // x ∈ A' }),
              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
      (r • s) =
    ↑(RingHom.id R) r •
      AddHom.toFun
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
        s
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ∀ (r : R) (x : { x // x ∈ A' }),
    AddHom.toFun
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
        (r • x) =
      ↑(RingHom.id R) r •
        AddHom.toFun
          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
            map_add' :=
              (_ :
                ∀ (x y : { x // x ∈ A' }),
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
          x
intros r s
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
r : R
s : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑(AddHom.toFun
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
            (r • s))
        x✝) =
    ↑(↑(↑(RingHom.id R) r •
            AddHom.toFun
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
              s)
        x✝)
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
r : R
s : { x // x ∈ A' }
⊢ AddHom.toFun
      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
        map_add' :=
          (_ :
            ∀ (x y : { x // x ∈ A' }),
              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
      (r • s) =
    ↑(RingHom.id R) r •
      AddHom.toFun
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
        s
ext
no goals
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
r : R
s : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑(AddHom.toFun
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
            (r • s))
        x✝) =
    ↑(↑(↑(RingHom.id R) r •
            AddHom.toFun
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
              s)
        x✝)
apply smul_assoc
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x✝ : { x // x ∈ N }
⊢ ↑(↑(↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            1)
        x✝) =
    ↑(↑1 x✝)
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ↑{
          toAddHom :=
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : { x // x ∈ A' }),
                AddHom.toFun
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                    (r • s) =
                  ↑(RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      s) }
      1 =
    1
ext
no goals
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x✝ : { x // x ∈ N }
⊢ ↑(↑(↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            1)
        x✝) =
    ↑(↑1 x✝)
apply one_smul
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝ : A
hx : ∀ (n : M), n ∈ N → x✝ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
⊢ ↑{
          toAddHom :=
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : { x // x ∈ A' }),
                AddHom.toFun
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                    (r • s) =
                  ↑(RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      s) }
      (x * y) =
    ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        x *
      ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        y
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
⊢ ∀ (x y : { x // x ∈ A' }),
    ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        (x * y) =
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          x *
        ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          y
intros x y
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝¹ : A
hx : ∀ (n : M), n ∈ N → x✝¹ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑(↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y))
        x✝) =
    ↑(↑(↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
        x✝)
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝ : A
hx : ∀ (n : M), n ∈ N → x✝ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
⊢ ↑{
          toAddHom :=
            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
              map_add' :=
                (_ :
                  ∀ (x y : { x // x ∈ A' }),
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
          map_smul' :=
            (_ :
              ∀ (r : R) (s : { x // x ∈ A' }),
                AddHom.toFun
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                    (r • s) =
                  ↑(RingHom.id R) r •
                    AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      s) }
      (x * y) =
    ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        x *
      ↑{
            toAddHom :=
              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                map_add' :=
                  (_ :
                    ∀ (x y : { x // x ∈ A' }),
                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (s : { x // x ∈ A' }),
                  AddHom.toFun
                      { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                        map_add' :=
                          (_ :
                            ∀ (x y : { x // x ∈ A' }),
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                      (r • s) =
                    ↑(RingHom.id R) r •
                      AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        s) }
        y
ext
no goals
case h.a
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x✝¹ : A
hx : ∀ (n : M), n ∈ N → x✝¹ • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
x y : { x // x ∈ A' }
x✝ : { x // x ∈ N }
⊢ ↑(↑(↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y))
        x✝) =
    ↑(↑(↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
        x✝)
apply mul_smul
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ¬∃ a, a ∈ N ∧ a ≠ 0
⊢ False
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
⊢ ∃ a, a ∈ N ∧ a ≠ 0
by_contra h'
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ∀ (a : M), a ∈ N → a = 0
⊢ False
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ¬∃ a, a ∈ N ∧ a ≠ 0
⊢ False
push_neg  at h'
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ∀ (a : M), a ∈ N → a = 0
⊢ N = ⊥
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ∀ (a : M), a ∈ N → a = 0
⊢ False
apply hN
no goals
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
h' : ∀ (a : M), a ∈ N → a = 0
⊢ N = ⊥
rwa [eq_bot_iff]
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ Function.Injective ↑(AlgHom.toLinearMap f)
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ Function.Injective ↑f
show Function.Injective f.toLinearMap
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ LinearMap.ker (AlgHom.toLinearMap f) ≤ ⊥
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ Function.Injective ↑(AlgHom.toLinearMap f)
rw [← LinearMap.ker_eq_bot, eq_bot_iff]
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
s : { x // x ∈ A' }
hs : s ∈ LinearMap.ker (AlgHom.toLinearMap f)
⊢ s ∈ ⊥
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
⊢ LinearMap.ker (AlgHom.toLinearMap f) ≤ ⊥
intro s hs
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
s : { x // x ∈ A' }
hs : s ∈ LinearMap.ker (AlgHom.toLinearMap f)
this : ↑s • a = 0
⊢ s ∈ ⊥
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
s : { x // x ∈ A' }
hs : s ∈ LinearMap.ker (AlgHom.toLinearMap f)
⊢ s ∈ ⊥
have : s.1 • a = 0 := congr_arg Subtype.val (LinearMap.congr_fun hs ⟨a, ha₁⟩)
no goals
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
s : { x // x ∈ A' }
hs : s ∈ LinearMap.ker (AlgHom.toLinearMap f)
this : ↑s • a = 0
⊢ s ∈ ⊥
exact Subtype.ext ((eq_zero_or_eq_zero_of_smul_eq_zero this).resolve_right ha₂)
no goals
R : Type u_2
A : Type u_3
B : Type ?u.566791
S : Type ?u.566794
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing A
inst✝⁸ : CommRing B
inst✝⁷ : CommRing S
inst✝⁶ : Algebra R A
inst✝⁵ : Algebra R B
f✝ : R →+* S
M : Type u_1
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : Module A M
inst✝¹ : IsScalarTower R A M
inst✝ : NoZeroSMulDivisors A M
N : Submodule R M
hN : N ≠ ⊥
hN' : FG N
x : A
hx : ∀ (n : M), n ∈ N → x • n ∈ N
A' : Subalgebra R A :=
  {
    toSubsemiring :=
      {
        toSubmonoid :=
          {
            toSubsemigroup :=
              { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                mul_mem' :=
                  (_ :
                    ∀ {a b : A},
                      a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                        b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
            one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) },
        add_mem' :=
          (_ :
            ∀ {a b : A},
              a ∈
                  {
                        toSubsemigroup :=
                          { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                            mul_mem' :=
                              (_ :
                                ∀ {a b : A},
                                  a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                    b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                        one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                b ∈
                    {
                          toSubsemigroup :=
                            { carrier := {x | ∀ (n : M), n ∈ N → x • n ∈ N},
                              mul_mem' :=
                                (_ :
                                  ∀ {a b : A},
                                    a ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} →
                                      b ∈ {x | ∀ (n : M), n ∈ N → x • n ∈ N} → ∀ (n : M), n ∈ N → (a * b) • n ∈ N) },
                          one_mem' := (_ : ∀ (n : M), n ∈ N → 1 • n ∈ N) }.toSubsemigroup.carrier →
                  ∀ (n : M), n ∈ N → (a + b) • n ∈ N),
        zero_mem' := (_ : ∀ (n : M), n ∈ N → 0 • n ∈ N) },
    algebraMap_mem' := (_ : ∀ (r : R) (n : M), n ∈ N → ↑(algebraMap R A) r • n ∈ N) }
f : { x // x ∈ A' } →ₐ[R] Module.End R { x // x ∈ N } :=
  AlgHom.ofLinearMap
    {
      toAddHom :=
        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
          map_add' :=
            (_ :
              ∀ (x y : { x // x ∈ A' }),
                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
      map_smul' :=
        (_ :
          ∀ (r : R) (s : { x // x ∈ A' }),
            AddHom.toFun
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                (r • s) =
              ↑(RingHom.id R) r •
                AddHom.toFun
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) }
                  s) }
    (_ :
      ↑{
              toAddHom :=
                { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                  map_add' :=
                    (_ :
                      ∀ (x y : { x // x ∈ A' }),
                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (s : { x // x ∈ A' }),
                    AddHom.toFun
                        { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                          map_add' :=
                            (_ :
                              ∀ (x y : { x // x ∈ A' }),
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                    (x + y) =
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      y) }
                        (r • s) =
                      ↑(RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          s) }
          1 =
        1)
    (_ :
      ∀ (x y : { x // x ∈ A' }),
        ↑{
                toAddHom :=
                  { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                    map_add' :=
                      (_ :
                        ∀ (x y : { x // x ∈ A' }),
                          (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (s : { x // x ∈ A' }),
                      AddHom.toFun
                          { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                            map_add' :=
                              (_ :
                                ∀ (x y : { x // x ∈ A' }),
                                  (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                      (x + y) =
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        y) }
                          (r • s) =
                        ↑(RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            s) }
            (x * y) =
          ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              x *
            ↑{
                  toAddHom :=
                    { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                      map_add' :=
                        (_ :
                          ∀ (x y : { x // x ∈ A' }),
                            (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) (x + y) =
                              (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) x +
                                (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A')) y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (s : { x // x ∈ A' }),
                        AddHom.toFun
                            { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                              map_add' :=
                                (_ :
                                  ∀ (x y : { x // x ∈ A' }),
                                    (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                        (x + y) =
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          x +
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          y) }
                            (r • s) =
                          ↑(RingHom.id R) r •
                            AddHom.toFun
                              { toFun := fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : { x // x ∈ A' }),
                                      (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                          (x + y) =
                                        (fun x => LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            x +
                                          (fun x =>
                                              LinearMap.restrict (DistribMulAction.toLinearMap R M x) (_ : ↑x ∈ A'))
                                            y) }
                              s) }
              y)
a : M
ha₁ : a ∈ N
ha₂ : a ≠ 0
this : Function.Injective ↑f
⊢ Module.Finite R { x // x ∈ N }
rwa [Module.finite_def, Submodule.fg_top]