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

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:

namespace Chapter9

Визначення 9.8.1

theorem MonotoneOn.iff {X: Set } (f: ) : MonotoneOn f X x X, y X, y > x f y f x := X:Set f: MonotoneOn f X x X, y X, y > x f y f x X:Set f: MonotoneOn f X x X, y X, y > x f y f xX:Set f: (∀ x X, y X, y > x f y f x) MonotoneOn f X X:Set f: MonotoneOn f X x X, y X, y > x f y f x X:Set f: h:MonotoneOn f Xx:hx:x Xy:hy:y Xhxy:y > xf y f x All goals completed! 🐙 X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x yf x f y X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x < y x = yf x f y X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x < yf x f yX:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x = yf x f y X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x < yf x f y All goals completed! 🐙 All goals completed! 🐙
theorem StrictMono.iff {X: Set } (f: ) : StrictMonoOn f X x X, y X, y > x f y > f x := X:Set f: StrictMonoOn f X x X, y X, y > x f y > f x X:Set f: StrictMonoOn f X x X, y X, y > x f y > f xX:Set f: (∀ x X, y X, y > x f y > f x) StrictMonoOn f X X:Set f: StrictMonoOn f X x X, y X, y > x f y > f x X:Set f: h:StrictMonoOn f Xx:hx:x Xy:hy:y Xhxy:y > xf y > f x All goals completed! 🐙 X:Set f: h: x X, y X, y > x f y > f xx:hx:x Xy:hy:y Xhxy:x < yf x < f y All goals completed! 🐙theorem AntitoneOn.iff {X: Set } (f: ) : AntitoneOn f X x X, y X, y > x f y f x := X:Set f: AntitoneOn f X x X, y X, y > x f y f x X:Set f: AntitoneOn f X x X, y X, y > x f y f xX:Set f: (∀ x X, y X, y > x f y f x) AntitoneOn f X X:Set f: AntitoneOn f X x X, y X, y > x f y f x X:Set f: h:AntitoneOn f Xx:hx:x Xy:hy:y Xhxy:y > xf y f x All goals completed! 🐙 X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x yf y f x X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x < y x = yf y f x X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x < yf y f xX:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x = yf y f x X:Set f: h: x X, y X, y > x f y f xx:hx:x Xy:hy:y Xhxy:x < yf y f x All goals completed! 🐙 All goals completed! 🐙theorem StrictAntitone.iff {X: Set } (f: ) : StrictAntiOn f X x X, y X, y > x f y < f x := X:Set f: StrictAntiOn f X x X, y X, y > x f y < f x X:Set f: StrictAntiOn f X x X, y X, y > x f y < f xX:Set f: (∀ x X, y X, y > x f y < f x) StrictAntiOn f X X:Set f: StrictAntiOn f X x X, y X, y > x f y < f x X:Set f: h:StrictAntiOn f Xx:hx:x Xy:hy:y Xhxy:y > xf y < f x All goals completed! 🐙 X:Set f: h: x X, y X, y > x f y < f xx:hx:x Xy:hy:y Xhxy:x < yf y < f x All goals completed! 🐙

Приклади 9.8.2

declaration uses 'sorry'example : StrictMonoOn (fun x: x^2) (Set.Ici 0) := StrictMonoOn (fun x => x ^ 2) (Set.Ici 0) All goals completed! 🐙
declaration uses 'sorry'example : StrictAntiOn (fun x: x^2) (Set.Iic 0) := StrictAntiOn (fun x => x ^ 2) (Set.Iic 0) All goals completed! 🐙declaration uses 'sorry'example : ¬ MonotoneOn (fun x: x^2) Set.univ := ¬MonotoneOn (fun x => x ^ 2) Set.univ All goals completed! 🐙declaration uses 'sorry'example : ¬ AntitoneOn (fun x: x^2) Set.univ := ¬AntitoneOn (fun x => x ^ 2) Set.univ All goals completed! 🐙declaration uses 'sorry'example {X:Set } {f: } (hf: StrictMonoOn f X) : MonotoneOn f X := X:Set f: hf:StrictMonoOn f XMonotoneOn f X All goals completed! 🐙declaration uses 'sorry'example (X:Set ) : MonotoneOn (fun x: (6:)) X := X:Set MonotoneOn (fun x => 6) X All goals completed! 🐙declaration uses 'sorry'example (X:Set ) : AntitoneOn (fun x: (6:)) X := X:Set AntitoneOn (fun x => 6) X All goals completed! 🐙nontrivial_iff.{u_1} {α : Type u_1} : Nontrivial α ↔ ∃ x y, x ≠ y#check nontrivial_iff
nontrivial_iff.{u_1} {α : Type u_1} : Nontrivial α ↔ ∃ x y, x ≠ y
declaration uses 'sorry'example {X:Set } (hX: Nontrivial X) : ¬ StrictMonoOn (fun x: (6:)) X := X:Set hX:Nontrivial X¬StrictMonoOn (fun x => 6) X All goals completed! 🐙declaration uses 'sorry'example (X:Set ) (hX: Nontrivial X) : ¬ StrictAntiOn (fun x: (6:)) X := X:Set hX:Nontrivial X¬StrictAntiOn (fun x => 6) X All goals completed! 🐙declaration uses 'sorry'example : (X:Set ) (f: ), ContinuousOn f X ¬ MonotoneOn f X ¬ AntitoneOn f X := X f, ContinuousOn f X ¬MonotoneOn f X ¬AntitoneOn f X All goals completed! 🐙declaration uses 'sorry'example : (X:Set ) (f: ), MonotoneOn f X ¬ ContinuousOn f X := X f, MonotoneOn f X ¬ContinuousOn f X All goals completed! 🐙

Твердження 9.8.3 / Вправа 9.8.4

theorem declaration uses 'sorry'MonotoneOn.exist_inverse {a b:} (h: a < b) (f: ) (hcont: ContinuousOn f (Set.Icc a b)) (hmono: StrictMonoOn f (Set.Icc a b)) : f '' (Set.Icc a b) = Set.Icc (f a) (f b) finv: , ContinuousOn finv (Set.Icc (f a) (f b)) StrictMonoOn finv (Set.Icc (f a) (f b)) finv '' (Set.Icc (f a) (f b)) = Set.Icc a b ( x Set.Icc a b, finv (f x) = x) y Set.Icc (f a) (f b), f (finv y) = y := a:b:h:a < bf: hcont:ContinuousOn f (Set.Icc a b)hmono:StrictMonoOn f (Set.Icc a b)f '' Set.Icc a b = Set.Icc (f a) (f b) finv, ContinuousOn finv (Set.Icc (f a) (f b)) StrictMonoOn finv (Set.Icc (f a) (f b)) finv '' Set.Icc (f a) (f b) = Set.Icc a b (∀ x Set.Icc a b, finv (f x) = x) y Set.Icc (f a) (f b), f (finv y) = y All goals completed! 🐙

Приклад 9.8.4

example {R :} (hR: R > 0) {n:} (hn: n > 0) : g : , x Set.Icc 0 (R^n), (g x)^n = x := R:hR:R > 0n:hn:n > 0 g, x Set.Icc 0 (R ^ n), g x ^ n = x R:hR:R > 0n:hn:n > 0f: := fun x => x ^ n g, x Set.Icc 0 (R ^ n), g x ^ n = x have hcont : ContinuousOn f (Set.Icc 0 R) := R:hR:R > 0n:hn:n > 0 g, x Set.Icc 0 (R ^ n), g x ^ n = x All goals completed! 🐙 have hmono : StrictMonoOn f (Set.Icc 0 R) := R:hR:R > 0n:hn:n > 0 g, x Set.Icc 0 (R ^ n), g x ^ n = x R:hR:R > 0n:hn:n > 0f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)x:hx:x Set.Icc 0 Ry:hy:y Set.Icc 0 Rhxy:x < yf x < f y R:hR:R > 0n:hn:n > 0f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)x:y:hy:y Set.Icc 0 Rhxy:x < yhx:0 x x Rf x < f y R:hR:R > 0n:hn:n > 0f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)x:y:hy:y Set.Icc 0 Rhxy:x < yhx:0 x x Rx ^ n < y ^ n exact pow_lt_pow_left₀ hxy (R:hR:R > 0n:hn:n > 0f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)x:y:hy:y Set.Icc 0 Rhxy:x < yhx:0 x x R0 x R:hR:R > 0n:f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)x:y:hy:y Set.Icc 0 Rhxy:x < yhx:0 x x Rhn:x < 0n 0; All goals completed! 🐙) (R:hR:R > 0n:hn:n > 0f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)x:y:hy:y Set.Icc 0 Rhxy:x < yhx:0 x x Rn 0 All goals completed! 🐙) obtain g, _, _, _, _, hg := (MonotoneOn.exist_inverse (R:hR:R > 0n:hn:n > 0f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)hmono:StrictMonoOn f (Set.Icc 0 R)0 < R All goals completed! 🐙) f hcont hmono).2 R:hR:R > 0n:hn:n > 0f: := fun x => x ^ nhcont:ContinuousOn f (Set.Icc 0 R)hmono:StrictMonoOn f (Set.Icc 0 R)g: left✝³:ContinuousOn g (Set.Icc (f 0) (f R))left✝²:StrictMonoOn g (Set.Icc (f 0) (f R))left✝¹:g '' Set.Icc (f 0) (f R) = Set.Icc 0 Rleft✝: x Set.Icc 0 R, g (f x) = xhg: y Set.Icc 0 (R ^ n), g y ^ n = y g, x Set.Icc 0 (R ^ n), g x ^ n = x All goals completed! 🐙

Вправа 9.8.1

theorem declaration uses 'sorry'IsMaxOn.of_monotone_on_compact {a b:} (h:a < b) {f: } (hf: MonotoneOn f (Set.Icc a b)) : xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax := a:b:h:a < bf: hf:MonotoneOn f (Set.Icc a b) xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax All goals completed! 🐙
theorem declaration uses 'sorry'IsMaxOn.of_strictmono_on_compact {a b:} (h:a < b) {f: } (hf: StrictMonoOn f (Set.Icc a b)) : xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax := a:b:h:a < bf: hf:StrictMonoOn f (Set.Icc a b) xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax All goals completed! 🐙theorem declaration uses 'sorry'IsMaxOn.of_antitone_on_compact {a b:} (h:a < b) {f: } (hf: AntitoneOn f (Set.Icc a b)) : xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax := a:b:h:a < bf: hf:AntitoneOn f (Set.Icc a b) xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax All goals completed! 🐙theorem declaration uses 'sorry'IsMaxOn.of_strictantitone_on_compact {a b:} (h:a < b) {f: } (hf: StrictAntiOn f (Set.Icc a b)) : xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax := a:b:h:a < bf: hf:StrictAntiOn f (Set.Icc a b) xmax Set.Icc a b, IsMaxOn f (Set.Icc a b) xmax All goals completed! 🐙

Вправа 9.8.2

theorem declaration uses 'sorry'no_strictmono_intermediate_value : (a b:) (hab: a < b) (f: ) (hf: StrictMonoOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) := a b, (_ : a < b), f, (_ : StrictMonoOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) All goals completed! 🐙
theorem declaration uses 'sorry'no_monotone_intermediate_value : (a b:) (hab: a < b) (f: ) (hf: MonotoneOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) := a b, (_ : a < b), f, (_ : MonotoneOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) All goals completed! 🐙theorem declaration uses 'sorry'no_strictanti_intermediate_value : (a b:) (hab: a < b) (f: ) (hf: StrictAntiOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) := a b, (_ : a < b), f, (_ : StrictAntiOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) All goals completed! 🐙theorem declaration uses 'sorry'no_antitone_intermediate_value : (a b:) (hab: a < b) (f: ) (hf: AntitoneOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) := a b, (_ : a < b), f, (_ : AntitoneOn f (Set.Icc a b)), ¬ y, y Set.Icc (f a) (f b) y Set.Icc (f a) (f b) All goals completed! 🐙

Вправа 9.8.3

theorem declaration uses 'sorry'mono_of_continuous_inj {a b:} (h: a < b) {f: } (hf: ContinuousOn f (Set.Icc a b)) (hinj: Function.Injective (fun x: Set.Icc a b f x )) : StrictMonoOn f (Set.Icc a b) StrictAntiOn f (Set.Icc a b) := a:b:h:a < bf: hf:ContinuousOn f (Set.Icc a b)hinj:Function.Injective fun x => f xStrictMonoOn f (Set.Icc a b) StrictAntiOn f (Set.Icc a b) All goals completed! 🐙

Вправа 9.8.4

def declaration uses 'sorry'MonotoneOn.exist_inverse_without_continuity {a b:} (h: a < b) (f: ) (hmono: StrictMonoOn f (Set.Icc a b)) : Decidable ( f '' (Set.Icc a b) = Set.Icc (f a) (f b) finv: , ContinuousOn finv (Set.Icc (f a) (f b)) StrictMonoOn finv (Set.Icc (f a) (f b)) finv '' (Set.Icc (f a) (f b)) = Set.Icc a b ( x Set.Icc a b, finv (f x) = x) y Set.Icc (f a) (f b), f (finv y) = y ) := a:b:h:a < bf: hmono:StrictMonoOn f (Set.Icc a b)Decidable (f '' Set.Icc a b = Set.Icc (f a) (f b) finv, ContinuousOn finv (Set.Icc (f a) (f b)) StrictMonoOn finv (Set.Icc (f a) (f b)) finv '' Set.Icc (f a) (f b) = Set.Icc a b (∀ x Set.Icc a b, finv (f x) = x) y Set.Icc (f a) (f b), f (finv y) = y) -- перший рядок цієї конструкції має бути або `apply isTrue`, або `apply isFalse`. All goals completed! 🐙

Вправа 9.8.4

def declaration uses 'sorry'MonotoneOn.exist_inverse_without_strictmono {a b:} (h: a < b) (f: ) (hcont: ContinuousOn f (Set.Icc a b)) (hmono: MonotoneOn f (Set.Icc a b)) : Decidable ( f '' (Set.Icc a b) = Set.Icc (f a) (f b) finv: , ContinuousOn finv (Set.Icc (f a) (f b)) StrictMonoOn finv (Set.Icc (f a) (f b)) finv '' (Set.Icc (f a) (f b)) = Set.Icc a b ( x Set.Icc a b, finv (f x) = x) y Set.Icc (f a) (f b), f (finv y) = y ) := a:b:h:a < bf: hcont:ContinuousOn f (Set.Icc a b)hmono:MonotoneOn f (Set.Icc a b)Decidable (f '' Set.Icc a b = Set.Icc (f a) (f b) finv, ContinuousOn finv (Set.Icc (f a) (f b)) StrictMonoOn finv (Set.Icc (f a) (f b)) finv '' Set.Icc (f a) (f b) = Set.Icc a b (∀ x Set.Icc a b, finv (f x) = x) y Set.Icc (f a) (f b), f (finv y) = y) -- перший рядок цієї конструкції має бути або `apply isTrue`, або `apply isFalse`. All goals completed! 🐙
/- Вправа 9.8.4: state and prove an analogue of `MonotoneOne.exist_inverse` for `Antitone` functions. -/ -- theorem AntitoneOn.exist_inverse {a b:ℝ} (h: a < b) (f: ℝ → ℝ) (hcont: ContinuousOn f (Set.Icc a b)) (hmono: StrictAntiOn f (Set.Icc a b)) : sorry := by sorry

An equivalence between the natural numbers and the rationals.

noncomputable abbrev q_9_8_5 : := nonempty_equiv_of_countable.some
noncomputable abbrev g_9_8_5 : := fun q (2:)^(-q_9_8_5.symm q:)noncomputable abbrev f_9_8_5 : := fun x ∑' r : {r: // (r:) < x}, g_9_8_5 r

Вправа 9.8.5(a)

declaration uses 'sorry'example : StrictMonoOn f_9_8_5 Set.univ := StrictMonoOn f_9_8_5 Set.univ All goals completed! 🐙

Вправа 9.8.5(b)

declaration uses 'sorry'example (r:) : ¬ ContinuousAt f_9_8_5 r := r:¬ContinuousAt f_9_8_5 r All goals completed! 🐙

Вправа 9.8.5(c)

declaration uses 'sorry'example {x:} (hx: ¬ r:, x = r) : ContinuousAt f_9_8_5 x := x:hx:¬ r, x = rContinuousAt f_9_8_5 x All goals completed! 🐙
end Chapter9