Theorem: isArtinian_of_fg_of_artinian
File: Mathlib/RingTheory/Artinian.lean

tactic: let ⟨s, hs⟩ := hN
state_before: R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
N : Submodule R M
inst✝ : IsArtinianRing R
hN : FG N
⊢ IsArtinian R { x // x ∈ N }

tactic: haveI := Classical.decEq M
state_before: R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
N : Submodule R M
inst✝ : IsArtinianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
⊢ IsArtinian R { x // x ∈ N }

tactic: haveI := Classical.decEq R
state_before: R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
N : Submodule R M
inst✝ : IsArtinianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this : DecidableEq M
⊢ IsArtinian R { x // x ∈ N }

tactic: have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx
state_before: R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
N : Submodule R M
inst✝ : IsArtinianRing R
hN : FG N
s : Finset M
hs : span R ↑s = N
this✝ : DecidableEq M
this : DecidableEq R
⊢ IsArtinian R { x // x ∈ N }

tactic: refine' @isArtinian_of_surjective _ ((↑s : Set M) →₀ R) N _ _ _ _ _ _ _ isArtinian_finsupp
state_before: R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
N : Submodule R M
inst✝ : IsArtinianRing 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
⊢ IsArtinian R { x // x ∈ N }

tactic: . exact Finsupp.total (↑s : Set M) N R (fun i => ⟨i, hs ▸ subset_span i.2⟩)
state_before: 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
inst✝ : IsArtinianRing 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
inst✝ : IsArtinianRing 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 ↑?refine'_1

tactic: . rw [← LinearMap.range_eq_top, eq_top_iff,
     ← map_le_map_iff_of_injective (show Injective (Submodule.subtype N)
       from Subtype.val_injective), Submodule.map_top, range_subtype,
       ← Submodule.map_top, ← Submodule.map_comp, Submodule.map_top]
  subst N
  refine span_le.2 (fun i hi => ?_)
  use Finsupp.single ⟨i, hi⟩ 1
  simp
state_before: 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
inst✝ : IsArtinianRing 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 ↑(Finsupp.total ↑↑s { x // x ∈ N } R fun i => { val := ↑i, property := (_ : ↑i ∈ N) })

tactic: exact Finsupp.total (↑s : Set M) N R (fun i => ⟨i, hs ▸ subset_span i.2⟩)
state_before: 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
inst✝ : IsArtinianRing 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 }

tactic: rw [← LinearMap.range_eq_top, eq_top_iff,
   ← map_le_map_iff_of_injective (show Injective (Submodule.subtype N)
     from Subtype.val_injective), Submodule.map_top, range_subtype,
     ← Submodule.map_top, ← Submodule.map_comp, Submodule.map_top]
state_before: 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
inst✝ : IsArtinianRing 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 ↑(Finsupp.total ↑↑s { x // x ∈ N } R fun i => { val := ↑i, property := (_ : ↑i ∈ N) })

tactic: subst N
state_before: 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
inst✝ : IsArtinianRing 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 ≤
    LinearMap.range
      (LinearMap.comp (Submodule.subtype N)
        (Finsupp.total ↑↑s { x // x ∈ N } R fun i => { val := ↑i, property := (_ : ↑i ∈ N) }))

tactic: refine span_le.2 (fun i hi => ?_)
state_before: case refine'_2
R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsArtinianRing R
s : Finset M
this✝¹ : DecidableEq M
this✝ : DecidableEq R
hN : FG (span R ↑s)
this : ∀ (x : M), x ∈ s → x ∈ span R ↑s
⊢ span R ↑s ≤
    LinearMap.range
      (LinearMap.comp (Submodule.subtype (span R ↑s))
        (Finsupp.total ↑↑s { x // x ∈ span R ↑s } R fun i => { val := ↑i, property := (_ : ↑i ∈ span R ↑s) }))

tactic: use Finsupp.single ⟨i, hi⟩ 1
state_before: case refine'_2
R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsArtinianRing R
s : Finset M
this✝¹ : DecidableEq M
this✝ : DecidableEq R
hN : FG (span R ↑s)
this : ∀ (x : M), x ∈ s → x ∈ span R ↑s
i : M
hi : i ∈ ↑s
⊢ i ∈
    ↑(LinearMap.range
        (LinearMap.comp (Submodule.subtype (span R ↑s))
          (Finsupp.total ↑↑s { x // x ∈ span R ↑s } R fun i => { val := ↑i, property := (_ : ↑i ∈ span R ↑s) })))

tactic: simp
state_before: case refine'_2
R : Type u_1
M : Type u_2
inst✝³ : Ring R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsArtinianRing R
s : Finset M
this✝¹ : DecidableEq M
this✝ : DecidableEq R
hN : FG (span R ↑s)
this : ∀ (x : M), x ∈ s → x ∈ span R ↑s
i : M
hi : i ∈ ↑s
⊢ ↑(LinearMap.comp (Submodule.subtype (span R ↑s))
          (Finsupp.total ↑↑s { x // x ∈ span R ↑s } R fun i => { val := ↑i, property := (_ : ↑i ∈ span R ↑s) }))
      (Finsupp.single { val := i, property := hi } 1) =
    i