-- Mathlib/RingTheory/Noetherian/Defs.lean
theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) :
    ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n))

Proof state:
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
⊢ ∀ᶠ (n : ℕ) in atTop, Disjoint (ker (f ^ n)) (range (f ^ n))

Tactic:
obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ :=
  monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer

Result:
case intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
⊢ ∀ᶠ (n : ℕ) in atTop, Disjoint (ker (f ^ n)) (range (f ^ n))

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
⊢ ker (f ^ m) ⊓ range (f ^ m) = ⊥

Tactic:
rw [← hn _ hm, Submodule.eq_bot_iff]

Result:
case intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
⊢ ∀ x ∈ ker (f ^ n) ⊓ range (f ^ m), x = 0

Proof state:
case intro.intro.intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
x : M
hx : x ∈ ker (f ^ (n + m))
⊢ (f ^ n) x = 0

Tactic:
rwa [← hn _ (n.le_add_right m)] at hx

Result:
no goals

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
⊢ ∀ x ∈ ker (f ^ n) ⊓ range (f ^ m), x = 0

Tactic:
rintro - ⟨hx, ⟨x, rfl⟩⟩

Result:
case intro.intro.intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
x : M
hx : (f ^ m) x ∈ ↑(ker (f ^ n))
⊢ (f ^ m) x = 0

Proof state:
case intro.intro.intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
x : M
hx : (f ^ m) x ∈ ↑(ker (f ^ n))
⊢ (f ^ n) x = 0

Tactic:
replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by
  simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx

Result:
case intro.intro.intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
x : M
hx : x ∈ ker (f ^ (n + m))
⊢ (f ^ n) x = 0

Proof state:
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
x : M
hx : (f ^ m) x ∈ ↑(ker (f ^ n))
⊢ x ∈ ker (f ^ (n + m))

Tactic:
simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx

Result:
no goals

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
⊢ ∀ᶠ (n : ℕ) in atTop, Disjoint (ker (f ^ n)) (range (f ^ n))

Tactic:
refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩

Result:
case intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
⊢ ker (f ^ m) ⊓ range (f ^ m) = ⊥

Proof state:
case intro.intro.intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
x : M
hx : (f ^ m) x ∈ ↑(ker (f ^ n))
⊢ (f ^ m) x = 0

Tactic:
apply LinearMap.pow_map_zero_of_le hm

Result:
case intro.intro.intro
R : Type u_1
M : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : IsNoetherian R M
f : M →ₗ[R] M
n : ℕ
hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m)
m : ℕ
hm : m ≥ n
x : M
hx : (f ^ m) x ∈ ↑(ker (f ^ n))
⊢ (f ^ n) x = 0