Theorem: Ideal.span_pow_eq_top
File: Mathlib/RingTheory/Ideal/Basic.lean

tactic: rw [eq_top_iff_one]
state_before: α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
hs : span s = ⊤
n : ℕ
⊢ span ((fun x => x ^ n) '' s) = ⊤

tactic: cases' n with n
state_before: α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
hs : span s = ⊤
n : ℕ
⊢ 1 ∈ span ((fun x => x ^ n) '' s)

tactic: rw [eq_top_iff_one, span, Finsupp.mem_span_iff_total] at hs
state_before: case succ
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
hs : span s = ⊤
n : ℕ
⊢ 1 ∈ span ((fun x => x ^ Nat.succ n) '' s)

tactic: rcases hs with ⟨f, hf⟩
state_before: case succ
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
hs : ∃ l, ↑(Finsupp.total (↑s) α α Subtype.val) l = 1
n : ℕ
⊢ 1 ∈ span ((fun x => x ^ Nat.succ n) '' s)

tactic: have hf : (f.support.sum fun a => f a * a) = 1 := hf
state_before: case succ.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
⊢ 1 ∈ span ((fun x => x ^ Nat.succ n) '' s)

tactic: have := sum_pow_mem_span_pow f.support (fun a => f a * a) n
state_before: case succ.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
⊢ 1 ∈ span ((fun x => x ^ Nat.succ n) '' s)

tactic: rw [hf, one_pow] at this
state_before: case succ.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this :
  (∑ i in f.support, ↑f i * ↑i) ^ (Finset.card f.support * n + 1) ∈
    span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
⊢ 1 ∈ span ((fun x => x ^ Nat.succ n) '' s)

tactic: refine' span_le.mpr _ this
state_before: case succ.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
⊢ 1 ∈ span ((fun x => x ^ Nat.succ n) '' s)

tactic: rintro _ hx
state_before: case succ.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
⊢ (fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support ⊆ ↑(span ((fun x => x ^ Nat.succ n) '' s))

tactic: simp_rw [Set.mem_image] at hx
state_before: case succ.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
a✝ : α
hx : a✝ ∈ (fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support
⊢ a✝ ∈ ↑(span ((fun x => x ^ Nat.succ n) '' s))

tactic: rcases hx with ⟨x, _, rfl⟩
state_before: case succ.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
a✝ : α
hx : ∃ x, x ∈ ↑f.support ∧ (↑f x * ↑x) ^ (n + 1) = a✝
⊢ a✝ ∈ ↑(span ((fun x => x ^ Nat.succ n) '' s))

tactic: have : span ({(x:α) ^ (n + 1)} : Set α) ≤ span ((fun x : α => x ^ (n + 1)) '' s) := by
  rw [span_le, Set.singleton_subset_iff]
  exact subset_span ⟨x, x.prop, rfl⟩
state_before: case succ.intro.intro.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
x : ↑s
left✝ : x ∈ ↑f.support
⊢ (↑f x * ↑x) ^ (n + 1) ∈ ↑(span ((fun x => x ^ Nat.succ n) '' s))

tactic: refine' this _
state_before: case succ.intro.intro.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this✝ : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
x : ↑s
left✝ : x ∈ ↑f.support
this : span {↑x ^ (n + 1)} ≤ span ((fun x => x ^ (n + 1)) '' s)
⊢ (↑f x * ↑x) ^ (n + 1) ∈ ↑(span ((fun x => x ^ Nat.succ n) '' s))

tactic: rw [mul_pow, mem_span_singleton]
state_before: case succ.intro.intro.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this✝ : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
x : ↑s
left✝ : x ∈ ↑f.support
this : span {↑x ^ (n + 1)} ≤ span ((fun x => x ^ (n + 1)) '' s)
⊢ (↑f x * ↑x) ^ (n + 1) ∈ span {↑x ^ (n + 1)}

tactic: exact ⟨f x ^ (n + 1), mul_comm _ _⟩
state_before: case succ.intro.intro.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this✝ : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
x : ↑s
left✝ : x ∈ ↑f.support
this : span {↑x ^ (n + 1)} ≤ span ((fun x => x ^ (n + 1)) '' s)
⊢ ↑x ^ (n + 1) ∣ ↑f x ^ (n + 1) * ↑x ^ (n + 1)

tactic: obtain rfl | ⟨x, hx⟩ := eq_empty_or_nonempty s
state_before: case zero
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
hs : span s = ⊤
⊢ 1 ∈ span ((fun x => x ^ Nat.zero) '' s)

tactic: rw [Set.image_empty, hs]
state_before: case zero.inl
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
hs : span ∅ = ⊤
⊢ 1 ∈ span ((fun x => x ^ Nat.zero) '' ∅)

tactic: trivial
state_before: case zero.inl
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
hs : span ∅ = ⊤
⊢ 1 ∈ ⊤

tactic: exact subset_span ⟨_, hx, pow_zero _⟩
state_before: case zero.inr.intro
α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
hs : span s = ⊤
x : α
hx : x ∈ s
⊢ 1 ∈ span ((fun x => x ^ Nat.zero) '' s)

tactic: rw [span_le, Set.singleton_subset_iff]
state_before: α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
x : ↑s
left✝ : x ∈ ↑f.support
⊢ span {↑x ^ (n + 1)} ≤ span ((fun x => x ^ (n + 1)) '' s)

tactic: exact subset_span ⟨x, x.prop, rfl⟩
state_before: α : Type u
β : Type v
a b : α
inst✝ : CommSemiring α
I : Ideal α
s : Set α
n : ℕ
f : ↑s →₀ α
hf✝ : ↑(Finsupp.total (↑s) α α Subtype.val) f = 1
hf : ∑ a in f.support, ↑f a * ↑a = 1
this : 1 ∈ span ((fun i => (↑f i * ↑i) ^ (n + 1)) '' ↑f.support)
x : ↑s
left✝ : x ∈ ↑f.support
⊢ ↑x ^ (n + 1) ∈ ↑(span ((fun x => x ^ (n + 1)) '' s))