@@ -22,212 +22,122 @@ open Set
2222
2323variable {α : Type *}
2424
25- /-! ### `WithTop` -/
26-
2725namespace WithTop
2826
29- @[simp]
27+ @ [to_dual (attr := simp) ]
3028theorem preimage_coe_top : (some : α → WithTop α) ⁻¹' {⊤} = (∅ : Set α) :=
3129 eq_empty_of_subset_empty fun _ => coe_ne_top
3230
3331variable [Preorder α] {a b : α}
3432
33+ @[to_dual]
3534theorem range_coe : range (some : α → WithTop α) = Iio ⊤ := by
3635 ext; simp [mem_range, WithTop.lt_top_iff_ne_top, ne_top_iff_exists]
3736
38- @[simp]
37+ @ [to_dual (attr := simp) ]
3938theorem preimage_coe_Ioi : (some : α → WithTop α) ⁻¹' Ioi a = Ioi a :=
4039 ext fun _ => coe_lt_coe
4140
42- @[simp]
41+ @ [to_dual (attr := simp) ]
4342theorem preimage_coe_Ici : (some : α → WithTop α) ⁻¹' Ici a = Ici a :=
4443 ext fun _ => coe_le_coe
4544
46- @[simp]
45+ @ [to_dual (attr := simp) ]
4746theorem preimage_coe_Iio : (some : α → WithTop α) ⁻¹' Iio a = Iio a :=
4847 ext fun _ => coe_lt_coe
4948
50- @[simp]
49+ @ [to_dual (attr := simp) ]
5150theorem preimage_coe_Iic : (some : α → WithTop α) ⁻¹' Iic a = Iic a :=
5251 ext fun _ => coe_le_coe
5352
54- @[simp]
53+ @ [to_dual (attr := simp) ]
5554theorem preimage_coe_Icc : (some : α → WithTop α) ⁻¹' Icc a b = Icc a b := by simp [← Ici_inter_Iic]
5655
57- @[simp]
56+ @ [to_dual (attr := simp) ]
5857theorem preimage_coe_Ico : (some : α → WithTop α) ⁻¹' Ico a b = Ico a b := by simp [← Ici_inter_Iio]
5958
60- @[simp]
59+ @ [to_dual (attr := simp) ]
6160theorem preimage_coe_Ioc : (some : α → WithTop α) ⁻¹' Ioc a b = Ioc a b := by simp [← Ioi_inter_Iic]
6261
63- @[simp]
62+ @ [to_dual (attr := simp) ]
6463theorem preimage_coe_Ioo : (some : α → WithTop α) ⁻¹' Ioo a b = Ioo a b := by simp [← Ioi_inter_Iio]
6564
66- @[simp]
65+ @ [to_dual (attr := simp) ]
6766theorem preimage_coe_Iio_top : (some : α → WithTop α) ⁻¹' Iio ⊤ = univ := by
6867 rw [← range_coe, preimage_range]
6968
70- @[simp]
69+ @ [to_dual (attr := simp) ]
7170theorem preimage_coe_Ico_top : (some : α → WithTop α) ⁻¹' Ico a ⊤ = Ici a := by
7271 simp [← Ici_inter_Iio]
7372
74- @[simp]
73+ @ [to_dual (attr := simp) ]
7574theorem preimage_coe_Ioo_top : (some : α → WithTop α) ⁻¹' Ioo a ⊤ = Ioi a := by
7675 simp [← Ioi_inter_Iio]
7776
77+ @[to_dual]
7878theorem image_coe_Ioi : (some : α → WithTop α) '' Ioi a = Ioo (a : WithTop α) ⊤ := by
7979 rw [← preimage_coe_Ioi, image_preimage_eq_inter_range, range_coe, Ioi_inter_Iio]
8080
81+ @[to_dual]
8182theorem image_coe_Ici : (some : α → WithTop α) '' Ici a = Ico (a : WithTop α) ⊤ := by
8283 rw [← preimage_coe_Ici, image_preimage_eq_inter_range, range_coe, Ici_inter_Iio]
8384
85+ @[to_dual]
8486theorem image_coe_Iio : (some : α → WithTop α) '' Iio a = Iio (a : WithTop α) := by
8587 rw [← preimage_coe_Iio, image_preimage_eq_inter_range, range_coe,
8688 inter_eq_self_of_subset_left (Iio_subset_Iio le_top)]
8789
90+ @[to_dual]
8891theorem image_coe_Iic : (some : α → WithTop α) '' Iic a = Iic (a : WithTop α) := by
8992 rw [← preimage_coe_Iic, image_preimage_eq_inter_range, range_coe,
9093 inter_eq_self_of_subset_left (Iic_subset_Iio.2 <| coe_lt_top a)]
9194
95+ @[to_dual]
9296theorem image_coe_Icc : (some : α → WithTop α) '' Icc a b = Icc (a : WithTop α) b := by
9397 rw [← preimage_coe_Icc, image_preimage_eq_inter_range, range_coe,
9498 inter_eq_self_of_subset_left
9599 (Subset.trans Icc_subset_Iic_self <| Iic_subset_Iio.2 <| coe_lt_top b)]
96100
101+ @[to_dual]
97102theorem image_coe_Ico : (some : α → WithTop α) '' Ico a b = Ico (a : WithTop α) b := by
98103 rw [← preimage_coe_Ico, image_preimage_eq_inter_range, range_coe,
99104 inter_eq_self_of_subset_left (Subset.trans Ico_subset_Iio_self <| Iio_subset_Iio le_top)]
100105
106+ @[to_dual]
101107theorem image_coe_Ioc : (some : α → WithTop α) '' Ioc a b = Ioc (a : WithTop α) b := by
102108 rw [← preimage_coe_Ioc, image_preimage_eq_inter_range, range_coe,
103109 inter_eq_self_of_subset_left
104110 (Subset.trans Ioc_subset_Iic_self <| Iic_subset_Iio.2 <| coe_lt_top b)]
105111
112+ @[to_dual]
106113theorem image_coe_Ioo : (some : α → WithTop α) '' Ioo a b = Ioo (a : WithTop α) b := by
107114 rw [← preimage_coe_Ioo, image_preimage_eq_inter_range, range_coe,
108115 inter_eq_self_of_subset_left (Subset.trans Ioo_subset_Iio_self <| Iio_subset_Iio le_top)]
109116
117+ @[to_dual]
110118theorem Ioi_coe : Ioi (a : WithTop α) = (↑) '' (Ioi a) ∪ {⊤} := by
111119 ext x; induction x <;> simp
112120
121+ @[to_dual]
113122theorem Ici_coe : Ici (a : WithTop α) = (↑) '' (Ici a) ∪ {⊤} := by
114123 ext x; induction x <;> simp
115124
125+ @[to_dual]
116126theorem Iio_coe : Iio (a : WithTop α) = (↑) '' (Iio a) := image_coe_Iio.symm
117127
128+ @[to_dual]
118129theorem Iic_coe : Iic (a : WithTop α) = (↑) '' (Iic a) := image_coe_Iic.symm
119130
131+ @[to_dual]
120132theorem Icc_coe : Icc (a : WithTop α) b = (↑) '' (Icc a b) := image_coe_Icc.symm
121133
134+ @[to_dual]
122135theorem Ico_coe : Ico (a : WithTop α) b = (↑) '' (Ico a b) := image_coe_Ico.symm
123136
137+ @[to_dual]
124138theorem Ioc_coe : Ioc (a : WithTop α) b = (↑) '' (Ioc a b) := image_coe_Ioc.symm
125139
140+ @[to_dual]
126141theorem Ioo_coe : Ioo (a : WithTop α) b = (↑) '' (Ioo a b) := image_coe_Ioo.symm
127142
128143end WithTop
129-
130- /-! ### `WithBot` -/
131-
132- namespace WithBot
133-
134- @[simp]
135- theorem preimage_coe_bot : (some : α → WithBot α) ⁻¹' {⊥} = (∅ : Set α) :=
136- @WithTop.preimage_coe_top αᵒᵈ
137-
138- variable [Preorder α] {a b : α}
139-
140- theorem range_coe : range (some : α → WithBot α) = Ioi ⊥ := by
141- ext; simp [mem_range, WithBot.bot_lt_iff_ne_bot, ne_bot_iff_exists]
142-
143- @[simp]
144- theorem preimage_coe_Ioi : (some : α → WithBot α) ⁻¹' Ioi a = Ioi a :=
145- ext fun _ => coe_lt_coe
146-
147- @[simp]
148- theorem preimage_coe_Ici : (some : α → WithBot α) ⁻¹' Ici a = Ici a :=
149- ext fun _ => coe_le_coe
150-
151- @[simp]
152- theorem preimage_coe_Iio : (some : α → WithBot α) ⁻¹' Iio a = Iio a :=
153- ext fun _ => coe_lt_coe
154-
155- @[simp]
156- theorem preimage_coe_Iic : (some : α → WithBot α) ⁻¹' Iic a = Iic a :=
157- ext fun _ => coe_le_coe
158-
159- @[simp]
160- theorem preimage_coe_Icc : (some : α → WithBot α) ⁻¹' Icc a b = Icc a b := by simp [← Ici_inter_Iic]
161-
162- @[simp]
163- theorem preimage_coe_Ico : (some : α → WithBot α) ⁻¹' Ico a b = Ico a b := by simp [← Ici_inter_Iio]
164-
165- @[simp]
166- theorem preimage_coe_Ioc : (some : α → WithBot α) ⁻¹' Ioc a b = Ioc a b := by simp [← Ioi_inter_Iic]
167-
168- @[simp]
169- theorem preimage_coe_Ioo : (some : α → WithBot α) ⁻¹' Ioo a b = Ioo a b := by simp [← Ioi_inter_Iio]
170-
171- @[simp]
172- theorem preimage_coe_Ioi_bot : (some : α → WithBot α) ⁻¹' Ioi ⊥ = univ := by
173- rw [← range_coe, preimage_range]
174-
175- @[simp]
176- theorem preimage_coe_Ioc_bot : (some : α → WithBot α) ⁻¹' Ioc ⊥ a = Iic a := by
177- simp [← Ioi_inter_Iic]
178-
179- @[simp]
180- theorem preimage_coe_Ioo_bot : (some : α → WithBot α) ⁻¹' Ioo ⊥ a = Iio a := by
181- simp [← Ioi_inter_Iio]
182-
183- theorem image_coe_Iio : (some : α → WithBot α) '' Iio a = Ioo (⊥ : WithBot α) a := by
184- rw [← preimage_coe_Iio, image_preimage_eq_inter_range, range_coe, inter_comm, Ioi_inter_Iio]
185-
186- theorem image_coe_Iic : (some : α → WithBot α) '' Iic a = Ioc (⊥ : WithBot α) a := by
187- rw [← preimage_coe_Iic, image_preimage_eq_inter_range, range_coe, inter_comm, Ioi_inter_Iic]
188-
189- theorem image_coe_Ioi : (some : α → WithBot α) '' Ioi a = Ioi (a : WithBot α) := by
190- rw [← preimage_coe_Ioi, image_preimage_eq_inter_range, range_coe,
191- inter_eq_self_of_subset_left (Ioi_subset_Ioi bot_le)]
192-
193- theorem image_coe_Ici : (some : α → WithBot α) '' Ici a = Ici (a : WithBot α) := by
194- rw [← preimage_coe_Ici, image_preimage_eq_inter_range, range_coe,
195- inter_eq_self_of_subset_left (Ici_subset_Ioi.2 <| bot_lt_coe a)]
196-
197- theorem image_coe_Icc : (some : α → WithBot α) '' Icc a b = Icc (a : WithBot α) b := by
198- rw [← preimage_coe_Icc, image_preimage_eq_inter_range, range_coe,
199- inter_eq_self_of_subset_left
200- (Subset.trans Icc_subset_Ici_self <| Ici_subset_Ioi.2 <| bot_lt_coe a)]
201-
202- theorem image_coe_Ioc : (some : α → WithBot α) '' Ioc a b = Ioc (a : WithBot α) b := by
203- rw [← preimage_coe_Ioc, image_preimage_eq_inter_range, range_coe,
204- inter_eq_self_of_subset_left (Subset.trans Ioc_subset_Ioi_self <| Ioi_subset_Ioi bot_le)]
205-
206- theorem image_coe_Ico : (some : α → WithBot α) '' Ico a b = Ico (a : WithBot α) b := by
207- rw [← preimage_coe_Ico, image_preimage_eq_inter_range, range_coe,
208- inter_eq_self_of_subset_left
209- (Subset.trans Ico_subset_Ici_self <| Ici_subset_Ioi.2 <| bot_lt_coe a)]
210-
211- theorem image_coe_Ioo : (some : α → WithBot α) '' Ioo a b = Ioo (a : WithBot α) b := by
212- rw [← preimage_coe_Ioo, image_preimage_eq_inter_range, range_coe,
213- inter_eq_self_of_subset_left (Subset.trans Ioo_subset_Ioi_self <| Ioi_subset_Ioi bot_le)]
214-
215- theorem Ioi_coe : Ioi (a : WithBot α) = (↑) '' (Ioi a) := image_coe_Ioi.symm
216-
217- theorem Ici_coe : Ici (a : WithBot α) = (↑) '' (Ici a) := image_coe_Ici.symm
218-
219- theorem Iio_coe : Iio (a : WithBot α) = (↑) '' (Iio a) ∪ {⊥} := by
220- ext x; induction x <;> simp
221-
222- theorem Iic_coe : Iic (a : WithBot α) = (↑) '' (Iic a) ∪ {⊥} := by
223- ext x; induction x <;> simp
224-
225- theorem Icc_coe : Icc (a : WithBot α) b = (↑) '' (Icc a b) := image_coe_Icc.symm
226-
227- theorem Ico_coe : Ico (a : WithBot α) b = (↑) '' (Ico a b) := image_coe_Ico.symm
228-
229- theorem Ioc_coe : Ioc (a : WithBot α) b = (↑) '' (Ioc a b) := image_coe_Ioc.symm
230-
231- theorem Ioo_coe : Ioo (a : WithBot α) b = (↑) '' (Ioo a b) := image_coe_Ioo.symm
232-
233- end WithBot
0 commit comments