/-- The natural paring of `B.dualSubmodule N` and `N`. -/
-- TODO: Show that this is perfect when `N` is a lattice and `B` is nondegenerate.
@[simps]
noncomputable
def dualSubmoduleToDual [NoZeroSMulDivisors R S] (N : Submodule R M) :
    B.dualSubmodule N →ₗ[R] Module.Dual R N :=
  { toFun := fun x ↦
    { toFun := B.dualSubmoduleParing x
      map_add' := fun x y ↦ NoZeroSMulDivisors.algebraMap_injective R S (by simp)
      map_smul' := fun r m ↦ NoZeroSMulDivisors.algebraMap_injective R S
        (by simp [← Algebra.smul_def]) }
    map_add' := fun x y ↦ LinearMap.ext fun z ↦ NoZeroSMulDivisors.algebraMap_injective R S
      (by simp)
    map_smul' := fun r x ↦ LinearMap.ext fun y ↦ NoZeroSMulDivisors.algebraMap_injective R S
      (by 

Proof state:
R : Type ?u.87584
S : Type ?u.87587
M : Type ?u.87590
inst✝⁷ : CommRing R
inst✝⁶ : Field S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Algebra R S
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : IsScalarTower R S M
B : BilinForm S M
inst✝ : NoZeroSMulDivisors R S
N : Submodule R M
r : R
x : ↥(dualSubmodule B N)
y : ↥N
⊢ (algebraMap R S)
      ((AddHom.toFun
          {
            toFun := fun x =>
              {
                toAddHom :=
                  { toFun := dualSubmoduleParing B x,
                    map_add' :=
                      (_ :
                        ∀ (x_1 y : ↥N),
                          dualSubmoduleParing B x (x_1 + y) =
                            dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (m : ↥N),
                      AddHom.toFun
                          { toFun := dualSubmoduleParing B x,
                            map_add' :=
                              (_ :
                                ∀ (x_1 y : ↥N),
                                  dualSubmoduleParing B x (x_1 + y) =
                                    dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                          (r • m) =
                        (RingHom.id R) r •
                          AddHom.toFun
                            { toFun := dualSubmoduleParing B x,
                              map_add' :=
                                (_ :
                                  ∀ (x_1 y : ↥N),
                                    dualSubmoduleParing B x (x_1 + y) =
                                      dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                            m) },
            map_add' :=
              (_ :
                ∀ (x y : ↥(dualSubmodule B N)),
                  (fun x =>
                        {
                          toAddHom :=
                            { toFun := dualSubmoduleParing B x,
                              map_add' :=
                                (_ :
                                  ∀ (x_1 y : ↥N),
                                    dualSubmoduleParing B x (x_1 + y) =
                                      dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (m : ↥N),
                                AddHom.toFun
                                    { toFun := dualSubmoduleParing B x,
                                      map_add' :=
                                        (_ :
                                          ∀ (x_1 y : ↥N),
                                            dualSubmoduleParing B x (x_1 + y) =
                                              dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                    (r • m) =
                                  (RingHom.id R) r •
                                    AddHom.toFun
                                      { toFun := dualSubmoduleParing B x,
                                        map_add' :=
                                          (_ :
                                            ∀ (x_1 y : ↥N),
                                              dualSubmoduleParing B x (x_1 + y) =
                                                dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                      m) })
                      (x + y) =
                    (fun x =>
                          {
                            toAddHom :=
                              { toFun := dualSubmoduleParing B x,
                                map_add' :=
                                  (_ :
                                    ∀ (x_1 y : ↥N),
                                      dualSubmoduleParing B x (x_1 + y) =
                                        dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                            map_smul' :=
                              (_ :
                                ∀ (r : R) (m : ↥N),
                                  AddHom.toFun
                                      { toFun := dualSubmoduleParing B x,
                                        map_add' :=
                                          (_ :
                                            ∀ (x_1 y : ↥N),
                                              dualSubmoduleParing B x (x_1 + y) =
                                                dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                      (r • m) =
                                    (RingHom.id R) r •
                                      AddHom.toFun
                                        { toFun := dualSubmoduleParing B x,
                                          map_add' :=
                                            (_ :
                                              ∀ (x_1 y : ↥N),
                                                dualSubmoduleParing B x (x_1 + y) =
                                                  dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                        m) })
                        x +
                      (fun x =>
                          {
                            toAddHom :=
                              { toFun := dualSubmoduleParing B x,
                                map_add' :=
                                  (_ :
                                    ∀ (x_1 y : ↥N),
                                      dualSubmoduleParing B x (x_1 + y) =
                                        dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                            map_smul' :=
                              (_ :
                                ∀ (r : R) (m : ↥N),
                                  AddHom.toFun
                                      { toFun := dualSubmoduleParing B x,
                                        map_add' :=
                                          (_ :
                                            ∀ (x_1 y : ↥N),
                                              dualSubmoduleParing B x (x_1 + y) =
                                                dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                      (r • m) =
                                    (RingHom.id R) r •
                                      AddHom.toFun
                                        { toFun := dualSubmoduleParing B x,
                                          map_add' :=
                                            (_ :
                                              ∀ (x_1 y : ↥N),
                                                dualSubmoduleParing B x (x_1 + y) =
                                                  dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                        m) })
                        y) }
          (r • x))
        y) =
    (algebraMap R S)
      (((RingHom.id R) r •
          AddHom.toFun
            {
              toFun := fun x =>
                {
                  toAddHom :=
                    { toFun := dualSubmoduleParing B x,
                      map_add' :=
                        (_ :
                          ∀ (x_1 y : ↥N),
                            dualSubmoduleParing B x (x_1 + y) =
                              dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (m : ↥N),
                        AddHom.toFun
                            { toFun := dualSubmoduleParing B x,
                              map_add' :=
                                (_ :
                                  ∀ (x_1 y : ↥N),
                                    dualSubmoduleParing B x (x_1 + y) =
                                      dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                            (r • m) =
                          (RingHom.id R) r •
                            AddHom.toFun
                              { toFun := dualSubmoduleParing B x,
                                map_add' :=
                                  (_ :
                                    ∀ (x_1 y : ↥N),
                                      dualSubmoduleParing B x (x_1 + y) =
                                        dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                              m) },
              map_add' :=
                (_ :
                  ∀ (x y : ↥(dualSubmodule B N)),
                    (fun x =>
                          {
                            toAddHom :=
                              { toFun := dualSubmoduleParing B x,
                                map_add' :=
                                  (_ :
                                    ∀ (x_1 y : ↥N),
                                      dualSubmoduleParing B x (x_1 + y) =
                                        dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                            map_smul' :=
                              (_ :
                                ∀ (r : R) (m : ↥N),
                                  AddHom.toFun
                                      { toFun := dualSubmoduleParing B x,
                                        map_add' :=
                                          (_ :
                                            ∀ (x_1 y : ↥N),
                                              dualSubmoduleParing B x (x_1 + y) =
                                                dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                      (r • m) =
                                    (RingHom.id R) r •
                                      AddHom.toFun
                                        { toFun := dualSubmoduleParing B x,
                                          map_add' :=
                                            (_ :
                                              ∀ (x_1 y : ↥N),
                                                dualSubmoduleParing B x (x_1 + y) =
                                                  dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                        m) })
                        (x + y) =
                      (fun x =>
                            {
                              toAddHom :=
                                { toFun := dualSubmoduleParing B x,
                                  map_add' :=
                                    (_ :
                                      ∀ (x_1 y : ↥N),
                                        dualSubmoduleParing B x (x_1 + y) =
                                          dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                              map_smul' :=
                                (_ :
                                  ∀ (r : R) (m : ↥N),
                                    AddHom.toFun
                                        { toFun := dualSubmoduleParing B x,
                                          map_add' :=
                                            (_ :
                                              ∀ (x_1 y : ↥N),
                                                dualSubmoduleParing B x (x_1 + y) =
                                                  dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                        (r • m) =
                                      (RingHom.id R) r •
                                        AddHom.toFun
                                          { toFun := dualSubmoduleParing B x,
                                            map_add' :=
                                              (_ :
                                                ∀ (x_1 y : ↥N),
                                                  dualSubmoduleParing B x (x_1 + y) =
                                                    dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                          m) })
                          x +
                        (fun x =>
                            {
                              toAddHom :=
                                { toFun := dualSubmoduleParing B x,
                                  map_add' :=
                                    (_ :
                                      ∀ (x_1 y : ↥N),
                                        dualSubmoduleParing B x (x_1 + y) =
                                          dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) },
                              map_smul' :=
                                (_ :
                                  ∀ (r : R) (m : ↥N),
                                    AddHom.toFun
                                        { toFun := dualSubmoduleParing B x,
                                          map_add' :=
                                            (_ :
                                              ∀ (x_1 y : ↥N),
                                                dualSubmoduleParing B x (x_1 + y) =
                                                  dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                        (r • m) =
                                      (RingHom.id R) r •
                                        AddHom.toFun
                                          { toFun := dualSubmoduleParing B x,
                                            map_add' :=
                                              (_ :
                                                ∀ (x_1 y : ↥N),
                                                  dualSubmoduleParing B x (x_1 + y) =
                                                    dualSubmoduleParing B x x_1 + dualSubmoduleParing B x y) }
                                          m) })
                          y) }
            x)
        y)

Next tactic:
simp [← Algebra.smul_def]