Аналіз I, Глава 10.2

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:

open Chapter9namespace Chapter10

Визначення 10.2.1 (Local maxima and minima). Here we use Mathlib's IsLocalMaxOn.{u, v} {α : Type u} {β : Type v} [TopologicalSpace α] [Preorder β] (f : α → β) (s : Set α) (a : α) : PropIsLocalMaxOn type.

theorem IsLocalMaxOn.iff (X:Set ) (f: ) (x₀:) : IsLocalMaxOn f X x₀ δ > 0, IsMaxOn f (X Set.Ioo (x₀ - δ) (x₀ + δ)) x₀ := X:Set f: x₀:IsLocalMaxOn f X x₀ δ > 0, IsMaxOn f (X Set.Ioo (x₀ - δ) (x₀ + δ)) x₀ X:Set f: x₀:(∃ ε, 0 < ε y : ⦄, y - x₀ < ε x₀ - y < ε y X f y f x₀) δ, 0 < δ x X, x₀ - δ < x x < x₀ + δ f x f x₀ X:Set f: x₀: (a : ), (0 < a y : ⦄, y - x₀ < a x₀ - y < a y X f y f x₀) 0 < a x X, x₀ - a < x x < x₀ + a f x f x₀; X:Set f: x₀:ε:(0 < ε y : ⦄, y - x₀ < ε x₀ - y < ε y X f y f x₀) 0 < ε x X, x₀ - ε < x x < x₀ + ε f x f x₀ X:Set f: x₀:ε:0 < ε ((∀ y : ⦄, y - x₀ < ε x₀ - y < ε y X f y f x₀) x X, x₀ - ε < x x < x₀ + ε f x f x₀); X:Set f: x₀:ε::0 < ε(∀ y : ⦄, y - x₀ < ε x₀ - y < ε y X f y f x₀) x X, x₀ - ε < x x < x₀ + ε f x f x₀ X:Set f: x₀:ε::0 < ε (a : ), a - x₀ < ε x₀ - a < ε a X f a f x₀ a X x₀ - ε < a a < x₀ + ε f a f x₀; X:Set f: x₀:ε::0 < εx:x - x₀ < ε x₀ - x < ε x X f x f x₀ x X x₀ - ε < x x < x₀ + ε f x f x₀ X:Set f: x₀:ε::0 < εx:(x - x₀ < ε x₀ - x < ε x X f x f x₀) x X x₀ - ε < x x < x₀ + ε f x f x₀X:Set f: x₀:ε::0 < εx:(x X x₀ - ε < x x < x₀ + ε f x f x₀) x - x₀ < ε x₀ - x < ε x X f x f x₀ X:Set f: x₀:ε::0 < εx:(x - x₀ < ε x₀ - x < ε x X f x f x₀) x X x₀ - ε < x x < x₀ + ε f x f x₀ X:Set f: x₀:ε::0 < εx:h:x - x₀ < ε x₀ - x < ε x X f x f x₀hx:x Xhxm:x₀ - ε < xhxp:x < x₀ + εf x f x₀ exact h (X:Set f: x₀:ε::0 < εx:h:x - x₀ < ε x₀ - x < ε x X f x f x₀hx:x Xhxm:x₀ - ε < xhxp:x < x₀ + εx - x₀ < ε All goals completed! 🐙) (X:Set f: x₀:ε::0 < εx:h:x - x₀ < ε x₀ - x < ε x X f x f x₀hx:x Xhxm:x₀ - ε < xhxp:x < x₀ + εx₀ - x < ε All goals completed! 🐙) hx X:Set f: x₀:ε::0 < εx:h:x X x₀ - ε < x x < x₀ + ε f x f x₀hxm:x - x₀ < εhxp:x₀ - x < εhx:x Xf x f x₀ exact h hx (X:Set f: x₀:ε::0 < εx:h:x X x₀ - ε < x x < x₀ + ε f x f x₀hxm:x - x₀ < εhxp:x₀ - x < εhx:x Xx₀ - ε < x All goals completed! 🐙) (X:Set f: x₀:ε::0 < εx:h:x X x₀ - ε < x x < x₀ + ε f x f x₀hxm:x - x₀ < εhxp:x₀ - x < εhx:x Xx < x₀ + ε All goals completed! 🐙)
theorem IsLocalMinOn.iff (X:Set ) (f: ) (x₀:) : IsLocalMinOn f X x₀ δ > 0, IsMinOn f (X Set.Ioo (x₀ - δ) (x₀ + δ)) x₀ := X:Set f: x₀:IsLocalMinOn f X x₀ δ > 0, IsMinOn f (X Set.Ioo (x₀ - δ) (x₀ + δ)) x₀ X:Set f: x₀:(∃ ε, 0 < ε y : ⦄, y - x₀ < ε x₀ - y < ε y X f x₀ f y) δ, 0 < δ x X, x₀ - δ < x x < x₀ + δ f x₀ f x X:Set f: x₀: (a : ), (0 < a y : ⦄, y - x₀ < a x₀ - y < a y X f x₀ f y) 0 < a x X, x₀ - a < x x < x₀ + a f x₀ f x; X:Set f: x₀:ε:(0 < ε y : ⦄, y - x₀ < ε x₀ - y < ε y X f x₀ f y) 0 < ε x X, x₀ - ε < x x < x₀ + ε f x₀ f x X:Set f: x₀:ε:0 < ε ((∀ y : ⦄, y - x₀ < ε x₀ - y < ε y X f x₀ f y) x X, x₀ - ε < x x < x₀ + ε f x₀ f x); X:Set f: x₀:ε::0 < ε(∀ y : ⦄, y - x₀ < ε x₀ - y < ε y X f x₀ f y) x X, x₀ - ε < x x < x₀ + ε f x₀ f x X:Set f: x₀:ε::0 < ε (a : ), a - x₀ < ε x₀ - a < ε a X f x₀ f a a X x₀ - ε < a a < x₀ + ε f x₀ f a; X:Set f: x₀:ε::0 < εx:x - x₀ < ε x₀ - x < ε x X f x₀ f x x X x₀ - ε < x x < x₀ + ε f x₀ f x X:Set f: x₀:ε::0 < εx:(x - x₀ < ε x₀ - x < ε x X f x₀ f x) x X x₀ - ε < x x < x₀ + ε f x₀ f xX:Set f: x₀:ε::0 < εx:(x X x₀ - ε < x x < x₀ + ε f x₀ f x) x - x₀ < ε x₀ - x < ε x X f x₀ f x X:Set f: x₀:ε::0 < εx:(x - x₀ < ε x₀ - x < ε x X f x₀ f x) x X x₀ - ε < x x < x₀ + ε f x₀ f x X:Set f: x₀:ε::0 < εx:h:x - x₀ < ε x₀ - x < ε x X f x₀ f xhx:x Xhxm:x₀ - ε < xhxp:x < x₀ + εf x₀ f x exact h (X:Set f: x₀:ε::0 < εx:h:x - x₀ < ε x₀ - x < ε x X f x₀ f xhx:x Xhxm:x₀ - ε < xhxp:x < x₀ + εx - x₀ < ε All goals completed! 🐙) (X:Set f: x₀:ε::0 < εx:h:x - x₀ < ε x₀ - x < ε x X f x₀ f xhx:x Xhxm:x₀ - ε < xhxp:x < x₀ + εx₀ - x < ε All goals completed! 🐙) hx X:Set f: x₀:ε::0 < εx:h:x X x₀ - ε < x x < x₀ + ε f x₀ f xhxm:x - x₀ < εhxp:x₀ - x < εhx:x Xf x₀ f x exact h hx (X:Set f: x₀:ε::0 < εx:h:x X x₀ - ε < x x < x₀ + ε f x₀ f xhxm:x - x₀ < εhxp:x₀ - x < εhx:x Xx₀ - ε < x All goals completed! 🐙) (X:Set f: x₀:ε::0 < εx:h:x X x₀ - ε < x x < x₀ + ε f x₀ f xhxm:x - x₀ < εhxp:x₀ - x < εhx:x Xx < x₀ + ε All goals completed! 🐙)

Приклад 10.2.3

abbrev f_10_2_3 : := fun x x^2 - x^4
declaration uses 'sorry'example : ¬ IsMinOn f_10_2_3 Set.univ 0 := ¬IsMinOn f_10_2_3 Set.univ 0 All goals completed! 🐙declaration uses 'sorry'example : IsMinOn f_10_2_3 (Set.Ioo (-1) 1) 0 := IsMinOn f_10_2_3 (Set.Ioo (-1) 1) 0 All goals completed! 🐙declaration uses 'sorry'example : IsLocalMaxOn f_10_2_3 Set.univ 0 := IsLocalMaxOn f_10_2_3 Set.univ 0 All goals completed! 🐙

Приклад 10.2.4

declaration uses 'sorry'example : ¬ x, IsMaxOn (· : ) ((· : ) '' Set.univ) x := ¬ x, IsMaxOn (fun x => x) ((fun x => x) '' Set.univ) x All goals completed! 🐙
declaration uses 'sorry'example : ¬ x, IsMinOn (· : ) ((· : ) '' Set.univ) x := ¬ x, IsMinOn (fun x => x) ((fun x => x) '' Set.univ) x All goals completed! 🐙declaration uses 'sorry'example (n:) : IsMaxOn (· : ) ((· : ) '' Set.univ) n := n:IsMaxOn (fun x => x) ((fun x => x) '' Set.univ) n All goals completed! 🐙declaration uses 'sorry'example (n:) : IsMinOn (· : ) ((· : ) '' Set.univ) n := n:IsMinOn (fun x => x) ((fun x => x) '' Set.univ) n All goals completed! 🐙

Ремарка 10.2.5

theorem declaration uses 'sorry'IsLocalMaxOn.of_restrict {X Y:Set } (hXY: Y X) (f: ) (x₀:) (h: IsLocalMaxOn f X x₀) : IsLocalMaxOn f Y x₀ := X:Set Y:Set hXY:Y Xf: x₀:h:IsLocalMaxOn f X x₀IsLocalMaxOn f Y x₀ All goals completed! 🐙
theorem declaration uses 'sorry'IsLocalMinOn.of_restrict {X Y:Set } (hXY: Y X) (f: ) (x₀:) (h: IsLocalMinOn f X x₀) : IsLocalMinOn f Y x₀ := X:Set Y:Set hXY:Y Xf: x₀:h:IsLocalMinOn f X x₀IsLocalMinOn f Y x₀ All goals completed! 🐙

Твердження 10.2.6 (Local extrema are stationary) / Вправа 10.2.1

theorem declaration uses 'sorry'IsLocalMaxOn.deriv_eq_zero {a b:} (hab: a < b) {f: } {x₀:} (hx₀: x₀ Set.Ioo a b) (h: IsLocalMaxOn f (Set.Ioo a b) x₀) {L:} (hderiv: HasDerivWithinAt f L (Set.Ioo a b) x₀) : L = 0 := a:b:hab:a < bf: x₀:hx₀:x₀ Set.Ioo a bh:IsLocalMaxOn f (Set.Ioo a b) x₀L:hderiv:HasDerivWithinAt f L (Set.Ioo a b) x₀L = 0 All goals completed! 🐙

Твердження 10.2.6 (Local extrema are stationary) / Вправа 10.2.1

theorem declaration uses 'sorry'IsLocalMinOn.deriv_eq_zero {a b:} (hab: a < b) {f: } {x₀:} (hx₀: x₀ Set.Ioo a b) (h: IsLocalMinOn f (Set.Ioo a b) x₀) {L:} (hderiv: HasDerivWithinAt f L (Set.Ioo a b) x₀) : L = 0 := a:b:hab:a < bf: x₀:hx₀:x₀ Set.Ioo a bh:IsLocalMinOn f (Set.Ioo a b) x₀L:hderiv:HasDerivWithinAt f L (Set.Ioo a b) x₀L = 0 All goals completed! 🐙
theorem declaration uses 'sorry'IsMaxOn.deriv_eq_zero_counter : (a b:) (hab: a < b) (f: ) (x₀:) (hx₀: x₀ Set.Icc a b) (h: IsMaxOn f (Set.Icc a b) x₀) (L:) (hderiv: HasDerivWithinAt f L (Set.Icc a b) x₀), L 0 := a b, (_ : a < b), f x₀, (_ : x₀ Set.Icc a b) (_ : IsMaxOn f (Set.Icc a b) x₀), L, (_ : HasDerivWithinAt f L (Set.Icc a b) x₀), L 0 All goals completed! 🐙

Теорема 10.2.7 (Rolle's theorem) / Вправа 10.2.4

theorem declaration uses 'sorry'HasDerivWithinAt.exist_zero {a b:} (hab: a < b) {g: } (hcont: ContinuousOn g (Set.Icc a b)) (hderiv: DifferentiableOn g (Set.Ioo a b)) (hgab: g a = g b) : x Set.Ioo a b, HasDerivWithinAt g 0 (Set.Ioo a b) x := a:b:hab:a < bg: hcont:ContinuousOn g (Set.Icc a b)hderiv:DifferentiableOn g (Set.Ioo a b)hgab:g a = g b x Set.Ioo a b, HasDerivWithinAt g 0 (Set.Ioo a b) x All goals completed! 🐙

Наслідок 10.2.9 (Mean value theorem ) / Вправа 10.2.5

theorem declaration uses 'sorry'HasDerivWithinAt.mean_value {a b:} (hab: a < b) {f: } (hcont: ContinuousOn f (Set.Icc a b)) (hderiv: DifferentiableOn f (Set.Ioo a b)) : x Set.Ioo a b, HasDerivWithinAt f ((f b - f a) / (b - a)) (Set.Ioo a b) x := a:b:hab:a < bf: hcont:ContinuousOn f (Set.Icc a b)hderiv:DifferentiableOn f (Set.Ioo a b) x Set.Ioo a b, HasDerivWithinAt f ((f b - f a) / (b - a)) (Set.Ioo a b) x All goals completed! 🐙

Вправа 10.2.2

declaration uses 'sorry'example : f: , ContinuousOn f (Set.Icc (-1) 1) IsMaxOn f (Set.Icc (-1) 1) 0 ¬ DifferentiableWithinAt f (Set.Icc (-1) 1) 0 := f, ContinuousOn f (Set.Icc (-1) 1) IsMaxOn f (Set.Icc (-1) 1) 0 ¬DifferentiableWithinAt f (Set.Icc (-1) 1) 0 All goals completed! 🐙

Вправа 10.2.3

declaration uses 'sorry'example : f: , DifferentiableOn f (Set.Icc (-1) 1) HasDerivWithinAt f 0 (Set.Ioo (-1) 1) 0 ¬ IsLocalMaxOn f (Set.Icc (-1) 1) 0 ¬ IsLocalMinOn f (Set.Icc (-1) 1) 0 := f, DifferentiableOn f (Set.Icc (-1) 1) HasDerivWithinAt f 0 (Set.Ioo (-1) 1) 0 ¬IsLocalMaxOn f (Set.Icc (-1) 1) 0 ¬IsLocalMinOn f (Set.Icc (-1) 1) 0 All goals completed! 🐙

Вправа 10.2.6

theorem declaration uses 'sorry'lipschitz_bound {M a b:} (hM: M > 0) (hab: a < b) {f: } (hcont: ContinuousOn f (Set.Icc a b)) (hderiv: DifferentiableOn f (Set.Ioo a b)) (hlip: x Set.Ioo a b, |derivWithin f (Set.Ioo a b) x| M) {x y:} (hx: x Set.Ioo a b) (hy: y Set.Ioo a b) : |f x - f y| M * |x - y| := M:a:b:hM:M > 0hab:a < bf: hcont:ContinuousOn f (Set.Icc a b)hderiv:DifferentiableOn f (Set.Ioo a b)hlip: x Set.Ioo a b, |derivWithin f (Set.Ioo a b) x| Mx:y:hx:x Set.Ioo a bhy:y Set.Ioo a b|f x - f y| M * |x - y| All goals completed! 🐙

Вправа 10.2.7

theorem declaration uses 'sorry'UniformContinuousOn.of_lipschitz {f: } (hcont: ContinuousOn f Set.univ) (hderiv: DifferentiableOn f Set.univ) (hlip: BddOn (deriv f) Set.univ) : UniformContinuousOn f (Set.univ) := f: hcont:ContinuousOn f Set.univhderiv:DifferentiableOn f Set.univhlip:BddOn (deriv f) Set.univUniformContinuousOn f Set.univ All goals completed! 🐙
end Chapter10