Theorem: LaurentPolynomial.induction_on
File: Mathlib/Data/Polynomial/Laurent.lean

tactic: convert B p.support
state_before: R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
⊢ M p

tactic: ext a
state_before: case h.e'_1
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
⊢ p = ∑ n in p.support, ↑C (toFun p n) * T n

tactic: simp_rw [← single_eq_C_mul_T]
state_before: case h.e'_1.h
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
a : ℤ
⊢ ↑p a = ↑(∑ n in p.support, ↑C (toFun p n) * T n) a

tactic: rw [Finset.sum_apply']
state_before: case h.e'_1.h
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
a : ℤ
⊢ ↑p a = ↑(∑ x in p.support, Finsupp.single x (toFun p x)) a

tactic: simp_rw [Finsupp.single_apply, Finset.sum_ite_eq']
state_before: case h.e'_1.h
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
a : ℤ
⊢ ↑p a = ∑ k in p.support, ↑(Finsupp.single k (toFun p k)) a

tactic: split_ifs with h
state_before: case h.e'_1.h
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
a : ℤ
⊢ ↑p a = if a ∈ p.support then toFun p a else 0

tactic: intro n a
state_before: R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
⊢ ∀ {n : ℤ} {a : R}, M (↑C a * T n)

tactic: refine Int.induction_on n ?_ ?_ ?_
state_before: R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
n : ℤ
a : R
⊢ M (↑C a * T n)

tactic: simpa only [T_zero, mul_one] using h_C a
state_before: case refine_1
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
n : ℤ
a : R
⊢ M (↑C a * T 0)

tactic: exact fun m => h_C_mul_T m a
state_before: case refine_2
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
n : ℤ
a : R
⊢ ∀ (i : ℕ), M (↑C a * T ↑i) → M (↑C a * T (↑i + 1))

tactic: exact fun m => h_C_mul_T_Z m a
state_before: case refine_3
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
n : ℤ
a : R
⊢ ∀ (i : ℕ), M (↑C a * T (-↑i)) → M (↑C a * T (-↑i - 1))

tactic: apply Finset.induction
state_before: R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
⊢ ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)

tactic: convert h_C 0
state_before: case empty
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
⊢ M (∑ n in ∅, ↑C (toFun p n) * T n)

tactic: simp only [Finset.sum_empty, _root_.map_zero]
state_before: case h.e'_1
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
⊢ ∑ n in ∅, ↑C (toFun p n) * T n = ↑C 0

tactic: intro n s ns ih
state_before: case insert
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
⊢ ∀ ⦃a : ℤ⦄ {s : Finset ℤ}, ¬a ∈ s → M (∑ n in s, ↑C (toFun p n) * T n) → M (∑ n in insert a s, ↑C (toFun p n) * T n)

tactic: rw [Finset.sum_insert ns]
state_before: case insert
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
n : ℤ
s : Finset ℤ
ns : ¬n ∈ s
ih : M (∑ n in s, ↑C (toFun p n) * T n)
⊢ M (∑ n in insert n s, ↑C (toFun p n) * T n)

tactic: exact h_add A ih
state_before: case insert
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
n : ℤ
s : Finset ℤ
ns : ¬n ∈ s
ih : M (∑ n in s, ↑C (toFun p n) * T n)
⊢ M (↑C (toFun p n) * T n + ∑ x in s, ↑C (toFun p x) * T x)

tactic: rfl
state_before: case h.e'_1.h.inl
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
a : ℤ
h : a ∈ p.support
⊢ ↑p a = toFun p a

tactic: exact Finsupp.not_mem_support_iff.mp h
state_before: case h.e'_1.h.inr
R : Type u_1
inst✝ : Semiring R
M : R[T;T⁻¹] → Prop
p : R[T;T⁻¹]
h_C : ∀ (a : R), M (↑C a)
h_add : ∀ {p q : R[T;T⁻¹]}, M p → M q → M (p + q)
h_C_mul_T : ∀ (n : ℕ) (a : R), M (↑C a * T ↑n) → M (↑C a * T (↑n + 1))
h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (↑C a * T (-↑n)) → M (↑C a * T (-↑n - 1))
A : ∀ {n : ℤ} {a : R}, M (↑C a * T n)
B : ∀ (s : Finset ℤ), M (∑ n in s, ↑C (toFun p n) * T n)
a : ℤ
h : ¬a ∈ p.support
⊢ ↑p a = 0