-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathSection_9_4.lean
More file actions
149 lines (110 loc) · 5.46 KB
/
Section_9_4.lean
File metadata and controls
149 lines (110 loc) · 5.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import Mathlib.Tactic
import Mathlib.Data.Real.Sign
import Mathlib.Topology.ContinuousOn
import Analysis.Section_9_3
/-!
# Analysis I, Section 9.4: Continuous functions
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:
- Continuity of functions, using the Mathlib notions
-/
namespace Chapter9
/--
Definition 9.4.1. Here we use the Mathlib definition of continuity. The hypothesis {lean}`x₀ ∈ X` is not needed!
-/
theorem ContinuousWithinAt.iff (X:Set ℝ) (f: ℝ → ℝ) (x₀:ℝ) :
ContinuousWithinAt f X x₀ ↔ Convergesto X f (f x₀) x₀ := by
rw [ContinuousWithinAt.eq_1, Convergesto.iff, nhdsWithin.eq_1]
#check ContinuousOn.eq_1
#check continuousOn_univ
#check continuousWithinAt_univ
/-- Example 9.4.2 --/
example (c x₀:ℝ) : ContinuousWithinAt (fun x ↦ c) .univ x₀ := by sorry
example (c x₀:ℝ) : ContinuousAt (fun x ↦ c) x₀ := by sorry
example (c:ℝ) : ContinuousOn (fun x:ℝ ↦ c) .univ := by sorry
example (c:ℝ) : Continuous (fun x:ℝ ↦ c) := by sorry
/-- Example 9.4.3 --/
example : Continuous (fun x:ℝ ↦ x) := by sorry
/-- Example 9.4.4 --/
example {x₀:ℝ} (h: x₀ ≠ 0) : ContinuousAt Real.sign x₀ := by sorry
example :¬ ContinuousAt Real.sign 0 := by sorry
/-- Example 9.4.5 --/
example (x₀:ℝ) : ¬ ContinuousAt f_9_3_21 x₀ := by sorry
/-- Example 9.4.6 --/
noncomputable abbrev f_9_4_6 (x:ℝ) : ℝ := if x ≥ 0 then 1 else 0
example {x₀:ℝ} (h: x₀ ≠ 0) : ContinuousAt f_9_4_6 x₀ := by sorry
example : ¬ ContinuousAt f_9_4_6 0 := by sorry
example : ContinuousWithinAt f_9_4_6 (.Ici 0) 0 := by sorry
/-- Proposition 9.4.7 / Exercise 9.4.1. -/
theorem ContinuousWithinAt.tfae (X:Set ℝ) (f: ℝ → ℝ) (x₀:ℝ) :
[
ContinuousWithinAt f X x₀,
∀ a:ℕ → ℝ, (∀ n, a n ∈ X) → Filter.atTop.Tendsto a (nhds x₀) → Filter.atTop.Tendsto (fun n ↦ f (a n)) (nhds (f x₀)),
∀ ε > 0, ∃ δ > 0, ∀ x ∈ X, |x-x₀| < δ → |f x - f x₀| < ε,
∀ ε > 0, ∃ δ > 0, ∀ x ∈ X, |x-x₀| ≤ δ → |f x - f x₀| ≤ ε
].TFAE := by
sorry
/-- Remark 9.4.8 --/
theorem _root_.Filter.Tendsto.comp_of_continuous {X:Set ℝ} {f: ℝ → ℝ} {x₀:ℝ}
(h_cont: ContinuousWithinAt f X x₀) {a: ℕ → ℝ} (ha: ∀ n, a n ∈ X)
(hconv: Filter.atTop.Tendsto a (nhds x₀)):
Filter.atTop.Tendsto (fun n ↦ f (a n)) (nhds (f x₀)) := by
have := (ContinuousWithinAt.tfae X f x₀).out 0 1
grind
/- Proposition 9.4.9 -/
theorem ContinuousWithinAt.add {X:Set ℝ} (f g: ℝ → ℝ) {x₀:ℝ}
(hf: ContinuousWithinAt f X x₀) (hg: ContinuousWithinAt g X x₀) :
ContinuousWithinAt (f + g) X x₀ := by
rw [iff] at hf hg ⊢; convert hf.add hg using 1
theorem ContinuousWithinAt.sub {X:Set ℝ} (f g: ℝ → ℝ) {x₀:ℝ}
(hf: ContinuousWithinAt f X x₀) (hg: ContinuousWithinAt g X x₀) :
ContinuousWithinAt (f - g) X x₀ := by
rw [iff] at hf hg ⊢; convert hf.sub hg using 1
theorem ContinuousWithinAt.max {X:Set ℝ} (f g: ℝ → ℝ) {x₀:ℝ}
(hf: ContinuousWithinAt f X x₀) (hg: ContinuousWithinAt g X x₀) :
ContinuousWithinAt (max f g) X x₀ := by
rw [iff] at hf hg ⊢; convert hf.max hg using 1
theorem ContinuousWithinAt.min {X:Set ℝ} (f g: ℝ → ℝ) {x₀:ℝ}
(hf: ContinuousWithinAt f X x₀) (hg: ContinuousWithinAt g X x₀) :
ContinuousWithinAt (min f g) X x₀ := by
rw [iff] at hf hg ⊢; convert hf.min hg using 1
theorem ContinuousWithinAt.mul' {X:Set ℝ} (f g: ℝ → ℝ) {x₀:ℝ}
(hf: ContinuousWithinAt f X x₀) (hg: ContinuousWithinAt g X x₀) :
ContinuousWithinAt (f * g) X x₀ := by
rw [iff] at hf hg ⊢; convert hf.mul hg using 1
theorem ContinuousWithinAt.div' {X:Set ℝ} (f g: ℝ → ℝ) {x₀:ℝ} (hM: g x₀ ≠ 0)
(hf: ContinuousWithinAt f X x₀) (hg: ContinuousWithinAt g X x₀) :
ContinuousWithinAt (f / g) X x₀ := by
rw [iff] at hf hg ⊢; convert hf.div hM hg using 1
/-- Proposition 9.4.10 / Exercise 9.4.3 -/
theorem Continuous.exp {a:ℝ} (ha: a>0) : Continuous (fun x:ℝ ↦ a ^ x) := by
sorry
/-- Proposition 9.4.11 / Exercise 9.4.4 -/
theorem Continuous.exp' (p:ℝ) : ContinuousOn (fun x:ℝ ↦ x ^ p) (.Ioi 0) := by
sorry
/-- Proposition 9.4.12 -/
theorem Continuous.abs : Continuous (fun x:ℝ ↦ |x|) := by
sorry -- TODO
/-- Proposition 9.4.13 / Exercise 9.4.5 -/
theorem ContinuousWithinAt.comp {X Y: Set ℝ} {f g:ℝ → ℝ} (hf: ∀ x ∈ X, f x ∈ Y) (x₀:ℝ)
(hf_cont: ContinuousWithinAt f X x₀) (hg_cont: ContinuousWithinAt g Y (f x₀)):
ContinuousWithinAt (g ∘ f) X x₀ := by sorry
/-- Example 9.4.14 -/
example : Continuous (fun x:ℝ ↦ 3*x + 1) := by
sorry
example : Continuous (fun x:ℝ ↦ (5:ℝ)^x) := by
sorry
example : Continuous (fun x:ℝ ↦ (5:ℝ)^(3*x+1)) := by
sorry
example : Continuous (fun x:ℝ ↦ |x^2-8*x+8|^(Real.sqrt 2) / (x^2 + 1)) := by
sorry
/-- Exercise 9.4.6 -/
theorem ContinuousOn.restrict {X Y:Set ℝ} {f: ℝ → ℝ} (hY: Y ⊆ X) (hf: ContinuousOn f X) : ContinuousOn f Y := by
sorry
/-- Exercise 9.4.7 -/
theorem Continuous.polynomial {n:ℕ} (c: Fin n → ℝ) : Continuous (fun x:ℝ ↦ ∑ i, c i * x ^ (i:ℕ)) := by
sorry