l3lab/ntp-mathlib huggingface dataset:
/-- The `sInf` of a family of `I.Filtration`s is an `I.Filtration`. -/
instance : InfSet (I.Filtration M) :=
  ⟨fun S =>
    { N := sInf (Ideal.Filtration.N '' S)
      mono := fun i => by
        apply sInf_le_sInf_of_forall_exists_le _
        rintro _ ⟨⟨_, F, hF, rfl⟩, rfl⟩
        exact ⟨_, ⟨⟨_, F, hF, rfl⟩, rfl⟩, F.mono i⟩
      smul_le := fun i => by
        rw [sInf_eq_iInf', iInf_apply, iInf_apply]
        refine' Submodule.smul_iInf_le.trans _
        apply iInf_mono _
        

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
S : Set (Filtration I M)
i : ℕ
⊢ ∀ (i_1 : ↑(N '' S)), I • ↑i_1 i ≤ ↑i_1 (i + 1)

Next tactic:
rintro ⟨_, F, hF, rfl⟩
/-- The `sInf` of a family of `I.Filtration`s is an `I.Filtration`. -/
instance : InfSet (I.Filtration M) :=
  ⟨fun S =>
    { N := sInf (Ideal.Filtration.N '' S)
      mono := fun i => by
        apply sInf_le_sInf_of_forall_exists_le _
        rintro _ ⟨⟨_, F, hF, rfl⟩, rfl⟩
        exact ⟨_, ⟨⟨_, F, hF, rfl⟩, rfl⟩, F.mono i⟩
      smul_le := fun i => by
        rw [sInf_eq_iInf', iInf_apply, iInf_apply]
        refine' Submodule.smul_iInf_le.trans _
        apply iInf_mono _
        rintro ⟨_, F, hF, rfl⟩
        

Proof state:
case mk.intro.intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F✝ F' : Filtration I M
S : Set (Filtration I M)
i : ℕ
F : Filtration I M
hF : F ∈ S
⊢ I • ↑{ val := F.N, property := (_ : ∃ a ∈ S, a.N = F.N) } i ≤
    ↑{ val := F.N, property := (_ : ∃ a ∈ S, a.N = F.N) } (i + 1)

Next tactic:
exact F.smul_le i
/-- The trivial stable `I`-filtration of `N`. -/
@[simps]
def _root_.Ideal.stableFiltration (I : Ideal R) (N : Submodule R M) : I.Filtration M where
  N i := I ^ i • N
  mono i := 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
I : Ideal R
N : Submodule R M
i : ℕ
⊢ (fun i => I ^ i • N) (i + 1) ≤ (fun i => I ^ i • N) i

Next tactic:
dsimp only
/-- The trivial stable `I`-filtration of `N`. -/
@[simps]
def _root_.Ideal.stableFiltration (I : Ideal R) (N : Submodule R M) : I.Filtration M where
  N i := I ^ i • N
  mono i := by dsimp only; 

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I✝ : Ideal R
F F' : Filtration I✝ M
I : Ideal R
N : Submodule R M
i : ℕ
⊢ I ^ (i + 1) • N ≤ I ^ i • N

Next tactic:
rw [add_comm, pow_add, mul_smul]
/-- The trivial stable `I`-filtration of `N`. -/
@[simps]
def _root_.Ideal.stableFiltration (I : Ideal R) (N : Submodule R M) : I.Filtration M where
  N i := I ^ i • N
  mono i := by dsimp only; rw [add_comm, pow_add, mul_smul]; 

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I✝ : Ideal R
F F' : Filtration I✝ M
I : Ideal R
N : Submodule R M
i : ℕ
⊢ I ^ 1 • I ^ i • N ≤ I ^ i • N

Next tactic:
exact Submodule.smul_le_right
/-- The trivial stable `I`-filtration of `N`. -/
@[simps]
def _root_.Ideal.stableFiltration (I : Ideal R) (N : Submodule R M) : I.Filtration M where
  N i := I ^ i • N
  mono i := by dsimp only; rw [add_comm, pow_add, mul_smul]; exact Submodule.smul_le_right
  smul_le i := 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
I : Ideal R
N : Submodule R M
i : ℕ
⊢ I • (fun i => I ^ i • N) i ≤ (fun i => I ^ i • N) (i + 1)

Next tactic:
dsimp only
/-- The trivial stable `I`-filtration of `N`. -/
@[simps]
def _root_.Ideal.stableFiltration (I : Ideal R) (N : Submodule R M) : I.Filtration M where
  N i := I ^ i • N
  mono i := by dsimp only; rw [add_comm, pow_add, mul_smul]; exact Submodule.smul_le_right
  smul_le i := by dsimp only; 

Proof state:
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I✝ : Ideal R
F F' : Filtration I✝ M
I : Ideal R
N : Submodule R M
i : ℕ
⊢ I • I ^ i • N ≤ I ^ (i + 1) • N

Next tactic:
rw [add_comm, pow_add, mul_smul, pow_one]
theorem _root_.Ideal.stableFiltration_stable (I : Ideal R) (N : Submodule R M) :
    (I.stableFiltration N).Stable := 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
I : Ideal R
N : Submodule R M
⊢ Stable (stableFiltration I N)

Next tactic:
use 0
theorem _root_.Ideal.stableFiltration_stable (I : Ideal R) (N : Submodule R M) :
    (I.stableFiltration N).Stable := by
  use 0
  

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
I : Ideal R
N : Submodule R M
⊢ ∀ n ≥ 0, I • Ideal.Filtration.N (stableFiltration I N) n = Ideal.Filtration.N (stableFiltration I N) (n + 1)

Next tactic:
intro n _
theorem _root_.Ideal.stableFiltration_stable (I : Ideal R) (N : Submodule R M) :
    (I.stableFiltration N).Stable := by
  use 0
  intro n _
  

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
I : Ideal R
N : Submodule R M
n : ℕ
a✝ : n ≥ 0
⊢ I • Ideal.Filtration.N (stableFiltration I N) n = Ideal.Filtration.N (stableFiltration I N) (n + 1)

Next tactic:
dsimp
theorem _root_.Ideal.stableFiltration_stable (I : Ideal R) (N : Submodule R M) :
    (I.stableFiltration N).Stable := by
  use 0
  intro n _
  dsimp
  

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
I : Ideal R
N : Submodule R M
n : ℕ
a✝ : n ≥ 0
⊢ I • I ^ n • N = I ^ (n + 1) • N

Next tactic:
rw [add_comm, pow_add, mul_smul, pow_one]
theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀ := 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₀, ∀ (k : ℕ), N F (n₀ + k) = I ^ k • N F n₀

Next tactic:
obtain ⟨n₀, hn⟩ := h
theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀ := by
  obtain ⟨n₀, hn⟩ := h
  

Proof state:
case intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
n₀ : ℕ
hn : ∀ n ≥ n₀, I • N F n = N F (n + 1)
⊢ ∃ n₀, ∀ (k : ℕ), N F (n₀ + k) = I ^ k • N F n₀

Next tactic:
use n₀
theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀ := by
  obtain ⟨n₀, hn⟩ := h
  use n₀
  

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
n₀ : ℕ
hn : ∀ n ≥ n₀, I • N F n = N F (n + 1)
⊢ ∀ (k : ℕ), N F (n₀ + k) = I ^ k • N F n₀

Next tactic:
intro k
theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀ := by
  obtain ⟨n₀, hn⟩ := h
  use n₀
  intro k
  

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
n₀ : ℕ
hn : ∀ n ≥ n₀, I • N F n = N F (n + 1)
k : ℕ
⊢ N F (n₀ + k) = I ^ k • N F n₀

Next tactic:
induction' k with _ ih
theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀ := by
  obtain ⟨n₀, hn⟩ := h
  use n₀
  intro k
  induction' k with _ ih
  · 

Proof state:
case h.zero
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
n₀ : ℕ
hn : ∀ n ≥ n₀, I • N F n = N F (n + 1)
⊢ N F (n₀ + Nat.zero) = I ^ Nat.zero • N F n₀

Next tactic:
simp
theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀ := by
  obtain ⟨n₀, hn⟩ := h
  use n₀
  intro k
  induction' k with _ ih
  · simp
  · 

Proof state:
case h.succ
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
n₀ : ℕ
hn : ∀ n ≥ n₀, I • N F n = N F (n + 1)
n✝ : ℕ
ih : N F (n₀ + n✝) = I ^ n✝ • N F n₀
⊢ N F (n₀ + Nat.succ n✝) = I ^ Nat.succ n✝ • N F n₀

Next tactic:
rw [Nat.succ_eq_add_one, ← add_assoc, ← hn, ih, add_comm, pow_add, mul_smul, pow_one]
theorem Stable.exists_pow_smul_eq : ∃ n₀, ∀ k, F.N (n₀ + k) = I ^ k • F.N n₀ := by
  obtain ⟨n₀, hn⟩ := h
  use n₀
  intro k
  induction' k with _ ih
  · simp
  · rw [Nat.succ_eq_add_one, ← add_assoc, ← hn, ih, add_comm, pow_add, mul_smul, pow_one]
    

Proof state:
case h.succ.a
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
n₀ : ℕ
hn : ∀ n ≥ n₀, I • N F n = N F (n + 1)
n✝ : ℕ
ih : N F (n₀ + n✝) = I ^ n✝ • N F n₀
⊢ n₀ + n✝ ≥ n₀

Next tactic:
linarith
theorem Stable.exists_pow_smul_eq_of_ge : ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := 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₀, ∀ n ≥ n₀, N F n = I ^ (n - n₀) • N F n₀

Next tactic:
obtain ⟨n₀, hn₀⟩ := h.exists_pow_smul_eq
theorem Stable.exists_pow_smul_eq_of_ge : ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := by
  obtain ⟨n₀, hn₀⟩ := h.exists_pow_smul_eq
  

Proof state:
case 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₀ : ℕ
hn₀ : ∀ (k : ℕ), N F (n₀ + k) = I ^ k • N F n₀
⊢ ∃ n₀, ∀ n ≥ n₀, N F n = I ^ (n - n₀) • N F n₀

Next tactic:
use n₀
theorem Stable.exists_pow_smul_eq_of_ge : ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := by
  obtain ⟨n₀, hn₀⟩ := h.exists_pow_smul_eq
  use n₀
  

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
n₀ : ℕ
hn₀ : ∀ (k : ℕ), N F (n₀ + k) = I ^ k • N F n₀
⊢ ∀ n ≥ n₀, N F n = I ^ (n - n₀) • N F n₀

Next tactic:
intro n hn
theorem Stable.exists_pow_smul_eq_of_ge : ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := by
  obtain ⟨n₀, hn₀⟩ := h.exists_pow_smul_eq
  use n₀
  intro n hn
  

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
n₀ : ℕ
hn₀ : ∀ (k : ℕ), N F (n₀ + k) = I ^ k • N F n₀
n : ℕ
hn : n ≥ n₀
⊢ N F n = I ^ (n - n₀) • N F n₀

Next tactic:
convert hn₀ (n - n₀)
theorem Stable.exists_pow_smul_eq_of_ge : ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := by
  obtain ⟨n₀, hn₀⟩ := h.exists_pow_smul_eq
  use n₀
  intro n hn
  convert hn₀ (n - n₀)
  

Proof state:
case h.e'_2.h.e'_8
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₀ : ℕ
hn₀ : ∀ (k : ℕ), N F (n₀ + k) = I ^ k • N F n₀
n : ℕ
hn : n ≥ n₀
⊢ n = n₀ + (n - n₀)

Next tactic:
rw [add_comm, tsub_add_cancel_of_le hn]
theorem stable_iff_exists_pow_smul_eq_of_ge :
    F.Stable ↔ ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := 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
⊢ Stable F ↔ ∃ n₀, ∀ n ≥ n₀, N F n = I ^ (n - n₀) • N F n₀

Next tactic:
refine' ⟨Stable.exists_pow_smul_eq_of_ge, fun h => ⟨h.choose, fun n hn => _⟩⟩
theorem stable_iff_exists_pow_smul_eq_of_ge :
    F.Stable ↔ ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := by
  refine' ⟨Stable.exists_pow_smul_eq_of_ge, fun h => ⟨h.choose, fun n hn => _⟩⟩
  

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
h : ∃ n₀, ∀ n ≥ n₀, N F n = I ^ (n - n₀) • N F n₀
n : ℕ
hn : n ≥ Exists.choose h
⊢ I • N F n = N F (n + 1)

Next tactic:
rw [h.choose_spec n hn, h.choose_spec (n + 1) (by linarith), smul_smul, ← pow_succ,
    tsub_add_eq_add_tsub hn]
theorem stable_iff_exists_pow_smul_eq_of_ge :
    F.Stable ↔ ∃ n₀, ∀ n ≥ n₀, F.N n = I ^ (n - n₀) • F.N n₀ := by
  refine' ⟨Stable.exists_pow_smul_eq_of_ge, fun h => ⟨h.choose, fun n hn => _⟩⟩
  rw [h.choose_spec n hn, h.choose_spec (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
h : ∃ n₀, ∀ n ≥ n₀, N F n = I ^ (n - n₀) • N F n₀
n : ℕ
hn : n ≥ Exists.choose h
⊢ n + 1 ≥ Exists.choose h

Next tactic:
linarith
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := 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✝ h : Stable F
e : N F 0 ≤ N F' 0
⊢ ∃ n₀, ∀ (n : ℕ), N F (n + n₀) ≤ N F' n

Next tactic:
obtain ⟨n₀, hF⟩ := h
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  

Proof state:
case 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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
⊢ ∃ n₀, ∀ (n : ℕ), N F (n + n₀) ≤ N F' n

Next tactic:
use n₀
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  use n₀
  

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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
⊢ ∀ (n : ℕ), N F (n + n₀) ≤ N F' n

Next tactic:
intro n
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  use n₀
  intro n
  

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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
n : ℕ
⊢ N F (n + n₀) ≤ N F' n

Next tactic:
induction' n with n hn
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  use n₀
  intro n
  induction' n with n hn
  · 

Proof state:
case h.zero
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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
⊢ N F (Nat.zero + n₀) ≤ N F' Nat.zero

Next tactic:
refine' (F.antitone _).trans e
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  use n₀
  intro n
  induction' n with n hn
  · refine' (F.antitone _).trans e; 

Proof state:
case h.zero
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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
⊢ 0 ≤ Nat.zero + n₀

Next tactic:
simp
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  use n₀
  intro n
  induction' n with n hn
  · refine' (F.antitone _).trans e; simp
  · 

Proof state:
case h.succ
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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
n : ℕ
hn : N F (n + n₀) ≤ N F' n
⊢ N F (Nat.succ n + n₀) ≤ N F' (Nat.succ n)

Next tactic:
rw [Nat.succ_eq_one_add, add_assoc, add_comm, add_comm 1 n, ← hF]
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  use n₀
  intro n
  induction' n with n hn
  · refine' (F.antitone _).trans e; simp
  · rw [Nat.succ_eq_one_add, add_assoc, add_comm, add_comm 1 n, ← hF]
    

Proof state:
case h.succ
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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
n : ℕ
hn : N F (n + n₀) ≤ N F' n
⊢ I • N F (n + n₀) ≤ N F' (n + 1)
case h.succ.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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
n : ℕ
hn : N F (n + n₀) ≤ N F' n
⊢ n + n₀ ≥ n₀

Next tactic:
exact (Submodule.smul_mono_right hn).trans (F'.smul_le _)
theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n := by
  obtain ⟨n₀, hF⟩ := h
  use n₀
  intro n
  induction' n with n hn
  · refine' (F.antitone _).trans e; simp
  · rw [Nat.succ_eq_one_add, add_assoc, add_comm, add_comm 1 n, ← hF]
    exact (Submodule.smul_mono_right hn).trans (F'.smul_le _)
    

Proof state:
case h.succ.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
e : N F 0 ≤ N F' 0
n₀ : ℕ
hF : ∀ n ≥ n₀, I • N F n = N F (n + 1)
n : ℕ
hn : N F (n + n₀) ≤ N F' n
⊢ n + n₀ ≥ n₀

Next tactic:
simp
theorem Stable.bounded_difference (h : F.Stable) (h' : F'.Stable) (e : F.N 0 = F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n ∧ F'.N (n + n₀) ≤ F.N n := 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✝ h : Stable F
h' : Stable F'
e : N F 0 = N F' 0
⊢ ∃ n₀, ∀ (n : ℕ), N F (n + n₀) ≤ N F' n ∧ N F' (n + n₀) ≤ N F n

Next tactic:
obtain ⟨n₁, h₁⟩ := h.exists_forall_le (le_of_eq e)
theorem Stable.bounded_difference (h : F.Stable) (h' : F'.Stable) (e : F.N 0 = F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n ∧ F'.N (n + n₀) ≤ F.N n := by
  obtain ⟨n₁, h₁⟩ := h.exists_forall_le (le_of_eq e)
  

Proof state:
case intro
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h✝ h : Stable F
h' : Stable F'
e : N F 0 = N F' 0
n₁ : ℕ
h₁ : ∀ (n : ℕ), N F (n + n₁) ≤ N F' n
⊢ ∃ n₀, ∀ (n : ℕ), N F (n + n₀) ≤ N F' n ∧ N F' (n + n₀) ≤ N F n

Next tactic:
obtain ⟨n₂, h₂⟩ := h'.exists_forall_le (le_of_eq e.symm)
theorem Stable.bounded_difference (h : F.Stable) (h' : F'.Stable) (e : F.N 0 = F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n ∧ F'.N (n + n₀) ≤ F.N n := by
  obtain ⟨n₁, h₁⟩ := h.exists_forall_le (le_of_eq e)
  obtain ⟨n₂, h₂⟩ := h'.exists_forall_le (le_of_eq e.symm)
  

Proof state:
case 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✝ h : Stable F
h' : Stable F'
e : N F 0 = N F' 0
n₁ : ℕ
h₁ : ∀ (n : ℕ), N F (n + n₁) ≤ N F' n
n₂ : ℕ
h₂ : ∀ (n : ℕ), N F' (n + n₂) ≤ N F n
⊢ ∃ n₀, ∀ (n : ℕ), N F (n + n₀) ≤ N F' n ∧ N F' (n + n₀) ≤ N F n

Next tactic:
use max n₁ n₂
theorem Stable.bounded_difference (h : F.Stable) (h' : F'.Stable) (e : F.N 0 = F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n ∧ F'.N (n + n₀) ≤ F.N n := by
  obtain ⟨n₁, h₁⟩ := h.exists_forall_le (le_of_eq e)
  obtain ⟨n₂, h₂⟩ := h'.exists_forall_le (le_of_eq e.symm)
  use max n₁ n₂
  

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✝ h : Stable F
h' : Stable F'
e : N F 0 = N F' 0
n₁ : ℕ
h₁ : ∀ (n : ℕ), N F (n + n₁) ≤ N F' n
n₂ : ℕ
h₂ : ∀ (n : ℕ), N F' (n + n₂) ≤ N F n
⊢ ∀ (n : ℕ), N F (n + max n₁ n₂) ≤ N F' n ∧ N F' (n + max n₁ n₂) ≤ N F n

Next tactic:
intro n
theorem Stable.bounded_difference (h : F.Stable) (h' : F'.Stable) (e : F.N 0 = F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n ∧ F'.N (n + n₀) ≤ F.N n := by
  obtain ⟨n₁, h₁⟩ := h.exists_forall_le (le_of_eq e)
  obtain ⟨n₂, h₂⟩ := h'.exists_forall_le (le_of_eq e.symm)
  use max n₁ n₂
  intro n
  

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✝ h : Stable F
h' : Stable F'
e : N F 0 = N F' 0
n₁ : ℕ
h₁ : ∀ (n : ℕ), N F (n + n₁) ≤ N F' n
n₂ : ℕ
h₂ : ∀ (n : ℕ), N F' (n + n₂) ≤ N F n
n : ℕ
⊢ N F (n + max n₁ n₂) ≤ N F' n ∧ N F' (n + max n₁ n₂) ≤ N F n

Next tactic:
refine' ⟨(F.antitone _).trans (h₁ n), (F'.antitone _).trans (h₂ n)⟩
theorem Stable.bounded_difference (h : F.Stable) (h' : F'.Stable) (e : F.N 0 = F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n ∧ F'.N (n + n₀) ≤ F.N n := by
  obtain ⟨n₁, h₁⟩ := h.exists_forall_le (le_of_eq e)
  obtain ⟨n₂, h₂⟩ := h'.exists_forall_le (le_of_eq e.symm)
  use max n₁ n₂
  intro n
  refine' ⟨(F.antitone _).trans (h₁ n), (F'.antitone _).trans (h₂ n)⟩ <;> 

Proof state:
case h.refine'_1
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h✝ h : Stable F
h' : Stable F'
e : N F 0 = N F' 0
n₁ : ℕ
h₁ : ∀ (n : ℕ), N F (n + n₁) ≤ N F' n
n₂ : ℕ
h₂ : ∀ (n : ℕ), N F' (n + n₂) ≤ N F n
n : ℕ
⊢ n + n₁ ≤ n + max n₁ n₂

Next tactic:
simp
theorem Stable.bounded_difference (h : F.Stable) (h' : F'.Stable) (e : F.N 0 = F'.N 0) :
    ∃ n₀, ∀ n, F.N (n + n₀) ≤ F'.N n ∧ F'.N (n + n₀) ≤ F.N n := by
  obtain ⟨n₁, h₁⟩ := h.exists_forall_le (le_of_eq e)
  obtain ⟨n₂, h₂⟩ := h'.exists_forall_le (le_of_eq e.symm)
  use max n₁ n₂
  intro n
  refine' ⟨(F.antitone _).trans (h₁ n), (F'.antitone _).trans (h₂ n)⟩ <;> 

Proof state:
case h.refine'_2
R M : Type u
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
F F' : Filtration I M
h✝ h : Stable F
h' : Stable F'
e : N F 0 = N F' 0
n₁ : ℕ
h₁ : ∀ (n : ℕ), N F (n + n₁) ≤ N F' n
n₂ : ℕ
h₂ : ∀ (n : ℕ), N F' (n + n₂) ≤ N F n
n : ℕ
⊢ n + n₂ ≤ n + max n₁ n₂

Next tactic:
simp
/-- 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
    

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
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 : ℕ
⊢ (r • f) i ∈ N F i

Next tactic:
rw [Subalgebra.smul_def, PolynomialModule.smul_apply]
/-- 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]
    

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
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 : ℕ
⊢ ∑ x in Finset.antidiagonal i, coeff (↑r) x.1 • f x.2 ∈ N F i

Next tactic:
apply Submodule.sum_mem
/-- 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
    

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
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 : ℕ
⊢ ∀ c ∈ Finset.antidiagonal i, coeff (↑r) c.1 • f c.2 ∈ N F i

Next tactic:
rintro ⟨j, k⟩ e