l3lab/ntp-mathlib huggingface dataset:
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
  map_one' := by
    ext1
    simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
    split_ifs with h
    · rw [h, pow_zero a]
    rfl
  map_add' := by
    intros
    ext
    dsimp only
    exact mul_add _ _ _
  map_mul' f g := by
    

Proof state:
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : R⟦X⟧
⊢ OneHom.toFun
      { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
        map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
      (f * g) =
    OneHom.toFun
        { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
          map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
        f *
      OneHom.toFun
        { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
          map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
        g

Next tactic:
ext
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
  map_one' := by
    ext1
    simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
    split_ifs with h
    · rw [h, pow_zero a]
    rfl
  map_add' := by
    intros
    ext
    dsimp only
    exact mul_add _ _ _
  map_mul' f g := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : R⟦X⟧
n✝ : ℕ
⊢ (coeff R n✝)
      (OneHom.toFun
        { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
          map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
        (f * g)) =
    (coeff R n✝)
      (OneHom.toFun
          { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
            map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
          f *
        OneHom.toFun
          { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
            map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
          g)

Next tactic:
rw [PowerSeries.coeff_mul, PowerSeries.coeff_mk, PowerSeries.coeff_mul, Finset.mul_sum]
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
  map_one' := by
    ext1
    simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
    split_ifs with h
    · rw [h, pow_zero a]
    rfl
  map_add' := by
    intros
    ext
    dsimp only
    exact mul_add _ _ _
  map_mul' f g := by
    ext
    rw [PowerSeries.coeff_mul, PowerSeries.coeff_mk, PowerSeries.coeff_mul, Finset.mul_sum]
    

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : R⟦X⟧
n✝ : ℕ
⊢ ∑ x in antidiagonal n✝, a ^ n✝ * ((coeff R x.1) f * (coeff R x.2) g) =
    ∑ p in antidiagonal n✝,
      (coeff R p.1)
          (OneHom.toFun
            { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
            f) *
        (coeff R p.2)
          (OneHom.toFun
            { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
            g)

Next tactic:
apply sum_congr rfl
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
  map_one' := by
    ext1
    simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
    split_ifs with h
    · rw [h, pow_zero a]
    rfl
  map_add' := by
    intros
    ext
    dsimp only
    exact mul_add _ _ _
  map_mul' f g := by
    ext
    rw [PowerSeries.coeff_mul, PowerSeries.coeff_mk, PowerSeries.coeff_mul, Finset.mul_sum]
    apply sum_congr rfl
    

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : R⟦X⟧
n✝ : ℕ
⊢ ∀ x ∈ antidiagonal n✝,
    a ^ n✝ * ((coeff R x.1) f * (coeff R x.2) g) =
      (coeff R x.1)
          (OneHom.toFun
            { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
            f) *
        (coeff R x.2)
          (OneHom.toFun
            { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
            g)

Next tactic:
simp only [coeff_mk, Prod.forall, mem_antidiagonal]
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
  map_one' := by
    ext1
    simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
    split_ifs with h
    · rw [h, pow_zero a]
    rfl
  map_add' := by
    intros
    ext
    dsimp only
    exact mul_add _ _ _
  map_mul' f g := by
    ext
    rw [PowerSeries.coeff_mul, PowerSeries.coeff_mk, PowerSeries.coeff_mul, Finset.mul_sum]
    apply sum_congr rfl
    simp only [coeff_mk, Prod.forall, mem_antidiagonal]
    

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : R⟦X⟧
n✝ : ℕ
⊢ ∀ (a_1 b : ℕ),
    a_1 + b = n✝ → a ^ n✝ * ((coeff R a_1) f * (coeff R b) g) = a ^ a_1 * (coeff R a_1) f * (a ^ b * (coeff R b) g)

Next tactic:
intro b c H
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
  map_one' := by
    ext1
    simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
    split_ifs with h
    · rw [h, pow_zero a]
    rfl
  map_add' := by
    intros
    ext
    dsimp only
    exact mul_add _ _ _
  map_mul' f g := by
    ext
    rw [PowerSeries.coeff_mul, PowerSeries.coeff_mk, PowerSeries.coeff_mul, Finset.mul_sum]
    apply sum_congr rfl
    simp only [coeff_mk, Prod.forall, mem_antidiagonal]
    intro b c H
    

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : R⟦X⟧
n✝ b c : ℕ
H : b + c = n✝
⊢ a ^ n✝ * ((coeff R b) f * (coeff R c) g) = a ^ b * (coeff R b) f * (a ^ c * (coeff R c) g)

Next tactic:
rw [← H, pow_add, mul_mul_mul_comm]
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    

Proof state:
R : Type u_1
inst✝ : CommSemiring R
a : R
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (f g : R⟦X⟧),
                OneHom.toFun
                    { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
                      map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
                    (f * g) =
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
                      f *
                    OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
                      g) })
      0 =
    0

Next tactic:
ext
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
n✝ : ℕ
⊢ (coeff R n✝)
      (OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : R⟦X⟧),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * (coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * (coeff R n) f) 1 = 1) }
                        g) })
        0) =
    (coeff R n✝) 0

Next tactic:
simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
/-- The ring homomorphism taking a power series `f(X)` to `f(aX)`. -/
noncomputable def rescale (a : R) : R⟦X⟧ →+* R⟦X⟧ where
  toFun f := PowerSeries.mk fun n => a ^ n * PowerSeries.coeff R n f
  map_zero' := by
    ext
    simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
  map_one' := by
    ext1
    simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
    split_ifs with h
    · rw [h, pow_zero a]
    rfl
  map_add' := by
    intros
    ext
    dsimp only
    

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
x✝ y✝ : R⟦X⟧
n✝ : ℕ
⊢ (coeff R n✝) (mk fun n => a ^ n * (coeff R n) (x✝ + y✝)) =
    (coeff R n✝) ((mk fun n => a ^ n * (coeff R n) x✝) + mk fun n => a ^ n * (coeff R n) y✝)

Next tactic:
exact mul_add _ _ _
@[simp]
theorem rescale_zero : rescale 0 = (C R).comp (constantCoeff R) := by
  

Proof state:
R : Type u_1
inst✝ : CommSemiring R
⊢ rescale 0 = RingHom.comp (C R) (constantCoeff R)

Next tactic:
ext x n
@[simp]
theorem rescale_zero : rescale 0 = (C R).comp (constantCoeff R) := by
  ext x n
  

Proof state:
case a.h
R : Type u_1
inst✝ : CommSemiring R
x : R⟦X⟧
n : ℕ
⊢ (coeff R n) ((rescale 0) x) = (coeff R n) ((RingHom.comp (C R) (constantCoeff R)) x)

Next tactic:
simp only [Function.comp_apply, RingHom.coe_comp, rescale, RingHom.coe_mk,
    PowerSeries.coeff_mk _ _, coeff_C]
@[simp]
theorem rescale_zero : rescale 0 = (C R).comp (constantCoeff R) := by
  ext x n
  simp only [Function.comp_apply, RingHom.coe_comp, rescale, RingHom.coe_mk,
    PowerSeries.coeff_mk _ _, coeff_C]
  

Proof state:
case a.h
R : Type u_1
inst✝ : CommSemiring R
x : R⟦X⟧
n : ℕ
⊢ (coeff R n)
      ({
          toOneHom :=
            { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (f g : R⟦X⟧),
                OneHom.toFun
                    { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                      map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                    (f * g) =
                  OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                      f *
                    OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                      g) }
        x) =
    if n = 0 then (constantCoeff R) x else 0

Next tactic:
split_ifs with h
@[simp]
theorem rescale_zero : rescale 0 = (C R).comp (constantCoeff R) := by
  ext x n
  simp only [Function.comp_apply, RingHom.coe_comp, rescale, RingHom.coe_mk,
    PowerSeries.coeff_mk _ _, coeff_C]
  split_ifs with h <;> 

Proof state:
case pos
R : Type u_1
inst✝ : CommSemiring R
x : R⟦X⟧
n : ℕ
h : n = 0
⊢ (coeff R n)
      ({
          toOneHom :=
            { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (f g : R⟦X⟧),
                OneHom.toFun
                    { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                      map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                    (f * g) =
                  OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                      f *
                    OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                      g) }
        x) =
    (constantCoeff R) x

Next tactic:
simp [h]
@[simp]
theorem rescale_zero : rescale 0 = (C R).comp (constantCoeff R) := by
  ext x n
  simp only [Function.comp_apply, RingHom.coe_comp, rescale, RingHom.coe_mk,
    PowerSeries.coeff_mk _ _, coeff_C]
  split_ifs with h <;> 

Proof state:
case neg
R : Type u_1
inst✝ : CommSemiring R
x : R⟦X⟧
n : ℕ
h : ¬n = 0
⊢ (coeff R n)
      ({
          toOneHom :=
            { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (f g : R⟦X⟧),
                OneHom.toFun
                    { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                      map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                    (f * g) =
                  OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                      f *
                    OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * (coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * (coeff R n) f) 1 = 1) }
                      g) }
        x) =
    0

Next tactic:
simp [h]
theorem rescale_zero_apply : rescale 0 X = C R (constantCoeff R X) := by 

Proof state:
R : Type u_1
inst✝ : CommSemiring R
⊢ (rescale 0) X = (C R) ((constantCoeff R) X)

Next tactic:
simp
@[simp]
theorem rescale_one : rescale 1 = RingHom.id R⟦X⟧ := by
  

Proof state:
R : Type u_1
inst✝ : CommSemiring R
⊢ rescale 1 = RingHom.id R⟦X⟧

Next tactic:
ext
@[simp]
theorem rescale_one : rescale 1 = RingHom.id R⟦X⟧ := by
  ext
  

Proof state:
case a.h
R : Type u_1
inst✝ : CommSemiring R
x✝ : R⟦X⟧
n✝ : ℕ
⊢ (coeff R n✝) ((rescale 1) x✝) = (coeff R n✝) ((RingHom.id R⟦X⟧) x✝)

Next tactic:
simp only [coeff_rescale, one_pow, one_mul, RingHom.id_apply]
theorem rescale_mk (f : ℕ → R) (a : R) : rescale a (mk f) = mk fun n : ℕ => a ^ n * f n := by
  

Proof state:
R : Type u_1
inst✝ : CommSemiring R
f : ℕ → R
a : R
⊢ (rescale a) (mk f) = mk fun n => a ^ n * f n

Next tactic:
ext
theorem rescale_mk (f : ℕ → R) (a : R) : rescale a (mk f) = mk fun n : ℕ => a ^ n * f n := by
  ext
  

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
f : ℕ → R
a : R
n✝ : ℕ
⊢ (coeff R n✝) ((rescale a) (mk f)) = (coeff R n✝) (mk fun n => a ^ n * f n)

Next tactic:
rw [coeff_rescale, coeff_mk, coeff_mk]
theorem rescale_rescale (f : R⟦X⟧) (a b : R) :
    rescale b (rescale a f) = rescale (a * b) f := by
  

Proof state:
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
a b : R
⊢ (rescale b) ((rescale a) f) = (rescale (a * b)) f

Next tactic:
ext n
theorem rescale_rescale (f : R⟦X⟧) (a b : R) :
    rescale b (rescale a f) = rescale (a * b) f := by
  ext n
  

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
a b : R
n : ℕ
⊢ (coeff R n) ((rescale b) ((rescale a) f)) = (coeff R n) ((rescale (a * b)) f)

Next tactic:
simp_rw [coeff_rescale]
theorem rescale_rescale (f : R⟦X⟧) (a b : R) :
    rescale b (rescale a f) = rescale (a * b) f := by
  ext n
  simp_rw [coeff_rescale]
  

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
a b : R
n : ℕ
⊢ b ^ n * (a ^ n * (coeff R n) f) = (a * b) ^ n * (coeff R n) f

Next tactic:
rw [mul_pow, mul_comm _ (b ^ n), mul_assoc]
theorem rescale_mul (a b : R) : rescale (a * b) = (rescale b).comp (rescale a) := by
  

Proof state:
R : Type u_1
inst✝ : CommSemiring R
a b : R
⊢ rescale (a * b) = RingHom.comp (rescale b) (rescale a)

Next tactic:
ext
theorem rescale_mul (a b : R) : rescale (a * b) = (rescale b).comp (rescale a) := by
  ext
  

Proof state:
case a.h
R : Type u_1
inst✝ : CommSemiring R
a b : R
x✝ : R⟦X⟧
n✝ : ℕ
⊢ (coeff R n✝) ((rescale (a * b)) x✝) = (coeff R n✝) ((RingHom.comp (rescale b) (rescale a)) x✝)

Next tactic:
simp [← rescale_rescale]
theorem coeff_trunc (m) (n) (φ : R⟦X⟧) :
    (trunc n φ).coeff m = if m < n then coeff R m φ else 0 := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
m n : ℕ
φ : R⟦X⟧
⊢ Polynomial.coeff (trunc n φ) m = if m < n then (coeff R m) φ else 0

Next tactic:
simp [trunc, Polynomial.coeff_sum, Polynomial.coeff_monomial, Nat.lt_succ_iff]
@[simp]
theorem trunc_zero (n) : trunc n (0 : R⟦X⟧) = 0 :=
  Polynomial.ext fun m => by
    

Proof state:
R : Type u_1
inst✝ : Semiring R
n m : ℕ
⊢ Polynomial.coeff (trunc n 0) m = Polynomial.coeff 0 m

Next tactic:
rw [coeff_trunc, LinearMap.map_zero, Polynomial.coeff_zero]
@[simp]
theorem trunc_zero (n) : trunc n (0 : R⟦X⟧) = 0 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, LinearMap.map_zero, Polynomial.coeff_zero]
    

Proof state:
R : Type u_1
inst✝ : Semiring R
n m : ℕ
⊢ (if m < n then 0 else 0) = 0

Next tactic:
split_ifs
@[simp]
theorem trunc_zero (n) : trunc n (0 : R⟦X⟧) = 0 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, LinearMap.map_zero, Polynomial.coeff_zero]
    split_ifs <;> 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n m : ℕ
h✝ : m < n
⊢ 0 = 0

Next tactic:
rfl
@[simp]
theorem trunc_zero (n) : trunc n (0 : R⟦X⟧) = 0 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, LinearMap.map_zero, Polynomial.coeff_zero]
    split_ifs <;> 

Proof state:
case neg
R : Type u_1
inst✝ : Semiring R
n m : ℕ
h✝ : ¬m < n
⊢ 0 = 0

Next tactic:
rfl
@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 :=
  Polynomial.ext fun m => by
    

Proof state:
R : Type u_1
inst✝ : Semiring R
n m : ℕ
⊢ Polynomial.coeff (trunc (n + 1) 1) m = Polynomial.coeff 1 m

Next tactic:
rw [coeff_trunc, coeff_one, Polynomial.coeff_one]
@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_one, Polynomial.coeff_one]
    

Proof state:
R : Type u_1
inst✝ : Semiring R
n m : ℕ
⊢ (if m < n + 1 then if m = 0 then 1 else 0 else 0) = if m = 0 then 1 else 0

Next tactic:
split_ifs with h _ h'
@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_one, Polynomial.coeff_one]
    split_ifs with h _ h'
    · 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n m : ℕ
h : m < n + 1
_ : m = 0
⊢ 1 = 1

Next tactic:
rfl
@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_one, Polynomial.coeff_one]
    split_ifs with h _ h'
    · rfl
    · 

Proof state:
case neg
R : Type u_1
inst✝ : Semiring R
n m : ℕ
h : m < n + 1
_ : ¬m = 0
⊢ 0 = 0

Next tactic:
rfl
@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_one, Polynomial.coeff_one]
    split_ifs with h _ h'
    · rfl
    · rfl
    · 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n m : ℕ
h : ¬m < n + 1
h' : m = 0
⊢ 0 = 1

Next tactic:
subst h'
@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_one, Polynomial.coeff_one]
    split_ifs with h _ h'
    · rfl
    · rfl
    · subst h'; 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n : ℕ
h : ¬0 < n + 1
⊢ 0 = 1

Next tactic:
simp at h
@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1 :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_one, Polynomial.coeff_one]
    split_ifs with h _ h'
    · rfl
    · rfl
    · subst h'; simp at h
    · 

Proof state:
case neg
R : Type u_1
inst✝ : Semiring R
n m : ℕ
h : ¬m < n + 1
h' : ¬m = 0
⊢ 0 = 0

Next tactic:
rfl
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    

Proof state:
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
⊢ Polynomial.coeff (trunc (n + 1) ((C R) a)) m = Polynomial.coeff (Polynomial.C a) m

Next tactic:
rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    

Proof state:
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
⊢ (if m < n + 1 then if m = 0 then a else 0 else 0) = if m = 0 then a else 0

Next tactic:
split_ifs with H
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : m = 0
⊢ a = a

Next tactic:
first |rfl|try simp_all
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> first |

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : m = 0
⊢ a = a

Next tactic:
rfl
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> 

Proof state:
case neg
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : ¬m = 0
⊢ 0 = 0

Next tactic:
first |rfl|try simp_all
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> first |

Proof state:
case neg
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : ¬m = 0
⊢ 0 = 0

Next tactic:
rfl
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a

Next tactic:
first |rfl|try simp_all
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> first |

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a

Next tactic:
rfl
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> first |rfl|

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a

Next tactic:
try simp_all
@[simp]
theorem trunc_C (n) (a : R) : trunc (n + 1) (C R a) = Polynomial.C a :=
  Polynomial.ext fun m => by
    rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
    split_ifs with H <;> first |rfl|try 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a

Next tactic:
simp_all