l3lab/ntp-mathlib huggingface dataset:
/-- A function is `C^∞` on an open domain if and only if it is differentiable
there, and its derivative (formulated with `deriv`) is `C^∞`. -/
theorem contDiffOn_top_iff_deriv_of_isOpen (hs : IsOpen s₂) :
    ContDiffOn 𝕜 ∞ f₂ s₂ ↔ DifferentiableOn 𝕜 f₂ s₂ ∧ ContDiffOn 𝕜 ∞ (deriv f₂) s₂ := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hs : IsOpen s₂
⊢ ContDiffOn 𝕜 ⊤ f₂ s₂ ↔ DifferentiableOn 𝕜 f₂ s₂ ∧ ContDiffOn 𝕜 ⊤ (deriv f₂) s₂

Next tactic:
rw [contDiffOn_top_iff_derivWithin hs.uniqueDiffOn]
/-- A function is `C^∞` on an open domain if and only if it is differentiable
there, and its derivative (formulated with `deriv`) is `C^∞`. -/
theorem contDiffOn_top_iff_deriv_of_isOpen (hs : IsOpen s₂) :
    ContDiffOn 𝕜 ∞ f₂ s₂ ↔ DifferentiableOn 𝕜 f₂ s₂ ∧ ContDiffOn 𝕜 ∞ (deriv f₂) s₂ := by
  rw [contDiffOn_top_iff_derivWithin hs.uniqueDiffOn]
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hs : IsOpen s₂
⊢ DifferentiableOn 𝕜 f₂ s₂ ∧ ContDiffOn 𝕜 ⊤ (derivWithin f₂ s₂) s₂ ↔
    DifferentiableOn 𝕜 f₂ s₂ ∧ ContDiffOn 𝕜 ⊤ (deriv f₂) s₂

Next tactic:
exact Iff.rfl.and <| contDiffOn_congr fun _ => derivWithin_of_isOpen hs
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 n f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
hmn : m + 1 ≤ n
⊢ ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂

Next tactic:
cases m
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  cases m
  · 

Proof state:
case none
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 n f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
hmn : none + 1 ≤ n
⊢ ContDiffOn 𝕜 none (derivWithin f₂ s₂) s₂

Next tactic:
change ∞ + 1 ≤ n at hmn
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  cases m
  · change ∞ + 1 ≤ n at hmn
    

Proof state:
case none
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 n f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
hmn : ⊤ + 1 ≤ n
⊢ ContDiffOn 𝕜 none (derivWithin f₂ s₂) s₂

Next tactic:
have : n = ∞ := by simpa using hmn
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  cases m
  · change ∞ + 1 ≤ n at hmn
    have : n = ∞ := by 

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 n f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
hmn : ⊤ + 1 ≤ n
⊢ n = ⊤

Next tactic:
simpa using hmn
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  cases m
  · change ∞ + 1 ≤ n at hmn
    have : n = ∞ := by simpa using hmn
    

Proof state:
case none
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 n f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
hmn : ⊤ + 1 ≤ n
this : n = ⊤
⊢ ContDiffOn 𝕜 none (derivWithin f₂ s₂) s₂

Next tactic:
rw [this] at hf
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  cases m
  · change ∞ + 1 ≤ n at hmn
    have : n = ∞ := by simpa using hmn
    rw [this] at hf
    

Proof state:
case none
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 ⊤ f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
hmn : ⊤ + 1 ≤ n
this : n = ⊤
⊢ ContDiffOn 𝕜 none (derivWithin f₂ s₂) s₂

Next tactic:
exact ((contDiffOn_top_iff_derivWithin hs).1 hf).2
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  cases m
  · change ∞ + 1 ≤ n at hmn
    have : n = ∞ := by simpa using hmn
    rw [this] at hf
    exact ((contDiffOn_top_iff_derivWithin hs).1 hf).2
  · 

Proof state:
case some
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 n f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
val✝ : ℕ
hmn : some val✝ + 1 ≤ n
⊢ ContDiffOn 𝕜 (some val✝) (derivWithin f₂ s₂) s₂

Next tactic:
change (Nat.succ _ : ℕ∞) ≤ n at hmn
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn 𝕜 n f₂ s₂) (hs : UniqueDiffOn 𝕜 s₂)
    (hmn : m + 1 ≤ n) : ContDiffOn 𝕜 m (derivWithin f₂ s₂) s₂ := by
  cases m
  · change ∞ + 1 ≤ n at hmn
    have : n = ∞ := by simpa using hmn
    rw [this] at hf
    exact ((contDiffOn_top_iff_derivWithin hs).1 hf).2
  · change (Nat.succ _ : ℕ∞) ≤ n at hmn
    

Proof state:
case some
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
hf : ContDiffOn 𝕜 n f₂ s₂
hs : UniqueDiffOn 𝕜 s₂
val✝ : ℕ
hmn : ↑(Nat.succ val✝) ≤ n
⊢ ContDiffOn 𝕜 (some val✝) (derivWithin f₂ s₂) s₂

Next tactic:
exact ((contDiffOn_succ_iff_derivWithin hs).1 (hf.of_le hmn)).2
/-- A function is `C^(n + 1)` if and only if it is differentiable,
  and its derivative (formulated in terms of `deriv`) is `C^n`. -/
theorem contDiff_succ_iff_deriv {n : ℕ} :
    ContDiff 𝕜 (n + 1 : ℕ) f₂ ↔ Differentiable 𝕜 f₂ ∧ ContDiff 𝕜 n (deriv f₂) := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m n✝ : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
n : ℕ
⊢ ContDiff 𝕜 (↑(n + 1)) f₂ ↔ Differentiable 𝕜 f₂ ∧ ContDiff 𝕜 (↑n) (deriv f₂)

Next tactic:
simp only [← contDiffOn_univ, contDiffOn_succ_iff_deriv_of_isOpen, isOpen_univ,
    differentiableOn_univ]
/-- A function is `C^∞` if and only if it is differentiable,
and its derivative (formulated in terms of `deriv`) is `C^∞`. -/
theorem contDiff_top_iff_deriv :
    ContDiff 𝕜 ∞ f₂ ↔ Differentiable 𝕜 f₂ ∧ ContDiff 𝕜 ∞ (deriv f₂) := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
⊢ ContDiff 𝕜 ⊤ f₂ ↔ Differentiable 𝕜 f₂ ∧ ContDiff 𝕜 ⊤ (deriv f₂)

Next tactic:
simp only [← contDiffOn_univ, ← differentiableOn_univ, ← derivWithin_univ]
/-- A function is `C^∞` if and only if it is differentiable,
and its derivative (formulated in terms of `deriv`) is `C^∞`. -/
theorem contDiff_top_iff_deriv :
    ContDiff 𝕜 ∞ f₂ ↔ Differentiable 𝕜 f₂ ∧ ContDiff 𝕜 ∞ (deriv f₂) := by
  simp only [← contDiffOn_univ, ← differentiableOn_univ, ← derivWithin_univ]
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
X : Type u_2
inst✝¹ : NormedAddCommGroup X
inst✝ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
f₂ : 𝕜 → F
s₂ : Set 𝕜
⊢ ContDiffOn 𝕜 ⊤ f₂ univ ↔ DifferentiableOn 𝕜 f₂ univ ∧ ContDiffOn 𝕜 ⊤ (derivWithin f₂ univ) univ

Next tactic:
rw [contDiffOn_top_iff_derivWithin uniqueDiffOn_univ]
theorem HasFTaylorSeriesUpToOn.restrictScalars (h : HasFTaylorSeriesUpToOn n f p' s) :
    HasFTaylorSeriesUpToOn n f (fun x => (p' x).restrictScalars 𝕜) s where
  zero_eq x hx := h.zero_eq x hx
  fderivWithin m hm x hx := by
    

Proof state:
𝕜 : Type u_1
inst✝¹⁶ : NontriviallyNormedField 𝕜
D : Type uD
inst✝¹⁵ : NormedAddCommGroup D
inst✝¹⁴ : NormedSpace 𝕜 D
E : Type uE
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
F : Type uF
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
G : Type uG
inst✝⁹ : NormedAddCommGroup G
inst✝⁸ : NormedSpace 𝕜 G
X : Type u_2
inst✝⁷ : NormedAddCommGroup X
inst✝⁶ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x✝ x₀ : E
c : F
b : E × F → G
m✝ n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
𝕜' : Type u_3
inst✝⁵ : NontriviallyNormedField 𝕜'
inst✝⁴ : NormedAlgebra 𝕜 𝕜'
inst✝³ : NormedSpace 𝕜' E
inst✝² : IsScalarTower 𝕜 𝕜' E
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
p' : E → FormalMultilinearSeries 𝕜' E F
h : HasFTaylorSeriesUpToOn n f p' s
m : ℕ
hm : ↑m < n
x : E
hx : x ∈ s
⊢ HasFDerivWithinAt (fun x => FormalMultilinearSeries.restrictScalars 𝕜 (p' x) m)
    (ContinuousMultilinearMap.curryLeft (FormalMultilinearSeries.restrictScalars 𝕜 (p' x) (Nat.succ m))) s x

Next tactic:
simpa only using -- porting note: added `by simpa only using`
      (ContinuousMultilinearMap.restrictScalarsLinear 𝕜).hasFDerivAt.comp_hasFDerivWithinAt x <|
        (h.fderivWithin m hm x hx).restrictScalars 𝕜
theorem ContDiffWithinAt.restrict_scalars (h : ContDiffWithinAt 𝕜' n f s x) :
    ContDiffWithinAt 𝕜 n f s x := fun m hm ↦ by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁶ : NontriviallyNormedField 𝕜
D : Type uD
inst✝¹⁵ : NormedAddCommGroup D
inst✝¹⁴ : NormedSpace 𝕜 D
E : Type uE
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
F : Type uF
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
G : Type uG
inst✝⁹ : NormedAddCommGroup G
inst✝⁸ : NormedSpace 𝕜 G
X : Type u_2
inst✝⁷ : NormedAddCommGroup X
inst✝⁶ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m✝ n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
𝕜' : Type u_3
inst✝⁵ : NontriviallyNormedField 𝕜'
inst✝⁴ : NormedAlgebra 𝕜 𝕜'
inst✝³ : NormedSpace 𝕜' E
inst✝² : IsScalarTower 𝕜 𝕜' E
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
p' : E → FormalMultilinearSeries 𝕜' E F
h : ContDiffWithinAt 𝕜' n f s x
m : ℕ
hm : ↑m ≤ n
⊢ ∃ u ∈ 𝓝[insert x s] x, ∃ p, HasFTaylorSeriesUpToOn (↑m) f p u

Next tactic:
rcases h m hm with ⟨u, u_mem, p', hp'⟩
theorem ContDiffWithinAt.restrict_scalars (h : ContDiffWithinAt 𝕜' n f s x) :
    ContDiffWithinAt 𝕜 n f s x := fun m hm ↦ by
  rcases h m hm with ⟨u, u_mem, p', hp'⟩
  

Proof state:
case intro.intro.intro
𝕜 : Type u_1
inst✝¹⁶ : NontriviallyNormedField 𝕜
D : Type uD
inst✝¹⁵ : NormedAddCommGroup D
inst✝¹⁴ : NormedSpace 𝕜 D
E : Type uE
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
F : Type uF
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
G : Type uG
inst✝⁹ : NormedAddCommGroup G
inst✝⁸ : NormedSpace 𝕜 G
X : Type u_2
inst✝⁷ : NormedAddCommGroup X
inst✝⁶ : NormedSpace 𝕜 X
s s₁ t u✝ : Set E
f f₁ : E → F
g : F → G
x x₀ : E
c : F
b : E × F → G
m✝ n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
𝕜' : Type u_3
inst✝⁵ : NontriviallyNormedField 𝕜'
inst✝⁴ : NormedAlgebra 𝕜 𝕜'
inst✝³ : NormedSpace 𝕜' E
inst✝² : IsScalarTower 𝕜 𝕜' E
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
p'✝ : E → FormalMultilinearSeries 𝕜' E F
h : ContDiffWithinAt 𝕜' n f s x
m : ℕ
hm : ↑m ≤ n
u : Set E
u_mem : u ∈ 𝓝[insert x s] x
p' : E → FormalMultilinearSeries 𝕜' E F
hp' : HasFTaylorSeriesUpToOn (↑m) f p' u
⊢ ∃ u ∈ 𝓝[insert x s] x, ∃ p, HasFTaylorSeriesUpToOn (↑m) f p u

Next tactic:
exact ⟨u, u_mem, _, hp'.restrictScalars _⟩
instance linearOrderedAddCommGroup : LinearOrderedAddCommGroup ℤ := by 

Proof state:
⊢ LinearOrderedAddCommGroup ℤ

Next tactic:
infer_instance
lemma _root_.Nat.cast_natAbs {α : Type*} [AddGroupWithOne α] (n : ℤ) : (n.natAbs : α) = |n| :=
  by 

Proof state:
α : Type u_1
inst✝ : AddGroupWithOne α
n : ℤ
⊢ ↑(natAbs n) = ↑|n|

Next tactic:
rw [← coe_natAbs, Int.cast_ofNat]
theorem natAbs_abs (a : ℤ) : natAbs |a| = natAbs a := by 

Proof state:
a : ℤ
⊢ natAbs |a| = natAbs a

Next tactic:
rw [abs_eq_natAbs]
theorem natAbs_abs (a : ℤ) : natAbs |a| = natAbs a := by rw [abs_eq_natAbs]; 

Proof state:
a : ℤ
⊢ natAbs ↑(natAbs a) = natAbs a

Next tactic:
rfl
theorem sign_mul_abs (a : ℤ) : sign a * |a| = a := by
  

Proof state:
a : ℤ
⊢ sign a * |a| = a

Next tactic:
rw [abs_eq_natAbs, sign_mul_natAbs a]
theorem coe_nat_ne_zero {n : ℕ} : (n : ℤ) ≠ 0 ↔ n ≠ 0 := by 

Proof state:
n : ℕ
⊢ ↑n ≠ 0 ↔ n ≠ 0

Next tactic:
simp
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  

Proof state:
⊢ ∀ {m n : ℤ}, sign m = sign n → sign (m + n) = sign n

Next tactic:
have : (1 : ℤ) ≠ -1 := by decide
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by 

Proof state:
⊢ 1 ≠ -1

Next tactic:
decide
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  

Proof state:
this : 1 ≠ -1
⊢ ∀ {m n : ℤ}, sign m = sign n → sign (m + n) = sign n

Next tactic:
rintro ((_ | m) | m) ((_ | n) | n)
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case ofNat.zero.ofNat.zero
this : 1 ≠ -1
⊢ sign (ofNat zero) = sign (ofNat zero) → sign (ofNat zero + ofNat zero) = sign (ofNat zero)

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case ofNat.zero.ofNat.succ
this : 1 ≠ -1
n : ℕ
⊢ sign (ofNat zero) = sign (ofNat (Nat.succ n)) → sign (ofNat zero + ofNat (Nat.succ n)) = sign (ofNat (Nat.succ n))

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case ofNat.zero.negSucc
this : 1 ≠ -1
n : ℕ
⊢ sign (ofNat zero) = sign -[n+1] → sign (ofNat zero + -[n+1]) = sign -[n+1]

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case ofNat.succ.ofNat.zero
this : 1 ≠ -1
m : ℕ
⊢ sign (ofNat (Nat.succ m)) = sign (ofNat zero) → sign (ofNat (Nat.succ m) + ofNat zero) = sign (ofNat zero)

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case ofNat.succ.ofNat.succ
this : 1 ≠ -1
m n : ℕ
⊢ sign (ofNat (Nat.succ m)) = sign (ofNat (Nat.succ n)) →
    sign (ofNat (Nat.succ m) + ofNat (Nat.succ n)) = sign (ofNat (Nat.succ n))

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case ofNat.succ.negSucc
this : 1 ≠ -1
m n : ℕ
⊢ sign (ofNat (Nat.succ m)) = sign -[n+1] → sign (ofNat (Nat.succ m) + -[n+1]) = sign -[n+1]

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case negSucc.ofNat.zero
this : 1 ≠ -1
m : ℕ
⊢ sign -[m+1] = sign (ofNat zero) → sign (-[m+1] + ofNat zero) = sign (ofNat zero)

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case negSucc.ofNat.succ
this : 1 ≠ -1
m n : ℕ
⊢ sign -[m+1] = sign (ofNat (Nat.succ n)) → sign (-[m+1] + ofNat (Nat.succ n)) = sign (ofNat (Nat.succ n))

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> 

Proof state:
case negSucc.negSucc
this : 1 ≠ -1
m n : ℕ
⊢ sign -[m+1] = sign -[n+1] → sign (-[m+1] + -[n+1]) = sign -[n+1]

Next tactic:
simp [this, this.symm, Int.negSucc_add_negSucc]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> simp [this, this.symm, Int.negSucc_add_negSucc]
  

Proof state:
case ofNat.succ.ofNat.succ
this : 1 ≠ -1
m n : ℕ
⊢ sign (↑m + 1 + (↑n + 1)) = 1

Next tactic:
rw [Int.sign_eq_one_iff_pos]
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> simp [this, this.symm, Int.negSucc_add_negSucc]
  rw [Int.sign_eq_one_iff_pos]
  

Proof state:
case ofNat.succ.ofNat.succ
this : 1 ≠ -1
m n : ℕ
⊢ 0 < ↑m + 1 + (↑n + 1)

Next tactic:
apply Int.add_pos
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> simp [this, this.symm, Int.negSucc_add_negSucc]
  rw [Int.sign_eq_one_iff_pos]
  apply Int.add_pos <;> · 

Proof state:
case ofNat.succ.ofNat.succ.ha
this : 1 ≠ -1
m n : ℕ
⊢ 0 < ↑m + 1

Next tactic:
exact zero_lt_one.trans_le (le_add_of_nonneg_left <| coe_nat_nonneg _)
theorem sign_add_eq_of_sign_eq : ∀ {m n : ℤ}, m.sign = n.sign → (m + n).sign = n.sign := by
  have : (1 : ℤ) ≠ -1 := by decide
  rintro ((_ | m) | m) ((_ | n) | n) <;> simp [this, this.symm, Int.negSucc_add_negSucc]
  rw [Int.sign_eq_one_iff_pos]
  apply Int.add_pos <;> · 

Proof state:
case ofNat.succ.ofNat.succ.hb
this : 1 ≠ -1
m n : ℕ
⊢ 0 < ↑n + 1

Next tactic:
exact zero_lt_one.trans_le (le_add_of_nonneg_left <| coe_nat_nonneg _)
@[simp]
theorem abs_lt_one_iff {a : ℤ} : |a| < 1 ↔ a = 0 :=
  ⟨fun a0 => by
    

Proof state:
a : ℤ
a0 : |a| < 1
⊢ a = 0

Next tactic:
let ⟨hn, hp⟩ := abs_lt.mp a0
@[simp]
theorem abs_lt_one_iff {a : ℤ} : |a| < 1 ↔ a = 0 :=
  ⟨fun a0 => by
    let ⟨hn, hp⟩ := abs_lt.mp a0
    

Proof state:
a : ℤ
a0 : |a| < 1
hn : -1 < a
hp : a < 1
⊢ a = 0

Next tactic:
rw [← zero_add 1, lt_add_one_iff] at hp
@[simp]
theorem abs_lt_one_iff {a : ℤ} : |a| < 1 ↔ a = 0 :=
  ⟨fun a0 => by
    let ⟨hn, hp⟩ := abs_lt.mp a0
    rw [← zero_add 1, lt_add_one_iff] at hp
    -- Defeq abuse: `hn : -1 < a` but should be `hn : 0 λ a`.
    

Proof state:
a : ℤ
a0 : |a| < 1
hn : -1 < a
hp : a ≤ 0
⊢ a = 0

Next tactic:
exact hp.antisymm hn
theorem abs_le_one_iff {a : ℤ} : |a| ≤ 1 ↔ a = 0 ∨ a = 1 ∨ a = -1 := by
  

Proof state:
a : ℤ
⊢ |a| ≤ 1 ↔ a = 0 ∨ a = 1 ∨ a = -1

Next tactic:
rw [le_iff_lt_or_eq, abs_lt_one_iff, abs_eq (zero_le_one' ℤ)]