@@ -14,12 +14,82 @@ In this file we prove a bunch of trivial lemmas like “if we add `a` to all poi
14
14
then we get `[a + b, a + c]`”. For the functions `x ↦ x ± a`, `x ↦ a ± x`, and `x ↦ -x` we prove
15
15
lemmas about preimages and images of all intervals. We also prove a few lemmas about images under
16
16
`x ↦ a * x`, `x ↦ x * a` and `x ↦ x⁻¹`.
17
-
18
17
-/
19
18
20
19
universe u
21
20
22
21
namespace set
22
+
23
+ section has_exists_add_of_le
24
+ /-!
25
+ The lemmas in this section state that addition maps intervals bijectively. The typeclass
26
+ `has_exists_add_of_le` is defined specifically to make them work when combined with
27
+ `ordered_cancel_add_comm_monoid`; the lemmas below therefore apply to all
28
+ `ordered_add_comm_group`, but also to `ℕ` and `ℝ≥0`, which are not groups.
29
+
30
+ TODO : move as much as possible in this file to the setting of this weaker typeclass.
31
+ -/
32
+
33
+ variables {α : Type u} [ordered_cancel_add_comm_monoid α] [has_exists_add_of_le α] (a b d : α)
34
+
35
+ lemma Icc_add_bij : bij_on (+d) (Icc a b) (Icc (a + d) (b + d)) :=
36
+ begin
37
+ refine ⟨λ _ h, ⟨add_le_add_right h.1 _, add_le_add_right h.2 _⟩,
38
+ λ _ _ _ _ h, add_right_cancel h,
39
+ λ _ h, _⟩,
40
+ obtain ⟨c, rfl⟩ := exists_add_of_le h.1 ,
41
+ rw [mem_Icc, add_right_comm, add_le_add_iff_right, add_le_add_iff_right] at h,
42
+ exact ⟨a + c, h, by rw add_right_comm⟩,
43
+ end
44
+
45
+ lemma Ioo_add_bij : bij_on (+d) (Ioo a b) (Ioo (a + d) (b + d)) :=
46
+ begin
47
+ refine ⟨λ _ h, ⟨add_lt_add_right h.1 _, add_lt_add_right h.2 _⟩,
48
+ λ _ _ _ _ h, add_right_cancel h,
49
+ λ _ h, _⟩,
50
+ obtain ⟨c, rfl⟩ := exists_add_of_le h.1 .le,
51
+ rw [mem_Ioo, add_right_comm, add_lt_add_iff_right, add_lt_add_iff_right] at h,
52
+ exact ⟨a + c, h, by rw add_right_comm⟩,
53
+ end
54
+
55
+ lemma Ioc_add_bij : bij_on (+d) (Ioc a b) (Ioc (a + d) (b + d)) :=
56
+ begin
57
+ refine ⟨λ _ h, ⟨add_lt_add_right h.1 _, add_le_add_right h.2 _⟩,
58
+ λ _ _ _ _ h, add_right_cancel h,
59
+ λ _ h, _⟩,
60
+ obtain ⟨c, rfl⟩ := exists_add_of_le h.1 .le,
61
+ rw [mem_Ioc, add_right_comm, add_lt_add_iff_right, add_le_add_iff_right] at h,
62
+ exact ⟨a + c, h, by rw add_right_comm⟩,
63
+ end
64
+
65
+ lemma Ico_add_bij : bij_on (+d) (Ico a b) (Ico (a + d) (b + d)) :=
66
+ begin
67
+ refine ⟨λ _ h, ⟨add_le_add_right h.1 _, add_lt_add_right h.2 _⟩,
68
+ λ _ _ _ _ h, add_right_cancel h,
69
+ λ _ h, _⟩,
70
+ obtain ⟨c, rfl⟩ := exists_add_of_le h.1 ,
71
+ rw [mem_Ico, add_right_comm, add_le_add_iff_right, add_lt_add_iff_right] at h,
72
+ exact ⟨a + c, h, by rw add_right_comm⟩,
73
+ end
74
+
75
+ lemma Ici_add_bij : bij_on (+d) (Ici a) (Ici (a + d)) :=
76
+ begin
77
+ refine ⟨λ x h, add_le_add_right (mem_Ici.mp h) _, λ _ _ _ _ h, add_right_cancel h, λ _ h, _⟩,
78
+ obtain ⟨c, rfl⟩ := exists_add_of_le (mem_Ici.mp h),
79
+ rw [mem_Ici, add_right_comm, add_le_add_iff_right] at h,
80
+ exact ⟨a + c, h, by rw add_right_comm⟩,
81
+ end
82
+
83
+ lemma Ioi_add_bij : bij_on (+d) (Ioi a) (Ioi (a + d)) :=
84
+ begin
85
+ refine ⟨λ x h, add_lt_add_right (mem_Ioi.mp h) _, λ _ _ _ _ h, add_right_cancel h, λ _ h, _⟩,
86
+ obtain ⟨c, rfl⟩ := exists_add_of_le (mem_Ioi.mp h).le,
87
+ rw [mem_Ioi, add_right_comm, add_lt_add_iff_right] at h,
88
+ exact ⟨a + c, h, by rw add_right_comm⟩,
89
+ end
90
+
91
+ end has_exists_add_of_le
92
+
23
93
section ordered_add_comm_group
24
94
25
95
variables {G : Type u} [ordered_add_comm_group G] (a b c : G)
@@ -268,6 +338,22 @@ by simp [sub_eq_neg_add]
268
338
@[simp] lemma image_sub_const_Ioo : (λ x, x - a) '' Ioo b c = Ioo (b - a) (c - a) :=
269
339
by simp [sub_eq_neg_add]
270
340
341
+ /-!
342
+ ### Bijections
343
+ -/
344
+
345
+ lemma Iic_add_bij : bij_on (+a) (Iic b) (Iic (b + a)) :=
346
+ begin
347
+ refine ⟨λ x h, add_le_add_right (mem_Iic.mp h) _, λ _ _ _ _ h, add_right_cancel h, λ _ h, _⟩,
348
+ simpa [add_comm a] using h,
349
+ end
350
+
351
+ lemma Iio_add_bij : bij_on (+a) (Iio b) (Iio (b + a)) :=
352
+ begin
353
+ refine ⟨λ x h, add_lt_add_right (mem_Iio.mp h) _, λ _ _ _ _ h, add_right_cancel h, λ _ h, _⟩,
354
+ simpa [add_comm a] using h,
355
+ end
356
+
271
357
end ordered_add_comm_group
272
358
273
359
/-!
0 commit comments