Imports
import Mathlib.Tactic import Mathlib.Topology.Instances.Irrational import Analysis.Section_11_6
set_option doc.verso.suggestions false

Analysis I, Section 11.8: The Riemann-Stieltjes integral

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:

  • Definition of α_length.

  • The piecewise constant Riemann-Stieltjes integral.

  • The full Riemann-Stieltjes integral.

Technical notes:

  • In Lean it is more convenient to make definitions such as α_length and the Riemann-Stieltjes integral totally defined, thus assigning "junk" values to the cases where the definition is not intended to be applied. For the definition of α_length, the definition is intended to be applied in contexts where left and right limits exist, and the function is extended by constants to the left and right of its intended domain of definition; for instance, if a function x f is defined on Icc 0 1, then it is intended that f x = f 1 for all x ≥ 1 and f x = f 0 for all x ≤ 0; in particular, at a right endpoint, the value of a function is intended to agree with its right limit, and similarly for the left endpoint, although we do not enforce this in our definition of α_length. (For functions defined on open intervals, the extension is immaterial.)

  • The notion of α_length and piecewise constant Riemann-Stieltjes integral is intended for situations where left and right limits exist, such as for monotone functions or continuous functions, though technically they make sense without these hypotheses. The full Riemann-Stieltjes integral is intended for functions that are of bounded variation, though we shall restrict attention to the special case of monotone increasing functions for the most part.

namespace Chapter11open BoundedInterval Chapter9

Left and right limits. A junk value is assigned if the limit does not exist.

noncomputable abbrev right_lim (f: ) (x₀:) : := Filter.lim ((nhdsWithin x₀ (.Ioi x₀)).map f)
noncomputable abbrev left_lim (f: ) (x₀:) : := Filter.lim ((nhdsWithin x₀ (.Iio x₀)).map f)theorem right_lim_def {f: } {x₀ L:} (h: Convergesto (.Ioi x₀) f L x₀) : right_lim f x₀ = L := f: x₀:L:h:Convergesto (Set.Ioi x₀) f L x₀right_lim f x₀ = L f: x₀:L:h:Convergesto (Set.Ioi x₀) f L x₀(Filter.map f (nhdsWithin x₀ (Set.Ioi x₀))).lim = L f: x₀:L:h:Convergesto (Set.Ioi x₀) f L x₀Filter.map f (nhdsWithin x₀ (Set.Ioi x₀)) nhds L; rwa [Convergesto.iff, Filter.Tendsto.eq_1f: x₀:L:h:Filter.map f (nhdsWithin x₀ (Set.Ioi x₀)) nhds LFilter.map f (nhdsWithin x₀ (Set.Ioi x₀)) nhds L at htheorem left_lim_def {f: } {x₀ L:} (h: Convergesto (.Iio x₀) f L x₀) : left_lim f x₀ = L := f: x₀:L:h:Convergesto (Set.Iio x₀) f L x₀left_lim f x₀ = L f: x₀:L:h:Convergesto (Set.Iio x₀) f L x₀(Filter.map f (nhdsWithin x₀ (Set.Iio x₀))).lim = L f: x₀:L:h:Convergesto (Set.Iio x₀) f L x₀Filter.map f (nhdsWithin x₀ (Set.Iio x₀)) nhds L; rwa [Convergesto.iff, Filter.Tendsto.eq_1f: x₀:L:h:Filter.map f (nhdsWithin x₀ (Set.Iio x₀)) nhds LFilter.map f (nhdsWithin x₀ (Set.Iio x₀)) nhds L at hnoncomputable abbrev jump (f: ) (x₀:) : := right_lim f x₀ - left_lim f x₀

Right limits exist for continuous functions

theorem right_lim_of_continuous {X:Set } {f: } {x₀:} (h : ε>0, .Ico x₀ (x₀+ε) X) (hf: ContinuousWithinAt f X x₀) : right_lim f x₀ = f x₀ := X:Set f: x₀:h: ε > 0, Set.Ico x₀ (x₀ + ε) Xhf:ContinuousWithinAt f X x₀right_lim f x₀ = f x₀ X:Set f: x₀:hf:ContinuousWithinAt f X x₀ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xright_lim f x₀ = f x₀ X:Set f: x₀:hf:ContinuousWithinAt f X x₀ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) XConvergesto (Set.Ioi x₀) f (f x₀) x₀ X:Set f: x₀:hf:Filter.Tendsto f (nhdsWithin x₀ X) (nhds (f x₀))ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) XConvergesto (Set.Ioi x₀) f (f x₀) x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))Convergesto (Set.Ioi x₀) f (f x₀) x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))Filter.Tendsto f (nhdsWithin x₀ (Set.Ioi x₀)) (nhds (f x₀)) X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))nhdsWithin x₀ (Set.Ioi x₀) = nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε)) have h1 : .Ioo x₀ (x₀ + ε) nhdsWithin x₀ (.Ioi x₀) := X:Set f: x₀:h: ε > 0, Set.Ico x₀ (x₀ + ε) Xhf:ContinuousWithinAt f X x₀right_lim f x₀ = f x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))Set.Ioo x₀ (x₀ + ε) = Set.Ioi x₀ Set.Ioo (x₀ - ε) (x₀ + ε)X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))Set.Ioo (x₀ - ε) (x₀ + ε) nhds x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))Set.Ioo x₀ (x₀ + ε) = Set.Ioi x₀ Set.Ioo (x₀ - ε) (x₀ + ε) All goals completed! 🐙 X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))x₀ - ε < x₀X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))x₀ < x₀ + ε X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))x₀ - ε < x₀X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))x₀ < x₀ + ε All goals completed! 🐙 X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))h1:Set.Ioo x₀ (x₀ + ε) nhdsWithin x₀ (Set.Ioi x₀)nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε) Set.Ioi x₀) = nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε)); X:Set f: x₀:ε::ε > 0hX:Set.Ico x₀ (x₀ + ε) Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo x₀ (x₀ + ε))) (nhds (f x₀))h1:Set.Ioo x₀ (x₀ + ε) nhdsWithin x₀ (Set.Ioi x₀)Set.Ioo x₀ (x₀ + ε) Set.Ioi x₀ = Set.Ioo x₀ (x₀ + ε); All goals completed! 🐙

Left limits exist for continuous functions

theorem left_lim_of_continuous {X:Set } {f: } {x₀:} (h : ε>0, .Ioc (x₀-ε) x₀ X) (hf: ContinuousWithinAt f X x₀) : left_lim f x₀ = f x₀ := X:Set f: x₀:h: ε > 0, Set.Ioc (x₀ - ε) x₀ Xhf:ContinuousWithinAt f X x₀left_lim f x₀ = f x₀ X:Set f: x₀:hf:ContinuousWithinAt f X x₀ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xleft_lim f x₀ = f x₀ X:Set f: x₀:hf:ContinuousWithinAt f X x₀ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ XConvergesto (Set.Iio x₀) f (f x₀) x₀ X:Set f: x₀:hf:Filter.Tendsto f (nhdsWithin x₀ X) (nhds (f x₀))ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ XConvergesto (Set.Iio x₀) f (f x₀) x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))Convergesto (Set.Iio x₀) f (f x₀) x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))Filter.Tendsto f (nhdsWithin x₀ (Set.Iio x₀)) (nhds (f x₀)) X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))nhdsWithin x₀ (Set.Iio x₀) = nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀) have h1 : .Ioo (x₀-ε) x₀ nhdsWithin x₀ (.Iio x₀) := X:Set f: x₀:h: ε > 0, Set.Ioc (x₀ - ε) x₀ Xhf:ContinuousWithinAt f X x₀left_lim f x₀ = f x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))Set.Ioo (x₀ - ε) x₀ = Set.Iio x₀ Set.Ioo (x₀ - ε) (x₀ + ε)X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))Set.Ioo (x₀ - ε) (x₀ + ε) nhds x₀ X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))Set.Ioo (x₀ - ε) x₀ = Set.Iio x₀ Set.Ioo (x₀ - ε) (x₀ + ε) All goals completed! 🐙 X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))x₀ - ε < x₀X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))x₀ < x₀ + ε X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))x₀ - ε < x₀X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))x₀ < x₀ + ε All goals completed! 🐙 X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))h1:Set.Ioo (x₀ - ε) x₀ nhdsWithin x₀ (Set.Iio x₀)nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀ Set.Iio x₀) = nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀) X:Set f: x₀:ε::ε > 0hX:Set.Ioc (x₀ - ε) x₀ Xhf:Filter.Tendsto f (nhdsWithin x₀ (Set.Ioo (x₀ - ε) x₀)) (nhds (f x₀))h1:Set.Ioo (x₀ - ε) x₀ nhdsWithin x₀ (Set.Iio x₀)Set.Ioo (x₀ - ε) x₀ Set.Iio x₀ = Set.Ioo (x₀ - ε) x₀; All goals completed! 🐙

No jump for continuous functions

theorem jump_of_continuous {X:Set } {f: } {x₀:} (h : X nhds x₀) (hf: ContinuousWithinAt f X x₀) : jump f x₀ = 0 := X:Set f: x₀:h:X nhds x₀hf:ContinuousWithinAt f X x₀jump f x₀ = 0 X:Set f: x₀:h: l u, x₀ Set.Ioo l u Set.Ioo l u Xhf:ContinuousWithinAt f X x₀jump f x₀ = 0 X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hx₀:x₀ Set.Ioo l uhX:Set.Ioo l u Xjump f x₀ = 0; X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < ujump f x₀ = 0 have hl : ε>0, .Ioc (x₀-ε) x₀ X := x₀-l, X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < ux₀ - l > 0 All goals completed! 🐙, Set.Subset.trans (X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < uSet.Ioc (x₀ - (x₀ - l)) x₀ Set.Ioo l u intro x X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < ux:h1:x₀ - (x₀ - l) < xh2:x x₀x Set.Ioo l u; exact X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < ux:h1:x₀ - (x₀ - l) < xh2:x x₀l < x All goals completed! 🐙, X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < ux:h1:x₀ - (x₀ - l) < xh2:x x₀x < u All goals completed! 🐙) hX have hu : ε>0, .Ico x₀ (x₀+ε) X := u-x₀, X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < uhl: ε > 0, Set.Ioc (x₀ - ε) x₀ Xu - x₀ > 0 All goals completed! 🐙, Set.Subset.trans (X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < uhl: ε > 0, Set.Ioc (x₀ - ε) x₀ XSet.Ico x₀ (x₀ + (u - x₀)) Set.Ioo l u intro x X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < uhl: ε > 0, Set.Ioc (x₀ - ε) x₀ Xx:h1:x₀ xh2:x < x₀ + (u - x₀)x Set.Ioo l u; exact X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < uhl: ε > 0, Set.Ioc (x₀ - ε) x₀ Xx:h1:x₀ xh2:x < x₀ + (u - x₀)l < x All goals completed! 🐙, X:Set f: x₀:hf:ContinuousWithinAt f X x₀l:u:hX:Set.Ioo l u Xhx₀:l < x₀ x₀ < uhl: ε > 0, Set.Ioc (x₀ - ε) x₀ Xx:h1:x₀ xh2:x < x₀ + (u - x₀)x < u All goals completed! 🐙) hX All goals completed! 🐙

Right limits exist for monotone functions

theorem right_lim_of_monotone {f: } (x₀:) (hf: Monotone f) : Convergesto (.Ioi x₀) f (sInf (f '' .Ioi x₀)) x₀ := f: x₀:hf:Monotone fConvergesto (Set.Ioi x₀) f (sInf (f '' Set.Ioi x₀)) x₀ f: x₀:hf:Monotone fFilter.Tendsto f (nhdsWithin x₀ (Set.Ioi x₀)) (nhds (sInf (f '' Set.Ioi x₀))) f: x₀:hf:Monotone fBddBelow (f '' Set.Ioi x₀) f: x₀:hf:Monotone f x, y f '' Set.Ioi x₀, x y; f: x₀:hf:Monotone f y f '' Set.Ioi x₀, f x₀ y; intro y f: x₀:hf:Monotone fy:hy:y f '' Set.Ioi x₀f x₀ y; f: x₀:hf:Monotone fy:hy: x, x₀ < x f x = yf x₀ y; f: x₀:hf:Monotone fx:hx:x₀ < xf x₀ f x; f: x₀:hf:Monotone fx:hx:x₀ < xx₀ x; All goals completed! 🐙
theorem right_lim_of_monotone' {f: } (x₀:) (hf: Monotone f) : right_lim f x₀ = sInf (f '' .Ioi x₀) := right_lim_def (right_lim_of_monotone x₀ hf)

Left limits exist for monotone functions

theorem left_lim_of_monotone {f: } (x₀:) (hf: Monotone f) : Convergesto (.Iio x₀) f (sSup (f '' .Iio x₀)) x₀ := f: x₀:hf:Monotone fConvergesto (Set.Iio x₀) f (sSup (f '' Set.Iio x₀)) x₀ f: x₀:hf:Monotone fFilter.Tendsto f (nhdsWithin x₀ (Set.Iio x₀)) (nhds (sSup (f '' Set.Iio x₀))) f: x₀:hf:Monotone fBddAbove (f '' Set.Iio x₀) f: x₀:hf:Monotone f x, y f '' Set.Iio x₀, y x; f: x₀:hf:Monotone f y f '' Set.Iio x₀, y f x₀; intro y f: x₀:hf:Monotone fy:hy:y f '' Set.Iio x₀y f x₀; f: x₀:hf:Monotone fy:hy: x < x₀, f x = yy f x₀; f: x₀:hf:Monotone fx:hx:x < x₀f x f x₀; f: x₀:hf:Monotone fx:hx:x < x₀x x₀; All goals completed! 🐙
theorem left_lim_of_monotone' {f: } (x₀:) (hf: Monotone f) : left_lim f x₀ = sSup (f '' .Iio x₀) := left_lim_def (left_lim_of_monotone x₀ hf)theorem jump_of_monotone {f: } (x₀:) (hf: Monotone f) : 0 jump f x₀ := f: x₀:hf:Monotone f0 jump f x₀ f: x₀:hf:Monotone fsSup (f '' Set.Iio x₀) sInf (f '' Set.Ioi x₀) apply csSup_le (f: x₀:hf:Monotone f(f '' Set.Iio x₀).Nonempty All goals completed! 🐙); intro a f: x₀:hf:Monotone fa:ha:a f '' Set.Iio x₀a sInf (f '' Set.Ioi x₀) apply le_csInf (f: x₀:hf:Monotone fa:ha:a f '' Set.Iio x₀(f '' Set.Ioi x₀).Nonempty All goals completed! 🐙); intro b f: x₀:hf:Monotone fa:ha:a f '' Set.Iio x₀b:hb:b f '' Set.Ioi x₀a b; f: x₀:hf:Monotone fa:b:ha: x < x₀, f x = ahb: x, x₀ < x f x = ba b f: x₀:hf:Monotone fb:hb: x, x₀ < x f x = bx:hx:x < x₀f x b; f: x₀:hf:Monotone fx:hx:x < x₀y:hy:x₀ < yf x f y f: x₀:hf:Monotone fx:hx:x < x₀y:hy:x₀ < yx y; All goals completed! 🐙theorem right_lim_le_left_lim_of_monotone {f: } {a b:} (hab: a < b) (hf: Monotone f) : right_lim f a left_lim f b := f: a:b:hab:a < bhf:Monotone fright_lim f a left_lim f b f: a:b:hab:a < bhf:Monotone fsInf (f '' Set.Ioi a) sSup (f '' Set.Iio b) calc _ f ((a+b)/2) := f: a:b:hab:a < bhf:Monotone fsInf (f '' Set.Ioi a) f ((a + b) / 2) f: a:b:hab:a < bhf:Monotone fBddBelow (f '' Set.Ioi a)f: a:b:hab:a < bhf:Monotone ff ((a + b) / 2) f '' Set.Ioi a f: a:b:hab:a < bhf:Monotone fBddBelow (f '' Set.Ioi a) f: a:b:hab:a < bhf:Monotone f x, y f '' Set.Ioi a, x y; f: a:b:hab:a < bhf:Monotone f y f '' Set.Ioi a, f a y; intro y f: a:b:hab:a < bhf:Monotone fy:hy:y f '' Set.Ioi af a y; f: a:b:hab:a < bhf:Monotone fy:hy: x, a < x f x = yf a y; f: a:b:hab:a < bhf:Monotone fx:hx:a < xf a f x; f: a:b:hab:a < bhf:Monotone fx:hx:a < xa x; All goals completed! 🐙 f: a:b:hab:a < bhf:Monotone f x, a < x f x = f ((a + b) / 2); f: a:b:hab:a < bhf:Monotone fa < (a + b) / 2 f ((a + b) / 2) = f ((a + b) / 2); f: a:b:hab:a < bhf:Monotone fa < (a + b) / 2; All goals completed! 🐙 _ _ := f: a:b:hab:a < bhf:Monotone ff ((a + b) / 2) sSup (f '' Set.Iio b) f: a:b:hab:a < bhf:Monotone fBddAbove (f '' Set.Iio b)f: a:b:hab:a < bhf:Monotone ff ((a + b) / 2) f '' Set.Iio b f: a:b:hab:a < bhf:Monotone fBddAbove (f '' Set.Iio b) f: a:b:hab:a < bhf:Monotone f x, y f '' Set.Iio b, y x; f: a:b:hab:a < bhf:Monotone f y f '' Set.Iio b, y f b; intro y f: a:b:hab:a < bhf:Monotone fy:hy:y f '' Set.Iio by f b; f: a:b:hab:a < bhf:Monotone fy:hy: x < b, f x = yy f b; f: a:b:hab:a < bhf:Monotone fx:hx:x < bf x f b; f: a:b:hab:a < bhf:Monotone fx:hx:x < bx b; All goals completed! 🐙 f: a:b:hab:a < bhf:Monotone f x < b, f x = f ((a + b) / 2); f: a:b:hab:a < bhf:Monotone f(a + b) / 2 < b f ((a + b) / 2) = f ((a + b) / 2); f: a:b:hab:a < bhf:Monotone f(a + b) / 2 < b; All goals completed! 🐙

Definition 11.8.1

noncomputable abbrev α_length (α: ) (I: BoundedInterval) : := match I with | Icc a b => if a b then (right_lim α b) - (left_lim α a) else 0 | Ico a b => if a b then (left_lim α b) - (left_lim α a) else 0 | Ioc a b => if a b then (right_lim α b) - (right_lim α a) else 0 | Ioo a b => if a < b then (left_lim α b) - (right_lim α a) else 0
syntax:max term "[" term "]ₗ" : termmacro_rules | `($α[$I]ₗ) => `(α_length $α $I)theorem α_length_of_empty (α: ) {I: BoundedInterval} (hI: (I:Set ) = ) : α[I]ₗ = 0 := match I with α: I:BoundedIntervala✝:b✝:hI:(Icc a✝ b✝) = α_length α (Icc a✝ b✝) = 0 α: I:BoundedIntervala✝:b✝:hI:(Icc a✝ b✝) = α_length α (Icc a✝ b✝) = 0 α: I:BoundedIntervala✝:b✝:hI:b✝ < a✝a✝ b✝ right_lim α b✝ - left_lim α a✝ = 0; All goals completed! 🐙 α: I:BoundedIntervala:b:hI:(Ico a b) = α_length α (Ico a b) = 0 α: I:BoundedIntervala:b:hI:(Ico a b) = α_length α (Ico a b) = 0 α: I:BoundedIntervala:b:hI:b aa b left_lim α b - left_lim α a = 0; α: I:BoundedIntervala:b:hI:b ah:a bleft_lim α b - left_lim α a = 0; α: I:BoundedIntervala:b:hI:b ah:a bthis:b = aleft_lim α b - left_lim α a = 0; α: I:BoundedIntervalb:hI:b bh:b bleft_lim α b - left_lim α b = 0; All goals completed! 🐙 α: I:BoundedIntervala:b:hI:(Ioc a b) = α_length α (Ioc a b) = 0 α: I:BoundedIntervala:b:hI:(Ioc a b) = α_length α (Ioc a b) = 0 α: I:BoundedIntervala:b:hI:b aa b right_lim α b - right_lim α a = 0; α: I:BoundedIntervala:b:hI:b ah:a bright_lim α b - right_lim α a = 0; α: I:BoundedIntervala:b:hI:b ah:a bthis:b = aright_lim α b - right_lim α a = 0; α: I:BoundedIntervalb:hI:b bh:b bright_lim α b - right_lim α b = 0; All goals completed! 🐙 α: I:BoundedIntervala✝:b✝:hI:(Ioo a✝ b✝) = α_length α (Ioo a✝ b✝) = 0 α: I:BoundedIntervala✝:b✝:hI:(Ioo a✝ b✝) = α_length α (Ioo a✝ b✝) = 0 α: I:BoundedIntervala✝:b✝:hI:b✝ a✝a✝ < b✝ left_lim α b✝ - right_lim α a✝ = 0; All goals completed! 🐙@[simp] theorem α_length_of_pt {α: } (a:) : α[Icc a a]ₗ = jump α a := α: a:α_length α (Icc a a) = jump α a All goals completed! 🐙theorem α_length_of_cts {α: } {I: BoundedInterval} {a b: } (haa: a < I.a) (hab: I.a I.b) (hbb: I.b < b) (hI : I Ioo a b) (: ContinuousOn α (Ioo a b)) : α[I]ₗ = α I.b - α I.a := α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)α_length α I = α I.b - α I.a have ha_left : left_lim α I.a = α I.a := α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)α_length α I = α I.b - α I.a apply left_lim_of_continuous _ (.continuousWithinAt (α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)I.a (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)a < I.a I.a < b; All goals completed! 🐙)) exact I.a - a, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)I.a - a > 0 All goals completed! 🐙, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)Set.Ioc (I.a - (I.a - a)) I.a (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)a✝:a✝ Set.Ioc (I.a - (I.a - a)) I.a a✝ (Ioo a b); α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)a✝:a < a✝ a✝ I.a a < a✝ a✝ < b; All goals completed! 🐙 have ha_right : right_lim α I.a = α I.a := α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)α_length α I = α I.b - α I.a apply right_lim_of_continuous _ (.continuousWithinAt (α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aI.a (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aa < I.a I.a < b; All goals completed! 🐙)) exact b - I.a, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.ab - I.a > 0 All goals completed! 🐙, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aSet.Ico I.a (I.a + (b - I.a)) (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aa✝:a✝ Set.Ico I.a (I.a + (b - I.a)) a✝ (Ioo a b); α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aa✝:I.a a✝ a✝ < b a < a✝ a✝ < b; All goals completed! 🐙 have hb_left : left_lim α I.b = α I.b := α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)α_length α I = α I.b - α I.a apply left_lim_of_continuous _ (.continuousWithinAt (α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.aI.b (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.aa < I.b I.b < b; All goals completed! 🐙)) exact I.b - a, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.aI.b - a > 0 All goals completed! 🐙, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.aSet.Ioc (I.b - (I.b - a)) I.b (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.aa✝:a✝ Set.Ioc (I.b - (I.b - a)) I.b a✝ (Ioo a b); α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.aa✝:a < a✝ a✝ I.b a < a✝ a✝ < b; All goals completed! 🐙 have hb_right : right_lim α I.b = α I.b := α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)α_length α I = α I.b - α I.a apply right_lim_of_continuous _ (.continuousWithinAt (α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.ahb_left:left_lim α I.b = α I.bI.b (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.ahb_left:left_lim α I.b = α I.ba < I.b I.b < b; All goals completed! 🐙)) exact b - I.b, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.ahb_left:left_lim α I.b = α I.bb - I.b > 0 All goals completed! 🐙, α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.ahb_left:left_lim α I.b = α I.bSet.Ico I.b (I.b + (b - I.b)) (Ioo a b) α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.ahb_left:left_lim α I.b = α I.ba✝:a✝ Set.Ico I.b (I.b + (b - I.b)) a✝ (Ioo a b); α: I:BoundedIntervala:b:haa:a < I.ahab:I.a I.bhbb:I.b < bhI:I Ioo a b:ContinuousOn α (Ioo a b)ha_left:left_lim α I.a = α I.aha_right:right_lim α I.a = α I.ahb_left:left_lim α I.b = α I.ba✝:I.b a✝ a✝ < b a < a✝ a✝ < b; All goals completed! 🐙 cases I with α: a:b::ContinuousOn α (Ioo a b)a✝:b✝:haa:a < (Icc a✝ b✝).ahab:(Icc a✝ b✝).a (Icc a✝ b✝).bhbb:(Icc a✝ b✝).b < bhI:Icc a✝ b✝ Ioo a bha_left:left_lim α (Icc a✝ b✝).a = α (Icc a✝ b✝).aha_right:right_lim α (Icc a✝ b✝).a = α (Icc a✝ b✝).ahb_left:left_lim α (Icc a✝ b✝).b = α (Icc a✝ b✝).bhb_right:right_lim α (Icc a✝ b✝).b = α (Icc a✝ b✝).bα_length α (Icc a✝ b✝) = α (Icc a✝ b✝).b - α (Icc a✝ b✝).a All goals completed! 🐙 α: a:b::ContinuousOn α (Ioo a b)a✝:b✝:haa:a < (Ico a✝ b✝).ahab:(Ico a✝ b✝).a (Ico a✝ b✝).bhbb:(Ico a✝ b✝).b < bhI:Ico a✝ b✝ Ioo a bha_left:left_lim α (Ico a✝ b✝).a = α (Ico a✝ b✝).aha_right:right_lim α (Ico a✝ b✝).a = α (Ico a✝ b✝).ahb_left:left_lim α (Ico a✝ b✝).b = α (Ico a✝ b✝).bhb_right:right_lim α (Ico a✝ b✝).b = α (Ico a✝ b✝).bα_length α (Ico a✝ b✝) = α (Ico a✝ b✝).b - α (Ico a✝ b✝).a All goals completed! 🐙 α: a:b::ContinuousOn α (Ioo a b)a✝:b✝:haa:a < (Ioc a✝ b✝).ahab:(Ioc a✝ b✝).a (Ioc a✝ b✝).bhbb:(Ioc a✝ b✝).b < bhI:Ioc a✝ b✝ Ioo a bha_left:left_lim α (Ioc a✝ b✝).a = α (Ioc a✝ b✝).aha_right:right_lim α (Ioc a✝ b✝).a = α (Ioc a✝ b✝).ahb_left:left_lim α (Ioc a✝ b✝).b = α (Ioc a✝ b✝).bhb_right:right_lim α (Ioc a✝ b✝).b = α (Ioc a✝ b✝).bα_length α (Ioc a✝ b✝) = α (Ioc a✝ b✝).b - α (Ioc a✝ b✝).a All goals completed! 🐙 α: a:b::ContinuousOn α (Ioo a b)a✝:b✝:haa:a < (Ioo a✝ b✝).ahab:(Ioo a✝ b✝).a (Ioo a✝ b✝).bhbb:(Ioo a✝ b✝).b < bhI:Ioo a✝ b✝ Ioo a bha_left:left_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).aha_right:right_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).ahb_left:left_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bhb_right:right_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bα_length α (Ioo a✝ b✝) = α (Ioo a✝ b✝).b - α (Ioo a✝ b✝).a α: a:b::ContinuousOn α (Ioo a b)a✝:b✝:haa:a < (Ioo a✝ b✝).ahab:(Ioo a✝ b✝).a (Ioo a✝ b✝).bhbb:(Ioo a✝ b✝).b < bhI:Ioo a✝ b✝ Ioo a bha_left:left_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).aha_right:right_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).ahb_left:left_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bhb_right:right_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bb✝ a✝ 0 = α (Ioo a✝ b✝).b - α (Ioo a✝ b✝).a; α: a:b::ContinuousOn α (Ioo a b)a✝:b✝:haa:a < (Ioo a✝ b✝).ahab:(Ioo a✝ b✝).a (Ioo a✝ b✝).bhbb:(Ioo a✝ b✝).b < bhI:Ioo a✝ b✝ Ioo a bha_left:left_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).aha_right:right_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).ahb_left:left_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bhb_right:right_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bh:b✝ a✝0 = α (Ioo a✝ b✝).b - α (Ioo a✝ b✝).a; have := le_antisymm h (α: a:b::ContinuousOn α (Ioo a b)a✝:b✝:haa:a < (Ioo a✝ b✝).ahab:(Ioo a✝ b✝).a (Ioo a✝ b✝).bhbb:(Ioo a✝ b✝).b < bhI:Ioo a✝ b✝ Ioo a bha_left:left_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).aha_right:right_lim α (Ioo a✝ b✝).a = α (Ioo a✝ b✝).ahb_left:left_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bhb_right:right_lim α (Ioo a✝ b✝).b = α (Ioo a✝ b✝).bh:b✝ a✝a✝ b✝ All goals completed! 🐙); α: a:b::ContinuousOn α (Ioo a b)b✝:haa:a < (Ioo b✝ b✝).ahab:(Ioo b✝ b✝).a (Ioo b✝ b✝).bhbb:(Ioo b✝ b✝).b < bhI:Ioo b✝ b✝ Ioo a bha_left:left_lim α (Ioo b✝ b✝).a = α (Ioo b✝ b✝).aha_right:right_lim α (Ioo b✝ b✝).a = α (Ioo b✝ b✝).ahb_left:left_lim α (Ioo b✝ b✝).b = α (Ioo b✝ b✝).bhb_right:right_lim α (Ioo b✝ b✝).b = α (Ioo b✝ b✝).bh:b✝ b✝0 = α (Ioo b✝ b✝).b - α (Ioo b✝ b✝).a; All goals completed! 🐙/-- Example 11.8.2-/ declaration uses `sorry`example : (fun x x^2)[Icc 2 3]ₗ = 5 := α_length (fun x x ^ 2) (Icc 2 3) = 5 All goals completed! 🐙declaration uses `sorry`example : (fun x x^2)[Icc 2 2]ₗ = 0 := α_length (fun x x ^ 2) (Icc 2 2) = 0 All goals completed! 🐙declaration uses `sorry`example : (fun x x^2)[Ioo 2 2]ₗ = 0 := α_length (fun x x ^ 2) (Ioo 2 2) = 0 All goals completed! 🐙

Example 11.8.3

@[simp] theorem declaration uses `sorry`α_len_of_id (I: BoundedInterval) : (fun x x)[I]ₗ = |I|ₗ := I:BoundedIntervalα_length (fun x x) I = I.length All goals completed! 🐙

An improved version of BoundedInterval.­joins that also controls α_length.

abbrev BoundedInterval.joins' (K I J: BoundedInterval) : Prop := K.joins I J α: , α[K]ₗ = α[I]ₗ + α[J]ₗ
theorem BoundedInterval.join_Icc_Ioc' {a b c:} (hab: a b) (hbc: b c) : (Icc a c).joins' (Icc a b) (Ioc b c) := join_Icc_Ioc hab hbc, a:b:c:hab:a bhbc:b c (α : ), α_length α (Icc a c) = α_length α (Icc a b) + α_length α (Ioc b c) All goals completed! 🐙 theorem BoundedInterval.join_Icc_Ioo' {a b c:} (hab: a b) (hbc: b < c) : (Ico a c).joins' (Icc a b) (Ioo b c) := join_Icc_Ioo hab hbc, a:b:c:hab:a bhbc:b < c (α : ), α_length α (Ico a c) = α_length α (Icc a b) + α_length α (Ioo b c) All goals completed! 🐙 theorem BoundedInterval.join_Ioc_Ioc' {a b c:} (hab: a b) (hbc: b c) : (Ioc a c).joins' (Ioc a b) (Ioc b c) := join_Ioc_Ioc hab hbc, a:b:c:hab:a bhbc:b c (α : ), α_length α (Ioc a c) = α_length α (Ioc a b) + α_length α (Ioc b c) All goals completed! 🐙 theorem BoundedInterval.join_Ioc_Ioo' {a b c:} (hab: a b) (hbc: b < c) : (Ioo a c).joins' (Ioc a b) (Ioo b c) := join_Ioc_Ioo hab hbc, a:b:c:hab:a bhbc:b < c (α : ), α_length α (Ioo a c) = α_length α (Ioc a b) + α_length α (Ioo b c) All goals completed! 🐙 theorem BoundedInterval.join_Ico_Icc' {a b c:} (hab: a b) (hbc: b c) : (Icc a c).joins' (Ico a b) (Icc b c) := join_Ico_Icc hab hbc, a:b:c:hab:a bhbc:b c (α : ), α_length α (Icc a c) = α_length α (Ico a b) + α_length α (Icc b c) All goals completed! 🐙 theorem BoundedInterval.join_Ico_Ico' {a b c:} (hab: a b) (hbc: b c) : (Ico a c).joins' (Ico a b) (Ico b c) := join_Ico_Ico hab hbc, a:b:c:hab:a bhbc:b c (α : ), α_length α (Ico a c) = α_length α (Ico a b) + α_length α (Ico b c) All goals completed! 🐙 theorem BoundedInterval.join_Ioo_Icc' {a b c:} (hab: a < b) (hbc: b c) : (Ioc a c).joins' (Ioo a b) (Icc b c) := join_Ioo_Icc hab hbc, a:b:c:hab:a < bhbc:b c (α : ), α_length α (Ioc a c) = α_length α (Ioo a b) + α_length α (Icc b c) All goals completed! 🐙 theorem BoundedInterval.join_Ioo_Ico' {a b c:} (hab: a < b) (hbc: b c) : (Ioo a c).joins' (Ioo a b) (Ico b c) := join_Ioo_Ico hab hbc, a:b:c:hab:a < bhbc:b c (α : ), α_length α (Ioo a c) = α_length α (Ioo a b) + α_length α (Ico b c) All goals completed! 🐙

Theorem 11.8.4 / Exercise 11.8.1

theorem declaration uses `sorry`Partition.sum_of_α_length {I: BoundedInterval} (P: Partition I) (α: ) : J P.intervals, α[J]ₗ = α[I]ₗ := I:BoundedIntervalP:Partition Iα: J P.intervals, α_length α J = α_length α I All goals completed! 🐙

Definition 11.8.5 (Piecewise constant RS integral)

noncomputable abbrev PiecewiseConstantWith.RS_integ (f: ) {I: BoundedInterval} (P: Partition I) (α: ) : := J P.intervals, constant_value_on f (J:Set ) * α[J]ₗ

Example 11.8.6

noncomputable abbrev f_11_8_6 (x:) : := if x < 2 then 4 else 2
noncomputable abbrev P_11_8_6 : Partition (Icc 1 3) := (: Partition (Ico 1 2)).join ( : Partition (Icc 2 3)) (join_Ico_Icc (1 2 All goals completed! 🐙) (2 3 All goals completed! 🐙) )theorem declaration uses `sorry`f_11_8_6_RS_integ : PiecewiseConstantWith.RS_integ f_11_8_6 P_11_8_6 (fun x x) = 22 := (PiecewiseConstantWith.RS_integ f_11_8_6 P_11_8_6 fun x x) = 22 All goals completed! 🐙

Example 11.8.7

theorem declaration uses `sorry`PiecewiseConstantWith.RS_integ_eq_integ {f: } {I: BoundedInterval} (P: Partition I) :RS_integ f P (fun x x) = integ f P := f: I:BoundedIntervalP:Partition I(RS_integ f P fun x x) = integ f P All goals completed! 🐙

Analogue of Proposition 11.2.13

theorem declaration uses `sorry`PiecewiseConstantWith.RS_integ_eq {f: } {I: BoundedInterval} {P P': Partition I} (hP: PiecewiseConstantWith f P) (hP': PiecewiseConstantWith f P') (α: ): RS_integ f P α = RS_integ f P' α := f: I:BoundedIntervalP:Partition IP':Partition IhP:PiecewiseConstantWith f PhP':PiecewiseConstantWith f P'α: RS_integ f P α = RS_integ f P' α All goals completed! 🐙
open Classical in noncomputable abbrev PiecewiseConstantOn.RS_integ (f: ) (I: BoundedInterval) (α: ): := if h: PiecewiseConstantOn f I then PiecewiseConstantWith.RS_integ f h.choose α else 0theorem PiecewiseConstantOn.RS_integ_def {f: } {I: BoundedInterval} {P: Partition I} (h: PiecewiseConstantWith f P) (α: ) : RS_integ f I α = PiecewiseConstantWith.RS_integ f P α := f: I:BoundedIntervalP:Partition Ih:PiecewiseConstantWith f Pα: RS_integ f I α = PiecewiseConstantWith.RS_integ f P α have h' : PiecewiseConstantOn f I := f: I:BoundedIntervalP:Partition Ih:PiecewiseConstantWith f Pα: RS_integ f I α = PiecewiseConstantWith.RS_integ f P α All goals completed! 🐙 f: I:BoundedIntervalP:Partition Ih:PiecewiseConstantWith f Pα: h':PiecewiseConstantOn f IPiecewiseConstantWith.RS_integ f (Exists.choose ) α = PiecewiseConstantWith.RS_integ f P α; All goals completed! 🐙

α_length non-negative when α monotone

theorem declaration uses `sorry`α_length_nonneg_of_monotone {α: } (: Monotone α) (I: BoundedInterval): 0 α[I]ₗ := α: :Monotone αI:BoundedInterval0 α_length α I All goals completed! 🐙

Analogue of Theorem 11.2.16 (a) (Laws of integration) / Exercise 11.8.3

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_add {f g: } {I: BoundedInterval} (hf: PiecewiseConstantOn f I) (hg: PiecewiseConstantOn g I) {α: } (: Monotone α): RS_integ (f + g) I α = RS_integ f I α + RS_integ g I α := f: g: I:BoundedIntervalhf:PiecewiseConstantOn f Ihg:PiecewiseConstantOn g Iα: :Monotone αRS_integ (f + g) I α = RS_integ f I α + RS_integ g I α All goals completed! 🐙

Analogue of Theorem 11.2.16 (b) (Laws of integration) / Exercise 11.8.3

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_smul {f: } {I: BoundedInterval} (c:) (hf: PiecewiseConstantOn f I) {α: } (: Monotone α) : RS_integ (c f) I α = c * RS_integ f I α := f: I:BoundedIntervalc:hf:PiecewiseConstantOn f Iα: :Monotone αRS_integ (c f) I α = c * RS_integ f I α All goals completed! 🐙

Theorem 11.8.8 (c) (Laws of RS integration) / Exercise 11.8.8

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_sub {f g: } {I: BoundedInterval} {α: } (: Monotone α) (hf: PiecewiseConstantOn f I) (hg: PiecewiseConstantOn g I) : RS_integ (f - g) I α = RS_integ f I α - RS_integ g I α := f: g: I:BoundedIntervalα: :Monotone αhf:PiecewiseConstantOn f Ihg:PiecewiseConstantOn g IRS_integ (f - g) I α = RS_integ f I α - RS_integ g I α All goals completed! 🐙

Theorem 11.8.8 (d) (Laws of RS integration) / Exercise 11.8.8

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_of_nonneg {f: } {I: BoundedInterval} {α: } (: Monotone α) (h: x I, 0 f x) (hf: PiecewiseConstantOn f I) : 0 RS_integ f I α := f: I:BoundedIntervalα: :Monotone αh: x I, 0 f xhf:PiecewiseConstantOn f I0 RS_integ f I α All goals completed! 🐙

Theorem 11.8.8 (e) (Laws of RS integration) / Exercise 11.8.8

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_mono {f g: } {I: BoundedInterval} {α: } (: Monotone α) (h: x I, f x g x) (hf: PiecewiseConstantOn f I) (hg: PiecewiseConstantOn g I) : RS_integ f I α RS_integ g I α := f: g: I:BoundedIntervalα: :Monotone αh: x I, f x g xhf:PiecewiseConstantOn f Ihg:PiecewiseConstantOn g IRS_integ f I α RS_integ g I α All goals completed! 🐙

Theorem 11.8.8 (f) (Laws of RS integration) / Exercise 11.8.8

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_const (c: ) (I: BoundedInterval) {α: } (: Monotone α) : RS_integ (fun _ c) I α = c * α[I]ₗ := c:I:BoundedIntervalα: :Monotone αRS_integ (fun x c) I α = c * α_length α I All goals completed! 🐙

Theorem 11.8.8 (f) (Laws of RS integration) / Exercise 11.8.8

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_const' {f: } {I: BoundedInterval} {α: } (: Monotone α) (h: ConstantOn f I) : RS_integ f I α = (constant_value_on f I) * α[I]ₗ := f: I:BoundedIntervalα: :Monotone αh:ConstantOn f IRS_integ f I α = constant_value_on f I * α_length α I All goals completed! 🐙

Theorem 11.8.8 (g) (Laws of RS integration) / Exercise 11.8.8

open Classical intheorem declaration uses `sorry`PiecewiseConstantOn.RS_of_extend {I J: BoundedInterval} (hIJ: I J) {f: } (h: PiecewiseConstantOn f I) {α: } (: Monotone α): PiecewiseConstantOn (fun x if x I then f x else 0) J := I:BoundedIntervalJ:BoundedIntervalhIJ:I Jf: h:PiecewiseConstantOn f Iα: :Monotone αPiecewiseConstantOn (fun x if x I then f x else 0) J All goals completed! 🐙

Theorem 11.8.8 (g) (Laws of RS integration) / Exercise 11.8.8

open Classical intheorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_of_extend {I J: BoundedInterval} (hIJ: I J) {f: } (h: PiecewiseConstantOn f I) {α: } (: Monotone α): RS_integ (fun x if x I then f x else 0) J α = RS_integ f I α := I:BoundedIntervalJ:BoundedIntervalhIJ:I Jf: h:PiecewiseConstantOn f Iα: :Monotone αRS_integ (fun x if x I then f x else 0) J α = RS_integ f I α All goals completed! 🐙

Theorem 11.8.8 (h) (Laws of RS integration) / Exercise 11.8.8

theorem declaration uses `sorry`PiecewiseConstantOn.RS_integ_of_join {I J K: BoundedInterval} (hIJK: K.joins' I J) {f: } (h: PiecewiseConstantOn f K) {α: } (: Monotone α): RS_integ f K α = RS_integ f I α + RS_integ f J α := I:BoundedIntervalJ:BoundedIntervalK:BoundedIntervalhIJK:K.joins' I Jf: h:PiecewiseConstantOn f Kα: :Monotone αRS_integ f K α = RS_integ f I α + RS_integ f J α All goals completed! 🐙

Analogue of Definition 11.3.2 (Uppper and lower Riemann integrals )

noncomputable abbrev upper_RS_integral (f: ) (I: BoundedInterval) (α: ): := sInf ((PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I})
noncomputable abbrev lower_RS_integral (f: ) (I: BoundedInterval) (α: ): := sSup ((PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I})lemma RS_integral_bound_upper_of_bounded {f: } {M:} {I: BoundedInterval} (h: x (I:Set ), |f x| M) {α: } (:Monotone α) : M * α[I]ₗ (PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I} := f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone αM * α_length α I (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I} f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone α x, (MajorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = M * α_length α I; f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone αMajorizesOn (fun x M) f If: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone αPiecewiseConstantOn (fun x M) I f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone αMajorizesOn (fun x M) f I All goals completed! 🐙 exact (ConstantOn.of_const (c := M) (f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone α x I, M = M All goals completed! 🐙)).piecewiseConstantOnlemma RS_integral_bound_lower_of_bounded {f: } {M:} {I: BoundedInterval} (h: x (I:Set ), |f x| M) {α: } (:Monotone α) : -M * α[I]ₗ (PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I} := f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone α-M * α_length α I (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I} f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone α x, (MinorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = -(M * α_length α I); refine fun _ -M, ?_, ?_ , f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone αPiecewiseConstantOn.RS_integ (fun x -M) I α = -(M * α_length α I) f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone α-(M * α_length α I) = -M * α_length α I; All goals completed! 🐙 f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone αMinorizesOn (fun x -M) f I All goals completed! 🐙 exact (ConstantOn.of_const (c := -M) (f: M:I:BoundedIntervalh: x I, |f x| Mα: :Monotone α x I, -M = -M All goals completed! 🐙)).piecewiseConstantOnlemma RS_integral_bound_upper_nonempty {f: } {I: BoundedInterval} (h: BddOn f I) {α: } (: Monotone α) : ((PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}).Nonempty := f: I:BoundedIntervalh:BddOn f Iα: :Monotone α((fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}).Nonempty f: I:BoundedIntervalα: :Monotone αM:h: x I, |f x| M((fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}).Nonempty; All goals completed! 🐙lemma RS_integral_bound_lower_nonempty {f: } {I: BoundedInterval} (h: BddOn f I) {α: } (: Monotone α) : ((PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}).Nonempty := f: I:BoundedIntervalh:BddOn f Iα: :Monotone α((fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}).Nonempty f: I:BoundedIntervalα: :Monotone αM:h: x I, |f x| M((fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}).Nonempty; All goals completed! 🐙lemma RS_integral_bound_lower_le_upper {f: } {I: BoundedInterval} {a b:} {α: } (: Monotone α) (ha: a (PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}) (hb: b (PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}) : b a:= f: I:BoundedIntervala:b:α: :Monotone αha:a (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}hb:b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}b a f: I:BoundedIntervala:b:α: :Monotone αha:a (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}hb:b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}g: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:(fun x PiecewiseConstantOn.RS_integ x I α) g = ab a f: I:BoundedIntervala:b:α: :Monotone αha:a (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}hb:b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}g: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:(fun x PiecewiseConstantOn.RS_integ x I α) g = ah: hmin:MinorizesOn h f Ihhp:PiecewiseConstantOn h Ihhi:(fun x PiecewiseConstantOn.RS_integ x I α) h = bb a f: I:BoundedIntervala:b:α: :Monotone αha:a (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}hb:b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}g: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:(fun x PiecewiseConstantOn.RS_integ x I α) g = ah: hmin:MinorizesOn h f Ihhp:PiecewiseConstantOn h Ihhi:(fun x PiecewiseConstantOn.RS_integ x I α) h = b(fun x PiecewiseConstantOn.RS_integ x I α) h (fun x PiecewiseConstantOn.RS_integ x I α) g; f: I:BoundedIntervala:b:α: :Monotone αha:a (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}hb:b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}g: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:(fun x PiecewiseConstantOn.RS_integ x I α) g = ah: hmin:MinorizesOn h f Ihhp:PiecewiseConstantOn h Ihhi:(fun x PiecewiseConstantOn.RS_integ x I α) h = b x I, h x g x; intro _ f: I:BoundedIntervala:b:α: :Monotone αha:a (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}hb:b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}g: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:(fun x PiecewiseConstantOn.RS_integ x I α) g = ah: hmin:MinorizesOn h f Ihhp:PiecewiseConstantOn h Ihhi:(fun x PiecewiseConstantOn.RS_integ x I α) h = bx✝:hx:x✝ Ih x✝ g x✝; All goals completed! 🐙lemma RS_integral_bound_below {f: } {I: BoundedInterval} (h: BddOn f I) {α: } (: Monotone α) : BddBelow ((PiecewiseConstantOn.RS_integ · I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}) := f: I:BoundedIntervalh:BddOn f Iα: :Monotone αBddBelow ((fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}) f: I:BoundedIntervalh:BddOn f Iα: :Monotone α x, y (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}, x y; f: I:BoundedIntervalh:BddOn f Iα: :Monotone α y (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}, .some y intro a f: I:BoundedIntervalh:BddOn f Iα: :Monotone αa:ha:a (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}.some a; All goals completed! 🐙lemma RS_integral_bound_above {f: } {I: BoundedInterval} (h: BddOn f I) {α: } (: Monotone α): BddAbove ((PiecewiseConstantOn.RS_integ · I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}) := f: I:BoundedIntervalh:BddOn f Iα: :Monotone αBddAbove ((fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}) f: I:BoundedIntervalh:BddOn f Iα: :Monotone α x, y (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}, y x; f: I:BoundedIntervalh:BddOn f Iα: :Monotone α y (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}, y .some intro b f: I:BoundedIntervalh:BddOn f Iα: :Monotone αb:hb:b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}b .some; All goals completed! 🐙lemma le_lower_RS_integral {f: } {I: BoundedInterval} {M:} (h: x (I:Set ), |f x| M) {α: } (: Monotone α) : -M * α[I]ₗ lower_RS_integral f I α := le_csSup (RS_integral_bound_above (BddOn.of_bounded h) ) (RS_integral_bound_lower_of_bounded h )lemma lower_RS_integral_le_upper {f: } {I: BoundedInterval} (h: BddOn f I) {α: } (: Monotone α) : lower_RS_integral f I α upper_RS_integral f I α := f: I:BoundedIntervalh:BddOn f Iα: :Monotone αlower_RS_integral f I α upper_RS_integral f I α f: I:BoundedIntervalh:BddOn f Iα: :Monotone α b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}, b upper_RS_integral f I α f: I:BoundedIntervalh:BddOn f Iα: :Monotone αb✝:a✝:b✝ (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}b✝ upper_RS_integral f I α f: I:BoundedIntervalh:BddOn f Iα: :Monotone αb✝:a✝:b✝ (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I} b (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}, b✝ b f: I:BoundedIntervalh:BddOn f Iα: :Monotone αb✝¹:a✝¹:b✝ (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}b✝:a✝:b✝ (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}b✝¹ b✝; All goals completed! 🐙lemma RS_upper_integral_le {f: } {I: BoundedInterval} {M:} (h: x (I:Set ), |f x| M) {α: } (: Monotone α) : upper_RS_integral f I α M * α[I]ₗ := csInf_le (RS_integral_bound_below (.of_bounded h) ) (RS_integral_bound_upper_of_bounded h )lemma upper_RS_integral_le_integ {f g: } {I: BoundedInterval} (hf: BddOn f I) (hfg: MajorizesOn g f I) (hg: PiecewiseConstantOn g I) {α: } (: Monotone α) : upper_RS_integral f I α PiecewiseConstantOn.RS_integ g I α := csInf_le (RS_integral_bound_below hf ) g, f: g: I:BoundedIntervalhf:BddOn f Ihfg:MajorizesOn g f Ihg:PiecewiseConstantOn g Iα: :Monotone αg {g | MajorizesOn g f I PiecewiseConstantOn g I} (fun x PiecewiseConstantOn.RS_integ x I α) g = PiecewiseConstantOn.RS_integ g I α All goals completed! 🐙 lemma integ_le_lower_RS_integral {f h: } {I: BoundedInterval} (hf: BddOn f I) (hfh: MinorizesOn h f I) (hg: PiecewiseConstantOn h I) {α: } (: Monotone α) : PiecewiseConstantOn.RS_integ h I α lower_RS_integral f I α := le_csSup (RS_integral_bound_above hf ) h, f: h: I:BoundedIntervalhf:BddOn f Ihfh:MinorizesOn h f Ihg:PiecewiseConstantOn h Iα: :Monotone αh {g | MinorizesOn g f I PiecewiseConstantOn g I} (fun x PiecewiseConstantOn.RS_integ x I α) h = PiecewiseConstantOn.RS_integ h I α All goals completed! 🐙 lemma lt_of_gt_upper_RS_integral {f: } {I: BoundedInterval} (hf: BddOn f I) {α: } (: Monotone α) {X:} (hX: upper_RS_integral f I α < X ) : g, MajorizesOn g f I PiecewiseConstantOn g I PiecewiseConstantOn.RS_integ g I α < X := f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:upper_RS_integral f I α < X g, MajorizesOn g f I PiecewiseConstantOn g I PiecewiseConstantOn.RS_integ g I α < X f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:upper_RS_integral f I α < XY:hY:Y (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MajorizesOn g f I PiecewiseConstantOn g I}hYX:Y < X g, MajorizesOn g f I PiecewiseConstantOn g I PiecewiseConstantOn.RS_integ g I α < X f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:upper_RS_integral f I α < XY:hYX:Y < XhY: x, (MajorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Y g, MajorizesOn g f I PiecewiseConstantOn g I PiecewiseConstantOn.RS_integ g I α < X; f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:upper_RS_integral f I α < XY:hYX:Y < XhY: x, (MajorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Yg: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:PiecewiseConstantOn.RS_integ g I α = Y g, MajorizesOn g f I PiecewiseConstantOn g I PiecewiseConstantOn.RS_integ g I α < X; exact g, hmaj, hgp, f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:upper_RS_integral f I α < XY:hYX:Y < XhY: x, (MajorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Yg: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:PiecewiseConstantOn.RS_integ g I α = YPiecewiseConstantOn.RS_integ g I α < X rwa [hgif: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:upper_RS_integral f I α < XY:hYX:Y < XhY: x, (MajorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Yg: hmaj:MajorizesOn g f Ihgp:PiecewiseConstantOn g Ihgi:PiecewiseConstantOn.RS_integ g I α = YY < X lemma gt_of_lt_lower_RS_integral {f: } {I: BoundedInterval} (hf: BddOn f I) {α: } (: Monotone α) {X:} (hX: X < lower_RS_integral f I α) : h, MinorizesOn h f I PiecewiseConstantOn h I X < PiecewiseConstantOn.RS_integ h I α := f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:X < lower_RS_integral f I α h, MinorizesOn h f I PiecewiseConstantOn h I X < PiecewiseConstantOn.RS_integ h I α f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:X < lower_RS_integral f I αY:hY:Y (fun x PiecewiseConstantOn.RS_integ x I α) '' {g | MinorizesOn g f I PiecewiseConstantOn g I}hYX:X < Y h, MinorizesOn h f I PiecewiseConstantOn h I X < PiecewiseConstantOn.RS_integ h I α f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:X < lower_RS_integral f I αY:hYX:X < YhY: x, (MinorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Y h, MinorizesOn h f I PiecewiseConstantOn h I X < PiecewiseConstantOn.RS_integ h I α; f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:X < lower_RS_integral f I αY:hYX:X < YhY: x, (MinorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Yh: hmin:MinorizesOn h f Ihhp:PiecewiseConstantOn h Ihhi:PiecewiseConstantOn.RS_integ h I α = Y h, MinorizesOn h f I PiecewiseConstantOn h I X < PiecewiseConstantOn.RS_integ h I α; exact h, hmin, hhp, f: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:X < lower_RS_integral f I αY:hYX:X < YhY: x, (MinorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Yh: hmin:MinorizesOn h f Ihhp:PiecewiseConstantOn h Ihhi:PiecewiseConstantOn.RS_integ h I α = YX < PiecewiseConstantOn.RS_integ h I α rwa [hhif: I:BoundedIntervalhf:BddOn f Iα: :Monotone αX:hX:X < lower_RS_integral f I αY:hYX:X < YhY: x, (MinorizesOn x f I PiecewiseConstantOn x I) PiecewiseConstantOn.RS_integ x I α = Yh: hmin:MinorizesOn h f Ihhp:PiecewiseConstantOn h Ihhi:PiecewiseConstantOn.RS_integ h I α = YX < Y

Analogue of Definition 11.3.4

noncomputable abbrev RS_integ (f: ) (I: BoundedInterval) (α: ) : := upper_RS_integral f I α
noncomputable abbrev RS_IntegrableOn (f: ) (I: BoundedInterval) (α: ) : Prop := BddOn f I lower_RS_integral f I α = upper_RS_integral f I α

Analogue of various components of Lemma 11.3.3

theorem declaration uses `sorry`upper_RS_integral_eq_upper_integral (f: ) (I: BoundedInterval) : upper_RS_integral f I (fun x x) = upper_integral f I := f: I:BoundedInterval(upper_RS_integral f I fun x x) = upper_integral f I All goals completed! 🐙
theorem declaration uses `sorry`lower_RS_integral_eq_lower_integral (f: ) (I: BoundedInterval) : lower_RS_integral f I (fun x x) = lower_integral f I := f: I:BoundedInterval(lower_RS_integral f I fun x x) = lower_integral f I All goals completed! 🐙theorem declaration uses `sorry`RS_integ_eq_integ (f: ) (I: BoundedInterval) : RS_integ f I (fun x x) = integ f I := f: I:BoundedInterval(RS_integ f I fun x x) = integ f I All goals completed! 🐙theorem declaration uses `sorry`RS_IntegrableOn_iff_IntegrableOn (f: ) (I: BoundedInterval) : RS_IntegrableOn f I (fun x x) IntegrableOn f I := f: I:BoundedInterval(RS_IntegrableOn f I fun x x) IntegrableOn f I All goals completed! 🐙

Exercise 11.8.4

theorem declaration uses `sorry`RS_integ_of_uniform_cts {I: BoundedInterval} {f: } (hf: UniformContinuousOn f I) {α: } (: Monotone α): RS_IntegrableOn f I α := I:BoundedIntervalf: hf:UniformContinuousOn f Iα: :Monotone αRS_IntegrableOn f I α All goals completed! 🐙

Exercise 11.8.5

theorem declaration uses `sorry`RS_integ_with_sign (f: ) (hf: ContinuousOn f (.Icc (-1) 1)) : RS_IntegrableOn f (Icc (-1) 1) Real.sign RS_integ f (Icc (-1) 1) (fun x -Real.sign x) = 2 * f 0 := f: hf:ContinuousOn f (Set.Icc (-1) 1)RS_IntegrableOn f (Icc (-1) 1) Real.sign (RS_integ f (Icc (-1) 1) fun x -x.sign) = 2 * f 0 All goals completed! 🐙

Analogue of Lemma 11.3.7

theorem declaration uses `sorry`RS_integ_of_piecewise_const {f: } {I: BoundedInterval} (hf: PiecewiseConstantOn f I) {α: } (: Monotone α): RS_IntegrableOn f I α RS_integ f I α = PiecewiseConstantOn.RS_integ f I α := f: I:BoundedIntervalhf:PiecewiseConstantOn f Iα: :Monotone αRS_IntegrableOn f I α RS_integ f I α = PiecewiseConstantOn.RS_integ f I α All goals completed! 🐙
end Chapter11