Imports
import Mathlib.Tactic import Mathlib.Topology.Instances.Irrational import Analysis.Section_11_4

Analysis I, Section 11.7: A non-Riemann integrable function

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:

  • An example of a bounded function on a compact interval that is not Riemann integrable.

namespace Chapter11open BoundedInterval Chapter9

Proposition 11.7.1

theorem not_integrable : BddOn f_9_3_21 (Icc 0 1) ¬ IntegrableOn f_9_3_21 (Icc 0 1) := BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) -- This proof is adapted from the structure of the original text. have hbdd: BddOn f_9_3_21 (Icc 0 1):= BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) x (Icc 0 1), |f_9_3_21 x| 1; intro x x:a✝:x (Icc 0 1)|f_9_3_21 x| 1; x:a✝:x (Icc 0 1)h: y, y = x|f_9_3_21 x| 1x:a✝:x (Icc 0 1)h:¬ y, y = x|f_9_3_21 x| 1 x:a✝:x (Icc 0 1)h: y, y = x|f_9_3_21 x| 1x:a✝:x (Icc 0 1)h:¬ y, y = x|f_9_3_21 x| 1 All goals completed! 🐙 hbdd:BddOn f_9_3_21 (Icc 0 1)¬IntegrableOn f_9_3_21 (Icc 0 1) have hsup (P: Partition (Icc 0 1)) : J P.intervals, (sSup (f_9_3_21 '' (J:Set ))) * |J|ₗ = |J|ₗ := BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) intro J hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalssSup (f_9_3_21 '' J) * J.length = J.length; hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:J.length = 0sSup (f_9_3_21 '' J) * J.length = J.lengthhbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬J.length = 0sSup (f_9_3_21 '' J) * J.length = J.length hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:J.length = 0sSup (f_9_3_21 '' J) * J.length = J.length All goals completed! 🐙 hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬J.length = 0hJ0':¬J.length = 0sSup (f_9_3_21 '' J) * J.length = J.length hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sSup (f_9_3_21 '' J) * J.length = J.length hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sSup (f_9_3_21 '' J) = 1 hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sSup (f_9_3_21 '' J) 1hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 01 sSup (f_9_3_21 '' J) hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sSup (f_9_3_21 '' J) 1 hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0(f_9_3_21 '' J).Nonemptyhbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0 b f_9_3_21 '' J, b 1 hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0(f_9_3_21 '' J).Nonempty hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':¬J.length = 0hJ0:f_9_3_21 '' J = Subsingleton J; All goals completed! 🐙 All goals completed! 🐙 apply le_csSup_of_le _ _ (show (1:) 1 BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) All goals completed! 🐙) hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0BddAbove (f_9_3_21 '' J) hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0 x, y f_9_3_21 '' J, y x; hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0 y f_9_3_21 '' J, y 1; All goals completed! 🐙 hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':J.a < J.b1 f_9_3_21 '' J; hbdd:BddOn f_9_3_21 (Icc 0 1)P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':J.a < J.bz:hz:z Set.range Rat.casthz':z Set.Ioo J.a J.b1 f_9_3_21 '' J P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':J.a < J.bz:hbdd:BddOn f_9_3_21 (Set.Icc 0 1)hJ0:(↑J).Nontrivialhz: y, y = zhz':J.a < z z < J.b y, y J; P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':J.a < J.bhbdd:BddOn f_9_3_21 (Set.Icc 0 1)hJ0:(↑J).Nontrivialq:hz':J.a < q q < J.b y, y J have hq_mem : (q:) (J:Set ) := (subset_iff _ _).mp (Ioo_subset J) (P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':J.a < J.bhbdd:BddOn f_9_3_21 (Set.Icc 0 1)hJ0:(↑J).Nontrivialq:hz':J.a < q q < J.bq (Ioo J.a J.b) All goals completed! 🐙) All goals completed! 🐙 have hupper (P: Partition (Icc 0 1)) : upper_riemann_sum f_9_3_21 P = 1 := BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthP:Partition (Icc 0 1) J P.intervals, sSup (f_9_3_21 '' J) * J.length = 1 calc _ = J P.intervals, |J|ₗ := hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthP:Partition (Icc 0 1) J P.intervals, sSup (f_9_3_21 '' J) * J.length = J P.intervals, J.length hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthP:Partition (Icc 0 1) x P.intervals, sSup (f_9_3_21 '' x) * x.length = x.length; All goals completed! 🐙 _ = _ := hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthP:Partition (Icc 0 1) J P.intervals, J.length = 1 All goals completed! 🐙 replace hupper : upper_integral f_9_3_21 (Icc 0 1) = 1 := BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) All goals completed! 🐙 have hinf (P: Partition (Icc 0 1)) : J P.intervals, (sInf (f_9_3_21 '' (J:Set ))) * |J|ₗ = 0 := BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) intro J hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalssInf (f_9_3_21 '' J) * J.length = 0; hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:J.length = 0sInf (f_9_3_21 '' J) * J.length = 0hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬J.length = 0sInf (f_9_3_21 '' J) * J.length = 0 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:J.length = 0sInf (f_9_3_21 '' J) * J.length = 0 All goals completed! 🐙 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬J.length = 0hJ0':¬J.length = 0sInf (f_9_3_21 '' J) * J.length = 0 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sInf (f_9_3_21 '' J) * J.length = 0 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sInf (f_9_3_21 '' J) = 0 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sInf (f_9_3_21 '' J) 0hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 00 sInf (f_9_3_21 '' J) hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0sInf (f_9_3_21 '' J) 0 apply csInf_le_of_le _ _ (show (0:) 0 BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) All goals completed! 🐙) hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0BddBelow (f_9_3_21 '' J) hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0 x, y f_9_3_21 '' J, x y; hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0 y f_9_3_21 '' J, 0 y; All goals completed! 🐙 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':J.a < J.b0 f_9_3_21 '' J hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':J.a < J.bz:hz:z {x | Irrational x}hz':z Set.Ioo J.a J.b0 f_9_3_21 '' J hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':J.a < J.bz:hz:Irrational zhbdd:BddOn f_9_3_21 (Set.Icc 0 1)hJ0:(↑J).Nontrivialhz':J.a < z z < J.b x J, (x_1 : ), ¬x_1 = x refine z, (subset_iff _ _).mp (Ioo_subset J) (hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':J.a < J.bz:hz:Irrational zhbdd:BddOn f_9_3_21 (Set.Icc 0 1)hJ0:(↑J).Nontrivialhz':J.a < z z < J.bz (Ioo J.a J.b) All goals completed! 🐙), ?_ hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':J.a < J.bz:hz:Irrational zhbdd:BddOn f_9_3_21 (Set.Icc 0 1)hJ0:(↑J).Nontrivialhz':J.a < z z < J.bq:¬q = z; hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':J.a < J.bz:hbdd:BddOn f_9_3_21 (Set.Icc 0 1)hJ0:(↑J).Nontrivialhz':J.a < z z < J.bq:hz:q = z¬Irrational z; All goals completed! 🐙 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0(f_9_3_21 '' J).Nonemptyhbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0 b f_9_3_21 '' J, 0 b hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0:¬Subsingleton JhJ0':¬J.length = 0(f_9_3_21 '' J).Nonempty hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1P:Partition (Icc 0 1)J:BoundedIntervalhJ:J P.intervalshJ0':¬J.length = 0hJ0:f_9_3_21 '' J = Subsingleton J; All goals completed! 🐙 All goals completed! 🐙 have hlower (P: Partition (Icc 0 1)) : lower_riemann_sum f_9_3_21 P = 0 := BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1hinf: (P : Partition (Icc 0 1)), J P.intervals, sInf (f_9_3_21 '' J) * J.length = 0P:Partition (Icc 0 1) J P.intervals, sInf (f_9_3_21 '' J) * J.length = 0; calc _ = J P.intervals, (0:) := hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1hinf: (P : Partition (Icc 0 1)), J P.intervals, sInf (f_9_3_21 '' J) * J.length = 0P:Partition (Icc 0 1) J P.intervals, sInf (f_9_3_21 '' J) * J.length = J P.intervals, 0 hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1hinf: (P : Partition (Icc 0 1)), J P.intervals, sInf (f_9_3_21 '' J) * J.length = 0P:Partition (Icc 0 1) x P.intervals, sInf (f_9_3_21 '' x) * x.length = 0; All goals completed! 🐙 _ = _ := hbdd:BddOn f_9_3_21 (Icc 0 1)hsup: (P : Partition (Icc 0 1)), J P.intervals, sSup (f_9_3_21 '' J) * J.length = J.lengthhupper:upper_integral f_9_3_21 (Icc 0 1) = 1hinf: (P : Partition (Icc 0 1)), J P.intervals, sInf (f_9_3_21 '' J) * J.length = 0P:Partition (Icc 0 1) J P.intervals, 0 = 0 All goals completed! 🐙 replace hlower : lower_integral f_9_3_21 (Icc 0 1) = 0 := BddOn f_9_3_21 (Icc 0 1) ¬IntegrableOn f_9_3_21 (Icc 0 1) All goals completed! 🐙 All goals completed! 🐙
end Chapter11