Theorem: taylor_mean_remainder_lagrange_central (ExponentialRamsey/Prereq/Mathlib/Analysis/Calculus/Taylor.lean)

State before:
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
⊢ ∃ x',
    ∃ (_ : x' ∈ Ioo a b),
      f x - taylorWithinEval f n (Icc a b) x₀ x =
        iteratedDerivWithin (n + 1) f (Icc a b) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!
Tactic:
have gcont : ContinuousOn (fun t : ℝ => (x - t) ^ (n + 1)) (Icc a b) := by
  refine' Continuous.continuousOn _; continuity
State after:
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
⊢ ∃ x',
    ∃ (_ : x' ∈ Ioo a b),
      f x - taylorWithinEval f n (Icc a b) x₀ x =
        iteratedDerivWithin (n + 1) f (Icc a b) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!

State before:
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
⊢ ∃ x',
    ∃ (_ : x' ∈ Ioo a b),
      f x - taylorWithinEval f n (Icc a b) x₀ x =
        iteratedDerivWithin (n + 1) f (Icc a b) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!
Tactic:
rcases taylor_mean_remainder_central_aux hab hx hx₀ hf hf' gcont fun y _ =>
    monomial_has_deriv_aux y x _ with
  ⟨y, hy, hy', h⟩
State after:
case intro.intro.intro
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1))) • iteratedDerivWithin (n + 1) f (Icc a b) y
⊢ ∃ x',
    ∃ (_ : x' ∈ Ioo a b),
      f x - taylorWithinEval f n (Icc a b) x₀ x =
        iteratedDerivWithin (n + 1) f (Icc a b) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!

State before:
case intro.intro.intro
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1))) • iteratedDerivWithin (n + 1) f (Icc a b) y
⊢ ∃ x',
    ∃ (_ : x' ∈ Ioo a b),
      f x - taylorWithinEval f n (Icc a b) x₀ x =
        iteratedDerivWithin (n + 1) f (Icc a b) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!
Tactic:
have hy_ne : x - y ≠ 0 := sub_ne_zero_of_ne hy'.symm
State after:
case intro.intro.intro
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1))) • iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ ∃ x',
    ∃ (_ : x' ∈ Ioo a b),
      f x - taylorWithinEval f n (Icc a b) x₀ x =
        iteratedDerivWithin (n + 1) f (Icc a b) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!

State before:
case intro.intro.intro
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1))) • iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ ∃ x',
    ∃ (_ : x' ∈ Ioo a b),
      f x - taylorWithinEval f n (Icc a b) x₀ x =
        iteratedDerivWithin (n + 1) f (Icc a b) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!
Tactic:
use y, hy
State after:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1))) • iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!

State before:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1))) • iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!
Tactic:
dsimp at h
State after:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!

State before:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!
Tactic:
rw [← eq_div_iff] at h
State after:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!

case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ -(↑n + 1) * (x - y) ^ n ≠ 0

State before:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!

case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ -(↑n + 1) * (x - y) ^ n ≠ 0
Tactic:
swap
State after:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ -(↑n + 1) * (x - y) ^ n ≠ 0

case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!

State before:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ f x - taylorWithinEval f n (Icc a b) x₀ x = iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!
Tactic:
simp only [h, sub_self, zero_pow' _ (Nat.succ_ne_zero n), zero_sub, mul_neg, neg_mul,
  Nat.factorial_succ, Nat.cast_add_one, neg_div_neg_eq, Nat.cast_mul, field_simps]
State after:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc a b) y / (↑n ! * ((↑n + 1) * (x - y) ^ n)) =
    iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ((↑n + 1) * ↑n !)

State before:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc a b) y / (↑n ! * ((↑n + 1) * (x - y) ^ n)) =
    iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) / ((↑n + 1) * ↑n !)
Tactic:
rw [mul_left_comm, ← mul_assoc, ← div_div, div_eq_iff (pow_ne_zero _ hy_ne), div_mul_eq_mul_div]
State after:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc a b) y / ((↑n + 1) * ↑n !) =
    iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) * (x - y) ^ n / ((↑n + 1) * ↑n !)

State before:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc a b) y / ((↑n + 1) * ↑n !) =
    iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) * (x - y) ^ n / ((↑n + 1) * ↑n !)
Tactic:
congr 1
State after:
case h.e_a
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc a b) y =
    iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) * (x - y) ^ n

State before:
case h.e_a
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  f x - taylorWithinEval f n (Icc a b) x₀ x =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y /
      (-(↑n + 1) * (x - y) ^ n)
hy_ne : x - y ≠ 0
⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc a b) y =
    iteratedDerivWithin (n + 1) f (Icc a b) y * (x - x₀) ^ (n + 1) * (x - y) ^ n
Tactic:
ring_nf
State after:
no goals

State before:
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
⊢ ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
Tactic:
refine' Continuous.continuousOn _
State after:
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
⊢ Continuous fun t => (x - t) ^ (n + 1)

State before:
case h
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ -(↑n + 1) * (x - y) ^ n ≠ 0
Tactic:
exact mul_ne_zero (neg_ne_zero.2 (by positivity)) (by positivity)
State after:
no goals

State before:
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ ↑n + 1 ≠ 0
Tactic:
positivity
State after:
no goals

State before:
f : ℝ → ℝ
x x₀ a b : ℝ
n : ℕ
hab : a < b
hx : x ∈ Icc a b
hx₀ : x₀ ∈ Icc a b
hf : ContDiffOn ℝ (↑n) f (Icc a b)
hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)
gcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc a b)
y : ℝ
hy : y ∈ Ioo a b
hy' : y ≠ x
h :
  (f x - taylorWithinEval f n (Icc a b) x₀ x) * (-(↑n + 1) * (x - y) ^ n) =
    (x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) * iteratedDerivWithin (n + 1) f (Icc a b) y
hy_ne : x - y ≠ 0
⊢ (x - y) ^ n ≠ 0
Tactic:
positivity
State after:
no goals