@@ -5,6 +5,7 @@ Authors: Alex J. Best, Yaël Dillies
5
5
-/
6
6
import algebra.order.hom.monoid
7
7
import algebra.order.ring
8
+ import data.equiv.ring
8
9
9
10
/-!
10
11
# Ordered ring homomorphisms
@@ -13,11 +14,13 @@ Homomorphisms between ordered (semi)rings that respect the ordering.
13
14
14
15
## Main definitions
15
16
16
- * `order_ring_hom` : A monotone homomorphism `f` between two `ordered_semiring`s.
17
+ * `order_ring_hom` : Monotone semiring homomorphisms.
18
+ * `order_ring_iso` : Monotone semiring isomorphisms.
17
19
18
20
## Notation
19
21
20
- * `→+*o`: Type of ordered ring homomorphisms.
22
+ * `→+*o`: Ordered ring homomorphisms.
23
+ * `≃+*o`: Ordered ring isomorphisms.
21
24
22
25
## Tags
23
26
@@ -32,43 +35,85 @@ variables {F α β γ δ : Type*}
32
35
33
36
When possible, instead of parametrizing results over `(f : order_ring_hom α β)`,
34
37
you should parametrize over `(F : Type*) [order_ring_hom_class F α β] (f : F)`.
35
- When you extend this structure, make sure to extend `order_ring_hom_class`.
36
- -/
37
- structure order_ring_hom (α β : Type *) [ordered_semiring α] [ordered_semiring β] extends α →+* β :=
38
+
39
+ When you extend this structure, make sure to extend `order_ring_hom_class`. -/
40
+ structure order_ring_hom (α β : Type *) [non_assoc_semiring α] [preorder α] [non_assoc_semiring β]
41
+ [preorder β]
42
+ extends α →+* β :=
38
43
(monotone' : monotone to_fun)
39
44
40
45
/-- Reinterpret an ordered ring homomorphism as a ring homomorphism. -/
41
46
add_decl_doc order_ring_hom.to_ring_hom
42
47
43
48
infix ` →+*o `:25 := order_ring_hom
44
49
50
+ /-- `order_ring_hom α β` is the type of order-preserving semiring isomorphisms between `α` and `β`.
51
+
52
+ When possible, instead of parametrizing results over `(f : order_ring_iso α β)`,
53
+ you should parametrize over `(F : Type*) [order_ring_iso_class F α β] (f : F)`.
54
+
55
+ When you extend this structure, make sure to extend `order_ring_iso_class`. -/
56
+ structure order_ring_iso (α β : Type *) [has_mul α] [has_add α] [has_le α] [has_mul β] [has_add β]
57
+ [has_le β] extends α ≃+* β :=
58
+ (map_le_map_iff' {a b : α} : to_fun a ≤ to_fun b ↔ a ≤ b)
59
+
60
+ infix ` ≃+*o `:25 := order_ring_iso
61
+
45
62
/-- `order_ring_hom_class F α β` states that `F` is a type of ordered semiring homomorphisms.
46
63
You should extend this typeclass when you extend `order_ring_hom`. -/
47
- class order_ring_hom_class (F : Type *) (α β : out_param $ Type *)
48
- [ordered_semiring α ] [ordered_semiring β] extends ring_hom_class F α β :=
64
+ class order_ring_hom_class (F : Type *) (α β : out_param $ Type *) [non_assoc_semiring α] [preorder α]
65
+ [non_assoc_semiring β ] [preorder β] extends ring_hom_class F α β :=
49
66
(monotone (f : F) : monotone f)
50
67
68
+ /-- `order_ring_iso_class F α β` states that `F` is a type of ordered semiring isomorphisms.
69
+ You should extend this class when you extend `order_ring_iso`. -/
70
+ class order_ring_iso_class (F : Type *) (α β : out_param Type *) [has_mul α] [has_add α] [has_le α]
71
+ [has_mul β] [has_add β] [has_le β]
72
+ extends ring_equiv_class F α β :=
73
+ (map_le_map_iff (f : F) {a b : α} : f a ≤ f b ↔ a ≤ b)
74
+
51
75
@[priority 100 ] -- See note [lower priority instance]
52
- instance order_ring_hom_class.to_order_add_monoid_hom_class [ordered_semiring α]
53
- [ordered_semiring β] [order_ring_hom_class F α β] :
76
+ instance order_ring_hom_class.to_order_add_monoid_hom_class [non_assoc_semiring α] [preorder α]
77
+ [non_assoc_semiring β] [preorder β] [order_ring_hom_class F α β] :
54
78
order_add_monoid_hom_class F α β :=
55
79
{ .. ‹order_ring_hom_class F α β› }
56
80
57
81
@[priority 100 ] -- See note [lower priority instance]
58
- instance order_ring_hom_class.to_order_monoid_with_zero_hom_class [ordered_semiring α]
59
- [ordered_semiring β] [order_ring_hom_class F α β] :
82
+ instance order_ring_hom_class.to_order_monoid_with_zero_hom_class [non_assoc_semiring α]
83
+ [preorder α] [non_assoc_semiring β] [preorder β] [order_ring_hom_class F α β] :
60
84
order_monoid_with_zero_hom_class F α β :=
61
85
{ .. ‹order_ring_hom_class F α β› }
62
86
63
- instance [ordered_semiring α] [ordered_semiring β] [order_ring_hom_class F α β] :
87
+ @[priority 100 ] -- See note [lower instance priority]
88
+ instance order_ring_iso_class.to_order_iso_class [has_mul α] [has_add α] [has_le α] [has_mul β]
89
+ [has_add β] [has_le β] [order_ring_iso_class F α β] :
90
+ order_iso_class F α β :=
91
+ { ..‹order_ring_iso_class F α β› }
92
+
93
+ @[priority 100 ] -- See note [lower instance priority]
94
+ instance order_ring_iso_class.to_order_ring_hom_class [non_assoc_semiring α] [preorder α]
95
+ [non_assoc_semiring β] [preorder β] [order_ring_iso_class F α β] :
96
+ order_ring_hom_class F α β :=
97
+ { monotone := λ f, order_hom_class.mono f, ..‹order_ring_iso_class F α β› }
98
+
99
+ instance [non_assoc_semiring α] [preorder α] [non_assoc_semiring β] [preorder β]
100
+ [order_ring_hom_class F α β] :
64
101
has_coe_t F (α →+*o β) :=
65
- ⟨λ f, { to_fun := f, map_one' := map_one f, map_mul' := map_mul f, map_add' := map_add f,
66
- map_zero' := map_zero f, monotone' := order_hom_class.mono f }⟩
102
+ ⟨λ f, ⟨f, order_hom_class.mono f⟩⟩
103
+
104
+ instance [has_mul α] [has_add α] [has_le α] [has_mul β] [has_add β] [has_le β]
105
+ [order_ring_iso_class F α β] :
106
+ has_coe_t F (α ≃+*o β) :=
107
+ ⟨λ f, ⟨f, λ a b, map_le_map_iff f⟩⟩
67
108
68
109
/-! ### Ordered ring homomorphisms -/
69
110
70
111
namespace order_ring_hom
71
- variables [ordered_semiring α] [ordered_semiring β] [ordered_semiring γ] [ordered_semiring δ]
112
+ variables [non_assoc_semiring α] [preorder α]
113
+
114
+ section preorder
115
+ variables [non_assoc_semiring β] [preorder β] [non_assoc_semiring γ] [preorder γ]
116
+ [non_assoc_semiring δ] [preorder δ]
72
117
73
118
/-- Reinterpret an ordered ring homomorphism as an ordered additive monoid homomorphism. -/
74
119
def to_order_add_monoid_hom (f : α →+*o β) : α →+o β := { ..f }
@@ -150,6 +195,104 @@ lemma cancel_left {f : β →+*o γ} {g₁ g₂ : α →+*o β} (hf : injective
150
195
f.comp g₁ = f.comp g₂ ↔ g₁ = g₂ :=
151
196
⟨λ h, ext $ λ a, hf $ by rw [←comp_apply, h, comp_apply], congr_arg _⟩
152
197
153
- instance : partial_order (order_ring_hom α β) := partial_order.lift _ fun_like.coe_injective
198
+ end preorder
199
+
200
+ variables [non_assoc_semiring β]
201
+
202
+ instance [preorder β] : preorder (order_ring_hom α β) := preorder.lift (coe_fn : _ → α → β)
203
+
204
+ instance [partial_order β] : partial_order (order_ring_hom α β) :=
205
+ partial_order.lift _ fun_like.coe_injective
154
206
155
207
end order_ring_hom
208
+
209
+ /-! ### Ordered ring isomorphisms -/
210
+
211
+ namespace order_ring_iso
212
+ section has_le
213
+ variables [has_mul α] [has_add α] [has_le α] [has_mul β] [has_add β] [has_le β] [has_mul γ]
214
+ [has_add γ] [has_le γ] [has_mul δ] [has_add δ] [has_le δ]
215
+
216
+ /-- Reinterpret an ordered ring isomorphism as an order isomorphism. -/
217
+ def to_order_iso (f : α ≃+*o β) : α ≃o β := ⟨f.to_ring_equiv.to_equiv, f.map_le_map_iff'⟩
218
+
219
+ instance : order_ring_iso_class (α ≃+*o β) α β :=
220
+ { coe := λ f, f.to_fun,
221
+ inv := λ f, f.inv_fun,
222
+ coe_injective' := λ f g h₁ h₂, by { obtain ⟨⟨_, _⟩, _⟩ := f, obtain ⟨⟨_, _⟩, _⟩ := g, congr' },
223
+ map_add := λ f, f.map_add',
224
+ map_mul := λ f, f.map_mul',
225
+ map_le_map_iff := λ f, f.map_le_map_iff',
226
+ left_inv := λ f, f.left_inv,
227
+ right_inv := λ f, f.right_inv }
228
+
229
+ /-- Helper instance for when there's too many metavariables to apply `fun_like.has_coe_to_fun`
230
+ directly. -/
231
+ instance : has_coe_to_fun (α ≃+*o β) (λ _, α → β) := fun_like.has_coe_to_fun
232
+
233
+ lemma to_fun_eq_coe (f : α ≃+*o β) : f.to_fun = f := rfl
234
+
235
+ @[ext] lemma ext {f g : α ≃+*o β} (h : ∀ a, f a = g a) : f = g := fun_like.ext f g h
236
+
237
+ @[simp] lemma coe_mk (e : α ≃+* β) (h) : ⇑(⟨e, h⟩ : α ≃+*o β) = e := rfl
238
+ @[simp] lemma mk_coe (e : α ≃+*o β) (h) : (⟨e, h⟩ : α ≃+*o β) = e := ext $ λ _, rfl
239
+
240
+ @[simp] lemma to_ring_equiv_eq_coe (f : α ≃+*o β) : f.to_ring_equiv = f := ring_equiv.ext $ λ _, rfl
241
+ @[simp] lemma to_order_iso_eq_coe (f : α ≃+*o β) : f.to_order_iso = f := order_iso.ext rfl
242
+
243
+ @[simp, norm_cast] lemma coe_to_ring_equiv (f : α ≃+*o β) : ⇑(f : α ≃+* β) = f := rfl
244
+ @[simp, norm_cast] lemma coe_to_order_iso (f : α ≃+*o β) : ⇑(f : α ≃o β) = f := rfl
245
+
246
+ variable (α)
247
+
248
+ /-- The identity map as an ordered ring isomorphism. -/
249
+ @[refl] protected def refl : α ≃+*o α := ⟨ring_equiv.refl α, λ _ _, iff.rfl⟩
250
+
251
+ instance : inhabited (α ≃+*o α) := ⟨order_ring_iso.refl α⟩
252
+
253
+ @[simp] lemma refl_apply (x : α) : order_ring_iso.refl α x = x := rfl
254
+ @[simp] lemma coe_ring_equiv_refl : (order_ring_iso.refl α : α ≃+* α) = ring_equiv.refl α := rfl
255
+ @[simp] lemma coe_order_iso_refl : (order_ring_iso.refl α : α ≃o α) = order_iso.refl α := rfl
256
+
257
+ variables {α}
258
+
259
+ /-- The inverse of an ordered ring isomorphism as an ordered ring isomorphism. -/
260
+ @[symm] protected def symm (e : α ≃+*o β) : β ≃+*o α :=
261
+ ⟨e.to_ring_equiv.symm,
262
+ λ a b, by erw [←map_le_map_iff e, e.1 .apply_symm_apply, e.1 .apply_symm_apply]⟩
263
+
264
+ /-- See Note [custom simps projection] -/
265
+ def simps.symm_apply (e : α ≃+*o β) : β → α := e.symm
266
+
267
+ @[simp] lemma symm_symm (e : α ≃+*o β) : e.symm.symm = e := ext $ λ _, rfl
268
+
269
+ /-- Composition of `order_ring_iso`s as an `order_ring_iso`. -/
270
+ @[trans, simps] protected def trans (f : α ≃+*o β) (g : β ≃+*o γ) : α ≃+*o γ :=
271
+ ⟨f.to_ring_equiv.trans g.to_ring_equiv, λ a b, (map_le_map_iff g).trans (map_le_map_iff f)⟩
272
+
273
+ @[simp] lemma trans_apply (f : α ≃+*o β) (g : β ≃+*o γ) (a : α) : f.trans g a = g (f a) := rfl
274
+
275
+ @[simp] lemma self_trans_symm (e : α ≃+*o β) : e.trans e.symm = order_ring_iso.refl α :=
276
+ ext e.left_inv
277
+ @[simp] lemma symm_trans_self (e : α ≃+*o β) : e.symm.trans e = order_ring_iso.refl β :=
278
+ ext e.right_inv
279
+
280
+ end has_le
281
+
282
+ section non_assoc_semiring
283
+ variables [non_assoc_semiring α] [preorder α] [non_assoc_semiring β] [preorder β]
284
+ [non_assoc_semiring γ] [preorder γ]
285
+
286
+ /-- Reinterpret an ordered ring isomorphism as an ordered ring homomorphism. -/
287
+ def to_order_ring_hom (f : α ≃+*o β) : α →+*o β :=
288
+ ⟨f.to_ring_equiv.to_ring_hom, λ a b, (map_le_map_iff f).2 ⟩
289
+
290
+ @[simp] lemma to_order_ring_hom_eq_coe (f : α ≃+*o β) : f.to_order_ring_hom = f := rfl
291
+
292
+ @[simp, norm_cast] lemma coe_to_order_ring_hom (f : α ≃+*o β) : ⇑(f : α →+*o β) = f := rfl
293
+
294
+ @[simp]
295
+ lemma coe_to_order_ring_hom_refl : (order_ring_iso.refl α : α →+*o α) = order_ring_hom.id α := rfl
296
+
297
+ end non_assoc_semiring
298
+ end order_ring_iso
0 commit comments