Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit fd623d6

Browse files
committed
feat(data/set/intervals/image_preimage): new file (#2958)
* Create a file for lemmas like `(λ x, x + a) '' Icc b c = Icc (b + a) (b + c)`. * Prove lemmas about images and preimages of all intervals under `x ↦ x ± a`, `x ↦ a ± x`, and `x ↦ -x`. * Move lemmas about multiplication from `basic`.
1 parent 1ef65c9 commit fd623d6

File tree

3 files changed

+329
-95
lines changed

3 files changed

+329
-95
lines changed

src/analysis/convex/basic.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alexander Bentkamp, Yury Kudriashov
55
-/
6-
import data.set.intervals
6+
import data.set.intervals.unordered_interval
7+
import data.set.intervals.image_preimage
78
import data.complex.module
89
import algebra.pointwise
910

@@ -91,7 +92,7 @@ lemma segment_eq_Icc {a b : ℝ} (h : a ≤ b) : [a, b] = Icc a b :=
9192
begin
9293
rw [segment_eq_image'],
9394
show (((+) a) ∘ (λ t, t * (b - a))) '' Icc 0 1 = Icc a b,
94-
rw [image_comp, image_mul_right_Icc (@zero_le_one ℝ _) (sub_nonneg.2 h), image_add_left_Icc],
95+
rw [image_comp, image_mul_right_Icc (@zero_le_one ℝ _) (sub_nonneg.2 h), image_const_add_Icc],
9596
simp
9697
end
9798

src/data/set/intervals/basic.lean

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ This file contains these definitions, and basic facts on inclusion, intersection
2323
intervals (where the precise statements may depend on the properties of the order, in particular
2424
for some statements it should be `linear_order` or `densely_ordered`).
2525
26-
This file also contains statements on lower and upper bounds of intervals.
27-
2826
TODO: This is just the beginning; a lot of rules are missing
2927
-/
3028

@@ -633,61 +631,6 @@ set.ext $ by simp [Ico, Iio, iff_def, lt_min_iff] {contextual:=tt}
633631

634632
end decidable_linear_order
635633

636-
section ordered_add_comm_group
637-
638-
variables {α : Type u} [ordered_add_comm_group α]
639-
640-
lemma image_add_left_Icc (a b c : α) : ((+) a) '' Icc b c = Icc (a + b) (a + c) :=
641-
begin
642-
ext x,
643-
split,
644-
{ rintros ⟨x, hx, rfl⟩,
645-
exact ⟨add_le_add_left hx.1 a, add_le_add_left hx.2 a⟩},
646-
{ intro hx,
647-
refine ⟨-a + x, _, add_neg_cancel_left _ _⟩,
648-
exact ⟨le_neg_add_iff_add_le.2 hx.1, neg_add_le_iff_le_add.2 hx.2⟩ }
649-
end
650-
651-
lemma image_add_right_Icc (a b c : α) : (λ x, x + c) '' Icc a b = Icc (a + c) (b + c) :=
652-
by convert image_add_left_Icc c a b using 1; simp only [add_comm _ c]
653-
654-
lemma image_neg_Iio (r : α) : image (λz, -z) (Iio r) = Ioi (-r) :=
655-
begin
656-
ext z,
657-
apply iff.intro,
658-
{ intros hz,
659-
apply exists.elim hz,
660-
intros z' hz',
661-
rw [←hz'.2],
662-
simp only [mem_Ioi, neg_lt_neg_iff],
663-
exact hz'.1 },
664-
{ intros hz,
665-
simp only [mem_image, mem_Iio],
666-
use -z,
667-
simp [hz],
668-
exact neg_lt.1 hz }
669-
end
670-
671-
lemma image_neg_Iic (r : α) : image (λz, -z) (Iic r) = Ici (-r) :=
672-
begin
673-
apply set.ext,
674-
intros z,
675-
apply iff.intro,
676-
{ intros hz,
677-
apply exists.elim hz,
678-
intros z' hz',
679-
rw [←hz'.2],
680-
simp only [neg_le_neg_iff, mem_Ici],
681-
exact hz'.1 },
682-
{ intros hz,
683-
simp only [mem_image, mem_Iic],
684-
use -z,
685-
simp [hz],
686-
exact neg_le.1 hz }
687-
end
688-
689-
end ordered_add_comm_group
690-
691634
section decidable_linear_ordered_add_comm_group
692635

693636
variables {α : Type u} [decidable_linear_ordered_add_comm_group α]
@@ -703,40 +646,4 @@ end
703646

704647
end decidable_linear_ordered_add_comm_group
705648

706-
section linear_ordered_field
707-
708-
variables {α : Type u} [linear_ordered_field α]
709-
710-
lemma image_mul_right_Icc' (a b : α) {c : α} (h : 0 < c) :
711-
(λ x, x * c) '' Icc a b = Icc (a * c) (b * c) :=
712-
begin
713-
ext x,
714-
split,
715-
{ rintros ⟨x, hx, rfl⟩,
716-
exact ⟨mul_le_mul_of_nonneg_right hx.1 (le_of_lt h),
717-
mul_le_mul_of_nonneg_right hx.2 (le_of_lt h)⟩ },
718-
{ intro hx,
719-
refine ⟨x / c, _, div_mul_cancel x (ne_of_gt h)⟩,
720-
exact ⟨le_div_of_mul_le h hx.1, div_le_of_le_mul h (mul_comm b c ▸ hx.2)⟩ }
721-
end
722-
723-
lemma image_mul_right_Icc {a b c : α} (hab : a ≤ b) (hc : 0 ≤ c) :
724-
(λ x, x * c) '' Icc a b = Icc (a * c) (b * c) :=
725-
begin
726-
cases eq_or_lt_of_le hc,
727-
{ subst c,
728-
simp [(nonempty_Icc.2 hab).image_const] },
729-
exact image_mul_right_Icc' a b ‹0 < c›
730-
end
731-
732-
lemma image_mul_left_Icc' {a : α} (h : 0 < a) (b c : α) :
733-
((*) a) '' Icc b c = Icc (a * b) (a * c) :=
734-
by { convert image_mul_right_Icc' b c h using 1; simp only [mul_comm _ a] }
735-
736-
lemma image_mul_left_Icc {a b c : α} (ha : 0 ≤ a) (hbc : b ≤ c) :
737-
((*) a) '' Icc b c = Icc (a * b) (a * c) :=
738-
by { convert image_mul_right_Icc hbc ha using 1; simp only [mul_comm _ a] }
739-
740-
end linear_ordered_field
741-
742649
end set

0 commit comments

Comments
 (0)