@@ -102,9 +102,12 @@ set.ext $ λ x, and_comm _ _
102
102
@[simp] lemma nonempty_Ioc : (Ioc a b).nonempty ↔ a < b :=
103
103
⟨λ ⟨x, hx⟩, lt_of_lt_of_le hx.1 hx.2 , λ h, ⟨b, right_mem_Ioc.2 h⟩⟩
104
104
105
- lemma nonempty_Ici : (Ici a).nonempty := ⟨a, left_mem_Ici⟩
105
+ @[simp] lemma nonempty_Ici : (Ici a).nonempty := ⟨a, left_mem_Ici⟩
106
106
107
- lemma nonempty_Iic : (Iic a).nonempty := ⟨a, right_mem_Iic⟩
107
+ @[simp] lemma nonempty_Iic : (Iic a).nonempty := ⟨a, right_mem_Iic⟩
108
+
109
+ @[simp] lemma nonempty_Ioo [densely_ordered α] : (Ioo a b).nonempty ↔ a < b :=
110
+ ⟨λ ⟨x, ha, hb⟩, lt_trans ha hb, dense⟩
108
111
109
112
@[simp] lemma Ioo_eq_empty (h : b ≤ a) : Ioo a b = ∅ :=
110
113
eq_empty_iff_forall_not_mem.2 $ λ x ⟨h₁, h₂⟩, not_le_of_lt (lt_trans h₁ h₂) h
@@ -389,29 +392,133 @@ begin
389
392
exact lt_irrefl _ (lt_of_lt_of_le bc (h ca))
390
393
end
391
394
392
- @[simp] lemma Iic_union_Ici : Iic a ∪ Ici a = set.univ :=
393
- begin
394
- refine univ_subset_iff.1 (λx hx, _),
395
- by_cases h : x ≤ a,
396
- { exact or.inl h },
397
- { exact or.inr (le_of_lt (not_le.1 h)) }
398
- end
395
+ /-! ### Unions of adjacent intervals -/
399
396
400
- @[simp] lemma Iio_union_Ici : Iio a ∪ Ici a = set.univ :=
401
- begin
402
- refine univ_subset_iff.1 (λx hx, _),
403
- by_cases h : x < a,
404
- { exact or.inl h },
405
- { exact or.inr (not_lt.1 h) }
406
- end
397
+ /-! #### Two infinite intervals -/
407
398
408
- @[simp] lemma Iic_union_Ioi : Iic a ∪ Ioi a = set.univ :=
409
- begin
410
- refine univ_subset_iff.1 (λx hx, _),
411
- by_cases h : x ≤ a,
412
- { exact or.inl h },
413
- { exact or.inr (not_le.1 h) }
414
- end
399
+ @[simp] lemma Iic_union_Ici : Iic a ∪ Ici a = univ := eq_univ_of_forall (λ x, le_total x a)
400
+
401
+ @[simp] lemma Iio_union_Ici : Iio a ∪ Ici a = univ := eq_univ_of_forall (λ x, lt_or_le x a)
402
+
403
+ @[simp] lemma Iic_union_Ioi : Iic a ∪ Ioi a = univ := eq_univ_of_forall (λ x, le_or_lt x a)
404
+
405
+ /-! #### A finite and an infinite interval -/
406
+
407
+ @[simp] lemma Ioc_union_Ici_eq_Ioi (h : a < b) : Ioc a b ∪ Ici b = Ioi a :=
408
+ ext $ λ x, ⟨λ hx, hx.elim and.left (lt_of_lt_of_le h),
409
+ λ hx, (le_total x b).elim (λ hxb, or.inl ⟨hx, hxb⟩) (λ hxb, or.inr hxb)⟩
410
+
411
+ @[simp] lemma Icc_union_Ici_eq_Ioi (h : a ≤ b) : Icc a b ∪ Ici b = Ici a :=
412
+ ext $ λ x, ⟨λ hx, hx.elim and.left (le_trans h),
413
+ λ hx, (le_total x b).elim (λ hxb, or.inl ⟨hx, hxb⟩) (λ hxb, or.inr hxb)⟩
414
+
415
+ @[simp] lemma Ioo_union_Ici_eq_Ioi (h : a < b) : Ioo a b ∪ Ici b = Ioi a :=
416
+ ext $ λ x, ⟨λ hx, hx.elim and.left (lt_of_lt_of_le h),
417
+ λ hx, (lt_or_le x b).elim (λ hxb, or.inl ⟨hx, hxb⟩) (λ hxb, or.inr hxb)⟩
418
+
419
+ @[simp] lemma Ico_union_Ici_eq_Ioi (h : a ≤ b) : Ico a b ∪ Ici b = Ici a :=
420
+ ext $ λ x, ⟨λ hx, hx.elim and.left (le_trans h),
421
+ λ hx, (lt_or_le x b).elim (λ hxb, or.inl ⟨hx, hxb⟩) (λ hxb, or.inr hxb)⟩
422
+
423
+ @[simp] lemma Ioc_union_Ioi_eq_Ioi (h : a ≤ b) : Ioc a b ∪ Ioi b = Ioi a :=
424
+ ext $ λ x, ⟨λ hx, hx.elim and.left (lt_of_le_of_lt h),
425
+ λ hx, (le_or_lt x b).elim (λ hxb, or.inl ⟨hx, hxb⟩) (λ hxb, or.inr hxb)⟩
426
+
427
+ @[simp] lemma Icc_union_Ioi_eq_Ioi (h : a ≤ b) : Icc a b ∪ Ioi b = Ici a :=
428
+ ext $ λ x, ⟨λ hx, hx.elim and.left (λ hx, le_trans h (le_of_lt hx)),
429
+ λ hx, (le_or_lt x b).elim (λ hxb, or.inl ⟨hx, hxb⟩) (λ hxb, or.inr hxb)⟩
430
+
431
+ /-! #### An infinite and a finite interval -/
432
+
433
+ @[simp] lemma Iic_union_Icc_eq_Iic (h : a ≤ b) : Iic a ∪ Icc a b = Iic b :=
434
+ ext $ λ x, ⟨λ hx, hx.elim (λ hx, le_trans hx h) and.right,
435
+ λ hx, (le_total x a).elim (λ hxa, or.inl hxa) (λ hxa, or.inr ⟨hxa, hx⟩)⟩
436
+
437
+ @[simp] lemma Iic_union_Ico_eq_Iio (h : a < b) : Iic a ∪ Ico a b = Iio b :=
438
+ ext $ λ x, ⟨λ hx, hx.elim (λ hx, lt_of_le_of_lt hx h) and.right,
439
+ λ hx, (le_total x a).elim (λ hxa, or.inl hxa) (λ hxa, or.inr ⟨hxa, hx⟩)⟩
440
+
441
+ @[simp] lemma Iio_union_Icc_eq_Iic (h : a ≤ b) : Iio a ∪ Icc a b = Iic b :=
442
+ ext $ λ x, ⟨λ hx, hx.elim (λ hx, le_trans (le_of_lt hx) h) and.right,
443
+ λ hx, (lt_or_le x a).elim (λ hxa, or.inl hxa) (λ hxa, or.inr ⟨hxa, hx⟩)⟩
444
+
445
+ @[simp] lemma Iio_union_Ico_eq_Iio (h : a ≤ b) : Iio a ∪ Ico a b = Iio b :=
446
+ ext $ λ x, ⟨λ hx, hx.elim (λ hx, lt_of_lt_of_le hx h) and.right,
447
+ λ hx, (lt_or_le x a).elim (λ hxa, or.inl hxa) (λ hxa, or.inr ⟨hxa, hx⟩)⟩
448
+
449
+ @[simp] lemma Iic_union_Ioc_eq_Iic (h : a ≤ b) : Iic a ∪ Ioc a b = Iic b :=
450
+ ext $ λ x, ⟨λ hx, hx.elim (λ hx, le_trans hx h) and.right,
451
+ λ hx, (le_or_lt x a).elim (λ hxa, or.inl hxa) (λ hxa, or.inr ⟨hxa, hx⟩)⟩
452
+
453
+ @[simp] lemma Iic_union_Ioo_eq_Iio (h : a < b) : Iic a ∪ Ioo a b = Iio b :=
454
+ ext $ λ x, ⟨λ hx, hx.elim (λ hx, lt_of_le_of_lt hx h) and.right,
455
+ λ hx, (le_or_lt x a).elim (λ hxa, or.inl hxa) (λ hxa, or.inr ⟨hxa, hx⟩)⟩
456
+
457
+ /-! #### Two finite intervals with a common point -/
458
+
459
+ @[simp] lemma Ioc_union_Ico_eq_Ioo {c} (h₁ : a < b) (h₂ : b < c) : Ioc a b ∪ Ico b c = Ioo a c :=
460
+ ext $ λ x,
461
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , lt_of_le_of_lt hx.2 h₂⟩) (λ hx, ⟨lt_of_lt_of_le h₁ hx.1 , hx.2 ⟩),
462
+ λ hx, (le_total x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
463
+
464
+ @[simp] lemma Icc_union_Ico_eq_Ico {c} (h₁ : a ≤ b) (h₂ : b < c) : Icc a b ∪ Ico b c = Ico a c :=
465
+ ext $ λ x,
466
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , lt_of_le_of_lt hx.2 h₂⟩) (λ hx, ⟨le_trans h₁ hx.1 , hx.2 ⟩),
467
+ λ hx, (le_total x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
468
+
469
+ @[simp] lemma Icc_union_Icc_eq_Icc {c} (h₁ : a ≤ b) (h₂ : b ≤ c) : Icc a b ∪ Icc b c = Icc a c :=
470
+ ext $ λ x,
471
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , le_trans hx.2 h₂⟩) (λ hx, ⟨le_trans h₁ hx.1 , hx.2 ⟩),
472
+ λ hx, (le_total x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
473
+
474
+ @[simp] lemma Ioc_union_Icc_eq_Ioc {c} (h₁ : a < b) (h₂ : b ≤ c) : Ioc a b ∪ Icc b c = Ioc a c :=
475
+ ext $ λ x,
476
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , le_trans hx.2 h₂⟩) (λ hx, ⟨lt_of_lt_of_le h₁ hx.1 , hx.2 ⟩),
477
+ λ hx, (le_total x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
478
+
479
+ /-! #### Two finite intervals, `I?o` and `Ic?` -/
480
+
481
+ @[simp] lemma Ioo_union_Ico_eq_Ioo {c} (h₁ : a < b) (h₂ : b ≤ c) : Ioo a b ∪ Ico b c = Ioo a c :=
482
+ ext $ λ x,
483
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , lt_of_lt_of_le hx.2 h₂⟩) (λ hx, ⟨lt_of_lt_of_le h₁ hx.1 , hx.2 ⟩),
484
+ λ hx, (lt_or_le x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
485
+
486
+ @[simp] lemma Ico_union_Ico_eq_Ico {c} (h₁ : a ≤ b) (h₂ : b ≤ c) : Ico a b ∪ Ico b c = Ico a c :=
487
+ ext $ λ x,
488
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , lt_of_lt_of_le hx.2 h₂⟩) (λ hx, ⟨le_trans h₁ hx.1 , hx.2 ⟩),
489
+ λ hx, (lt_or_le x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
490
+
491
+ @[simp] lemma Ico_union_Icc_eq_Icc {c} (h₁ : a ≤ b) (h₂ : b ≤ c) : Ico a b ∪ Icc b c = Icc a c :=
492
+ ext $ λ x,
493
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , le_trans (le_of_lt hx.2 ) h₂⟩) (λ hx, ⟨le_trans h₁ hx.1 , hx.2 ⟩),
494
+ λ hx, (lt_or_le x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
495
+
496
+ @[simp] lemma Ioo_union_Icc_eq_Ioc {c} (h₁ : a < b) (h₂ : b ≤ c) : Ioo a b ∪ Icc b c = Ioc a c :=
497
+ ext $ λ x,
498
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , le_trans (le_of_lt hx.2 ) h₂⟩) (λ hx, ⟨lt_of_lt_of_le h₁ hx.1 , hx.2 ⟩),
499
+ λ hx, (lt_or_le x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
500
+
501
+ /-! #### Two finite intervals, `I?c` and `Io?` -/
502
+
503
+ @[simp] lemma Ioc_union_Ioo_eq_Ioo {c} (h₁ : a ≤ b) (h₂ : b < c) : Ioc a b ∪ Ioo b c = Ioo a c :=
504
+ ext $ λ x,
505
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , lt_of_le_of_lt hx.2 h₂⟩) (λ hx, ⟨lt_of_le_of_lt h₁ hx.1 , hx.2 ⟩),
506
+ λ hx, (le_or_lt x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
507
+
508
+ @[simp] lemma Icc_union_Ioo_eq_Ico {c} (h₁ : a ≤ b) (h₂ : b < c) : Icc a b ∪ Ioo b c = Ico a c :=
509
+ ext $ λ x,
510
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , lt_of_le_of_lt hx.2 h₂⟩) (λ hx, ⟨le_trans h₁ (le_of_lt hx.1 ), hx.2 ⟩),
511
+ λ hx, (le_or_lt x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
512
+
513
+ @[simp] lemma Icc_union_Ioc_eq_Icc {c} (h₁ : a ≤ b) (h₂ : b ≤ c) : Icc a b ∪ Ioc b c = Icc a c :=
514
+ ext $ λ x,
515
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , le_trans hx.2 h₂⟩) (λ hx, ⟨le_trans h₁ (le_of_lt hx.1 ), hx.2 ⟩),
516
+ λ hx, (le_or_lt x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
517
+
518
+ @[simp] lemma Ioc_union_Ioc_eq_Ioc {c} (h₁ : a ≤ b) (h₂ : b ≤ c) : Ioc a b ∪ Ioc b c = Ioc a c :=
519
+ ext $ λ x,
520
+ ⟨λ hx, hx.elim (λ hx, ⟨hx.1 , le_trans hx.2 h₂⟩) (λ hx, ⟨lt_of_le_of_lt h₁ hx.1 , hx.2 ⟩),
521
+ λ hx, (le_or_lt x b).elim (λ hxb, or.inl ⟨hx.1 , hxb⟩) (λ hxb, or.inr ⟨hxb, hx.2 ⟩)⟩
415
522
416
523
end linear_order
417
524
0 commit comments