···118118 sorry
119119120120/-- Example 11.2.6 -/
121121-theorem PiecewiseConstantOn.of_const {f:ℝ → ℝ} {I: BoundedInterval} (h: ConstantOn f (I:Set ℝ)) :
121121+theorem ConstantOn.piecewiseConstantOn {f:ℝ → ℝ} {I: BoundedInterval} (h: ConstantOn f (I:Set ℝ)) :
122122 PiecewiseConstantOn f I := by sorry
123123124124/-- Lemma 11.2.7 / Exercise 11.2.1 -/
···166166 ℝ := ∑ J ∈ P.intervals, constant_value_on f (J:Set ℝ) * |J|ₗ
167167168168theorem PiecewiseConstantWith.integ_congr {f g:ℝ → ℝ} {I: BoundedInterval} {P: Partition I}
169169- (h: ∀ x ∈ (I:Set ℝ), f x = g x) : PiecewiseConstantWith.integ f P = PiecewiseConstantWith.integ g P := by
169169+ (h: ∀ x ∈ (I:Set ℝ), f x = g x) : integ f P = integ g P := by
170170 simp only [integ, Subtype.forall]
171171 apply Finset.sum_congr rfl; intro J hJ; congr 1; apply constant_value_on_congr; intros
172172 have := P.contains _ hJ; rw [subset_iff] at this
···222222 simp [integ, h']; exact PiecewiseConstantWith.integ_eq h'.choose_spec h
223223224224theorem PiecewiseConstantOn.integ_congr {f g:ℝ → ℝ} {I: BoundedInterval}
225225- (h: ∀ x ∈ (I:Set ℝ), f x = g x) : PiecewiseConstantOn.integ f I = PiecewiseConstantOn.integ g I := by
225225+ (h: ∀ x ∈ (I:Set ℝ), f x = g x) : integ f I = integ g I := by
226226 by_cases hf : PiecewiseConstantOn f I
227227 <;> have hg := hf <;> rw [congr h] at hg <;> simp [integ, hf, hg]
228228 rw [PiecewiseConstantWith.integ_congr h, ←integ_def hg.choose_spec, ←integ_def ?_]
+3-3
analysis/Analysis/Section_11_3.lean
···4646 simp
4747 refine ⟨ fun _ ↦ M , ⟨ ⟨ ?_, ?_, ⟩, PiecewiseConstantOn.integ_const M I ⟩ ⟩
4848 . peel h with _ _ h'; simp [abs_le'] at h'; simp [h'.1]
4949- exact PiecewiseConstantOn.of_const (ConstantOn.of_const (c := M) (by simp))
4949+ exact (ConstantOn.of_const (c := M) (by simp)).piecewiseConstantOn
50505151lemma integral_bound_lower_of_bounded {f:ℝ → ℝ} {M:ℝ} {I: BoundedInterval} (h: ∀ x ∈ (I:Set ℝ), |f x| ≤ M) : -M * |I|ₗ ∈ (fun g ↦ PiecewiseConstantOn.integ g I) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I} := by
5252 simp
5353 refine ⟨ fun _ ↦ -M , ⟨ ⟨ ?_, ?_, ⟩, by convert PiecewiseConstantOn.integ_const (-M) I using 1; simp ⟩ ⟩
5454 . peel h with _ _ h'; simp [abs_le'] at h'; simp; linarith
5555- exact PiecewiseConstantOn.of_const (ConstantOn.of_const (c := -M) (by simp))
5555+ exact (ConstantOn.of_const (c := -M) (by simp)).piecewiseConstantOn
56565757lemma integral_bound_upper_nonempty {f:ℝ → ℝ} {I: BoundedInterval} (h: BddOn f I) : ((fun g ↦ PiecewiseConstantOn.integ g I) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I}).Nonempty := by
5858 obtain ⟨ _, h ⟩ := h; exact Set.nonempty_of_mem (integral_bound_upper_of_bounded h)
···142142 IntegrableOn f I ∧ integ f I = 0 := by
143143 have _ := length_of_subsingleton.mpr hI
144144 have hconst : ConstantOn f I := ConstantOn.of_subsingleton
145145- convert integ_of_piecewise_const (PiecewiseConstantOn.of_const hconst)
145145+ convert integ_of_piecewise_const hconst.piecewiseConstantOn
146146 simp [PiecewiseConstantOn.integ_const' hconst, hI]
147147148148/-- Definition 11.3.9 (Riemann sums). The restriction to positive length J is not needed thanks to various junk value conventions. -/
+4-4
analysis/Analysis/Section_11_4.lean
···186186 have : ∃ f', MinorizesOn f' f I ∧ PiecewiseConstantOn f' I ∧ integ f I - ε < PiecewiseConstantOn.integ f' I ∧ MajorizesOn f' 0 I := by
187187 obtain ⟨ f', hf'min, hf'const, hf'int ⟩ := gt_of_lt_lower_integral hf.1 (show integ f I - ε < lower_integral f I by linarith)
188188 use max f' 0
189189- have hzero := PiecewiseConstantOn.of_const (ConstantOn.of_const' 0 I)
189189+ have hzero := (ConstantOn.of_const' 0 I).piecewiseConstantOn
190190 and_intros
191191 . peel hf_nonneg with x hx _; specialize hf'min _ hx; aesop
192192 . exact hf'const.max hzero
···196196 have : ∃ g', MinorizesOn g' g I ∧ PiecewiseConstantOn g' I ∧ integ g I - ε < PiecewiseConstantOn.integ g' I ∧ MajorizesOn g' 0 I := by
197197 obtain ⟨ g', hg'min, hg'const, hg'int ⟩ := gt_of_lt_lower_integral hg.1 (show integ g I - ε < lower_integral g I by linarith)
198198 use max g' 0
199199- have hzero := PiecewiseConstantOn.of_const (ConstantOn.of_const' 0 I)
199199+ have hzero := (ConstantOn.of_const' 0 I).piecewiseConstantOn
200200 and_intros
201201 . peel hg_nonneg with x hx _; specialize hg'min _ hx; aesop
202202 . exact hg'const.max hzero
···206206 have : ∃ f'', MajorizesOn f'' f I ∧ PiecewiseConstantOn f'' I ∧ PiecewiseConstantOn.integ f'' I < integ f I + ε ∧ MinorizesOn f'' (fun _ ↦ M₁) I := by
207207 obtain ⟨ f'', hf''maj, hf''const, hf''int ⟩ := lt_of_gt_upper_integral hf.1 (show upper_integral f I < integ f I + ε by linarith)
208208 use min f'' (fun _ ↦ M₁)
209209- have hM₁_piece := PiecewiseConstantOn.of_const (ConstantOn.of_const' M₁ I)
209209+ have hM₁_piece := (ConstantOn.of_const' M₁ I).piecewiseConstantOn
210210 and_intros
211211 . peel hM₁ with x hx hM₁; rw [abs_le'] at hM₁
212212 specialize hf''maj _ hx; simp [hf''maj, hM₁.1]
···218218 have : ∃ g'', MajorizesOn g'' g I ∧ PiecewiseConstantOn g'' I ∧ PiecewiseConstantOn.integ g'' I < integ g I + ε ∧ MinorizesOn g'' (fun _ ↦ M₂) I := by
219219 obtain ⟨ g'', hg''maj, hg''const, hg''int ⟩ := lt_of_gt_upper_integral hg.1 (show upper_integral g I < integ g I + ε by linarith)
220220 use min g'' (fun _ ↦ M₂)
221221- have hM₂_piece := PiecewiseConstantOn.of_const (ConstantOn.of_const' M₂ I)
221221+ have hM₂_piece := (ConstantOn.of_const' M₂ I).piecewiseConstantOn
222222 and_intros
223223 . peel hM₂ with x hx hM₂; rw [abs_le'] at hM₂
224224 specialize hg''maj _ hx; simp [hg''maj, hM₂.1]
+4-4
analysis/Analysis/Section_11_5.lean
···170170 have h'const : PiecewiseConstantOn h' I := by
171171 rw [of_join hjoin2 _]; and_intros
172172 . rw [of_join hjoin1 _]; and_intros
173173- . exact of_const (ConstantOn.of_const h'const_left)
173173+ . exact (ConstantOn.of_const h'const_left).piecewiseConstantOn
174174 apply hhconst.congr'
175175 intro x hx; simp [h', hx, mem_iff]
176176- exact of_const (ConstantOn.of_const h'const_right)
176176+ exact (ConstantOn.of_const h'const_right).piecewiseConstantOn
177177 have h'maj : MajorizesOn h' f I := by
178178 intro x hx; by_cases hxI': x ∈ I' <;> simp [h', hxI']
179179 . solve_by_elim
···204204 and_intros
205205 . rw [of_join hjoin1 _]
206206 and_intros
207207- . exact of_const (ConstantOn.of_const g'const_left)
207207+ . exact (ConstantOn.of_const g'const_left).piecewiseConstantOn
208208 apply hgconst.congr'
209209 intro x hx; simp [g', hx, mem_iff]
210210- exact of_const (ConstantOn.of_const g'const_right)
210210+ exact (ConstantOn.of_const g'const_right).piecewiseConstantOn
211211 have g'maj : MinorizesOn g' f I := by
212212 intro x hx; by_cases hxI': x ∈ I' <;> simp [g', hxI']
213213 . solve_by_elim
+73-109
analysis/Analysis/Section_11_8.lean
···8484 convert hf using 1
8585 have h1 : .Ioo (x₀-ε) x₀ ∈ nhdsWithin x₀ (.Iio x₀) := by
8686 convert inter_mem_nhdsWithin (t := .Ioo (x₀-ε) (x₀+ε)) _ _
8787- . ext; simp; constructor
8888- . intro ⟨ h1, h2 ⟩; simp [h1, h2]; linarith
8989- aesop
8787+ . ext; simp; exact ⟨ by intro ⟨ h1, h2 ⟩; simp [h1, h2]; linarith, by aesop ⟩
9088 apply Ioo_mem_nhds <;> linarith
9189 rw [←nhdsWithin_inter_of_mem h1]
9290 congr 1; simp [Set.Ioo_subset_Iio_self]
···9694 (h : X ∈ nhds x₀) (hf: ContinuousWithinAt f X x₀) :
9795 jump f x₀ = 0 := by
9896 rw [mem_nhds_iff_exists_Ioo_subset] at h
9999- obtain ⟨ l, u, hx₀, hX ⟩ := h
100100- simp at hx₀
101101- have hl : ∃ ε>0, .Ioc (x₀-ε) x₀ ⊆ X := by
102102- refine ⟨ x₀-l, by linarith, Set.Subset.trans ?_ hX ⟩
103103- intro x hx; simp at hx ⊢; exact ⟨ hx.1, by linarith ⟩
104104- have hu : ∃ ε>0, .Ico x₀ (x₀+ε) ⊆ X := by
105105- refine ⟨ u-x₀, by linarith, Set.Subset.trans ?_ hX ⟩
106106- intro x hx; simp at hx ⊢; exact ⟨ by linarith, hx.2 ⟩
9797+ obtain ⟨ l, u, hx₀, hX ⟩ := h; simp at hx₀
9898+ have hl : ∃ ε>0, .Ioc (x₀-ε) x₀ ⊆ X :=
9999+ ⟨ x₀-l, by linarith, Set.Subset.trans (by intro _ _; simp_all; linarith) hX ⟩
100100+ have hu : ∃ ε>0, .Ico x₀ (x₀+ε) ⊆ X :=
101101+ ⟨ u-x₀, by linarith, Set.Subset.trans (by intro _ _; simp_all; linarith) hX ⟩
107102 simp [jump, left_lim_of_continuous hl hf, right_lim_of_continuous hu hf]
108103109104/-- Right limits exist for monotone functions -/
110105theorem right_lim_of_monotone {f: ℝ → ℝ} (x₀:ℝ) (hf: Monotone f) :
111106 Convergesto (.Ioi x₀) f (sInf (f '' .Ioi x₀)) x₀ := by
112107 rw [Convergesto.iff, ←nhdsWithin.eq_1]
113113- apply MonotoneOn.tendsto_nhdsGT
114114- . apply hf.monotoneOn
115115- rw [bddBelow_def]
116116- use f x₀; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
108108+ apply (hf.monotoneOn _).tendsto_nhdsGT
109109+ rw [bddBelow_def]; use f x₀; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
117110118111theorem right_lim_of_monotone' {f: ℝ → ℝ} (x₀:ℝ) (hf: Monotone f) :
119112 right_lim f x₀ = sInf (f '' .Ioi x₀) := right_lim_def (right_lim_of_monotone x₀ hf)
···122115theorem left_lim_of_monotone {f: ℝ → ℝ} (x₀:ℝ) (hf: Monotone f) :
123116 Convergesto (.Iio x₀) f (sSup (f '' .Iio x₀)) x₀ := by
124117 rw [Convergesto.iff, ←nhdsWithin.eq_1]
125125- apply MonotoneOn.tendsto_nhdsLT
126126- . apply hf.monotoneOn
127127- rw [bddAbove_def]
128128- use f x₀; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
118118+ apply (hf.monotoneOn _).tendsto_nhdsLT
119119+ rw [bddAbove_def]; use f x₀; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
129120130121theorem left_lim_of_monotone' {f: ℝ → ℝ} (x₀:ℝ) (hf: Monotone f) :
131122 left_lim f x₀ = sSup (f '' .Iio x₀) := left_lim_def (left_lim_of_monotone x₀ hf)
···133124theorem jump_of_monotone {f: ℝ → ℝ} (x₀:ℝ) (hf: Monotone f) :
134125 0 ≤ jump f x₀ := by
135126 simp [jump, left_lim_of_monotone' x₀ hf, right_lim_of_monotone' x₀ hf]
136136- apply csSup_le (by simp)
137137- intro a ha
138138- apply le_csInf (by simp)
139139- intro b hb; simp at ha hb
140140- obtain ⟨ x, hx, rfl ⟩ := ha
141141- obtain ⟨ y, hy, rfl ⟩ := hb
127127+ apply csSup_le (by simp); intro a ha
128128+ apply le_csInf (by simp); intro b hb; simp at ha hb
129129+ obtain ⟨ x, hx, rfl ⟩ := ha; obtain ⟨ y, hy, rfl ⟩ := hb
142130 apply hf; linarith
143131144132theorem right_lim_le_left_lim_of_monotone {f:ℝ → ℝ} {a b:ℝ} (hab: a < b)
···148136 calc
149137 _ ≤ f ((a+b)/2) := by
150138 apply ConditionallyCompleteLattice.csInf_le
151151- . rw [bddBelow_def]
152152- use f a; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
139139+ . rw [bddBelow_def]; use f a; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
153140 simp; use (a+b)/2; simp; linarith
154141 _ ≤ _ := by
155142 apply ConditionallyCompleteLattice.le_csSup
156156- . rw [bddAbove_def]
157157- use f b; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
143143+ . rw [bddAbove_def]; use f b; intro y hy; simp at hy; obtain ⟨ x, hx, rfl ⟩ := hy; apply hf; linarith
158144 simp; use (a+b)/2; simp; linarith
159145160146/-- Definition 11.8.1 -/
···181167 (hI : I ⊆ Ioo a b) (hα: ContinuousOn α (Ioo a b)) :
182168 α[I]ₗ = α I.b - α I.a := by
183169 have ha_left : left_lim α I.a = α I.a := by
184184- apply left_lim_of_continuous _ (hα.continuousWithinAt _)
185185- . refine ⟨ I.a - a, by linarith, ?_ ⟩
186186- intro _; simp; intro h1 _; exact ⟨ h1, by linarith ⟩
187187- simp [haa]; linarith
170170+ apply left_lim_of_continuous _ (hα.continuousWithinAt (by simp [haa]; linarith))
171171+ exact ⟨ I.a - a, by linarith, by intro _; simp; intro _ _; and_intros <;> linarith ⟩
188172 have ha_right : right_lim α I.a = α I.a := by
189189- apply right_lim_of_continuous _ (hα.continuousWithinAt _)
190190- . refine ⟨ b - I.a, by linarith, ?_ ⟩
191191- intro _; simp; intro _ h2; exact ⟨ by linarith, h2 ⟩
192192- simp [haa]; linarith
173173+ apply right_lim_of_continuous _ (hα.continuousWithinAt (by simp [haa]; linarith))
174174+ exact ⟨ b - I.a, by linarith, by intro _; simp; intro _ _; and_intros <;> linarith ⟩
193175 have hb_left : left_lim α I.b = α I.b := by
194194- apply left_lim_of_continuous _ (hα.continuousWithinAt _)
195195- . refine ⟨ I.b - a, by linarith, ?_ ⟩
196196- intro _; simp; intro h1 _; exact ⟨ h1, by linarith ⟩
197197- simp [hbb]; linarith
176176+ apply left_lim_of_continuous _ (hα.continuousWithinAt (by simp [hbb]; linarith))
177177+ exact ⟨ I.b - a, by linarith, by intro _; simp; intro _ _; and_intros <;> linarith ⟩
198178 have hb_right : right_lim α I.b = α I.b := by
199199- apply right_lim_of_continuous _ (hα.continuousWithinAt _)
200200- . refine ⟨ b - I.b, by linarith, ?_ ⟩
201201- intro _; simp; intro h1 h2; exact ⟨ by linarith, h2 ⟩
202202- simp [hbb]; linarith
179179+ apply right_lim_of_continuous _ (hα.continuousWithinAt (by simp [hbb]; linarith))
180180+ exact ⟨ b - I.b, by linarith, by intro _; simp; intro _ _; and_intros <;> linarith ⟩
203181 cases I with
204182 | Icc _ _ => simp [α_length, hb_right, ha_left, hab]
205183 | Ico _ _ => simp [α_length, hb_left, ha_left, hab]
206184 | Ioc _ _ => simp [α_length, hb_right, ha_right, hab]
207207- | Ioo a' b' => simp [α_length, hb_left, ha_right]; intro h; simp [show a' = b' by linarith]
185185+ | Ioo a' b' => simp [α_length, hb_left, ha_right]; intros; simp [show a' = b' by linarith]
208186209187/-- Example 11.8.2-/
210188example : (fun x ↦ x^2)[Icc 2 3]ₗ = 5 := by
···222200 sorry
223201224202/-- An improved version of BoundedInterval.joins that also controls α-length. -/
225225-abbrev BoundedInterval.joins' (K I J: BoundedInterval) : Prop :=
226226- K.joins I J ∧ ∀ α:ℝ → ℝ, α[K]ₗ = α[I]ₗ + α[J]ₗ
203203+abbrev BoundedInterval.joins' (K I J: BoundedInterval) : Prop := K.joins I J ∧ ∀ α:ℝ → ℝ, α[K]ₗ = α[I]ₗ + α[J]ₗ
227204228205theorem BoundedInterval.join_Icc_Ioc' {a b c:ℝ} (hab: a ≤ b) (hbc: b ≤ c) : (Icc a c).joins' (Icc a b) (Ioc b c) := by
229206 refine ⟨ join_Icc_Ioc hab hbc, ?_ ⟩
···290267 ℝ := if h: PiecewiseConstantOn f I then PiecewiseConstantWith.RS_integ f h.choose α else 0
291268292269theorem PiecewiseConstantOn.RS_integ_def {f:ℝ → ℝ} {I: BoundedInterval} {P: Partition I}
293293- (h: PiecewiseConstantWith f P) (α:ℝ → ℝ) : PiecewiseConstantOn.RS_integ f I α = PiecewiseConstantWith.RS_integ f P α := by
270270+ (h: PiecewiseConstantWith f P) (α:ℝ → ℝ) : RS_integ f I α = PiecewiseConstantWith.RS_integ f P α := by
294271 have h' : PiecewiseConstantOn f I := by use P
295295- simp [PiecewiseConstantOn.RS_integ, h']
296296- exact PiecewiseConstantWith.RS_integ_eq h'.choose_spec h α
272272+ simp [RS_integ, h']; exact PiecewiseConstantWith.RS_integ_eq h'.choose_spec h α
297273298274/-- α-length non-negative when α monotone -/
299275theorem α_length_nonneg_of_monotone {α:ℝ → ℝ} (hα: Monotone α) (I: BoundedInterval):
···303279/-- Analogue of Theorem 11.2.16 (a) (Laws of integration) / Exercise 11.8.3 -/
304280theorem PiecewiseConstantOn.RS_integ_add {f g: ℝ → ℝ} {I: BoundedInterval}
305281 (hf: PiecewiseConstantOn f I) (hg: PiecewiseConstantOn g I) {α:ℝ → ℝ} (hα: Monotone α):
306306- PiecewiseConstantOn.RS_integ (f + g) I α = PiecewiseConstantOn.RS_integ f I α + PiecewiseConstantOn.RS_integ g I α := by
282282+ RS_integ (f + g) I α = RS_integ f I α + RS_integ g I α := by
307283 sorry
308284309285/-- Analogue of Theorem 11.2.16 (b) (Laws of integration) / Exercise 11.8.3 -/
310286theorem PiecewiseConstantOn.RS_integ_smul {f: ℝ → ℝ} {I: BoundedInterval} (c:ℝ)
311287 (hf: PiecewiseConstantOn f I) {α:ℝ → ℝ} (hα: Monotone α) :
312312- PiecewiseConstantOn.RS_integ (c • f) I α = c * PiecewiseConstantOn.RS_integ f I α
288288+ RS_integ (c • f) I α = c * RS_integ f I α
313289 := by
314290 sorry
315291···317293theorem PiecewiseConstantOn.RS_integ_sub {f g: ℝ → ℝ} {I: BoundedInterval}
318294 {α:ℝ → ℝ} (hα: Monotone α)
319295 (hf: PiecewiseConstantOn f I) (hg: PiecewiseConstantOn g I) :
320320- PiecewiseConstantOn.RS_integ (f - g) I α = PiecewiseConstantOn.RS_integ f I α - PiecewiseConstantOn.RS_integ g I α := by
296296+ RS_integ (f - g) I α = RS_integ f I α - RS_integ g I α := by
321297 sorry
322298323299/-- Theorem 11.8.8 (d) (Laws of RS integration) / Exercise 11.8.8 -/
324300theorem PiecewiseConstantOn.RS_integ_of_nonneg {f: ℝ → ℝ} {I: BoundedInterval}
325301 {α:ℝ → ℝ} (hα: Monotone α)
326302 (h: ∀ x ∈ I, 0 ≤ f x) (hf: PiecewiseConstantOn f I) :
327327- 0 ≤ PiecewiseConstantOn.RS_integ f I α := by
303303+ 0 ≤ RS_integ f I α := by
328304 sorry
329305330306/-- Theorem 11.8.8 (e) (Laws of RS integration) / Exercise 11.8.8 -/
331307theorem PiecewiseConstantOn.RS_integ_mono {f g: ℝ → ℝ} {I: BoundedInterval}
332308 {α:ℝ → ℝ} (hα: Monotone α)
333309 (h: ∀ x ∈ I, f x ≤ g x) (hf: PiecewiseConstantOn f I) (hg: PiecewiseConstantOn g I) :
334334- PiecewiseConstantOn.RS_integ f I α ≤ PiecewiseConstantOn.RS_integ g I α := by
310310+ RS_integ f I α ≤ RS_integ g I α := by
335311 sorry
336312337313/-- Theorem 11.8.8 (f) (Laws of RS integration) / Exercise 11.8.8 -/
338314theorem PiecewiseConstantOn.RS_integ_const (c: ℝ) (I: BoundedInterval) {α:ℝ → ℝ} (hα: Monotone α) :
339339- PiecewiseConstantOn.RS_integ (fun _ ↦ c) I α = c * α[I]ₗ := by
315315+ RS_integ (fun _ ↦ c) I α = c * α[I]ₗ := by
340316 sorry
341317342318/-- Theorem 11.8.8 (f) (Laws of RS integration) / Exercise 11.8.8 -/
343319theorem PiecewiseConstantOn.RS_integ_const' {f:ℝ → ℝ} {I: BoundedInterval}
344320 {α:ℝ → ℝ} (hα: Monotone α) (h: ConstantOn f I) :
345345- PiecewiseConstantOn.RS_integ f I α = (constant_value_on f I) * α[I]ₗ := by
321321+ RS_integ f I α = (constant_value_on f I) * α[I]ₗ := by
346322 sorry
347323348324open Classical in
···356332/-- Theorem 11.8.8 (g) (Laws of RS integration) / Exercise 11.8.8 -/
357333theorem PiecewiseConstantOn.RS_integ_of_extend {I J: BoundedInterval} (hIJ: I ⊆ J)
358334 {f: ℝ → ℝ} (h: PiecewiseConstantOn f I) {α:ℝ → ℝ} (hα: Monotone α):
359359- PiecewiseConstantOn.RS_integ (fun x ↦ if x ∈ I then f x else 0) J α = PiecewiseConstantOn.RS_integ f I α := by
335335+ RS_integ (fun x ↦ if x ∈ I then f x else 0) J α = RS_integ f I α := by
360336 sorry
361337362338/-- Theorem 11.8.8 (h) (Laws of RS integration) / Exercise 11.8.8 -/
363339theorem PiecewiseConstantOn.RS_integ_of_join {I J K: BoundedInterval} (hIJK: K.joins' I J)
364340 {f: ℝ → ℝ} (h: PiecewiseConstantOn f K) {α:ℝ → ℝ} (hα: Monotone α):
365365- PiecewiseConstantOn.RS_integ f K α = PiecewiseConstantOn.RS_integ f I α + PiecewiseConstantOn.RS_integ f J α := by
341341+ RS_integ f K α = RS_integ f I α + RS_integ f J α := by
366342 sorry
367343368344/-- Analogue of Definition 11.3.2 (Uppper and lower Riemann integrals )-/
369345noncomputable abbrev upper_RS_integral (f:ℝ → ℝ) (I: BoundedInterval) (α: ℝ → ℝ): ℝ :=
370370- sInf ((fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I})
346346+ sInf ((PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I})
371347372348noncomputable abbrev lower_RS_integral (f:ℝ → ℝ) (I: BoundedInterval) (α: ℝ → ℝ): ℝ :=
373373- sSup ((fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I})
349349+ sSup ((PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I})
374350375351lemma RS_integral_bound_upper_of_bounded {f:ℝ → ℝ} {M:ℝ} {I: BoundedInterval}
376352 (h: ∀ x ∈ (I:Set ℝ), |f x| ≤ M) {α:ℝ → ℝ} (hα:Monotone α)
377377- : M * α[I]ₗ ∈ (fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I} := by
378378- simp
379379- refine ⟨ fun _ ↦ M, ⟨ ⟨ ?_, ?_, ⟩, PiecewiseConstantOn.RS_integ_const M I hα ⟩ ⟩
380380- . peel h with x hx h; simp_all [abs_le']
381381- apply PiecewiseConstantOn.of_const (ConstantOn.of_const (c := M) (by simp))
353353+ : M * α[I]ₗ ∈ (PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I} := by
354354+ simp; refine ⟨ fun _ ↦ M, ⟨ ⟨ ?_, ?_ ⟩, PiecewiseConstantOn.RS_integ_const M I hα ⟩ ⟩
355355+ . peel h with _ _ _; simp_all [abs_le']
356356+ exact (ConstantOn.of_const (c := M) (by simp)).piecewiseConstantOn
382357383358384359lemma RS_integral_bound_lower_of_bounded {f:ℝ → ℝ} {M:ℝ} {I: BoundedInterval} (h: ∀ x ∈ (I:Set ℝ), |f x| ≤ M) {α:ℝ → ℝ} (hα:Monotone α)
385385- : -M * α[I]ₗ ∈ (fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I} := by
386386- simp
387387- refine ⟨ fun _ ↦ -M, ⟨ ⟨ ?_, ?_, ⟩, ?_ ⟩ ⟩
388388- . peel h with x hx h'; simp [abs_le'] at *; linarith
389389- . apply PiecewiseConstantOn.of_const (ConstantOn.of_const (c := -M) (by simp))
390390- convert PiecewiseConstantOn.RS_integ_const _ _ hα using 1
391391- simp
360360+ : -M * α[I]ₗ ∈ (PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I} := by
361361+ simp; refine ⟨ fun _ ↦ -M, ⟨ ⟨ ?_, ?_ ⟩, by convert PiecewiseConstantOn.RS_integ_const _ _ hα using 1; simp ⟩ ⟩
362362+ . peel h with _ _ _; simp [abs_le'] at *; linarith
363363+ exact (ConstantOn.of_const (c := -M) (by simp)).piecewiseConstantOn
364364+392365393366lemma RS_integral_bound_upper_nonempty {f:ℝ → ℝ} {I: BoundedInterval} (h: BddOn f I)
394367 {α:ℝ → ℝ} (hα: Monotone α) :
395395- ((fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I}).Nonempty := by
396396- obtain ⟨ M, h ⟩ := h
397397- exact Set.nonempty_of_mem (RS_integral_bound_upper_of_bounded h hα)
368368+ ((PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I}).Nonempty := by
369369+ obtain ⟨ M, h ⟩ := h; exact Set.nonempty_of_mem (RS_integral_bound_upper_of_bounded h hα)
398370399371lemma RS_integral_bound_lower_nonempty {f:ℝ → ℝ} {I: BoundedInterval} (h: BddOn f I)
400372 {α:ℝ → ℝ} (hα: Monotone α) :
401401- ((fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I}).Nonempty := by
402402- obtain ⟨ M, h ⟩ := h
403403- exact Set.nonempty_of_mem (RS_integral_bound_lower_of_bounded h hα)
373373+ ((PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I}).Nonempty := by
374374+ obtain ⟨ M, h ⟩ := h; exact Set.nonempty_of_mem (RS_integral_bound_lower_of_bounded h hα)
404375405376lemma RS_integral_bound_lower_le_upper {f:ℝ → ℝ} {I: BoundedInterval} {a b:ℝ}
406377 {α:ℝ → ℝ} (hα: Monotone α)
407407- (ha: a ∈ (fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I})
408408- (hb: b ∈ (fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I})
378378+ (ha: a ∈ (PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I})
379379+ (hb: b ∈ (PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I})
409380 : b ≤ a:= by
410381 obtain ⟨ g, ⟨ ⟨ hmaj, hgp⟩, hgi ⟩ ⟩ := ha
411382 obtain ⟨ h, ⟨ ⟨ hmin, hhp⟩, hhi ⟩ ⟩ := hb
412412- rw [←hgi, ←hhi]
413413- apply hhp.RS_integ_mono hα _ hgp
414414- intro x hx; exact (ge_iff_le.mp (hmin _ hx)).trans (hmaj _ hx)
383383+ rw [←hgi, ←hhi]; apply hhp.RS_integ_mono hα _ hgp; intro _ hx; linarith [hmin _ hx, hmaj _ hx]
415384416385lemma RS_integral_bound_below {f:ℝ → ℝ} {I: BoundedInterval} (h: BddOn f I)
417386 {α:ℝ → ℝ} (hα: Monotone α) :
418418- BddBelow ((fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I}) := by
419419- rw [bddBelow_def]
420420- use (RS_integral_bound_lower_nonempty h hα).some
387387+ BddBelow ((PiecewiseConstantOn.RS_integ · I α) ''
388388+ {g | MajorizesOn g f I ∧ PiecewiseConstantOn g I}) := by
389389+ rw [bddBelow_def]; use (RS_integral_bound_lower_nonempty h hα).some
421390 intro a ha; exact RS_integral_bound_lower_le_upper hα ha (RS_integral_bound_lower_nonempty h hα).some_mem
422391423392lemma RS_integral_bound_above {f:ℝ → ℝ} {I: BoundedInterval} (h: BddOn f I)
424393 {α:ℝ → ℝ} (hα: Monotone α):
425425- BddAbove ((fun g ↦ PiecewiseConstantOn.RS_integ g I α) '' {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I}) := by
426426- rw [bddAbove_def]
427427- use (RS_integral_bound_upper_nonempty h hα).some
394394+ BddAbove ((PiecewiseConstantOn.RS_integ · I α) ''
395395+ {g | MinorizesOn g f I ∧ PiecewiseConstantOn g I}) := by
396396+ rw [bddAbove_def]; use (RS_integral_bound_upper_nonempty h hα).some
428397 intro b hb; exact RS_integral_bound_lower_le_upper hα (RS_integral_bound_upper_nonempty h hα).some_mem hb
429398430399lemma le_lower_RS_integral {f:ℝ → ℝ} {I: BoundedInterval} {M:ℝ} (h: ∀ x ∈ (I:Set ℝ), |f x| ≤ M)
431400 {α:ℝ → ℝ} (hα: Monotone α) :
432432- -M * α[I]ₗ ≤ lower_RS_integral f I α := by
433433- exact ConditionallyCompleteLattice.le_csSup _ _
401401+ -M * α[I]ₗ ≤ lower_RS_integral f I α :=
402402+ ConditionallyCompleteLattice.le_csSup _ _
434403 (RS_integral_bound_above (BddOn.of_bounded h) hα) (RS_integral_bound_lower_of_bounded h hα)
435404436405lemma lower_RS_integral_le_upper {f:ℝ → ℝ} {I: BoundedInterval} (h: BddOn f I)
437406 {α:ℝ → ℝ} (hα: Monotone α) :
438407 lower_RS_integral f I α ≤ upper_RS_integral f I α := by
439408 apply ConditionallyCompleteLattice.csSup_le _ _ (RS_integral_bound_lower_nonempty h hα) _
440440- rw [mem_upperBounds]
441441- intros
409409+ rw [mem_upperBounds]; intros
442410 apply ConditionallyCompleteLattice.le_csInf _ _ (RS_integral_bound_upper_nonempty h hα) _
443443- rw [mem_lowerBounds]
444444- intros; solve_by_elim [RS_integral_bound_lower_le_upper]
411411+ rw [mem_lowerBounds]; intros; solve_by_elim [RS_integral_bound_lower_le_upper]
445412446413lemma RS_upper_integral_le {f:ℝ → ℝ} {I: BoundedInterval} {M:ℝ} (h: ∀ x ∈ (I:Set ℝ), |f x| ≤ M)
447414 {α:ℝ → ℝ} (hα: Monotone α) :
448448- upper_RS_integral f I α ≤ M * α[I]ₗ := by
449449- exact ConditionallyCompleteLattice.csInf_le _ _
415415+ upper_RS_integral f I α ≤ M * α[I]ₗ :=
416416+ ConditionallyCompleteLattice.csInf_le _ _
450417 (RS_integral_bound_below (.of_bounded h) hα) (RS_integral_bound_upper_of_bounded h hα)
451418452419lemma upper_RS_integral_le_integ {f g:ℝ → ℝ} {I: BoundedInterval} (hf: BddOn f I)
453420 (hfg: MajorizesOn g f I) (hg: PiecewiseConstantOn g I)
454421 {α:ℝ → ℝ} (hα: Monotone α) :
455455- upper_RS_integral f I α ≤ PiecewiseConstantOn.RS_integ g I α := by
456456- apply ConditionallyCompleteLattice.csInf_le _ _ (RS_integral_bound_below hf hα) _
457457- use g; simpa [hg]
422422+ upper_RS_integral f I α ≤ PiecewiseConstantOn.RS_integ g I α :=
423423+ ConditionallyCompleteLattice.csInf_le _ _ (RS_integral_bound_below hf hα) ⟨ g, by simpa [hg] ⟩
458424459425lemma integ_le_lower_RS_integral {f h:ℝ → ℝ} {I: BoundedInterval} (hf: BddOn f I)
460426 (hfh: MinorizesOn h f I) (hg: PiecewiseConstantOn h I)
461427 {α:ℝ → ℝ} (hα: Monotone α) :
462462- PiecewiseConstantOn.RS_integ h I α ≤ lower_RS_integral f I α := by
463463- apply ConditionallyCompleteLattice.le_csSup _ _ (RS_integral_bound_above hf hα) _
464464- use h; simpa [hg]
428428+ PiecewiseConstantOn.RS_integ h I α ≤ lower_RS_integral f I α :=
429429+ ConditionallyCompleteLattice.le_csSup _ _ (RS_integral_bound_above hf hα) ⟨ h, by simpa [hg] ⟩
465430466431lemma lt_of_gt_upper_RS_integral {f:ℝ → ℝ} {I: BoundedInterval} (hf: BddOn f I)
467432 {α: ℝ → ℝ} (hα: Monotone α) {X:ℝ} (hX: upper_RS_integral f I α < X ) :
468433 ∃ g, MajorizesOn g f I ∧ PiecewiseConstantOn g I ∧ PiecewiseConstantOn.RS_integ g I α < X := by
469469- obtain ⟨ Y, hY, hYX ⟩ := exists_lt_of_csInf_lt (RS_integral_bound_upper_nonempty hf hα) hX
434434+ have ⟨ Y, hY, hYX ⟩ := exists_lt_of_csInf_lt (RS_integral_bound_upper_nonempty hf hα) hX
470435 simp at hY; obtain ⟨ g, ⟨ hmaj, hgp ⟩, hgi ⟩ := hY; exact ⟨ g, hmaj, hgp, by rwa [hgi] ⟩
471436472437lemma gt_of_lt_lower_RS_integral {f:ℝ → ℝ} {I: BoundedInterval} (hf: BddOn f I)
473438 {α:ℝ → ℝ} (hα: Monotone α) {X:ℝ} (hX: X < lower_RS_integral f I α) :
474439 ∃ h, MinorizesOn h f I ∧ PiecewiseConstantOn h I ∧ X < PiecewiseConstantOn.RS_integ h I α := by
475475- obtain ⟨ Y, hY, hYX ⟩ := exists_lt_of_lt_csSup (RS_integral_bound_lower_nonempty hf hα) hX
440440+ have ⟨ Y, hY, hYX ⟩ := exists_lt_of_lt_csSup (RS_integral_bound_lower_nonempty hf hα) hX
476441 simp at hY; obtain ⟨ h, ⟨ hmin, hhp ⟩, hhi ⟩ := hY; exact ⟨ h, hmin, hhp, by rwa [hhi] ⟩
477442478443/-- Analogue of Definition 11.3.4 -/
479479-noncomputable abbrev RS_integ (f:ℝ → ℝ) (I: BoundedInterval) (α:ℝ → ℝ) : ℝ :=
480480-upper_RS_integral f I α
444444+noncomputable abbrev RS_integ (f:ℝ → ℝ) (I: BoundedInterval) (α:ℝ → ℝ) : ℝ := upper_RS_integral f I α
481445482446noncomputable abbrev RS_IntegrableOn (f:ℝ → ℝ) (I: BoundedInterval) (α: ℝ → ℝ) : Prop :=
483447 BddOn f I ∧ lower_RS_integral f I α = upper_RS_integral f I α
-1
analysis/Analysis/Section_3_1.lean
···224224theorem SetTheory.Set.pair_uniq (a b:Object) : ∃! (X:Set), ∀ x, x ∈ X ↔ x = a ∨ x = b := by sorry
225225226226/-- Remark 3.1.8 -/
227227-@[simp]
228227theorem SetTheory.Set.pair_comm (a b:Object) : ({a,b}:Set) = {b,a} := by sorry
229228230229/-- Remark 3.1.8 -/
+1-1
analysis/Analysis/Section_3_4.lean
···25252626/-- Definition 3.4.1. Interestingly, the definition does not require S to be a subset of X. -/
2727abbrev SetTheory.Set.image {X Y:Set} (f:X → Y) (S: Set) : Set :=
2828- X.replace (P := fun x y ↦ y = f x ∧ x.val ∈ S) (by simp_all)
2828+ X.replace (P := fun x y ↦ f x = y ∧ x.val ∈ S) (by simp_all)
29293030/-- Definition 3.4.1 -/
3131theorem SetTheory.Set.mem_image {X Y:Set} (f:X → Y) (S: Set) (y:Object) :