You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Analysis/Section_5_1.lean
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Main constructions and results of this section:
16
16
namespace Chapter5
17
17
18
18
/-- Definition 5.1.1 (Sequence). To avoid some technicalities involving dependent types, we extend sequences by zero to the left of the starting point `n₀`. -/
instanceCauchySequence.instZero : Zero CauchySequence where
78
+
zero := CauchySequence.mk' (a := fun _: ℕ ↦ 0) (Sequence.isCauchy_of_const (0:ℚ))
79
+
80
+
abbrevReal := Quotient CauchySequence.instSetoid
81
+
82
+
open Classical in
83
+
/-- It is convenient in Lean to assign the "dummy" value of 0 to `LIM a` when `a` is not Cauchy. This requires Classical logic, because the property of being Cauchy is not computable or decidable. -/
84
+
noncomputableabbrevLIM (a:ℕ → ℚ) : Real := Quotient.mk _ (if h : (a:Sequence).isCauchy then CauchySequence.mk' h else (0:CauchySequence))
85
+
86
+
theoremLIM_def {a:ℕ → ℚ} (ha: (a:Sequence).isCauchy) : LIM a = Quotient.mk _ (CauchySequence.mk' ha) := by
87
+
rw [LIM, dif_pos ha]
88
+
89
+
/-- Definition 5.3.1 (Real numbers) -/
90
+
theoremReal.eq_lim (x:Real) : ∃ (a:ℕ → ℚ), (a:Sequence).isCauchy ∧ x = LIM a := by
91
+
-- I had a lot of trouble with this proof; perhaps there is a more idiomatic way to proceed
92
+
apply Quot.ind _ x; intro a
93
+
set a' : ℕ → ℚ := (a:ℕ → ℚ); use a'
94
+
set s : Sequence := (a':Sequence)
95
+
have : s = a.toSequence := CauchySequence.coe_to_sequence a
96
+
rw [this]
97
+
refine ⟨ a.cauchy, ?_ ⟩
98
+
congr
99
+
convert (dif_pos a.cauchy).symm with n
100
+
. apply CauchySequence.ext'
101
+
change a.seq = s.seq
102
+
rw [this]
103
+
classical
104
+
exact Classical.propDecidable _
105
+
106
+
/-- Definition 5.3.1 (Real numbers) -/
107
+
theoremReal.lim_eq_lim (a b:ℕ → ℚ) (ha: (a:Sequence).isCauchy) (hb: (b:Sequence).isCauchy) :
108
+
LIM a = LIM b ↔ Sequence.equiv a b := by
109
+
constructor
110
+
. intro h
111
+
replace h := Quotient.exact h
112
+
rwa [dif_pos ha, dif_pos hb, CauchySequence.equiv_iff] at h
113
+
intro h
114
+
apply Quotient.sound
115
+
rwa [dif_pos ha, dif_pos hb, CauchySequence.equiv_iff]
116
+
117
+
/--Lemma 5.3.6 (Sum of Cauchy sequences is Cauchy)-/
118
+
theoremSequence.add_cauchy {a b:ℕ → ℚ} (ha: (a:Sequence).isCauchy) (hb: (b:Sequence).isCauchy) : (a + b:Sequence).isCauchy := by
119
+
-- This proof is written to follow the structure of the original text.
120
+
rw [isCauchy_def] at ha hb ⊢
121
+
intro ε hε
122
+
have : ε/2 > 0 := by exact half_pos hε
123
+
replace ha := ha (ε/2) this
124
+
replace hb := hb (ε/2) this
125
+
rw [Rat.eventuallySteady_def] at ha hb ⊢
126
+
obtain ⟨ N, hN, hha ⟩ := ha
127
+
obtain ⟨ M, hM, hhb ⟩ := hb
128
+
use max N M
129
+
simp at hN hM ⊢
130
+
simp [hN, Rat.steady_def'] at hha hhb ⊢
131
+
intro n m hnN hnM hmN hmM
132
+
have hn := hN.trans hnN
133
+
have hm := hM.trans hmM
134
+
replace hha := hha n m hnN hmN
135
+
replace hhb := hhb n m hn hnM hm hmM
136
+
simp [hn, hm, hnN, hnM, hmN, hmM] at hha hhb ⊢
137
+
convert Section_4_3.add_close hha hhb
138
+
ring
139
+
140
+
/--Lemma 5.3.7 (Sum of equivalent sequences is equivalent)-/
0 commit comments