Skip to content

Commit bd59987

Browse files
authored
Merge pull request #474 from kvanvels/KEV_testing2
cleaned up exists_gt_of_lt_csSup and exists_le_of_lt_csInf
2 parents e49d1fe + 58390d8 commit bd59987

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

Analysis/MeasureTheory/Section_1_1_1.lean

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -288,27 +288,26 @@ def witness_upperBound_lowerBounds {X : Set ℝ} (y : ℝ) (hy : y ∈ X)
288288
intro u hu; simp [lowerBounds] at hu; exact hu hy
289289

290290
/-- If x < sSup X, then there exists z ∈ X with x < z -/
291-
theorem exists_gt_of_lt_csSup {X : Set ℝ} (hBddAbove : BddAbove X) (hNonempty : X.Nonempty)
292-
(hLowerBound : ∃ y ∈ X, y ∈ lowerBounds (upperBounds X)) (x : ℝ) (hx : x < sSup X) :
291+
theorem exists_gt_of_lt_csSup {X : Set ℝ} (hBddAbove : BddAbove X) (hNonempty : X.Nonempty) {x : ℝ} (hx : x < sSup X) :
293292
∃ z ∈ X, x < z := by
294293
by_contra! h
295294
have : sSup X ≤ x := by
296295
rw [← csInf_upperBounds_eq_csSup hBddAbove hNonempty]
297-
exact csInf_le
298-
(by obtain ⟨y, hy, _⟩ := hLowerBound; exact ⟨y, witness_lowerBound_upperBounds y hy⟩)
299-
(fun z hz => h z hz)
296+
obtain ⟨y,hy⟩ : ∃ y : ℝ, y ∈ X := Set.nonempty_def.mp hNonempty
297+
have hLowerBound := witness_lowerBound_upperBounds y hy
298+
exact csInf_le ⟨y,hLowerBound⟩ (fun z hz h z hz)
300299
linarith
301300

302301
/-- If sInf X < x, then there exists w ∈ X with w ≤ x -/
303302
theorem exists_le_of_lt_csInf {X : Set ℝ} (hBddBelow : BddBelow X) (hNonempty : X.Nonempty)
304-
(hUpperBound : ∃ y ∈ X, y ∈ upperBounds (lowerBounds X)) (x : ℝ) (hx : sInf X < x) :
303+
(x : ℝ) (hx : sInf X < x) :
305304
∃ w ∈ X, w ≤ x := by
306305
by_contra! h
307306
have : x ≤ sInf X := by
308307
rw [← csSup_lowerBounds_eq_csInf hBddBelow hNonempty]
309-
exact le_csSup
310-
(by obtain ⟨y, hy, _⟩ := hUpperBound; exact ⟨y, witness_upperBound_lowerBounds y hy⟩)
311-
(fun u hu => le_of_lt (h u hu))
308+
have ⟨y,hy⟩ : ∃ y : ℝ, y ∈ X := Set.nonempty_def.mp hNonempty
309+
have hUpperBound := witness_upperBound_lowerBounds y hy
310+
apply le_csSup ⟨y,hUpperBound⟩ (fun z hz ↦ le_of_lt (h z hz))
312311
linarith
313312

314313
/-- Show x < b when b = sSup X and b ∉ X -/
@@ -379,7 +378,7 @@ theorem BoundedInterval.ordConnected_iff (X:Set ℝ) :
379378
· intro hx; simp [Set.mem_Ico] at hx
380379
have hb_eq : b = sSup X := rfl
381380
obtain ⟨z, hz, hxz⟩ := exists_gt_of_lt_csSup hBddAbove hNonempty
382-
⟨a, ha, witness_lowerBound_upperBounds a ha⟩ x (by rw [←hb_eq]; exact hx.2)
381+
(by rw [←hb_eq]; exact hx.2)
383382
exact mem_of_mem_Icc_ordConnected hOrdConn ha hz ⟨hx.1, le_of_lt hxz⟩
384383
· by_cases hb : b ∈ X
385384
· -- Case: a ∉ X ∧ b ∈ X → use Ioc a b
@@ -391,7 +390,7 @@ theorem BoundedInterval.ordConnected_iff (X:Set ℝ) :
391390
· rw [hx_eq_b]; exact hb
392391
· have ha_eq : a = sInf X := rfl
393392
obtain ⟨w, hw, hwx⟩ := exists_le_of_lt_csInf hBddBelow hNonempty
394-
⟨b, hb, witness_upperBound_lowerBounds b hb⟩ x (by rw [←ha_eq]; exact hx.1)
393+
x (by rw [←ha_eq]; exact hx.1)
395394
exact mem_of_mem_Icc_ordConnected hOrdConn hw hb ⟨hwx, hx.2
396395
· -- Case: a ∉ X ∧ b ∉ X → use Ioo a b
397396
use Ioo a b; simp [set_Ioo]; ext x; constructor
@@ -400,13 +399,9 @@ theorem BoundedInterval.ordConnected_iff (X:Set ℝ) :
400399
lt_sSup_of_ne_sSup hBddAbove rfl hb hx (le_csSup hBddAbove hx)⟩
401400
· intro hx; simp [Set.mem_Ioo] at hx
402401
have ha_eq : a = sInf X := rfl; have hb_eq : b = sSup X := rfl
403-
have h_lower : ∃ y ∈ X, y ∈ lowerBounds (upperBounds X) := by
404-
obtain ⟨y, hy⟩ := hNonempty; exact ⟨y, hy, witness_lowerBound_upperBounds y hy⟩
405-
have h_upper : ∃ y ∈ X, y ∈ upperBounds (lowerBounds X) := by
406-
obtain ⟨y, hy⟩ := hNonempty; exact ⟨y, hy, witness_upperBound_lowerBounds y hy⟩
407-
obtain ⟨z, hz, hxz⟩ := exists_gt_of_lt_csSup hBddAbove hNonempty h_lower x
402+
obtain ⟨z, hz, hxz⟩ := exists_gt_of_lt_csSup hBddAbove hNonempty
408403
(by rw [←hb_eq]; exact hx.2)
409-
obtain ⟨w, hw, hwx⟩ := exists_le_of_lt_csInf hBddBelow hNonempty h_upper x
404+
obtain ⟨w, hw, hwx⟩ := exists_le_of_lt_csInf hBddBelow hNonempty x
410405
(by rw [←ha_eq]; exact hx.1)
411406
exact mem_of_mem_Icc_ordConnected hOrdConn hw hz ⟨hwx, le_of_lt hxz⟩
412407
· -- Trivial direction: if X = I for some BoundedInterval I, then X is bounded and order-connected

0 commit comments

Comments
 (0)