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:
-
API for Mathlib's
HasDerivWithinAt,derivWithin, andDifferentiableWithinAt.
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 still selects one such
derivative in such cases (or 0, if no derivative exists).
namespace Chapter10variable (xβ : β)
Definition 10.1.1 (Differentiability at a point). For the Mathlib notion HasDerivWithinAt, the
hypothesis that 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! π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
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! πexample (xβ:β) : DifferentiableWithinAt β (fun x β¦ x^2) .univ xβ := xββ:βxβ:ββ’ DifferentiableWithinAt β (fun x => x ^ 2) Set.univ xβ
All goals completed! π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! π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 : (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! π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! π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! πexample : Β¬ DifferentiableWithinAt β f_10_1_6 (.univ) 0 := xβ:ββ’ Β¬DifferentiableWithinAt β f_10_1_6 Set.univ 0
All goals completed! πexample : DifferentiableWithinAt β f_10_1_6 (.Ioi 0) 0 := xβ:ββ’ DifferentiableWithinAt β f_10_1_6 (Set.Ioi 0) 0
All goals completed! πexample : derivWithin f_10_1_6 (.Ioi 0) 0 = 1 := xβ:ββ’ derivWithin f_10_1_6 (Set.Ioi 0) 0 = 1
All goals completed! πexample : DifferentiableWithinAt β f_10_1_6 (.Iio 0) 0 := xβ:ββ’ DifferentiableWithinAt β f_10_1_6 (Set.Iio 0) 0
All goals completed! π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 _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 _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! π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 _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 _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 _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 _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 _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 _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 _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 _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! π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 _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 _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 _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