l3lab/ntp-mathlib huggingface dataset:
/-- The `R[IX]`-submodule of `M[X]` associated with an `I`-filtration. -/
protected def submodule : Submodule (reesAlgebra I) (PolynomialModule R M) where
  carrier := { f | ∀ i, f i ∈ F.N i }
  add_mem' hf hg i := Submodule.add_mem _ (hf i) (hg i)
  zero_mem' i := Submodule.zero_mem _
  smul_mem' r f hf i := by
    rw [Subalgebra.smul_def, PolynomialModule.smul_apply]
    apply Submodule.sum_mem
    rintro ⟨j, k⟩ e
    

Proof state:
case a.mk
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
r : ↥(reesAlgebra I)
f : PolynomialModule R M
hf :
  f ∈
    {
          toAddSubsemigroup :=
            { carrier := {f | ∀ (i : ℕ), f i ∈ N F i},
              add_mem' :=
                (_ :
                  ∀ {a b : PolynomialModule R M},
                    a ∈ {f | ∀ (i : ℕ), f i ∈ N F i} →
                      b ∈ {f | ∀ (i : ℕ), f i ∈ N F i} → ∀ (i : ℕ), a i + b i ∈ N F i) },
          zero_mem' := (_ : ∀ (i : ℕ), 0 ∈ N F i) }.toAddSubsemigroup.carrier
i j k : ℕ
e : (j, k) ∈ Finset.antidiagonal i
⊢ coeff ↑r (j, k).1 • f (j, k).2 ∈ N F i

Next tactic:
rw [Finset.mem_antidiagonal] at e
/-- The `R[IX]`-submodule of `M[X]` associated with an `I`-filtration. -/
protected def submodule : Submodule (reesAlgebra I) (PolynomialModule R M) where
  carrier := { f | ∀ i, f i ∈ F.N i }
  add_mem' hf hg i := Submodule.add_mem _ (hf i) (hg i)
  zero_mem' i := Submodule.zero_mem _
  smul_mem' r f hf i := by
    rw [Subalgebra.smul_def, PolynomialModule.smul_apply]
    apply Submodule.sum_mem
    rintro ⟨j, k⟩ e
    rw [Finset.mem_antidiagonal] at e
    

Proof state:
case a.mk
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
r : ↥(reesAlgebra I)
f : PolynomialModule R M
hf :
  f ∈
    {
          toAddSubsemigroup :=
            { carrier := {f | ∀ (i : ℕ), f i ∈ N F i},
              add_mem' :=
                (_ :
                  ∀ {a b : PolynomialModule R M},
                    a ∈ {f | ∀ (i : ℕ), f i ∈ N F i} →
                      b ∈ {f | ∀ (i : ℕ), f i ∈ N F i} → ∀ (i : ℕ), a i + b i ∈ N F i) },
          zero_mem' := (_ : ∀ (i : ℕ), 0 ∈ N F i) }.toAddSubsemigroup.carrier
i j k : ℕ
e : (j, k).1 + (j, k).2 = i
⊢ coeff ↑r (j, k).1 • f (j, k).2 ∈ N F i

Next tactic:
subst e
/-- The `R[IX]`-submodule of `M[X]` associated with an `I`-filtration. -/
protected def submodule : Submodule (reesAlgebra I) (PolynomialModule R M) where
  carrier := { f | ∀ i, f i ∈ F.N i }
  add_mem' hf hg i := Submodule.add_mem _ (hf i) (hg i)
  zero_mem' i := Submodule.zero_mem _
  smul_mem' r f hf i := by
    rw [Subalgebra.smul_def, PolynomialModule.smul_apply]
    apply Submodule.sum_mem
    rintro ⟨j, k⟩ e
    rw [Finset.mem_antidiagonal] at e
    subst e
    

Proof state:
case a.mk
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
r : ↥(reesAlgebra I)
f : PolynomialModule R M
hf :
  f ∈
    {
          toAddSubsemigroup :=
            { carrier := {f | ∀ (i : ℕ), f i ∈ N F i},
              add_mem' :=
                (_ :
                  ∀ {a b : PolynomialModule R M},
                    a ∈ {f | ∀ (i : ℕ), f i ∈ N F i} →
                      b ∈ {f | ∀ (i : ℕ), f i ∈ N F i} → ∀ (i : ℕ), a i + b i ∈ N F i) },
          zero_mem' := (_ : ∀ (i : ℕ), 0 ∈ N F i) }.toAddSubsemigroup.carrier
j k : ℕ
⊢ coeff ↑r (j, k).1 • f (j, k).2 ∈ N F ((j, k).1 + (j, k).2)

Next tactic:
exact F.pow_smul_le j k (Submodule.smul_mem_smul (r.2 j) (hf k))
theorem inf_submodule : (F ⊓ F').submodule = F.submodule ⊓ F'.submodule := by
  

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
⊢ Filtration.submodule (F ⊓ F') = Filtration.submodule F ⊓ Filtration.submodule F'

Next tactic:
ext
theorem inf_submodule : (F ⊓ F').submodule = F.submodule ⊓ F'.submodule := by
  ext
  

Proof state:
case h
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
x✝ : PolynomialModule R M
⊢ x✝ ∈ Filtration.submodule (F ⊓ F') ↔ x✝ ∈ Filtration.submodule F ⊓ Filtration.submodule F'

Next tactic:
exact forall_and
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
⊢ AddSubmonoid.closure (⋃ i, ⇑(single R i) '' ↑(N F i)) = (Filtration.submodule F).toAddSubmonoid

Next tactic:
apply le_antisymm
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · 

Proof state:
case a
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
⊢ AddSubmonoid.closure (⋃ i, ⇑(single R i) '' ↑(N F i)) ≤ (Filtration.submodule F).toAddSubmonoid

Next tactic:
rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    

Proof state:
case a
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
⊢ ∀ (i : ℕ), ⇑(single R i) '' ↑(N F i) ⊆ ↑(Filtration.submodule F).toAddSubmonoid

Next tactic:
rintro i _ ⟨m, hm, rfl⟩ j
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    

Proof state:
case a.intro.intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
i : ℕ
m : M
hm : m ∈ ↑(N F i)
j : ℕ
⊢ ((single R i) m) j ∈ N F j

Next tactic:
rw [single_apply]
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    

Proof state:
case a.intro.intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
i : ℕ
m : M
hm : m ∈ ↑(N F i)
j : ℕ
⊢ (if i = j then m else 0) ∈ N F j

Next tactic:
split_ifs with h
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    split_ifs with h
    · 

Proof state:
case pos
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h✝ : Stable F
i : ℕ
m : M
hm : m ∈ ↑(N F i)
j : ℕ
h : i = j
⊢ m ∈ N F j

Next tactic:
rwa [← h]
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    split_ifs with h
    · rwa [← h]
    · 

Proof state:
case neg
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h✝ : Stable F
i : ℕ
m : M
hm : m ∈ ↑(N F i)
j : ℕ
h : ¬i = j
⊢ 0 ∈ N F j

Next tactic:
exact (F.N j).zero_mem
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    split_ifs with h
    · rwa [← h]
    · exact (F.N j).zero_mem
  · 

Proof state:
case a
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
⊢ (Filtration.submodule F).toAddSubmonoid ≤ AddSubmonoid.closure (⋃ i, ⇑(single R i) '' ↑(N F i))

Next tactic:
intro f hf
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    split_ifs with h
    · rwa [← h]
    · exact (F.N j).zero_mem
  · intro f hf
    

Proof state:
case a
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
f : PolynomialModule R M
hf : f ∈ (Filtration.submodule F).toAddSubmonoid
⊢ f ∈ AddSubmonoid.closure (⋃ i, ⇑(single R i) '' ↑(N F i))

Next tactic:
rw [← f.sum_single]
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    split_ifs with h
    · rwa [← h]
    · exact (F.N j).zero_mem
  · intro f hf
    rw [← f.sum_single]
    

Proof state:
case a
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
f : PolynomialModule R M
hf : f ∈ (Filtration.submodule F).toAddSubmonoid
⊢ Finsupp.sum f Finsupp.single ∈ AddSubmonoid.closure (⋃ i, ⇑(single R i) '' ↑(N F i))

Next tactic:
apply AddSubmonoid.sum_mem _ _
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    split_ifs with h
    · rwa [← h]
    · exact (F.N j).zero_mem
  · intro f hf
    rw [← f.sum_single]
    apply AddSubmonoid.sum_mem _ _
    

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
f : PolynomialModule R M
hf : f ∈ (Filtration.submodule F).toAddSubmonoid
⊢ ∀ c ∈ f.support, (fun₀ | c => f c) ∈ AddSubmonoid.closure (⋃ i, ⇑(single R i) '' ↑(N F i))

Next tactic:
rintro c -
theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid := by
  apply le_antisymm
  · rw [AddSubmonoid.closure_le, Set.iUnion_subset_iff]
    rintro i _ ⟨m, hm, rfl⟩ j
    rw [single_apply]
    split_ifs with h
    · rwa [← h]
    · exact (F.N j).zero_mem
  · intro f hf
    rw [← f.sum_single]
    apply AddSubmonoid.sum_mem _ _
    rintro c -
    

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
f : PolynomialModule R M
hf : f ∈ (Filtration.submodule F).toAddSubmonoid
c : ℕ
⊢ (fun₀ | c => f c) ∈ AddSubmonoid.closure (⋃ i, ⇑(single R i) '' ↑(N F i))

Next tactic:
exact AddSubmonoid.subset_closure (Set.subset_iUnion _ c <| Set.mem_image_of_mem _ (hf c))
theorem submodule_span_single :
    Submodule.span (reesAlgebra I) (⋃ i, single R i '' (F.N i : Set M)) = F.submodule := by
  

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
⊢ Submodule.span (↥(reesAlgebra I)) (⋃ i, ⇑(single R i) '' ↑(N F i)) = Filtration.submodule F

Next tactic:
rw [← Submodule.span_closure, submodule_closure_single, Submodule.coe_toAddSubmonoid]
theorem submodule_span_single :
    Submodule.span (reesAlgebra I) (⋃ i, single R i '' (F.N i : Set M)) = F.submodule := by
  rw [← Submodule.span_closure, submodule_closure_single, Submodule.coe_toAddSubmonoid]
  

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
⊢ Submodule.span ↥(reesAlgebra I) ↑(Filtration.submodule F) = Filtration.submodule F

Next tactic:
exact Submodule.span_eq (Filtration.submodule F)
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
⊢ Filtration.submodule F = Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)) ↔
    ∀ n ≥ n₀, I • N F n = N F (n + 1)

Next tactic:
rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
⊢ (∀ (i : ℕ),
      ⇑(single R i) '' ↑(N F i) ⊆
        ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))) ↔
    ∀ n ≥ n₀, I • N F n = N F (n + 1)
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
⊢ Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)) ≤
    Submodule.span (↥(reesAlgebra I)) (⋃ i, ⇑(single R i) '' ↑(N F i))

Next tactic:
swap
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · 

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
⊢ Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)) ≤
    Submodule.span (↥(reesAlgebra I)) (⋃ i, ⇑(single R i) '' ↑(N F i))

Next tactic:
exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
⊢ (∀ (i : ℕ),
      ⇑(single R i) '' ↑(N F i) ⊆
        ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))) ↔
    ∀ n ≥ n₀, I • N F n = N F (n + 1)

Next tactic:
constructor
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · 

Proof state:
case mp
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
⊢ (∀ (i : ℕ),
      ⇑(single R i) '' ↑(N F i) ⊆
        ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))) →
    ∀ n ≥ n₀, I • N F n = N F (n + 1)

Next tactic:
intro H n hn
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · intro H n hn
    

Proof state:
case mp
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
H :
  ∀ (i : ℕ),
    ⇑(single R i) '' ↑(N F i) ⊆ ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))
n : ℕ
hn : n ≥ n₀
⊢ I • N F n = N F (n + 1)

Next tactic:
refine' (F.smul_le n).antisymm _
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · intro H n hn
    refine' (F.smul_le n).antisymm _
    

Proof state:
case mp
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
H :
  ∀ (i : ℕ),
    ⇑(single R i) '' ↑(N F i) ⊆ ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))
n : ℕ
hn : n ≥ n₀
⊢ N F (n + 1) ≤ I • N F n

Next tactic:
intro x hx
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · intro H n hn
    refine' (F.smul_le n).antisymm _
    intro x hx
    

Proof state:
case mp
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
H :
  ∀ (i : ℕ),
    ⇑(single R i) '' ↑(N F i) ⊆ ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))
n : ℕ
hn : n ≥ n₀
x : M
hx : x ∈ N F (n + 1)
⊢ x ∈ I • N F n

Next tactic:
obtain ⟨l, hl⟩ := (Finsupp.mem_span_iff_total _ _ _).mp (H _ ⟨x, hx, rfl⟩)
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · intro H n hn
    refine' (F.smul_le n).antisymm _
    intro x hx
    obtain ⟨l, hl⟩ := (Finsupp.mem_span_iff_total _ _ _).mp (H _ ⟨x, hx, rfl⟩)
    

Proof state:
case mp.intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
H :
  ∀ (i : ℕ),
    ⇑(single R i) '' ↑(N F i) ⊆ ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))
n : ℕ
hn : n ≥ n₀
x : M
hx : x ∈ N F (n + 1)
l : ↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)) →₀ ↥(reesAlgebra I)
hl :
  (Finsupp.total (↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i))) (PolynomialModule R M) (↥(reesAlgebra I))
        Subtype.val)
      l =
    (single R (n + 1)) x
⊢ x ∈ I • N F n

Next tactic:
replace hl := congr_arg (fun f : ℕ →₀ M => f (n + 1)) hl
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · intro H n hn
    refine' (F.smul_le n).antisymm _
    intro x hx
    obtain ⟨l, hl⟩ := (Finsupp.mem_span_iff_total _ _ _).mp (H _ ⟨x, hx, rfl⟩)
    replace hl := congr_arg (fun f : ℕ →₀ M => f (n + 1)) hl
    

Proof state:
case mp.intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
H :
  ∀ (i : ℕ),
    ⇑(single R i) '' ↑(N F i) ⊆ ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))
n : ℕ
hn : n ≥ n₀
x : M
hx : x ∈ N F (n + 1)
l : ↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)) →₀ ↥(reesAlgebra I)
hl :
  (fun f => f (n + 1))
      ((Finsupp.total (↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i))) (PolynomialModule R M) (↥(reesAlgebra I))
          Subtype.val)
        l) =
    (fun f => f (n + 1)) ((single R (n + 1)) x)
⊢ x ∈ I • N F n

Next tactic:
dsimp only at hl
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · intro H n hn
    refine' (F.smul_le n).antisymm _
    intro x hx
    obtain ⟨l, hl⟩ := (Finsupp.mem_span_iff_total _ _ _).mp (H _ ⟨x, hx, rfl⟩)
    replace hl := congr_arg (fun f : ℕ →₀ M => f (n + 1)) hl
    dsimp only at hl
    

Proof state:
case mp.intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
H :
  ∀ (i : ℕ),
    ⇑(single R i) '' ↑(N F i) ⊆ ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))
n : ℕ
hn : n ≥ n₀
x : M
hx : x ∈ N F (n + 1)
l : ↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)) →₀ ↥(reesAlgebra I)
hl :
  ((Finsupp.total (↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i))) (PolynomialModule R M) (↥(reesAlgebra I))
          Subtype.val)
        l)
      (n + 1) =
    ((single R (n + 1)) x) (n + 1)
⊢ x ∈ I • N F n

Next tactic:
erw [Finsupp.single_eq_same] at hl
theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) :
    F.submodule = Submodule.span _ (⋃ i ≤ n₀, single R i '' (F.N i : Set M)) ↔
      ∀ n ≥ n₀, I • F.N n = F.N (n + 1) := by
  rw [← submodule_span_single, ← LE.le.le_iff_eq, Submodule.span_le, Set.iUnion_subset_iff]
  swap; · exact Submodule.span_mono (Set.iUnion₂_subset_iUnion _ _)
  constructor
  · intro H n hn
    refine' (F.smul_le n).antisymm _
    intro x hx
    obtain ⟨l, hl⟩ := (Finsupp.mem_span_iff_total _ _ _).mp (H _ ⟨x, hx, rfl⟩)
    replace hl := congr_arg (fun f : ℕ →₀ M => f (n + 1)) hl
    dsimp only at hl
    erw [Finsupp.single_eq_same] at hl
    

Proof state:
case mp.intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h : Stable F
n₀ : ℕ
H :
  ∀ (i : ℕ),
    ⇑(single R i) '' ↑(N F i) ⊆ ↑(Submodule.span (↥(reesAlgebra I)) (⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)))
n : ℕ
hn : n ≥ n₀
x : M
hx : x ∈ N F (n + 1)
l : ↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i)) →₀ ↥(reesAlgebra I)
hl :
  ((Finsupp.total (↑(⋃ i, ⋃ (_ : i ≤ n₀), ⇑(single R i) '' ↑(N F i))) (PolynomialModule R M) (↥(reesAlgebra I))
          Subtype.val)
        l)
      (n + 1) =
    x
⊢ x ∈ I • N F n

Next tactic:
rw [← hl, Finsupp.total_apply, Finsupp.sum_apply]