R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
⊢ IsNoetherian R { x // x ∈ N }
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
⊢ IsNoetherian R { x // x ∈ N }
let ⟨s, hs⟩ := hN
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this : DecidableEq M
⊢ IsNoetherian R { x // x ∈ N }
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
⊢ IsNoetherian R { x // x ∈ N }
haveI := Classical.decEq M
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝ : DecidableEq M
this : DecidableEq R
⊢ IsNoetherian R { x // x ∈ N }
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this : DecidableEq M
⊢ IsNoetherian R { x // x ∈ N }
haveI := Classical.decEq R
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ IsNoetherian R { x // x ∈ N }
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝ : DecidableEq M
this : DecidableEq R
⊢ IsNoetherian R { x // x ∈ N }
have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx
case refine_1
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ (↑↑s → R) →ₗ[R] { x // x ∈ N }

case refine_2
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ LinearMap.range ?refine_1 = ⊤
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ IsNoetherian R { x // x ∈ N }
refine
  @isNoetherian_of_surjective
    R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi
case refine_1.toAddHom
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ AddHom (↑↑s → R) { x // x ∈ N }

case refine_1.map_smul'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ ∀ (r : R) (x : ↑↑s → R),
    AddHom.toFun ?refine_1.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun ?refine_1.toAddHom x
case refine_1
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ (↑↑s → R) →ₗ[R] { x // x ∈ N }
fapply LinearMap.mk
case refine_1.toAddHom.toFun
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ (↑↑s → R) → { x // x ∈ N }

case refine_1.toAddHom.map_add'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ ∀ (x y : ↑↑s → R), ?refine_1.toAddHom.toFun (x + y) = ?refine_1.toAddHom.toFun x + ?refine_1.toAddHom.toFun y
case refine_1.toAddHom
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ AddHom (↑↑s → R) { x // x ∈ N }
fapply AddHom.mk
no goals
case refine_1.toAddHom.toFun
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ (↑↑s → R) → { x // x ∈ N }
exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩
case refine_1.toAddHom.map_add'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
    { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
      { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }
case refine_1.toAddHom.map_add'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ ∀ (x y : ↑↑s → R),
    { val := ∑ i in Finset.attach s, (x + y) i • ↑i, property := (_ : ∑ i in Finset.attach s, (x + y) i • ↑i ∈ N) } =
      { val := ∑ i in Finset.attach s, x i • ↑i, property := (_ : ∑ i in Finset.attach s, x i • ↑i ∈ N) } +
        { val := ∑ i in Finset.attach s, y i • ↑i, property := (_ : ∑ i in Finset.attach s, y i • ↑i ∈ N) }
intro f g
case refine_1.toAddHom.map_add'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ ↑{ val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
    ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
        { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
case refine_1.toAddHom.map_add'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
    { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
      { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }
apply Subtype.eq
case refine_1.toAddHom.map_add'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ ∑ i in Finset.attach s, (f i + g i) • ↑i =
    ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
        { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
case refine_1.toAddHom.map_add'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ ↑{ val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
    ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
        { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
change (∑ i in s.attach, (f i + g i) • _) = _
case refine_1.toAddHom.map_add'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ ∑ x in Finset.attach s, f x • ↑x + ∑ x in Finset.attach s, g x • ↑x =
    ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
        { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
case refine_1.toAddHom.map_add'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ ∑ i in Finset.attach s, (f i + g i) • ↑i =
    ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
        { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
simp only [add_smul, Finset.sum_add_distrib]
no goals
case refine_1.toAddHom.map_add'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
f g : ↑↑s → R
⊢ ∑ x in Finset.attach s, f x • ↑x + ∑ x in Finset.attach s, g x • ↑x =
    ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
        { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
rfl
case refine_1.map_smul'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ AddHom.toFun
      {
        toFun := fun f =>
          { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
        map_add' :=
          (_ :
            ∀ (f g : ↑↑s → R),
              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                  { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
      (c • f) =
    ↑(RingHom.id R) c •
      AddHom.toFun
        {
          toFun := fun f =>
            { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
          map_add' :=
            (_ :
              ∀ (f g : ↑↑s → R),
                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                    { val := ∑ i in Finset.attach s, g i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
        f
case refine_1.map_smul'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ ∀ (r : R) (x : ↑↑s → R),
    AddHom.toFun
        {
          toFun := fun f =>
            { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
          map_add' :=
            (_ :
              ∀ (f g : ↑↑s → R),
                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                    { val := ∑ i in Finset.attach s, g i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
        (r • x) =
      ↑(RingHom.id R) r •
        AddHom.toFun
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
          x
intro c f
case refine_1.map_smul'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ ↑(AddHom.toFun
        {
          toFun := fun f =>
            { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
          map_add' :=
            (_ :
              ∀ (f g : ↑↑s → R),
                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                    { val := ∑ i in Finset.attach s, g i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
        (c • f)) =
    ↑(↑(RingHom.id R) c •
        AddHom.toFun
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
          f)
case refine_1.map_smul'
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ AddHom.toFun
      {
        toFun := fun f =>
          { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
        map_add' :=
          (_ :
            ∀ (f g : ↑↑s → R),
              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                  { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
      (c • f) =
    ↑(RingHom.id R) c •
      AddHom.toFun
        {
          toFun := fun f =>
            { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
          map_add' :=
            (_ :
              ∀ (f g : ↑↑s → R),
                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                    { val := ∑ i in Finset.attach s, g i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
        f
apply Subtype.eq
case refine_1.map_smul'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ ∑ i in Finset.attach s, (c • f i) • ↑i =
    ↑(↑(RingHom.id R) c •
        AddHom.toFun
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
          f)
case refine_1.map_smul'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ ↑(AddHom.toFun
        {
          toFun := fun f =>
            { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
          map_add' :=
            (_ :
              ∀ (f g : ↑↑s → R),
                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                    { val := ∑ i in Finset.attach s, g i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
        (c • f)) =
    ↑(↑(RingHom.id R) c •
        AddHom.toFun
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
          f)
change (∑ i in s.attach, (c • f i) • _) = _
case refine_1.map_smul'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ ∑ x in Finset.attach s, c • f x • ↑x =
    ↑(↑(RingHom.id R) c •
        { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) })
case refine_1.map_smul'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ ∑ i in Finset.attach s, (c • f i) • ↑i =
    ↑(↑(RingHom.id R) c •
        AddHom.toFun
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
          f)
simp only [smul_eq_mul, mul_smul]
no goals
case refine_1.map_smul'.a
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
c : R
f : ↑↑s → R
⊢ ∑ x in Finset.attach s, c • f x • ↑x =
    ↑(↑(RingHom.id R) c •
        { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) })
exact Finset.smul_sum.symm
case refine_2
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ Surjective
    ↑{
        toAddHom :=
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
        map_smul' :=
          (_ :
            ∀ (c : R) (f : ↑↑s → R),
              AddHom.toFun
                  {
                    toFun := fun f =>
                      { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                    map_add' :=
                      (_ :
                        ∀ (f g : ↑↑s → R),
                          { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                              { val := ∑ i in Finset.attach s, g i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                  (c • f) =
                ↑(RingHom.id R) c •
                  AddHom.toFun
                    {
                      toFun := fun f =>
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                      map_add' :=
                        (_ :
                          ∀ (f g : ↑↑s → R),
                            { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                              { val := ∑ i in Finset.attach s, f i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                { val := ∑ i in Finset.attach s, g i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                    f) }
case refine_2
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ LinearMap.range
      {
        toAddHom :=
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
        map_smul' :=
          (_ :
            ∀ (c : R) (f : ↑↑s → R),
              AddHom.toFun
                  {
                    toFun := fun f =>
                      { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                    map_add' :=
                      (_ :
                        ∀ (f g : ↑↑s → R),
                          { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                              { val := ∑ i in Finset.attach s, g i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                  (c • f) =
                ↑(RingHom.id R) c •
                  AddHom.toFun
                    {
                      toFun := fun f =>
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                      map_add' :=
                        (_ :
                          ∀ (f g : ↑↑s → R),
                            { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                              { val := ∑ i in Finset.attach s, f i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                { val := ∑ i in Finset.attach s, g i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                    f) } =
    ⊤
rw [LinearMap.range_eq_top]
case refine_2.mk
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn }
case refine_2
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
⊢ Surjective
    ↑{
        toAddHom :=
          {
            toFun := fun f =>
              { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
            map_add' :=
              (_ :
                ∀ (f g : ↑↑s → R),
                  { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                      property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                    { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                      { val := ∑ i in Finset.attach s, g i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
        map_smul' :=
          (_ :
            ∀ (c : R) (f : ↑↑s → R),
              AddHom.toFun
                  {
                    toFun := fun f =>
                      { val := ∑ i in Finset.attach s, f i • ↑i,
                        property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                    map_add' :=
                      (_ :
                        ∀ (f g : ↑↑s → R),
                          { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                              { val := ∑ i in Finset.attach s, g i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                  (c • f) =
                ↑(RingHom.id R) c •
                  AddHom.toFun
                    {
                      toFun := fun f =>
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                      map_add' :=
                        (_ :
                          ∀ (f g : ↑↑s → R),
                            { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                              { val := ∑ i in Finset.attach s, f i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                { val := ∑ i in Finset.attach s, g i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                    f) }
rintro ⟨n, hn⟩
case refine_2.mk
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn }
case refine_2.mk
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn }
change n ∈ N at hn
case refine_2.mk
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn✝ : n ∈ N
hn : ∃ l, l ∈ Finsupp.supported R R ↑s ∧ ↑(Finsupp.total M M R id) l = n
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn✝ }
case refine_2.mk
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn }
rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn }
case refine_2.mk
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn✝ : n ∈ N
hn : ∃ l, l ∈ Finsupp.supported R R ↑s ∧ ↑(Finsupp.total M M R id) l = n
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn✝ }
rcases hn with ⟨l, hl1, hl2⟩
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ↑(↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        fun x => ↑l ↑x) =
    ↑{ val := n, property := hn }
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ∃ a,
    ↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        a =
      { val := n, property := hn }
refine' ⟨fun x => l x, Subtype.ext _⟩
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ∑ i in Finset.attach s, ↑l ↑i • ↑i = n
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ↑(↑{
            toAddHom :=
              {
                toFun := fun f =>
                  { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                map_add' :=
                  (_ :
                    ∀ (f g : ↑↑s → R),
                      { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                          property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                        { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                          { val := ∑ i in Finset.attach s, g i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) },
            map_smul' :=
              (_ :
                ∀ (c : R) (f : ↑↑s → R),
                  AddHom.toFun
                      {
                        toFun := fun f =>
                          { val := ∑ i in Finset.attach s, f i • ↑i,
                            property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                        map_add' :=
                          (_ :
                            ∀ (f g : ↑↑s → R),
                              { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                  property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                { val := ∑ i in Finset.attach s, f i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                  { val := ∑ i in Finset.attach s, g i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                      (c • f) =
                    ↑(RingHom.id R) c •
                      AddHom.toFun
                        {
                          toFun := fun f =>
                            { val := ∑ i in Finset.attach s, f i • ↑i,
                              property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) },
                          map_add' :=
                            (_ :
                              ∀ (f g : ↑↑s → R),
                                { val := ∑ i in Finset.attach s, (f + g) i • ↑i,
                                    property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } =
                                  { val := ∑ i in Finset.attach s, f i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } +
                                    { val := ∑ i in Finset.attach s, g i • ↑i,
                                      property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }
                        f) }
        fun x => ↑l ↑x) =
    ↑{ val := n, property := hn }
change (∑ i in s.attach, l i • (i : M)) = n
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ∑ a in l.support, ↑l a • id a = ∑ x in s, ↑l x • x
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ∑ i in Finset.attach s, ↑l ↑i • ↑i = n
rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2,
  Finsupp.total_apply, Finsupp.sum, eq_comm]
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
x : M
x✝ : x ∈ s
hx : ¬x ∈ l.support
⊢ ↑l x • id x = 0
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
⊢ ∑ a in l.support, ↑l a • id a = ∑ x in s, ↑l x • x
refine' Finset.sum_subset hl1 fun x _ hx => _
no goals
case refine_2.mk.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Ring R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
N : Submodule R M
I : IsNoetherianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝¹ : DecidableEq M
this✝ : DecidableEq R
this : ∀ (x : M), x ∈ s → x ∈ N
n : M
hn : n ∈ N
l : M →₀ R
hl1 : l ∈ Finsupp.supported R R ↑s
hl2 : ↑(Finsupp.total M M R id) l = n
x : M
x✝ : x ∈ s
hx : ¬x ∈ l.support
⊢ ↑l x • id x = 0
rw [Finsupp.not_mem_support_iff.1 hx, zero_smul]