Analysis I, Section 10.1: Basic definitions

I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.

Main constructions and results of this section:

Note that the Mathlib conventions differ slightly from that in the text, in that differentiability is defined even at points that are not limit points of the domain; derivatives in such cases may not be unique, but derivWithin.{u, v} {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [AddCommGroup F] [Module π•œ F] [TopologicalSpace F] (f : π•œ β†’ F) (s : Set π•œ) (x : π•œ) : FderivWithin still selects one such derivative in such cases (or 0 : β„•0, if no derivative exists).

namespace Chapter10variable (xβ‚€ : ℝ)

Definition 10.1.1 (Differentiability at a point). For the Mathlib notion HasDerivWithinAt.{u, v} {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [AddCommGroup F] [Module π•œ F] [TopologicalSpace F] [ContinuousSMul π•œ F] (f : π•œ β†’ F) (f' : F) (s : Set π•œ) (x : π•œ) : PropHasDerivWithinAt, the hypothesis that xβ‚€ : ℝxβ‚€ is a limit point is not needed.

theorem _root_.HasDerivWithinAt.iff (X: Set ℝ) (xβ‚€ : ℝ) (f: ℝ β†’ ℝ) (L:ℝ) : HasDerivWithinAt f L X xβ‚€ ↔ (nhdsWithin xβ‚€ (X \ {xβ‚€})).Tendsto (fun x ↦ (f x - f xβ‚€) / (x - xβ‚€)) (nhds L) := X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝL:β„βŠ’ HasDerivWithinAt f L X xβ‚€ ↔ Filter.Tendsto (fun x => (f x - f xβ‚€) / (x - xβ‚€)) (nhdsWithin xβ‚€ (X \ {xβ‚€})) (nhds L) All goals completed! πŸ™
theorem _root_.DifferentiableWithinAt.iff (X: Set ℝ) (xβ‚€ : ℝ) (f: ℝ β†’ ℝ) : DifferentiableWithinAt ℝ f X xβ‚€ ↔ βˆƒ L, HasDerivWithinAt f L X xβ‚€ := X:Set ℝxβ‚€:ℝf:ℝ β†’ β„βŠ’ DifferentiableWithinAt ℝ f X xβ‚€ ↔ βˆƒ L, HasDerivWithinAt f L X xβ‚€ X:Set ℝxβ‚€:ℝf:ℝ β†’ β„βŠ’ DifferentiableWithinAt ℝ f X xβ‚€ β†’ βˆƒ L, HasDerivWithinAt f L X xβ‚€X:Set ℝxβ‚€:ℝf:ℝ β†’ β„βŠ’ (βˆƒ L, HasDerivWithinAt f L X xβ‚€) β†’ DifferentiableWithinAt ℝ f X xβ‚€ X:Set ℝxβ‚€:ℝf:ℝ β†’ β„βŠ’ DifferentiableWithinAt ℝ f X xβ‚€ β†’ βˆƒ L, HasDerivWithinAt f L X xβ‚€ X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝh:DifferentiableWithinAt ℝ f X xβ‚€βŠ’ βˆƒ L, HasDerivWithinAt f L X xβ‚€; X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝh:DifferentiableWithinAt ℝ f X xβ‚€βŠ’ HasDerivWithinAt f (derivWithin f X xβ‚€) X xβ‚€; All goals completed! πŸ™ X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝL:ℝh:HasDerivWithinAt f L X xβ‚€βŠ’ DifferentiableWithinAt ℝ f X xβ‚€; All goals completed! πŸ™theorem _root_.DifferentiableWithinAt.of_hasDeriv {X: Set ℝ} {xβ‚€ : ℝ} {f: ℝ β†’ ℝ} {L:ℝ} (hL: HasDerivWithinAt f L X xβ‚€) : DifferentiableWithinAt ℝ f X xβ‚€ := X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝL:ℝhL:HasDerivWithinAt f L X xβ‚€βŠ’ DifferentiableWithinAt ℝ f X xβ‚€ X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝL:ℝhL:HasDerivWithinAt f L X xβ‚€βŠ’ βˆƒ L, HasDerivWithinAt f L X xβ‚€; All goals completed! πŸ™theorem derivative_unique {X: Set ℝ} {xβ‚€ : ℝ} (hxβ‚€: ClusterPt xβ‚€ (.principal (X \ {xβ‚€}))) {f: ℝ β†’ ℝ} {L L':ℝ} (hL: HasDerivWithinAt f L X xβ‚€) (hL': HasDerivWithinAt f L' X xβ‚€) : L = L' := X:Set ℝxβ‚€:ℝhxβ‚€:ClusterPt xβ‚€ (Filter.principal (X \ {xβ‚€}))f:ℝ β†’ ℝL:ℝL':ℝhL:HasDerivWithinAt f L X xβ‚€hL':HasDerivWithinAt f L' X xβ‚€βŠ’ L = L' X:Set ℝxβ‚€:ℝhxβ‚€:ClusterPt xβ‚€ (Filter.principal (X \ {xβ‚€}))f:ℝ β†’ ℝL:ℝL':ℝhL:Filter.Tendsto (fun x => (f x - f xβ‚€) / (x - xβ‚€)) (nhdsWithin xβ‚€ (X \ {xβ‚€})) (nhds L)hL':Filter.Tendsto (fun x => (f x - f xβ‚€) / (x - xβ‚€)) (nhdsWithin xβ‚€ (X \ {xβ‚€})) (nhds L')⊒ L = L' X:Set ℝxβ‚€:ℝhxβ‚€:(nhds xβ‚€ βŠ“ Filter.principal (X \ {xβ‚€})).NeBotf:ℝ β†’ ℝL:ℝL':ℝhL:Filter.Tendsto (fun x => (f x - f xβ‚€) / (x - xβ‚€)) (nhdsWithin xβ‚€ (X \ {xβ‚€})) (nhds L)hL':Filter.Tendsto (fun x => (f x - f xβ‚€) / (x - xβ‚€)) (nhdsWithin xβ‚€ (X \ {xβ‚€})) (nhds L')⊒ L = L' All goals completed! πŸ™
DifferentiableWithinAt.hasDerivWithinAt.{u, v} {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v}
  [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {x : π•œ} {s : Set π•œ} (h : DifferentiableWithinAt π•œ f s x) :
  HasDerivWithinAt f (derivWithin f s x) s x
theorem derivative_unique' (X: Set ℝ) {xβ‚€ : ℝ} (hxβ‚€: ClusterPt xβ‚€ (.principal (X \ {xβ‚€}))) {f: ℝ β†’ ℝ} {L :ℝ} (hL: HasDerivWithinAt f L X xβ‚€) (hdiff : DifferentiableWithinAt ℝ f X xβ‚€): L = derivWithin f X xβ‚€ := X:Set ℝxβ‚€:ℝhxβ‚€:ClusterPt xβ‚€ (Filter.principal (X \ {xβ‚€}))f:ℝ β†’ ℝL:ℝhL:HasDerivWithinAt f L X xβ‚€hdiff:DifferentiableWithinAt ℝ f X xβ‚€βŠ’ L = derivWithin f X xβ‚€ All goals completed! πŸ™

Example 10.1.3

declaration uses 'sorry'example (xβ‚€:ℝ) : HasDerivWithinAt (fun x ↦ x^2) (2 * xβ‚€) .univ xβ‚€ := xβ‚€βœ:ℝxβ‚€:β„βŠ’ HasDerivWithinAt (fun x => x ^ 2) (2 * xβ‚€) Set.univ xβ‚€ All goals completed! πŸ™
declaration uses 'sorry'example (xβ‚€:ℝ) : DifferentiableWithinAt ℝ (fun x ↦ x^2) .univ xβ‚€ := xβ‚€βœ:ℝxβ‚€:β„βŠ’ DifferentiableWithinAt ℝ (fun x => x ^ 2) Set.univ xβ‚€ All goals completed! πŸ™declaration uses 'sorry'example (xβ‚€:ℝ) : derivWithin (fun x ↦ x^2) .univ xβ‚€ = 2 * xβ‚€ := xβ‚€βœ:ℝxβ‚€:β„βŠ’ derivWithin (fun x => x ^ 2) Set.univ xβ‚€ = 2 * xβ‚€ All goals completed! πŸ™

Remark 10.1.4

example (X: Set ℝ) (xβ‚€ : ℝ) {f g: ℝ β†’ ℝ} (hfg: f = g): DifferentiableWithinAt ℝ f X xβ‚€ ↔ DifferentiableWithinAt ℝ g X xβ‚€ := xβ‚€βœ:ℝX:Set ℝxβ‚€:ℝf:ℝ β†’ ℝg:ℝ β†’ ℝhfg:f = g⊒ DifferentiableWithinAt ℝ f X xβ‚€ ↔ DifferentiableWithinAt ℝ g X xβ‚€ All goals completed! πŸ™
example (X: Set ℝ) (xβ‚€ : ℝ) {f g: ℝ β†’ ℝ} (L:ℝ) (hfg: f = g): HasDerivWithinAt f L X xβ‚€ ↔ HasDerivWithinAt g L X xβ‚€ := xβ‚€βœ:ℝX:Set ℝxβ‚€:ℝf:ℝ β†’ ℝg:ℝ β†’ ℝL:ℝhfg:f = g⊒ HasDerivWithinAt f L X xβ‚€ ↔ HasDerivWithinAt g L X xβ‚€ All goals completed! πŸ™declaration uses 'sorry'example : βˆƒ (X: Set ℝ) (xβ‚€ :ℝ) (f g: ℝ β†’ ℝ) (L:ℝ) (hfg: f xβ‚€ = g xβ‚€), HasDerivWithinAt f L X xβ‚€ ∧ Β¬ HasDerivWithinAt g L X xβ‚€ := xβ‚€:β„βŠ’ βˆƒ X xβ‚€ f g L, βˆƒ (_ : f xβ‚€ = g xβ‚€), HasDerivWithinAt f L X xβ‚€ ∧ Β¬HasDerivWithinAt g L X xβ‚€ All goals completed! πŸ™

Example 10.1.6

abbrev f_10_1_6 : ℝ β†’ ℝ := abs
declaration uses 'sorry'example : (nhdsWithin 0 (.Ioi 0)).Tendsto (fun x ↦ (f_10_1_6 x - f_10_1_6 0) / (x - 0)) (nhds 1) := xβ‚€:β„βŠ’ Filter.Tendsto (fun x => (f_10_1_6 x - f_10_1_6 0) / (x - 0)) (nhdsWithin 0 (Set.Ioi 0)) (nhds 1) All goals completed! πŸ™declaration uses 'sorry'example : (nhdsWithin 0 (.Iio 0)).Tendsto (fun x ↦ (f_10_1_6 x - f_10_1_6 0) / (x - 0)) (nhds (-1)) := xβ‚€:β„βŠ’ Filter.Tendsto (fun x => (f_10_1_6 x - f_10_1_6 0) / (x - 0)) (nhdsWithin 0 (Set.Iio 0)) (nhds (-1)) All goals completed! πŸ™declaration uses 'sorry'example : Β¬ βˆƒ L, (nhdsWithin 0 (.univ \ {0})).Tendsto (fun x ↦ (f_10_1_6 x - f_10_1_6 0) / (x - 0)) (nhds L) := xβ‚€:β„βŠ’ Β¬βˆƒ L, Filter.Tendsto (fun x => (f_10_1_6 x - f_10_1_6 0) / (x - 0)) (nhdsWithin 0 (Set.univ \ {0})) (nhds L) All goals completed! πŸ™declaration uses 'sorry'example : Β¬ DifferentiableWithinAt ℝ f_10_1_6 (.univ) 0 := xβ‚€:β„βŠ’ Β¬DifferentiableWithinAt ℝ f_10_1_6 Set.univ 0 All goals completed! πŸ™declaration uses 'sorry'example : DifferentiableWithinAt ℝ f_10_1_6 (.Ioi 0) 0 := xβ‚€:β„βŠ’ DifferentiableWithinAt ℝ f_10_1_6 (Set.Ioi 0) 0 All goals completed! πŸ™declaration uses 'sorry'example : derivWithin f_10_1_6 (.Ioi 0) 0 = 1 := xβ‚€:β„βŠ’ derivWithin f_10_1_6 (Set.Ioi 0) 0 = 1 All goals completed! πŸ™declaration uses 'sorry'example : DifferentiableWithinAt ℝ f_10_1_6 (.Iio 0) 0 := xβ‚€:β„βŠ’ DifferentiableWithinAt ℝ f_10_1_6 (Set.Iio 0) 0 All goals completed! πŸ™declaration uses 'sorry'example : derivWithin f_10_1_6 (.Iio 0) 0 = -1 := xβ‚€:β„βŠ’ derivWithin f_10_1_6 (Set.Iio 0) 0 = -1 All goals completed! πŸ™

Proposition 10.1.7 (Newton's approximation) / Exercise 10.1.2

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.iff_approx_linear (X: Set ℝ) (xβ‚€ :ℝ) (f: ℝ β†’ ℝ) (L:ℝ) : HasDerivWithinAt f L X xβ‚€ ↔ βˆ€ Ξ΅ > 0, βˆƒ Ξ΄ > 0, βˆ€ x ∈ X, |x - xβ‚€| < Ξ΄ β†’ |f x - f xβ‚€ - L * (x - xβ‚€)| ≀ Ξ΅ * |x - xβ‚€| := X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝL:β„βŠ’ HasDerivWithinAt f L X xβ‚€ ↔ βˆ€ Ξ΅ > 0, βˆƒ Ξ΄ > 0, βˆ€ x ∈ X, |x - xβ‚€| < Ξ΄ β†’ |f x - f xβ‚€ - L * (x - xβ‚€)| ≀ Ξ΅ * |x - xβ‚€| All goals completed! πŸ™

Proposition 10.1.10 / Exercise 10.1.3

theorem declaration uses 'sorry'_root_.ContinuousWithinAt.of_differentiableWithinAt {X: Set ℝ} {xβ‚€ : ℝ} {f: ℝ β†’ ℝ} (h: DifferentiableWithinAt ℝ f X xβ‚€) : ContinuousWithinAt f X xβ‚€ := X:Set ℝxβ‚€:ℝf:ℝ β†’ ℝh:DifferentiableWithinAt ℝ f X xβ‚€βŠ’ ContinuousWithinAt f X xβ‚€ All goals completed! πŸ™
DifferentiableOn.eq_1.{u_1, u_2, u_3} (π•œ : Type u_1) [NontriviallyNormedField π•œ] {E : Type u_2} [AddCommGroup E]
  [Module π•œ E] [TopologicalSpace E] {F : Type u_3} [AddCommGroup F] [Module π•œ F] [TopologicalSpace F] (f : E β†’ F)
  (s : Set E) : DifferentiableOn π•œ f s = βˆ€ x ∈ s, DifferentiableWithinAt π•œ f s x

Corollary 10.1.12

theorem _root_.ContinuousOn.of_differentiableOn {X: Set ℝ} {f: ℝ β†’ ℝ} (h: DifferentiableOn ℝ f X) : ContinuousOn f X := X:Set ℝf:ℝ β†’ ℝh:DifferentiableOn ℝ f X⊒ ContinuousOn f X All goals completed! πŸ™

Theorem 10.1.13 (a) (Differential calculus) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_const (X: Set ℝ) (xβ‚€ : ℝ) (c:ℝ) : HasDerivWithinAt (fun x ↦ c) 0 X xβ‚€ := X:Set ℝxβ‚€:ℝc:β„βŠ’ HasDerivWithinAt (fun x => c) 0 X xβ‚€ All goals completed! πŸ™

Theorem 10.1.13 (b) (Differential calculus) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_id (X: Set ℝ) (xβ‚€ : ℝ) : HasDerivWithinAt (fun x ↦ x) 1 X xβ‚€ := X:Set ℝxβ‚€:β„βŠ’ HasDerivWithinAt (fun x => x) 1 X xβ‚€ All goals completed! πŸ™

Theorem 10.1.13 (c) (Sum rule) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_add {X: Set ℝ} {xβ‚€ f'xβ‚€ g'xβ‚€: ℝ} {f g: ℝ β†’ ℝ} (hf: HasDerivWithinAt f f'xβ‚€ X xβ‚€) (hg: HasDerivWithinAt g g'xβ‚€ X xβ‚€) : HasDerivWithinAt (f + g) (f'xβ‚€ + g'xβ‚€) X xβ‚€ := X:Set ℝxβ‚€:ℝf'xβ‚€:ℝg'xβ‚€:ℝf:ℝ β†’ ℝg:ℝ β†’ ℝhf:HasDerivWithinAt f f'xβ‚€ X xβ‚€hg:HasDerivWithinAt g g'xβ‚€ X xβ‚€βŠ’ HasDerivWithinAt (f + g) (f'xβ‚€ + g'xβ‚€) X xβ‚€ All goals completed! πŸ™

Theorem 10.1.13 (d) (Product rule) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_mul {X: Set ℝ} {xβ‚€ f'xβ‚€ g'xβ‚€: ℝ} {f g: ℝ β†’ ℝ} (hf: HasDerivWithinAt f f'xβ‚€ X xβ‚€) (hg: HasDerivWithinAt g g'xβ‚€ X xβ‚€) : HasDerivWithinAt (f * g) (f'xβ‚€ * (g xβ‚€) + (f xβ‚€) * g'xβ‚€) X xβ‚€ := X:Set ℝxβ‚€:ℝf'xβ‚€:ℝg'xβ‚€:ℝf:ℝ β†’ ℝg:ℝ β†’ ℝhf:HasDerivWithinAt f f'xβ‚€ X xβ‚€hg:HasDerivWithinAt g g'xβ‚€ X xβ‚€βŠ’ HasDerivWithinAt (f * g) (f'xβ‚€ * g xβ‚€ + f xβ‚€ * g'xβ‚€) X xβ‚€ All goals completed! πŸ™

Theorem 10.1.13 (e) (Differential calculus) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_smul {X: Set ℝ} {xβ‚€ f'xβ‚€: ℝ} (c:ℝ) {f: ℝ β†’ ℝ} (hf: HasDerivWithinAt f f'xβ‚€ X xβ‚€) : HasDerivWithinAt (c β€’ f) (c * f'xβ‚€) X xβ‚€ := X:Set ℝxβ‚€:ℝf'xβ‚€:ℝc:ℝf:ℝ β†’ ℝhf:HasDerivWithinAt f f'xβ‚€ X xβ‚€βŠ’ HasDerivWithinAt (c β€’ f) (c * f'xβ‚€) X xβ‚€ All goals completed! πŸ™

Theorem 10.1.13 (f) (Difference rule) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_sub {X: Set ℝ} {xβ‚€ f'xβ‚€ g'xβ‚€: ℝ} {f g: ℝ β†’ ℝ} (hf: HasDerivWithinAt f f'xβ‚€ X xβ‚€) (hg: HasDerivWithinAt g g'xβ‚€ X xβ‚€) : HasDerivWithinAt (f - g) (f'xβ‚€ - g'xβ‚€) X xβ‚€ := X:Set ℝxβ‚€:ℝf'xβ‚€:ℝg'xβ‚€:ℝf:ℝ β†’ ℝg:ℝ β†’ ℝhf:HasDerivWithinAt f f'xβ‚€ X xβ‚€hg:HasDerivWithinAt g g'xβ‚€ X xβ‚€βŠ’ HasDerivWithinAt (f - g) (f'xβ‚€ - g'xβ‚€) X xβ‚€ All goals completed! πŸ™

Theorem 10.1.13 (g) (Differential calculus) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_inv {X: Set ℝ} {xβ‚€ g'xβ‚€: ℝ} {g: ℝ β†’ ℝ} (hgxβ‚€ : g xβ‚€ β‰  0) (hg: HasDerivWithinAt g g'xβ‚€ X xβ‚€) : HasDerivWithinAt (1/g) (-g'xβ‚€ / (g xβ‚€)^2) X xβ‚€ := X:Set ℝxβ‚€:ℝg'xβ‚€:ℝg:ℝ β†’ ℝhgxβ‚€:g xβ‚€ β‰  0hg:HasDerivWithinAt g g'xβ‚€ X xβ‚€βŠ’ HasDerivWithinAt (1 / g) (-g'xβ‚€ / g xβ‚€ ^ 2) X xβ‚€ All goals completed! πŸ™

Theorem 10.1.13 (h) (Quotient rule) / Exercise 10.1.4

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_div {X: Set ℝ} {xβ‚€ f'xβ‚€ g'xβ‚€: ℝ} {f g: ℝ β†’ ℝ} (hgxβ‚€ : g xβ‚€ β‰  0) (hf: HasDerivWithinAt f f'xβ‚€ X xβ‚€) (hg: HasDerivWithinAt g g'xβ‚€ X xβ‚€) : HasDerivWithinAt (f / g) ((f'xβ‚€ * (g xβ‚€) - (f xβ‚€) * g'xβ‚€) / (g xβ‚€)^2) X xβ‚€ := X:Set ℝxβ‚€:ℝf'xβ‚€:ℝg'xβ‚€:ℝf:ℝ β†’ ℝg:ℝ β†’ ℝhgxβ‚€:g xβ‚€ β‰  0hf:HasDerivWithinAt f f'xβ‚€ X xβ‚€hg:HasDerivWithinAt g g'xβ‚€ X xβ‚€βŠ’ HasDerivWithinAt (f / g) ((f'xβ‚€ * g xβ‚€ - f xβ‚€ * g'xβ‚€) / g xβ‚€ ^ 2) X xβ‚€ All goals completed! πŸ™
declaration uses 'sorry'example (xβ‚€:ℝ) (hxβ‚€: xβ‚€ β‰  1): HasDerivWithinAt (fun x ↦ (x-2)/(x-1)) (1 /(xβ‚€-1)^2) (.univ \ {1}) xβ‚€ := xβ‚€βœ:ℝxβ‚€:ℝhxβ‚€:xβ‚€ β‰  1⊒ HasDerivWithinAt (fun x => (x - 2) / (x - 1)) (1 / (xβ‚€ - 1) ^ 2) (Set.univ \ {1}) xβ‚€ All goals completed! πŸ™

Theorem 10.1.15 (Chain rule) / Exercise 10.1.7

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_comp {X Y: Set ℝ} {xβ‚€ yβ‚€ f'xβ‚€ g'yβ‚€: ℝ} {f g: ℝ β†’ ℝ} (hfxβ‚€: f xβ‚€ = yβ‚€) (hfX : βˆ€ x ∈ X, f x ∈ Y) (hf: HasDerivWithinAt f f'xβ‚€ X xβ‚€) (hg: HasDerivWithinAt g g'yβ‚€ Y yβ‚€) : HasDerivWithinAt (g ∘ f) (g'yβ‚€ * f'xβ‚€) X xβ‚€ := X:Set ℝY:Set ℝxβ‚€:ℝyβ‚€:ℝf'xβ‚€:ℝg'yβ‚€:ℝf:ℝ β†’ ℝg:ℝ β†’ ℝhfxβ‚€:f xβ‚€ = yβ‚€hfX:βˆ€ x ∈ X, f x ∈ Yhf:HasDerivWithinAt f f'xβ‚€ X xβ‚€hg:HasDerivWithinAt g g'yβ‚€ Y yβ‚€βŠ’ HasDerivWithinAt (g ∘ f) (g'yβ‚€ * f'xβ‚€) X xβ‚€ All goals completed! πŸ™

Exercise 10.1.5

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_pow (n:β„•) (xβ‚€:ℝ) : HasDerivWithinAt (fun x ↦ x^n) (n * xβ‚€^((n:β„€)-1)) .univ xβ‚€ := n:β„•xβ‚€:β„βŠ’ HasDerivWithinAt (fun x => x ^ n) (↑n * xβ‚€ ^ (↑n - 1)) Set.univ xβ‚€ All goals completed! πŸ™

Exercise 10.1.6

theorem declaration uses 'sorry'_root_.HasDerivWithinAt.of_zpow (n:β„€) (xβ‚€:ℝ) (hxβ‚€: xβ‚€ β‰  0) : HasDerivWithinAt (fun x ↦ x^n) (n * xβ‚€^(n-1)) (.univ \ {0}) xβ‚€ := n:β„€xβ‚€:ℝhxβ‚€:xβ‚€ β‰  0⊒ HasDerivWithinAt (fun x => x ^ n) (↑n * xβ‚€ ^ (n - 1)) (Set.univ \ {0}) xβ‚€ All goals completed! πŸ™
end Chapter10